Commit b7f617c9 authored by Kirill K. Smirnov's avatar Kirill K. Smirnov Committed by Alexandre Julliard

kernel32: Invalidate local copy of console input event handle while reallocating console.

parent 99a193ce
......@@ -67,6 +67,9 @@ static CRITICAL_SECTION CONSOLE_CritSect = { &critsect_debug, -1, 0, 0, 0, 0 };
static const WCHAR coninW[] = {'C','O','N','I','N','$',0};
static const WCHAR conoutW[] = {'C','O','N','O','U','T','$',0};
/* FIXME: this is not thread safe */
static HANDLE console_wait_event;
/* map input records to ASCII */
static void input_records_WtoA( INPUT_RECORD *buffer, int count )
{
......@@ -378,9 +381,6 @@ BOOL WINAPI CloseConsoleHandle(HANDLE handle)
*/
HANDLE WINAPI GetConsoleInputWaitHandle(void)
{
static HANDLE console_wait_event;
/* FIXME: this is not thread safe */
if (!console_wait_event)
{
SERVER_START_REQ(get_console_wait_event)
......@@ -1131,6 +1131,9 @@ BOOL WINAPI FreeConsole(VOID)
{
BOOL ret;
/* invalidate local copy of input event handle */
console_wait_event = 0;
SERVER_START_REQ(free_console)
{
ret = !wine_server_call_err( req );
......@@ -1230,6 +1233,9 @@ BOOL WINAPI AllocConsole(void)
/* happens when we're running on a Unix console */
if (handle_in != INVALID_HANDLE_VALUE) CloseHandle(handle_in);
/* invalidate local copy of input event handle */
console_wait_event = 0;
GetStartupInfoA(&siCurrent);
memset(&siConsole, 0, sizeof(siConsole));
......
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