Commit e43f5164 authored by Jacek Caban's avatar Jacek Caban Committed by Alexandre Julliard

kernel32: Return standard input handle in GetConsoleInputWaitHandle.

parent 99e6bab3
......@@ -76,9 +76,6 @@ 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 )
{
......@@ -302,16 +299,7 @@ BOOL WINAPI CloseConsoleHandle(HANDLE handle)
*/
HANDLE WINAPI GetConsoleInputWaitHandle(void)
{
if (!console_wait_event)
{
SERVER_START_REQ(get_console_wait_event)
{
if (!wine_server_call_err( req ))
console_wait_event = wine_server_ptr_handle( reply->event );
}
SERVER_END_REQ;
}
return console_wait_event;
return GetStdHandle( STD_INPUT_HANDLE );
}
......@@ -630,9 +618,6 @@ BOOL WINAPI AllocConsole(void)
return FALSE;
}
/* invalidate local copy of input event handle */
console_wait_event = 0;
GetStartupInfoA(&siCurrent);
memset(&siConsole, 0, sizeof(siConsole));
......
......@@ -30,6 +30,8 @@ static HANDLE (WINAPI *pOpenConsoleW)(LPCWSTR,DWORD,BOOL,DWORD);
static BOOL (WINAPI *pSetConsoleInputExeNameA)(LPCSTR);
static BOOL (WINAPI *pVerifyConsoleIoHandle)(HANDLE handle);
static BOOL skip_nt;
/* DEFAULT_ATTRIB is used for all initial filling of the console.
* all modifications are made with TEST_ATTRIB so that we could check
* what has to be modified or not
......@@ -1267,7 +1269,6 @@ static void test_CreateFileW(void)
UNICODE_STRING string;
IO_STATUS_BLOCK iosb;
NTSTATUS status;
BOOL skip_nt = FALSE;
for (index = 0; index < ARRAY_SIZE(cf_table); index++)
{
......@@ -3225,6 +3226,16 @@ static void test_FreeConsole(void)
ok(handle == INVALID_HANDLE_VALUE &&
(GetLastError() == ERROR_INVALID_HANDLE || broken(GetLastError() == ERROR_FILE_NOT_FOUND /* winxp */)),
"CreateFileA failed: %u\n", GetLastError());
if (!skip_nt)
{
SetStdHandle( STD_INPUT_HANDLE, (HANDLE)0xdeadbeef );
handle = GetConsoleInputWaitHandle();
ok(handle == (HANDLE)0xdeadbeef, "GetConsoleInputWaitHandle returned %p\n", handle);
SetStdHandle( STD_INPUT_HANDLE, NULL );
handle = GetConsoleInputWaitHandle();
ok(!handle, "GetConsoleInputWaitHandle returned %p\n", handle);
}
}
static void test_SetConsoleScreenBufferInfoEx(HANDLE std_output)
......
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