diff --git a/dlls/dinput/device.c b/dlls/dinput/device.c index 941206ccf3b..cf911531b52 100644 --- a/dlls/dinput/device.c +++ b/dlls/dinput/device.c @@ -533,10 +533,10 @@ int find_property(const DataFormat *df, LPCDIPROPHEADER ph) * queue_event - add new event to the ring queue */ -void queue_event(LPDIRECTINPUTDEVICE8A iface, int ofs, DWORD data, DWORD time, DWORD seq) +void queue_event(LPDIRECTINPUTDEVICE8A iface, int inst_id, DWORD data, DWORD time, DWORD seq) { IDirectInputDevice2AImpl *This = (IDirectInputDevice2AImpl *)iface; - int next_pos; + int next_pos, ofs = id_to_offset(&This->data_format, inst_id); /* Event is being set regardless of the queue state */ if (This->hEvent) SetEvent(This->hEvent); diff --git a/dlls/dinput/device_private.h b/dlls/dinput/device_private.h index 346338201e2..d62e32ef97f 100644 --- a/dlls/dinput/device_private.h +++ b/dlls/dinput/device_private.h @@ -78,7 +78,7 @@ extern DWORD get_config_key(HKEY, HKEY, const char*, char*, DWORD); /* Routines to do DataFormat / WineFormat conversions */ extern void fill_DataFormat(void *out, DWORD size, const void *in, const DataFormat *df) ; extern void release_DataFormat(DataFormat *df) ; -extern void queue_event(LPDIRECTINPUTDEVICE8A iface, int ofs, DWORD data, DWORD time, DWORD seq); +extern void queue_event(LPDIRECTINPUTDEVICE8A iface, int inst_id, DWORD data, DWORD time, DWORD seq); /* Helper functions to work with data format */ extern int id_to_object(LPCDIDATAFORMAT df, int id); extern int id_to_offset(const DataFormat *df, int id); diff --git a/dlls/dinput/joystick_linux.c b/dlls/dinput/joystick_linux.c index 2203a20fc4d..1396ea56d84 100644 --- a/dlls/dinput/joystick_linux.c +++ b/dlls/dinput/joystick_linux.c @@ -614,8 +614,7 @@ static void joy_polldev(JoystickGenericImpl *This_in) { } } if (inst_id >= 0) - queue_event((LPDIRECTINPUTDEVICE8A)This, - id_to_offset(&This->generic.base.data_format, inst_id), + queue_event((LPDIRECTINPUTDEVICE8A)This, inst_id, value, jse.time, This->generic.base.dinput->evsequence++); } } diff --git a/dlls/dinput/joystick_linuxinput.c b/dlls/dinput/joystick_linuxinput.c index 67a1ee38797..6c3c8ccfd1f 100644 --- a/dlls/dinput/joystick_linuxinput.c +++ b/dlls/dinput/joystick_linuxinput.c @@ -824,8 +824,7 @@ static void joy_polldev(JoystickGenericImpl *iface) break; } if (inst_id >= 0) - queue_event((LPDIRECTINPUTDEVICE8A)This, - id_to_offset(&This->generic.base.data_format, inst_id), + queue_event((LPDIRECTINPUTDEVICE8A)This, inst_id, value, ie.time.tv_usec, This->generic.base.dinput->evsequence++); } } diff --git a/dlls/dinput/keyboard.c b/dlls/dinput/keyboard.c index de8c63c9fc0..36928780392 100644 --- a/dlls/dinput/keyboard.c +++ b/dlls/dinput/keyboard.c @@ -107,9 +107,9 @@ static int KeyboardCallback( LPDIRECTINPUTDEVICE8A iface, WPARAM wparam, LPARAM This->DInputKeyState[dik_code] = new_diks; TRACE(" setting %02X to %02X\n", dik_code, This->DInputKeyState[dik_code]); - dik_code = id_to_offset(&This->base.data_format, DIDFT_MAKEINSTANCE(dik_code) | DIDFT_PSHBUTTON); EnterCriticalSection(&This->base.crit); - queue_event((LPDIRECTINPUTDEVICE8A)This, dik_code, new_diks, hook->time, This->base.dinput->evsequence++); + queue_event((LPDIRECTINPUTDEVICE8A)This, DIDFT_MAKEINSTANCE(dik_code) | DIDFT_PSHBUTTON, + new_diks, hook->time, This->base.dinput->evsequence++); LeaveCriticalSection(&This->base.crit); return ret; diff --git a/dlls/dinput/mouse.c b/dlls/dinput/mouse.c index 7b95be3460e..4809c567de2 100644 --- a/dlls/dinput/mouse.c +++ b/dlls/dinput/mouse.c @@ -324,7 +324,7 @@ static int dinput_mouse_hook( LPDIRECTINPUTDEVICE8A iface, WPARAM wparam, LPARAM { /* Already have X, need to queue it */ if (inst_id != -1) - queue_event((LPDIRECTINPUTDEVICE8A)This, id_to_offset(&This->base.data_format, inst_id), + queue_event((LPDIRECTINPUTDEVICE8A)This, inst_id, wdata, GetCurrentTime(), This->base.dinput->evsequence); inst_id = DIDFT_MAKEINSTANCE(WINE_MOUSE_Y_AXIS_INSTANCE) | DIDFT_RELAXIS; wdata = pt1.y; @@ -379,7 +379,7 @@ static int dinput_mouse_hook( LPDIRECTINPUTDEVICE8A iface, WPARAM wparam, LPARAM if (inst_id != -1) { _dump_mouse_state(&This->m_state); - queue_event((LPDIRECTINPUTDEVICE8A)This, id_to_offset(&This->base.data_format, inst_id), + queue_event((LPDIRECTINPUTDEVICE8A)This, inst_id, wdata, GetCurrentTime(), This->base.dinput->evsequence++); }