Don't send a CTRL_C_EVENT signal to console if we are on Win9x and

console signal handler is set to NULL.
This commit is contained in:
Saulius Krasuckas 2005-10-28 10:40:42 +00:00 committed by Alexandre Julliard
parent 89a4918218
commit d2e0d5e8bd
1 changed files with 5 additions and 1 deletions

View File

@ -537,10 +537,14 @@ static void testCtrlHandler(void)
#endif
ok(WaitForSingleObject(mch_event, 3000) == WAIT_OBJECT_0, "event sending didn't work\n");
CloseHandle(mch_event);
/* Turning off ctrl-c handling doesn't work on win9x such way ... */
ok(SetConsoleCtrlHandler(NULL, TRUE), "Couldn't turn off ctrl-c handling\n");
mch_event = CreateEventA(NULL, TRUE, FALSE, NULL);
mch_count = 0;
ok(GenerateConsoleCtrlEvent(CTRL_C_EVENT, 0), "Couldn't send ctrl-c event\n");
if(!(GetVersion() & 0x80000000))
/* ... and next line leads to an unhandled exception on 9x. Avoid it on 9x. */
ok(GenerateConsoleCtrlEvent(CTRL_C_EVENT, 0), "Couldn't send ctrl-c event\n");
ok(WaitForSingleObject(mch_event, 3000) == WAIT_TIMEOUT && mch_count == 0, "Event shouldn't have been sent\n");
CloseHandle(mch_event);
ok(SetConsoleCtrlHandler(mch, FALSE), "Couldn't remove handler\n");