Rémi Bernon : dinput: Add an instance number to HID joystick collection objects.

Alexandre Julliard julliard at winehq.org
Thu Sep 23 15:35:04 CDT 2021


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

Author: Rémi Bernon <rbernon at codeweavers.com>
Date:   Thu Sep 23 10:51:37 2021 +0200

dinput: Add an instance number to HID joystick collection objects.

Signed-off-by: Rémi Bernon <rbernon at codeweavers.com>
Signed-off-by: Alexandre Julliard <julliard at winehq.org>

---

 dlls/dinput/joystick_hid.c | 4 ++--
 dlls/dinput8/tests/hid.c   | 2 --
 2 files changed, 2 insertions(+), 4 deletions(-)

diff --git a/dlls/dinput/joystick_hid.c b/dlls/dinput/joystick_hid.c
index acd21001bdf..4d7bbe82a23 100644
--- a/dlls/dinput/joystick_hid.c
+++ b/dlls/dinput/joystick_hid.c
@@ -379,8 +379,8 @@ static BOOL enum_collections_objects( struct hid_joystick *impl, const DIPROPHEA
 {
     DIDEVICEOBJECTINSTANCEW instance = {.dwSize = sizeof(DIDEVICEOBJECTINSTANCEW)};
     struct hid_caps caps = {.type = LINK_COLLECTION_NODE};
+    DWORD collection = 0, i;
     BOOL ret;
-    DWORD i;
 
     for (i = 0; i < impl->caps.NumberLinkCollectionNodes; ++i)
     {
@@ -393,7 +393,7 @@ static BOOL enum_collections_objects( struct hid_joystick *impl, const DIPROPHEA
         else
         {
             instance.dwOfs = 0;
-            instance.dwType = DIDFT_COLLECTION | DIDFT_NODATA;
+            instance.dwType = DIDFT_COLLECTION | DIDFT_MAKEINSTANCE( collection++ ) | DIDFT_NODATA;
             instance.dwFlags = 0;
             instance.wUsagePage = caps.node->LinkUsagePage;
             instance.wUsage = caps.node->LinkUsage;
diff --git a/dlls/dinput8/tests/hid.c b/dlls/dinput8/tests/hid.c
index 23dc3f6d5f8..54d85cae14b 100644
--- a/dlls/dinput8/tests/hid.c
+++ b/dlls/dinput8/tests/hid.c
@@ -3572,8 +3572,6 @@ static void test_simple_joystick(void)
         {.ofs = TRUE},
         {.ofs = TRUE},
         {.ofs = TRUE},
-        {},
-        {.type = TRUE},
     };
 
     struct check_objects_params check_objects_params =




More information about the wine-cvs mailing list