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

This commit is contained in:
Kirill K. Smirnov 2007-12-20 15:19:10 +03:00 committed by Alexandre Julliard
parent 99a193ce7e
commit b7f617c916
1 changed files with 9 additions and 3 deletions

View File

@ -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));