Commit 57a22235 authored by Jacek Caban's avatar Jacek Caban Committed by Alexandre Julliard

kernel32: Set PEB console handle in AllocConsole.

parent ccaaf695
......@@ -3592,7 +3592,6 @@ static void test_FreeConsole(void)
HANDLE handle;
BOOL ret;
todo_wine
ok(RtlGetCurrentPeb()->ProcessParameters->ConsoleHandle != NULL, "ConsoleHandle is NULL\n");
ret = FreeConsole();
......
......@@ -266,7 +266,7 @@ BOOL WINAPI AllocConsole(void)
STARTUPINFOW app_si, console_si;
WCHAR buffer[1024], cmd[256];
PROCESS_INFORMATION pi;
HANDLE event, std_in;
HANDLE event, std_in, console;
DWORD mode;
BOOL ret;
......@@ -324,6 +324,10 @@ BOOL WINAPI AllocConsole(void)
}
CloseHandle( event );
if (!ret || !init_console_std_handles()) goto error;
console = CreateFileW( L"CONIN$", GENERIC_READ | GENERIC_WRITE | SYNCHRONIZE, 0, NULL, OPEN_EXISTING, 0, 0 );
if (console == INVALID_HANDLE_VALUE) goto error;
RtlGetCurrentPeb()->ProcessParameters->ConsoleHandle = console;
TRACE( "Started wineconsole pid=%08x tid=%08x\n", pi.dwProcessId, pi.dwThreadId );
RtlLeaveCriticalSection( &console_section );
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment