Rémi Bernon : dinput: Send -1 for infinite durations in HID reports.

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


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

Author: Rémi Bernon <rbernon at codeweavers.com>
Date:   Mon Nov 22 11:05:46 2021 +0100

dinput: Send -1 for infinite durations in HID reports.

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 |  3 ++-
 dlls/dinput8/tests/hid.c   | 11 +----------
 2 files changed, 3 insertions(+), 11 deletions(-)

diff --git a/dlls/dinput/joystick_hid.c b/dlls/dinput/joystick_hid.c
index 3d90e721fb6..5ecf54e2281 100644
--- a/dlls/dinput/joystick_hid.c
+++ b/dlls/dinput/joystick_hid.c
@@ -2728,7 +2728,8 @@ static void set_parameter_value_us( struct hid_joystick_effect *impl, char *repo
     LONG exp;
     if (!caps) return;
     exp = caps->units_exp;
-    if (caps->units != 0x1003) WARN( "unknown time unit caps %x\n", caps->units );
+    if (value == INFINITE) value = caps->physical_min - 1;
+    else if (caps->units != 0x1003) WARN( "unknown time unit caps %x\n", caps->units );
     else if (exp < -6) while (exp++ < -6) value *= 10;
     else if (exp > -6) while (exp-- > -6) value /= 10;
     set_parameter_value( impl, report_buf, caps, value );
diff --git a/dlls/dinput8/tests/hid.c b/dlls/dinput8/tests/hid.c
index 884a0100abe..26a5406fa57 100644
--- a/dlls/dinput8/tests/hid.c
+++ b/dlls/dinput8/tests/hid.c
@@ -5650,15 +5650,6 @@ static void test_periodic_effect( IDirectInputDevice8W *device, HANDLE file, DWO
             .report_id = 3,
             .report_len = 11,
             .report_buf = {0x03,0x01,0x02,0x08,0xff,0xff,version >= 0x700 ? 0x06 : 0x00,0x00,0x01,0x55,0xd5},
-            .todo = TRUE,
-        },
-        /* update effect */
-        {
-            .code = IOCTL_HID_WRITE_REPORT,
-            .report_id = 3,
-            .report_len = 11,
-            .report_buf = {0x03,0x01,0x02,0x08,0x00,0x00,version >= 0x700 ? 0x06 : 0x00,0x00,0x01,0x55,0xd5},
-            .wine_only = TRUE, .todo = TRUE,
         },
     };
     struct hid_expect expect_set_envelope[] =
@@ -5683,7 +5674,7 @@ static void test_periodic_effect( IDirectInputDevice8W *device, HANDLE file, DWO
             .code = IOCTL_HID_WRITE_REPORT,
             .report_id = 3,
             .report_len = 11,
-            .report_buf = {0x03,0x01,0x02,0x08,0x00,0x00,version >= 0x700 ? 0x06 : 0x00,0x00,0x01,0x55,0xd5},
+            .report_buf = {0x03,0x01,0x02,0x08,0xff,0xff,version >= 0x700 ? 0x06 : 0x00,0x00,0x01,0x55,0xd5},
             .wine_only = TRUE, .todo = TRUE,
         },
     };




More information about the wine-cvs mailing list