Module: wine Branch: master Commit: f110dc58ba7dac7819aaa3d73d42107cf4f66e3f URL: https://gitlab.winehq.org/wine/wine/-/commit/f110dc58ba7dac7819aaa3d73d42107...
Author: Zhiyi Zhang zzhang@codeweavers.com Date: Thu Dec 14 15:09:07 2023 +0800
win32u: Avoid calling WH_CBT HCBT_CLICKSKIPPED hooks recursively.
Previously, accept_hardware_message() is called after WH_CBT HCBT_CLICKSKIPPED hooks. So when these hooks call PeekMessage(), they will be called recursively. Note that WH_MOUSE hooks do get called recursively according to tests.
---
dlls/user32/tests/msg.c | 1 - dlls/win32u/message.c | 2 +- 2 files changed, 1 insertion(+), 2 deletions(-)
diff --git a/dlls/user32/tests/msg.c b/dlls/user32/tests/msg.c index b0b2295bb5d..55967286092 100644 --- a/dlls/user32/tests/msg.c +++ b/dlls/user32/tests/msg.c @@ -12629,7 +12629,6 @@ static void test_recursive_hook(void) flush_events();
/* Expect the WH_CBT HCBT_CLICKSKIPPED hook not gets called recursively */ - todo_wine ok(max_hook_depth <= 10, "Got expected %d.\n", max_hook_depth);
UnhookWindowsHookEx(cbt_hook); diff --git a/dlls/win32u/message.c b/dlls/win32u/message.c index 376af30554e..c567d697a41 100644 --- a/dlls/win32u/message.c +++ b/dlls/win32u/message.c @@ -2570,8 +2570,8 @@ static BOOL process_mouse_message( MSG *msg, UINT hw_id, ULONG_PTR extra_info, H hook.wHitTestCode = hittest; hook.dwExtraInfo = extra_info; hook.mouseData = msg->wParam; - call_hooks( WH_CBT, HCBT_CLICKSKIPPED, message, (LPARAM)&hook, sizeof(hook) ); accept_hardware_message( hw_id ); + call_hooks( WH_CBT, HCBT_CLICKSKIPPED, message, (LPARAM)&hook, sizeof(hook) ); return FALSE; }