Commit 6ed40bb2 authored by Alexandre Julliard's avatar Alexandre Julliard

Pass the correct instance when installing the mouse hook (spotted by

Lionel Ulmer).
parent 74c3eab2
......@@ -50,11 +50,14 @@ static ICOM_VTABLE(IDirectInput8A) ddi8avt;
static dinput_device * dinput_devices[MAX_WINE_DINPUT_DEVICES];
static int nrof_dinput_devices = 0;
HINSTANCE DINPUT_instance = NULL;
BOOL WINAPI DllMain( HINSTANCE inst, DWORD reason, LPVOID reserv)
{
switch(reason)
{
case DLL_PROCESS_ATTACH:
DINPUT_instance = inst;
keyboard_hook = SetWindowsHookExW( WH_KEYBOARD_LL, KeyboardCallback, inst, 0 );
break;
case DLL_PROCESS_DETACH:
......
......@@ -46,4 +46,6 @@ HHOOK keyboard_hook;
LRESULT CALLBACK KeyboardCallback( int code, WPARAM wparam, LPARAM lparam );
extern HINSTANCE DINPUT_instance;
#endif /* __WINE_DLLS_DINPUT_DINPUT_PRIVATE_H */
......@@ -527,7 +527,7 @@ static HRESULT WINAPI SysMouseAImpl_Acquire(LPDIRECTINPUTDEVICE8A iface)
/* Install our mouse hook */
if (This->dwCoopLevel & DISCL_EXCLUSIVE)
ShowCursor(FALSE); /* hide cursor */
This->hook = SetWindowsHookExW( WH_MOUSE_LL, dinput_mouse_hook, 0, 0 );
This->hook = SetWindowsHookExA( WH_MOUSE_LL, dinput_mouse_hook, DINPUT_instance, 0 );
/* Get the window dimension and find the center */
GetWindowRect(This->win, &rect);
......
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