kernel32: Set PEB ConsoleHandle for bare console.

Signed-off-by: Jacek Caban <jacek@codeweavers.com>
Signed-off-by: Alexandre Julliard <julliard@winehq.org>
This commit is contained in:
Jacek Caban 2020-08-13 16:01:14 +02:00 committed by Alexandre Julliard
parent 09ff2436c4
commit ac94d88905
1 changed files with 4 additions and 4 deletions

View File

@ -176,9 +176,7 @@ static BOOL restore_console_mode(HANDLE hin)
close(fd); close(fd);
} }
if (RtlGetCurrentPeb()->ProcessParameters->ConsoleHandle == KERNEL32_CONSOLE_SHELL) TERM_Exit();
TERM_Exit();
return ret; return ret;
} }
@ -1109,7 +1107,7 @@ BOOL CONSOLE_Init(RTL_USER_PROCESS_PARAMETERS *params)
memset(&S_termios, 0, sizeof(S_termios)); memset(&S_termios, 0, sizeof(S_termios));
if (params->ConsoleHandle == KERNEL32_CONSOLE_SHELL) if (params->ConsoleHandle == KERNEL32_CONSOLE_SHELL)
{ {
HANDLE conin; HANDLE conin, console;
/* FIXME: to be done even if program is a GUI ? */ /* FIXME: to be done even if program is a GUI ? */
/* This is wine specific: we have no parent (we're started from unix) /* This is wine specific: we have no parent (we're started from unix)
@ -1162,6 +1160,8 @@ BOOL CONSOLE_Init(RTL_USER_PROCESS_PARAMETERS *params)
} }
SERVER_END_REQ; SERVER_END_REQ;
} }
console = CreateFileW( coninW, GENERIC_READ | GENERIC_WRITE | SYNCHRONIZE, 0, NULL, OPEN_EXISTING, 0, 0 );
if (console != INVALID_HANDLE_VALUE) params->ConsoleHandle = console;
} }
/* convert value from server: /* convert value from server: