server: Don't clear the QS_POSTMESSAGE flag if there is a
pending quit message
Dmitry Timoshkov
dmitry at codeweavers.com
Tue May 23 05:04:10 CDT 2006
Hello,
please apply after the message test #2.
This test shows that the patch Rob sent "Don't clear the QS_POSTMESSAGE flag
if there is a pending quit message" is wrong.
Changelog:
Add a test to check the queue status if there are a pending posted
message and the quit flag is set.
--- cvs/hq/wine/dlls/user/tests/msg.c 2006-05-23 18:43:07.000000000 +0900
+++ wine/dlls/user/tests/msg.c 2006-05-23 18:44:08.000000000 +0900
@@ -7187,14 +7187,17 @@ static void test_PeekMessage(void)
info.hwnd = CreateWindowA("TestWindowClass", NULL, WS_OVERLAPPEDWINDOW,
100, 100, 200, 200, 0, 0, 0, NULL);
+ assert(info.hwnd);
ShowWindow(info.hwnd, SW_SHOW);
UpdateWindow(info.hwnd);
+ SetFocus(info.hwnd);
info.hevent[EV_START_STOP] = CreateEventA(NULL, 0, 0, NULL);
info.hevent[EV_SENDMSG] = CreateEventA(NULL, 0, 0, NULL);
info.hevent[EV_ACK] = CreateEventA(NULL, 0, 0, NULL);
hthread = CreateThread(NULL, 0, send_msg_thread_2, &info, 0, &tid);
+ Sleep(100);
trace("signalling to start looping\n");
SetEvent(info.hevent[EV_START_STOP]);
@@ -7379,6 +7382,23 @@ todo_wine {
ok(qstatus == 0,
"wrong qstatus %08lx\n", qstatus);
+ /* test whether presence of the quit flag in the queue affects
+ * the queue state
+ */
+ PostMessageA(info.hwnd, WM_USER, 0, 0);
+ PostQuitMessage(0x1234abcd);
+
+ qstatus = GetQueueStatus(qs_all_input);
+ ok(qstatus == MAKELONG(QS_POSTMESSAGE, QS_POSTMESSAGE),
+ "wrong qstatus %08lx\n", qstatus);
+
+ while (PeekMessageA(&msg, 0, 0, 0, PM_REMOVE)) DispatchMessageA(&msg);
+ ok_sequence(WmUser, "WmUser", FALSE);
+
+ qstatus = GetQueueStatus(qs_all_input);
+ ok(qstatus == 0,
+ "wrong qstatus %08lx\n", qstatus);
+
trace("signalling to exit\n");
SetEvent(info.hevent[EV_START_STOP]);
More information about the wine-patches
mailing list