Signed-off-by: Rémi Bernon rbernon@codeweavers.com --- dlls/dinput/joystick_hid.c | 4 ++++ dlls/dinput8/tests/hid.c | 13 +++++-------- 2 files changed, 9 insertions(+), 8 deletions(-)
diff --git a/dlls/dinput/joystick_hid.c b/dlls/dinput/joystick_hid.c index f7107733d26..acd21001bdf 100644 --- a/dlls/dinput/joystick_hid.c +++ b/dlls/dinput/joystick_hid.c @@ -248,6 +248,7 @@ static BOOL enum_value_objects( struct hid_joystick *impl, const DIPROPHEADER *f instance.wUsage = caps.value->NotRange.Usage; instance.guidType = *object_usage_to_guid( instance.wUsagePage, instance.wUsage ); instance.wReportId = caps.value->ReportID; + instance.wCollectionNumber = caps.value->LinkCollection;
switch (instance.wUsage) { @@ -348,6 +349,7 @@ static BOOL enum_button_objects( struct hid_joystick *impl, const DIPROPHEADER * instance.wUsage = j; instance.guidType = *object_usage_to_guid( instance.wUsagePage, instance.wUsage ); instance.wReportId = caps.button->ReportID; + instance.wCollectionNumber = caps.button->LinkCollection; ret = enum_object( impl, filter, flags, callback, &caps, &instance, data ); if (ret != DIENUM_CONTINUE) return ret; } @@ -363,6 +365,7 @@ static BOOL enum_button_objects( struct hid_joystick *impl, const DIPROPHEADER * instance.wUsage = caps.button->NotRange.Usage; instance.guidType = *object_usage_to_guid( instance.wUsagePage, instance.wUsage ); instance.wReportId = caps.button->ReportID; + instance.wCollectionNumber = caps.button->LinkCollection; ret = enum_object( impl, filter, flags, callback, &caps, &instance, data ); if (ret != DIENUM_CONTINUE) return ret; } @@ -396,6 +399,7 @@ static BOOL enum_collections_objects( struct hid_joystick *impl, const DIPROPHEA instance.wUsage = caps.node->LinkUsage; instance.guidType = *object_usage_to_guid( instance.wUsagePage, instance.wUsage ); instance.wReportId = 0; + instance.wCollectionNumber = caps.node->Parent; ret = enum_object( impl, filter, flags, callback, &caps, &instance, data ); if (ret != DIENUM_CONTINUE) return ret; } diff --git a/dlls/dinput8/tests/hid.c b/dlls/dinput8/tests/hid.c index c0f1b78160c..23dc3f6d5f8 100644 --- a/dlls/dinput8/tests/hid.c +++ b/dlls/dinput8/tests/hid.c @@ -3567,11 +3567,11 @@ static void test_simple_joystick(void) }; const struct check_objects_todos objects_todos[ARRAY_SIZE(expect_objects)] = { - {.ofs = TRUE, .type = TRUE, .collection_number = TRUE}, - {.ofs = TRUE, .type = TRUE, .collection_number = TRUE}, - {.ofs = TRUE, .collection_number = TRUE}, - {.ofs = TRUE, .collection_number = TRUE}, - {.ofs = TRUE, .collection_number = TRUE}, + {.ofs = TRUE, .type = TRUE}, + {.ofs = TRUE, .type = TRUE}, + {.ofs = TRUE}, + {.ofs = TRUE}, + {.ofs = TRUE}, {}, {.type = TRUE}, }; @@ -3968,7 +3968,6 @@ static void test_simple_joystick(void) if (!localized) todo_wine check_member_wstr( objinst, expect_objects[1], tszName ); check_member( objinst, expect_objects[1], "%u", dwFFMaxForce ); check_member( objinst, expect_objects[1], "%u", dwFFForceResolution ); - todo_wine check_member( objinst, expect_objects[1], "%u", wCollectionNumber ); check_member( objinst, expect_objects[1], "%u", wDesignatorIndex ); check_member( objinst, expect_objects[1], "%#04x", wUsagePage ); @@ -4000,7 +3999,6 @@ static void test_simple_joystick(void) if (!localized) todo_wine check_member_wstr( objinst, expect_objects[4], tszName ); check_member( objinst, expect_objects[4], "%u", dwFFMaxForce ); check_member( objinst, expect_objects[4], "%u", dwFFForceResolution ); - todo_wine check_member( objinst, expect_objects[4], "%u", wCollectionNumber ); check_member( objinst, expect_objects[4], "%u", wDesignatorIndex ); check_member( objinst, expect_objects[4], "%#04x", wUsagePage ); @@ -4035,7 +4033,6 @@ static void test_simple_joystick(void) if (!localized) todo_wine check_member_wstr( objinst, expect_objects[0], tszName ); check_member( objinst, expect_objects[0], "%u", dwFFMaxForce ); check_member( objinst, expect_objects[0], "%u", dwFFForceResolution ); - todo_wine check_member( objinst, expect_objects[0], "%u", wCollectionNumber ); check_member( objinst, expect_objects[0], "%u", wDesignatorIndex ); check_member( objinst, expect_objects[0], "%#04x", wUsagePage );