http://bugs.winehq.org/show_bug.cgi?id=5803
Summary: Multiple LL hooks generate never ending loop of events Product: Wine Version: CVS Platform: PC OS/Version: Linux Status: NEW Keywords: source Severity: major Priority: P2 Component: wine-user AssignedTo: wine-bugs@winehq.org ReportedBy: vitaliy@kievinfo.com OtherBugsDependingO 5712 nThis:
If we have two LL hooks in the system from the separate threads we will generate never ending loop of events. Attached is the sample program that demostrates the problem.
Here is the loop that starts from internal message that we generated in usr/hook.c: LRESULT WINAPI CallNextHookEx( HHOOK hhook, INT code, WPARAM wparam, LPARAM lparam ) { ... case WH_MOUSE_LL: MSG_SendInternalMessageTimeout( pid, tid, WM_WINE_MOUSE_LL_HOOK, wparam, lparam, SMTO_ABORTIFHUNG, get_ll_hook_timeout(), &ret );
And trying to process in user/message.c: static LRESULT handle_internal_message( HWND hwnd, UINT msg, WPARAM wparam, LPARAM lparam ) { ... case WM_WINE_MOUSE_LL_HOOK: return HOOK_CallHooks( WH_MOUSE_LL, HC_ACTION, wparam, lparam, TRUE );
Which re-starts the hook chain.