dinput: Set HID joystick objects wCollectionNumber field.

Signed-off-by: Rémi Bernon <rbernon@codeweavers.com>
Signed-off-by: Alexandre Julliard <julliard@winehq.org>
This commit is contained in:
Rémi Bernon 2021-09-23 10:51:36 +02:00 committed by Alexandre Julliard
parent 0686815ff6
commit aa60766259
2 changed files with 9 additions and 8 deletions

View File

@ -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;
}

View File

@ -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 );