From 67d38c699110a186ff69ecfa9a11e8c0cb3305a0 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?R=C3=A9mi=20Bernon?= Date: Mon, 8 Nov 2021 09:35:02 +0100 Subject: [PATCH] dinput: Support both DIEFFECT_DX5 and DIEFFECT_DX6 parameters. MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Star Wars Episode I Racer force-feedback doesn't work otherwise as it passes a DIEFFECT_DX5 struct to SetParameters. Signed-off-by: RĂ©mi Bernon Signed-off-by: Alexandre Julliard --- dlls/dinput/joystick_hid.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/dlls/dinput/joystick_hid.c b/dlls/dinput/joystick_hid.c index 20a10bde6ae..541aa26e73b 100644 --- a/dlls/dinput/joystick_hid.c +++ b/dlls/dinput/joystick_hid.c @@ -2043,7 +2043,7 @@ static HRESULT WINAPI hid_joystick_effect_GetParameters( IDirectInputEffect *ifa TRACE( "iface %p, params %p, flags %#x.\n", iface, params, flags ); if (!params) return DI_OK; - if (params->dwSize != sizeof(DIEFFECT)) return DIERR_INVALIDPARAM; + if (params->dwSize != sizeof(DIEFFECT_DX6) && params->dwSize != sizeof(DIEFFECT_DX5)) return DIERR_INVALIDPARAM; capacity = params->cAxes; object_flags = params->dwFlags & (DIEFF_OBJECTIDS | DIEFF_OBJECTOFFSETS); direction_flags = params->dwFlags & (DIEFF_CARTESIAN | DIEFF_POLAR | DIEFF_SPHERICAL); @@ -2199,7 +2199,7 @@ static HRESULT WINAPI hid_joystick_effect_SetParameters( IDirectInputEffect *ifa TRACE( "iface %p, params %p, flags %#x.\n", iface, params, flags ); if (!params) return E_POINTER; - if (params->dwSize != sizeof(DIEFFECT)) return DIERR_INVALIDPARAM; + if (params->dwSize != sizeof(DIEFFECT_DX6) && params->dwSize != sizeof(DIEFFECT_DX5)) return DIERR_INVALIDPARAM; object_flags = params->dwFlags & (DIEFF_OBJECTIDS | DIEFF_OBJECTOFFSETS); direction_flags = params->dwFlags & (DIEFF_CARTESIAN | DIEFF_POLAR | DIEFF_SPHERICAL);