A possible fix for the message queue state problem revealed by the previously sent test case

Dmitry Timoshkov dmitry at codeweavers.com
Wed May 24 01:54:38 CDT 2006


Hello,

here is a possible fix for the message queue state problem revealed
by the previously sent test case.

Changelog:
    get_quit_message() should not clear QS_POSTMESSAGE queue state,
    but only clear the quit_message flag. Clear QS_POSTMESSAGE state
    only if get_posted_message() is going to return FALSE and both posted
    messages queue is empty and quit_message flag is not set.

diff -up cvs/hq/wine/dlls/user/tests/msg.c wine/dlls/user/tests/msg.c
--- cvs/hq/wine/dlls/user/tests/msg.c	2006-05-24 15:33:45.000000000 +0900
+++ wine/dlls/user/tests/msg.c	2006-05-24 15:37:44.000000000 +0900
@@ -7421,10 +7421,8 @@ todo_wine {
     ok(msg.lParam == 0, "got lParam %lx instead of 0\n", msg.lParam);
 
     qstatus = GetQueueStatus(qs_all_input);
-todo_wine {
     ok(qstatus == MAKELONG(0, QS_POSTMESSAGE),
        "wrong qstatus %08lx\n", qstatus);
-}
 
     ret = PeekMessageA(&msg, 0, 0, 0, PM_REMOVE);
     ok(!ret,
diff -up cvs/hq/wine/server/queue.c wine/server/queue.c
--- cvs/hq/wine/server/queue.c	2006-05-24 13:17:03.000000000 +0900
+++ wine/server/queue.c	2006-05-24 15:32:39.000000000 +0900
@@ -651,6 +651,9 @@ static int get_posted_message( struct ms
         if (!check_msg_filter( msg->msg, first, last )) continue;
         goto found; /* found one */
     }
+
+    if (list_empty( &queue->msg_list[POST_MESSAGE] ) && !queue->quit_message)
+        clear_queue_bits( queue, QS_POSTMESSAGE|QS_ALLPOSTMESSAGE );
     return 0;
 
     /* return it to the app */
@@ -703,11 +706,8 @@ static int get_quit_message( struct msg_
         reply->info   = 0;
 
         if (flags & GET_MSG_REMOVE)
-        {
             queue->quit_message = 0;
-            if (list_empty( &queue->msg_list[POST_MESSAGE] ))
-                clear_queue_bits( queue, QS_POSTMESSAGE|QS_ALLPOSTMESSAGE );
-        }
+
         return 1;
     }
     else





More information about the wine-patches mailing list