From: Rémi Bernon rbernon@codeweavers.com
There's only driver events, with QS_DRIVER, internal hardware messages, with QS_HARDWARE, or input hardware messages with QS_INPUT and we should avoid returning from the wait unnecessarily.
Some applications like iTunes, simply call MsgWaitForMultipleObjects in a loop with an empty mask and without processing any message. They don't expect the wait to return spuriously more than a couple of times (which is allowed and happens on windows when focus changes for instance).
Wine-Bug: https://bugs.winehq.org/show_bug.cgi?id=58793 --- dlls/win32u/message.c | 12 ++++-------- 1 file changed, 4 insertions(+), 8 deletions(-)
diff --git a/dlls/win32u/message.c b/dlls/win32u/message.c index 4b179619cf9..28a05ce1027 100644 --- a/dlls/win32u/message.c +++ b/dlls/win32u/message.c @@ -3229,8 +3229,7 @@ BOOL process_driver_events( UINT mask ) peek_message( &msg, &filter ); }
- /* check for hardware messages requiring client dispatch */ - return check_internal_bits( QS_HARDWARE ); + return is_queue_signaled(); }
void check_for_events( UINT flags ) @@ -3287,12 +3286,9 @@ static DWORD wait_message( DWORD count, const HANDLE *handles, DWORD timeout, DW params.restore = TRUE; }
- if (process_driver_events( QS_ALLINPUT )) ret = count - 1; - else - { - do ret = NtWaitForMultipleObjects( count, handles, !(flags & MWMO_WAITALL), !!(flags & MWMO_ALERTABLE), abs ); - while (ret == count - 1 && !process_driver_events( QS_ALLINPUT ) && !is_queue_signaled()); - } + process_driver_events( QS_ALLINPUT ); + do ret = NtWaitForMultipleObjects( count, handles, !(flags & MWMO_WAITALL), !!(flags & MWMO_ALERTABLE), abs ); + while (ret == count - 1 && !process_driver_events( QS_ALLINPUT )); if (HIWORD(ret)) /* is it an error code? */ { RtlSetLastWin32Error( RtlNtStatusToDosError(ret) );