Ivo Ivanov : dinput: Return DI_OK when HID joystick CreateEffect succeeds.

Alexandre Julliard julliard at winehq.org
Mon Nov 15 16:01:28 CST 2021


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

Author: Ivo Ivanov <logos128 at gmail.com>
Date:   Mon Nov 15 11:14:07 2021 +0100

dinput: Return DI_OK when HID joystick CreateEffect succeeds.

SetParameters returns DI_DOWNLOADSKIPPED if the device is not acquired
exclusively.

This fixes Assetto Corsa Competizione and Assetto Corsa not having FFB
due to calling CreateEffect before acquiring the device, which skips the
effect download and returns DI_DOWNLOADSKIPPED.

In particular, ACC tries twice to create the effect, and each time they
unacquire the device to turn off the autocenter, and then create the
effect while still in unacquired state, which in turn returns
DI_DOWNLOADSKIPPED, etc.

Wine-Bug: https://bugs.winehq.org/show_bug.cgi?id=51922
Signed-off-by: Rémi Bernon <rbernon at codeweavers.com>
Signed-off-by: Alexandre Julliard <julliard at winehq.org>

---

 dlls/dinput/device.c     | 2 +-
 dlls/dinput8/tests/hid.c | 1 -
 2 files changed, 1 insertion(+), 2 deletions(-)

diff --git a/dlls/dinput/device.c b/dlls/dinput/device.c
index b423337c9ce..c58ffc7ac73 100644
--- a/dlls/dinput/device.c
+++ b/dlls/dinput/device.c
@@ -1375,7 +1375,7 @@ static HRESULT WINAPI dinput_device_CreateEffect( IDirectInputDevice8W *iface, c
     if (!impl->acquired || !(impl->dwCoopLevel & DISCL_EXCLUSIVE)) flags |= DIEP_NODOWNLOAD;
     hr = IDirectInputEffect_SetParameters( *out, params, flags );
     if (FAILED(hr)) goto failed;
-    return hr;
+    return DI_OK;
 
 failed:
     IDirectInputEffect_Release( *out );
diff --git a/dlls/dinput8/tests/hid.c b/dlls/dinput8/tests/hid.c
index 9bbe5dbcbcc..78c178086c9 100644
--- a/dlls/dinput8/tests/hid.c
+++ b/dlls/dinput8/tests/hid.c
@@ -6153,7 +6153,6 @@ static void test_periodic_effect( IDirectInputDevice8W *device, HANDLE file, DWO
     ok( hr == DI_OK, "Acquire returned: %#x\n", hr );
     set_hid_expect( file, NULL, 0 );
     hr = IDirectInputDevice8_CreateEffect( device, &GUID_Sine, &expect_desc, &effect, NULL );
-    todo_wine
     ok( hr == DI_OK, "CreateEffect returned %#x\n", hr );
     ref = IDirectInputEffect_Release( effect );
     ok( ref == 0, "Release returned %d\n", ref );




More information about the wine-cvs mailing list