In CreateProcess(), set std handle when passing a pseudo-console.

This MR tests and fix the std handles in child process when using CreateProcess with extended information and passing a pseudo-console handle.

From the added tests, and other manual testing (see linked bugzilla entry), it turns out native overrides the (bound) std handles from the parent console with handles on the passed pseudo-console for the child process. But happily inherits other kind of handles.

As side notes:

  • resetting the std handle in RTL_USER_PROCESS_PARAMETERS being console handles could be optimized: potentially, native could just test if the passed handles are bound to the passed console and reset them if not.
  • hijacked an unused bit in ConsoleFlags to discriminate when to recreate the std handles in child (didn't check-out how native does it though).

Merge request reports

Loading