1
0
Fork 0
mirror of synced 2025-03-07 03:53:26 +01:00

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.
This commit is contained in:
Zhiyi Zhang 2023-12-14 15:09:07 +08:00 committed by Alexandre Julliard
parent a676f094f6
commit f110dc58ba
2 changed files with 1 additions and 2 deletions

View file

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

View file

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