From: Rémi Bernon rbernon@codeweavers.com
This is important for other Win16 threads to have a chance to execute during peek_message, even if no messages are received, or if the thread is within a nested window message procedure call.
Wine-Bug: https://bugs.winehq.org/show_bug.cgi?id=57384 --- dlls/win32u/message.c | 12 ++++++++++++ 1 file changed, 12 insertions(+)
diff --git a/dlls/win32u/message.c b/dlls/win32u/message.c index ee3f2521fa4..ef8b6f86431 100644 --- a/dlls/win32u/message.c +++ b/dlls/win32u/message.c @@ -3270,8 +3270,20 @@ BOOL WINAPI NtUserPeekMessage( MSG *msg_out, HWND hwnd, UINT first, UINT last, U { if (!ret) { + struct thunk_lock_params params = {.dispatch.callback = thunk_lock_callback}; + void *ret_ptr; + ULONG ret_len; + flush_window_surfaces( TRUE ); + + if (!KeUserDispatchCallback( ¶ms.dispatch, sizeof(params), &ret_ptr, &ret_len ) && + ret_len == sizeof(params.locks)) + { + params.locks = *(DWORD *)ret_ptr; + params.restore = TRUE; + } NtYieldExecution(); + KeUserDispatchCallback( ¶ms.dispatch, sizeof(params), &ret_ptr, &ret_len ); } return FALSE; }