http://bugs.winehq.org/show_bug.cgi?id=14784
Summary: SetWindowHookEx fails to inject DLL conatining the HookProc if... Product: Wine Version: 1.1.2 Platform: All OS/Version: Linux Status: UNCONFIRMED Severity: enhancement Priority: P3 Component: user32 AssignedTo: wine-bugs@winehq.org ReportedBy: hongbo@njstar.com
SetWindowHookEx fails to inject DLL conatining the HookProc into another process if the DLL is linked with another DLL in the same directory which is not on PATH.
Suppose DLLA_GetMsgProcis is in A.DLL, and A.dll is linked to B.dll, with those code:
hwnd = FindWindow("Notepad",NULL); idThread = GetWindowThreadProcessId(hwnd, NULL); SetWindowsHookEx(WH_GETMESSAGE, DLLA_GetMsgProc, hinst, idThread );
SetWindowsHookEx will fail because it can not load B.dll which is imported by A.dll.
If hwnd is created by current process, there is no problem. But in above code, Notepad is not the current process.
I have created a simplest test application (attached) with source and compiled exe/dll to show the above bug on wine.