From: Ivo Ivanov logos128@gmail.com
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.
From: Ivo Ivanov logos128@gmail.com Wine-Bug: https://bugs.winehq.org/show_bug.cgi?id=51922 Signed-off-by: Rémi Bernon rbernon@codeweavers.com --- 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 f80a5013f1b..bea4d40d3e6 100644 --- a/dlls/dinput8/tests/hid.c +++ b/dlls/dinput8/tests/hid.c @@ -6156,7 +6156,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 );