server: Filter WM_QUIT message in PeekMessage call if PM_QS_POSTMESSAGE was not specified.

This commit is contained in:
Piotr Caban 2015-02-06 16:44:25 +01:00 committed by Alexandre Julliard
parent 21d470d11a
commit 03f645a76b
2 changed files with 6 additions and 3 deletions

View file

@ -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);

View file

@ -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 */