Commit f110dc58 authored by Zhiyi Zhang's avatar Zhiyi Zhang Committed by Alexandre Julliard

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.
parent a676f094
......@@ -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);
......
......@@ -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;
}
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment