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

Lionel Ulmer).
This commit is contained in:
Alexandre Julliard 2002-12-24 01:18:21 +00:00
parent 74c3eab255
commit 6ed40bb2af
3 changed files with 6 additions and 1 deletions

View File

@ -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:

View File

@ -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 */

View File

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