Ivo Ivanov : dinput: Return DI_DOWNLOADSKIPPED from SetParameters.

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


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

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

dinput: Return DI_DOWNLOADSKIPPED from SetParameters.

When Download or Start failed because device is not acquired.

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/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 8aeebc62ab7..9bbe5dbcbcc 100644
--- a/dlls/dinput8/tests/hid.c
+++ b/dlls/dinput8/tests/hid.c
@@ -5697,7 +5697,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 );




More information about the wine-cvs mailing list