CreateProcessAsUser, pipes, grandchildren.

A privileged process call CreatePipe once or twice, setting bInheritHandle
to True in the security attributes.

It sets these pipes as hStdOutput and error in the STARTUPINFO structure,
and calls CreateProcessAsUser, passing TRUE for the inherit flag and
CREATE_NEW_PROCESS_GROUP|DETACHED_PROCESS in the flags.

The resulting process works fine … unless it, in turn, calls
CreateProcess. The grandchild thus created can’t write output to the
pipes.

Anyone got a suggestion?