[PATCH 6/7] dinput: Send Device Gain Reports only on DISFFC_RESET command.

Rémi Bernon rbernon at codeweavers.com
Wed Dec 1 05:44:57 CST 2021


From: Ivo Ivanov <logos128 at gmail.com>

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

diff --git a/dlls/dinput/joystick_hid.c b/dlls/dinput/joystick_hid.c
index 06be759b685..a1e8e30bc29 100644
--- a/dlls/dinput/joystick_hid.c
+++ b/dlls/dinput/joystick_hid.c
@@ -1065,7 +1065,7 @@ static HRESULT hid_joystick_send_force_feedback_command( IDirectInputDevice8W *i
     if (status != HIDP_STATUS_SUCCESS) return status;
 
     if (!WriteFile( impl->device, report_buf, report_len, NULL, NULL )) return DIERR_INPUTLOST;
-    if (!unacquire) hid_joystick_send_device_gain( iface, impl->base.device_gain );
+    if (!unacquire && command == DISFFC_RESET) hid_joystick_send_device_gain( iface, impl->base.device_gain );
 
     return DI_OK;
 }
diff --git a/dlls/dinput8/tests/hid.c b/dlls/dinput8/tests/hid.c
index b57c5e9e841..bfd0185303d 100644
--- a/dlls/dinput8/tests/hid.c
+++ b/dlls/dinput8/tests/hid.c
@@ -8628,15 +8628,6 @@ static void test_device_managed_effect(void)
             .report_len = 2,
             .report_buf = {1, 0x04},
         },
-        /* device gain */
-        {
-            .code = IOCTL_HID_WRITE_REPORT,
-            .report_id = 6,
-            .report_len = 2,
-            .report_buf = {6, 0xff},
-            .todo = TRUE,
-            .wine_only = TRUE,
-        },
     };
     struct hid_expect expect_disable_actuators[] =
     {
@@ -8647,15 +8638,6 @@ static void test_device_managed_effect(void)
             .report_len = 2,
             .report_buf = {1, 0x05},
         },
-        /* device gain */
-        {
-            .code = IOCTL_HID_WRITE_REPORT,
-            .report_id = 6,
-            .report_len = 2,
-            .report_buf = {6, 0xff},
-            .todo = TRUE,
-            .wine_only = TRUE,
-        },
     };
     struct hid_expect expect_stop_all[] =
     {
@@ -8666,15 +8648,6 @@ static void test_device_managed_effect(void)
             .report_len = 2,
             .report_buf = {1, 0x06},
         },
-        /* device gain */
-        {
-            .code = IOCTL_HID_WRITE_REPORT,
-            .report_id = 6,
-            .report_len = 2,
-            .report_buf = {6, 0xff},
-            .todo = TRUE,
-            .wine_only = TRUE,
-        },
     };
     struct hid_expect expect_device_pause[] =
     {
@@ -8685,15 +8658,6 @@ static void test_device_managed_effect(void)
             .report_len = 2,
             .report_buf = {1, 0x02},
         },
-        /* device gain */
-        {
-            .code = IOCTL_HID_WRITE_REPORT,
-            .report_id = 6,
-            .report_len = 2,
-            .report_buf = {6, 0xff},
-            .todo = TRUE,
-            .wine_only = TRUE,
-        },
     };
     struct hid_expect expect_device_continue[] =
     {
@@ -8704,15 +8668,6 @@ static void test_device_managed_effect(void)
             .report_len = 2,
             .report_buf = {1, 0x03},
         },
-        /* device gain */
-        {
-            .code = IOCTL_HID_WRITE_REPORT,
-            .report_id = 6,
-            .report_len = 2,
-            .report_buf = {6, 0xff},
-            .todo = TRUE,
-            .wine_only = TRUE,
-        },
     };
     struct hid_expect expect_create[] =
     {
-- 
2.34.0




More information about the wine-devel mailing list