From 4b4b6a48cb49465319f8c9838d463e34abfa5ce9 Mon Sep 17 00:00:00 2001 From: Alexandre Julliard Date: Thu, 24 Dec 2009 12:03:45 +0100 Subject: [PATCH] user32: Use the wait message handler for the yield in PeekMessageW too. --- dlls/user32/message.c | 8 +------- dlls/user32/winproc.c | 4 +++- 2 files changed, 4 insertions(+), 8 deletions(-) diff --git a/dlls/user32/message.c b/dlls/user32/message.c index 48c806848dc..d85eabbb49d 100644 --- a/dlls/user32/message.c +++ b/dlls/user32/message.c @@ -2887,13 +2887,7 @@ BOOL WINAPI PeekMessageW( MSG *msg_out, HWND hwnd, UINT first, UINT last, UINT f if (!peek_message( &msg, hwnd, first, last, flags, 0 )) { - if (!(flags & PM_NOYIELD)) - { - DWORD count; - ReleaseThunkLock(&count); - NtYieldExecution(); - if (count) RestoreThunkLock(count); - } + if (!(flags & PM_NOYIELD)) wow_handlers.wait_message( 0, NULL, 0, 0, 0 ); return FALSE; } diff --git a/dlls/user32/winproc.c b/dlls/user32/winproc.c index c73a40e39ef..396ae8776d6 100644 --- a/dlls/user32/winproc.c +++ b/dlls/user32/winproc.c @@ -1123,7 +1123,9 @@ static LRESULT WINAPI StaticWndProcW( HWND hwnd, UINT msg, WPARAM wParam, LPARAM static DWORD wait_message( DWORD count, CONST HANDLE *handles, DWORD timeout, DWORD mask, DWORD flags ) { - return USER_Driver->pMsgWaitForMultipleObjectsEx( count, handles, timeout, mask, flags ); + DWORD ret = USER_Driver->pMsgWaitForMultipleObjectsEx( count, handles, timeout, mask, flags ); + if (ret == WAIT_TIMEOUT && !count && !timeout) NtYieldExecution(); + return ret; } static HICON alloc_icon_handle( unsigned int size )