Piotr Caban : server: Filter WM_QUIT message in PeekMessage call if PM_QS_POSTMESSAGE was not specified.
Alexandre Julliard
julliard at wine.codeweavers.com
Mon Feb 9 09:54:48 CST 2015
Module: wine
Branch: master
Commit: 03f645a76bf697ead28df5de665cb351b2d996f9
URL: http://source.winehq.org/git/wine.git/?a=commit;h=03f645a76bf697ead28df5de665cb351b2d996f9
Author: Piotr Caban <piotr at codeweavers.com>
Date: Fri Feb 6 16:44:25 2015 +0100
server: Filter WM_QUIT message in PeekMessage call if PM_QS_POSTMESSAGE was not specified.
---
dlls/user32/tests/msg.c | 4 ++++
server/queue.c | 5 ++---
2 files changed, 6 insertions(+), 3 deletions(-)
diff --git a/dlls/user32/tests/msg.c b/dlls/user32/tests/msg.c
index 66f054a..f1236cf 100644
--- a/dlls/user32/tests/msg.c
+++ b/dlls/user32/tests/msg.c
@@ -10500,6 +10500,10 @@ static void test_quit_message(void)
flush_events();
PostQuitMessage(0xbeef);
+ msg.message = 0;
+ ret = PeekMessageA(&msg, 0, 0, 0, PM_QS_SENDMESSAGE);
+ ok(!ret, "got %x message\n", msg.message);
+
ret = PeekMessageA(&msg, NULL, 0, 0, PM_NOREMOVE);
ok(ret, "PeekMessage failed with error %d\n", GetLastError());
ok(msg.message == WM_QUIT, "Received message 0x%04x instead of WM_QUIT\n", msg.message);
diff --git a/server/queue.c b/server/queue.c
index 5f87203..3a321cd 100644
--- a/server/queue.c
+++ b/server/queue.c
@@ -2384,9 +2384,8 @@ DECL_HANDLER(get_message)
get_posted_message( queue, get_win, WM_HOTKEY, WM_HOTKEY, req->flags, reply ))
return;
- /* only check for quit messages if not posted messages pending.
- * note: the quit message isn't filtered */
- if (get_quit_message( queue, req->flags, reply ))
+ /* only check for quit messages if not posted messages pending */
+ if ((filter & QS_POSTMESSAGE) && get_quit_message( queue, req->flags, reply ))
return;
/* then check for any raw hardware message */
More information about the wine-cvs
mailing list