[PATCH 03/11] dinput: Return DI_DOWNLOADSKIPPED from SetParameters.

Rémi Bernon rbernon at codeweavers.com
Mon Nov 15 03:00:22 CST 2021


From: Ivo Ivanov <logos128 at gmail.com>

When Download or Start failed because device is not acquired.

From: Ivo Ivanov <logos128 at gmail.com>
Wine-Bug: https://bugs.winehq.org/show_bug.cgi?id=51922
Signed-off-by: Rémi Bernon <rbernon at codeweavers.com>
---
 dlls/dinput/joystick_hid.c | 7 ++++---
 dlls/dinput8/tests/hid.c   | 1 -
 2 files changed, 4 insertions(+), 4 deletions(-)

diff --git a/dlls/dinput/joystick_hid.c b/dlls/dinput/joystick_hid.c
index a5fbfb81332..67a43924e19 100644
--- a/dlls/dinput/joystick_hid.c
+++ b/dlls/dinput/joystick_hid.c
@@ -2406,9 +2406,10 @@ static HRESULT WINAPI hid_joystick_effect_SetParameters( IDirectInputEffect *ifa
     impl->flags |= flags;
 
     if (flags & DIEP_NODOWNLOAD) return DI_DOWNLOADSKIPPED;
-    if (flags & DIEP_START) return IDirectInputEffect_Start( iface, 1, 0 );
-    if (FAILED(hr = IDirectInputEffect_Download( iface ))) return hr;
-    if (hr == DI_NOEFFECT) return DI_DOWNLOADSKIPPED;
+    if (flags & DIEP_START) hr = IDirectInputEffect_Start( iface, 1, 0 );
+    else hr = IDirectInputEffect_Download( iface );
+    if (hr == DIERR_NOTEXCLUSIVEACQUIRED) return DI_DOWNLOADSKIPPED;
+    if (FAILED(hr)) return hr;
     return DI_OK;
 }
 
diff --git a/dlls/dinput8/tests/hid.c b/dlls/dinput8/tests/hid.c
index 73813aa6948..f80a5013f1b 100644
--- a/dlls/dinput8/tests/hid.c
+++ b/dlls/dinput8/tests/hid.c
@@ -5700,7 +5700,6 @@ static void test_periodic_effect( IDirectInputDevice8W *device, HANDLE file, DWO
     ok( hr == DI_OK, "Unacquire returned: %#x\n", hr );
     set_hid_expect( file, NULL, 0 );
     hr = IDirectInputEffect_SetParameters( effect, &expect_desc, DIEP_DURATION );
-    todo_wine
     ok( hr == DI_DOWNLOADSKIPPED, "SetParameters returned %#x\n", hr );
     set_hid_expect( file, &expect_dc_reset, sizeof(expect_dc_reset) );
     hr = IDirectInputDevice8_Acquire( device );
-- 
2.33.1




More information about the wine-devel mailing list