Rémi Bernon : hid: Always return node count in HidP_GetLinkCollectionNodes.
Alexandre Julliard
julliard at winehq.org
Mon Jun 28 16:49:35 CDT 2021
Module: wine
Branch: master
Commit: 7f0e91f5aa8a6b1d47a89aabad256f8f0a39efd3
URL: https://source.winehq.org/git/wine.git/?a=commit;h=7f0e91f5aa8a6b1d47a89aabad256f8f0a39efd3
Author: Rémi Bernon <rbernon at codeweavers.com>
Date: Mon Jun 28 09:22:01 2021 +0200
hid: Always return node count in HidP_GetLinkCollectionNodes.
Signed-off-by: Rémi Bernon <rbernon at codeweavers.com>
Signed-off-by: Alexandre Julliard <julliard at winehq.org>
---
dlls/hid/hidp.c | 2 +-
dlls/ntoskrnl.exe/tests/ntoskrnl.c | 1 -
2 files changed, 1 insertion(+), 2 deletions(-)
diff --git a/dlls/hid/hidp.c b/dlls/hid/hidp.c
index 750dbce9f26..6a9fba6e425 100644
--- a/dlls/hid/hidp.c
+++ b/dlls/hid/hidp.c
@@ -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)
{
diff --git a/dlls/ntoskrnl.exe/tests/ntoskrnl.c b/dlls/ntoskrnl.exe/tests/ntoskrnl.c
index f9bb9e87cda..a3c2a303a59 100644
--- a/dlls/ntoskrnl.exe/tests/ntoskrnl.c
+++ b/dlls/ntoskrnl.exe/tests/ntoskrnl.c
@@ -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);
More information about the wine-cvs
mailing list