From e04cfc0b0a7c33f2d882b453d0fceda9e4793bef Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?R=C3=A9mi=20Bernon?= Date: Mon, 8 Nov 2021 09:35:00 +0100 Subject: [PATCH] dinput: Pretend that DIPROP_AUTOCENTER is supported. MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Star Wars Episode I Racer will ignore force-feedback joystick devices if we return an error here. Signed-off-by: RĂ©mi Bernon Signed-off-by: Alexandre Julliard --- dlls/dinput/device.c | 3 ++- dlls/dinput8/tests/hid.c | 1 - 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/dlls/dinput/device.c b/dlls/dinput/device.c index c79b182bc66..dff1f3426d3 100644 --- a/dlls/dinput/device.c +++ b/dlls/dinput/device.c @@ -1082,7 +1082,8 @@ static HRESULT WINAPI dinput_device_SetProperty( IDirectInputDevice8W *iface, co EnterCriticalSection( &impl->crit ); if (impl->acquired) hr = DIERR_ACQUIRED; else if (value->dwData > DIPROPAUTOCENTER_ON) hr = DIERR_INVALIDPARAM; - else hr = DIERR_UNSUPPORTED; + else if (!(impl->caps.dwFlags & DIDC_FORCEFEEDBACK)) hr = DIERR_UNSUPPORTED; + else hr = DI_OK; LeaveCriticalSection( &impl->crit ); return hr; } diff --git a/dlls/dinput8/tests/hid.c b/dlls/dinput8/tests/hid.c index af8d48dfc90..a0e202ba804 100644 --- a/dlls/dinput8/tests/hid.c +++ b/dlls/dinput8/tests/hid.c @@ -7360,7 +7360,6 @@ static void test_force_feedback_joystick( void ) prop_dword.diph.dwObj = 0; prop_dword.dwData = DIPROPAUTOCENTER_ON; hr = IDirectInputDevice8_SetProperty( device, DIPROP_AUTOCENTER, &prop_dword.diph ); - todo_wine ok( hr == DI_OK, "SetProperty DIPROP_AUTOCENTER returned %#x\n", hr ); hr = IDirectInputDevice8_Acquire( device );