Ivo Ivanov : dinput: Send Device Gain Reports only on DISFFC_RESET command.

Alexandre Julliard julliard at winehq.org
Wed Dec 1 15:23:49 CST 2021


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

Author: Ivo Ivanov <logos128 at gmail.com>
Date:   Wed Dec  1 12:44:57 2021 +0100

dinput: Send Device Gain Reports only on DISFFC_RESET command.

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>
Signed-off-by: Alexandre Julliard <julliard at winehq.org>

---

 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[] =
     {




More information about the wine-cvs mailing list