[PATCH 4/4] hid: Implement minimal HidP_GetLinkCollectionNodes.

Rémi Bernon rbernon at codeweavers.com
Fri Feb 7 12:25:33 CST 2020


Signed-off-by: Rémi Bernon <rbernon at codeweavers.com>
---

It may be better to reroder this before patch #3 where we advertise the
top level collection presence, but then the todo_wine removal would be
pointless here. Maybe squash both?

 dlls/hid/hidp.c         | 20 +++++++++++++++++---
 dlls/hid/tests/device.c |  1 -
 2 files changed, 17 insertions(+), 4 deletions(-)

diff --git a/dlls/hid/hidp.c b/dlls/hid/hidp.c
index 9aef7711d0b..e00d40ed280 100644
--- a/dlls/hid/hidp.c
+++ b/dlls/hid/hidp.c
@@ -931,9 +931,23 @@ NTSTATUS WINAPI HidP_GetData(HIDP_REPORT_TYPE ReportType, HIDP_DATA *DataList, U
 NTSTATUS WINAPI HidP_GetLinkCollectionNodes(HIDP_LINK_COLLECTION_NODE *LinkCollectionNode,
     ULONG *LinkCollectionNodeLength, PHIDP_PREPARSED_DATA PreparsedData)
 {
-    TRACE("stub (%p, %p, %p)\n", LinkCollectionNode, LinkCollectionNodeLength, PreparsedData);
+    WINE_HIDP_PREPARSED_DATA *data = (WINE_HIDP_PREPARSED_DATA*)PreparsedData;
 
-    *LinkCollectionNodeLength = 0;
+    TRACE("(%p, %p, %p)\n", LinkCollectionNode, LinkCollectionNodeLength, PreparsedData);
 
-    return STATUS_NOT_IMPLEMENTED;
+    if (data->caps.NumberLinkCollectionNodes > 1)
+        FIXME("Unsupported number of link collections!\n");
+
+    *LinkCollectionNodeLength = 1;
+    LinkCollectionNode[0].LinkUsage = data->caps.Usage;
+    LinkCollectionNode[0].LinkUsagePage = data->caps.UsagePage;
+    LinkCollectionNode[0].Parent = 0;
+    LinkCollectionNode[0].NumberOfChildren = 0;
+    LinkCollectionNode[0].NextSibling = 0;
+    LinkCollectionNode[0].FirstChild = 0;
+    LinkCollectionNode[0].CollectionType = 1;
+    LinkCollectionNode[0].IsAlias = 0;
+    LinkCollectionNode[0].UserContext = 0;
+
+    return STATUS_SUCCESS;
 }
diff --git a/dlls/hid/tests/device.c b/dlls/hid/tests/device.c
index cdc1d94db1a..79530c63416 100644
--- a/dlls/hid/tests/device.c
+++ b/dlls/hid/tests/device.c
@@ -240,7 +240,6 @@ static void process_data(HIDP_CAPS Caps, PHIDP_PREPARSED_DATA ppd, CHAR *data, D
         ULONG nodes_count = ARRAY_SIZE(nodes);
 
         status = HidP_GetLinkCollectionNodes(nodes, &nodes_count, ppd);
-        todo_wine
         ok(status == HIDP_STATUS_SUCCESS, "HidP_GetLinkCollectionNodes failed:%x\n", status);
 
         for (i = 0; i < nodes_count; ++i)
-- 
2.25.0




More information about the wine-devel mailing list