KERNEL/tests: don't send signal to console NULL handler

Saulius Krasuckas saulius2 at ar.fi.lt
Sat Oct 22 02:30:36 CDT 2005


On Fri, 21 Oct 2005, Saulius Krasuckas wrote:
> 
> 	Don't set NULL console signal handler on Win9x, as any signal 
> 	generates an unhandled exception then.

Oops, this is old changelog message.  Actually we _set_ NULL handler but 
we don't send a signal to it.  If this is too small change, notify me, 
please.


Log message:
	Saulius Krasuckas <saulius.krasuckas at ieee.org>
	Don't send a CTRL_C_EVENT signal to console if we are on Win9x and 
	signal handler is set to NULL.


Index: dlls/kernel/tests/console.c
===================================================================
RCS file: /home/wine/wine/dlls/kernel/tests/console.c,v
retrieving revision 1.10
diff -p -u -r1.10 console.c
--- dlls/kernel/tests/console.c	28 Jan 2005 14:02:52 -0000	1.10
+++ dlls/kernel/tests/console.c	21 Oct 2005 13:36:43 -0000
@@ -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() & 80000000))
+        /* ... 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");



More information about the wine-patches mailing list