By default, console handles are inheritable.
diff --git a/dlls/kernel/console.c b/dlls/kernel/console.c
index ef5d799..fa7286d 100644
--- a/dlls/kernel/console.c
+++ b/dlls/kernel/console.c
@@ -950,6 +950,7 @@
STARTUPINFOA siCurrent;
STARTUPINFOA siConsole;
char buffer[1024];
+ SECURITY_ATTRIBUTES sa;
TRACE("()\n");
@@ -988,12 +989,17 @@
if (!start_console_renderer(&siConsole))
goto the_end;
+ /* all std I/O handles are inheritable by default */
+ sa.nLength = sizeof(sa);
+ sa.lpSecurityDescriptor = NULL;
+ sa.bInheritHandle = TRUE;
+
handle_in = CreateFileA( "CONIN$", GENERIC_READ|GENERIC_WRITE|SYNCHRONIZE,
- 0, NULL, OPEN_EXISTING, 0, 0 );
+ 0, &sa, OPEN_EXISTING, 0, 0 );
if (handle_in == INVALID_HANDLE_VALUE) goto the_end;
handle_out = CreateFileA( "CONOUT$", GENERIC_READ|GENERIC_WRITE,
- 0, NULL, OPEN_EXISTING, 0, 0 );
+ 0, &sa, OPEN_EXISTING, 0, 0 );
if (handle_out == INVALID_HANDLE_VALUE) goto the_end;
if (!DuplicateHandle(GetCurrentProcess(), handle_out, GetCurrentProcess(), &handle_err,