Ivo Ivanov : dinput: Mark effect parameters as modified when duration is set.

Alexandre Julliard julliard at winehq.org
Mon Nov 22 16:05:17 CST 2021


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

Author: Ivo Ivanov <logos128 at gmail.com>
Date:   Mon Nov 22 11:05:49 2021 +0100

dinput: Mark effect parameters as modified when duration is set.

Even if it doesn't actually change.

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

---

 dlls/dinput/joystick_hid.c | 2 +-
 dlls/dinput8/tests/hid.c   | 9 +++++++++
 2 files changed, 10 insertions(+), 1 deletion(-)

diff --git a/dlls/dinput/joystick_hid.c b/dlls/dinput/joystick_hid.c
index 62856cefa44..99436bd8b05 100644
--- a/dlls/dinput/joystick_hid.c
+++ b/dlls/dinput/joystick_hid.c
@@ -2554,7 +2554,7 @@ static HRESULT WINAPI hid_joystick_effect_SetParameters( IDirectInputEffect *ifa
 
     if (flags & DIEP_DURATION)
     {
-        if (impl->params.dwDuration != params->dwDuration) impl->modified |= DIEP_DURATION;
+        impl->modified |= DIEP_DURATION;
         impl->params.dwDuration = params->dwDuration;
     }
     if (flags & DIEP_GAIN)
diff --git a/dlls/dinput8/tests/hid.c b/dlls/dinput8/tests/hid.c
index 4159c3edd90..0c63ed835e8 100644
--- a/dlls/dinput8/tests/hid.c
+++ b/dlls/dinput8/tests/hid.c
@@ -6471,6 +6471,15 @@ static void test_periodic_effect( IDirectInputDevice8W *device, HANDLE file, DWO
     hr = IDirectInputEffect_SetParameters( effect, &expect_desc, 0 );
     ok( hr == DI_OK, "SetParameters returned %#x\n", hr );
     wait_hid_expect( file, 100 ); /* these updates are sent asynchronously */
+    desc = expect_desc;
+    desc.dwDuration = INFINITE;
+    desc.dwTriggerButton = DIDFT_PSHBUTTON | DIDFT_MAKEINSTANCE( 0 ) | DIDFT_FFEFFECTTRIGGER,
+    hr = IDirectInputEffect_SetParameters( effect, &desc, DIEP_NODOWNLOAD|DIEP_DURATION|DIEP_TRIGGERBUTTON );
+    ok( hr == DI_DOWNLOADSKIPPED, "SetParameters returned %#x\n", hr );
+    set_hid_expect( file, expect_update, sizeof(expect_update) );
+    hr = IDirectInputEffect_SetParameters( effect, &expect_desc, 0 );
+    ok( hr == DI_OK, "SetParameters returned %#x\n", hr );
+    wait_hid_expect( file, 100 ); /* these updates are sent asynchronously */
 
     desc = expect_desc;
     desc.lpEnvelope = &envelope;




More information about the wine-cvs mailing list