hid: Always return node count in HidP_GetLinkCollectionNodes.

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-06-28 09:22:01 +02:00 committed by Alexandre Julliard
parent 37009031bb
commit 7f0e91f5aa
2 changed files with 1 additions and 2 deletions

View File

@ -731,8 +731,8 @@ NTSTATUS WINAPI HidP_GetLinkCollectionNodes( HIDP_LINK_COLLECTION_NODE *nodes, U
if (preparsed->magic != HID_MAGIC) return HIDP_STATUS_INVALID_PREPARSED_DATA;
if (capacity < preparsed->caps.NumberLinkCollectionNodes) return HIDP_STATUS_BUFFER_TOO_SMALL;
count = *nodes_len = preparsed->caps.NumberLinkCollectionNodes;
if (capacity < count) return HIDP_STATUS_BUFFER_TOO_SMALL;
for (i = 0; i < count; ++i)
{

View File

@ -1852,7 +1852,6 @@ static void test_hidp(HANDLE file, int report_id)
collection_count = 0;
status = HidP_GetLinkCollectionNodes(collections, &collection_count, preparsed_data);
ok(status == HIDP_STATUS_BUFFER_TOO_SMALL, "HidP_GetLinkCollectionNodes returned %#x\n", status);
todo_wine
ok(collection_count == caps.NumberLinkCollectionNodes, "got %d collection nodes, expected %d\n",
collection_count, caps.NumberLinkCollectionNodes);
collection_count = ARRAY_SIZE(collections);