Rémi Bernon : dinput: Pretend that DIPROP_AUTOCENTER is supported.

Alexandre Julliard julliard at winehq.org
Mon Nov 8 15:45:05 CST 2021


Module: wine
Branch: master
Commit: e04cfc0b0a7c33f2d882b453d0fceda9e4793bef
URL:    https://source.winehq.org/git/wine.git/?a=commit;h=e04cfc0b0a7c33f2d882b453d0fceda9e4793bef

Author: Rémi Bernon <rbernon at codeweavers.com>
Date:   Mon Nov  8 09:35:00 2021 +0100

dinput: Pretend that DIPROP_AUTOCENTER is supported.

Star Wars Episode I Racer will ignore force-feedback joystick devices if
we return an error here.

Signed-off-by: Rémi Bernon <rbernon at codeweavers.com>
Signed-off-by: Alexandre Julliard <julliard at winehq.org>

---

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




More information about the wine-cvs mailing list