There should always be the top level collection, and some games expect that or crash.
Signed-off-by: Rémi Bernon rbernon@codeweavers.com --- dlls/hid/hidp.c | 2 ++ dlls/hid/tests/device.c | 1 - dlls/hidclass.sys/descriptor.c | 1 + 3 files changed, 3 insertions(+), 1 deletion(-)
diff --git a/dlls/hid/hidp.c b/dlls/hid/hidp.c index 5f18f57dd93..9aef7711d0b 100644 --- a/dlls/hid/hidp.c +++ b/dlls/hid/hidp.c @@ -933,5 +933,7 @@ NTSTATUS WINAPI HidP_GetLinkCollectionNodes(HIDP_LINK_COLLECTION_NODE *LinkColle { TRACE("stub (%p, %p, %p)\n", LinkCollectionNode, LinkCollectionNodeLength, PreparsedData);
+ *LinkCollectionNodeLength = 0; + return STATUS_NOT_IMPLEMENTED; } diff --git a/dlls/hid/tests/device.c b/dlls/hid/tests/device.c index ce90f18f0cd..cdc1d94db1a 100644 --- a/dlls/hid/tests/device.c +++ b/dlls/hid/tests/device.c @@ -233,7 +233,6 @@ static void process_data(HIDP_CAPS Caps, PHIDP_PREPARSED_DATA ppd, CHAR *data, D HeapFree(GetProcessHeap(), 0, values); }
- todo_wine ok(Caps.NumberLinkCollectionNodes > 0, "Expected at least one link collection\n"); if (Caps.NumberLinkCollectionNodes) { diff --git a/dlls/hidclass.sys/descriptor.c b/dlls/hidclass.sys/descriptor.c index af1679d23b0..09455fb05b8 100644 --- a/dlls/hidclass.sys/descriptor.c +++ b/dlls/hidclass.sys/descriptor.c @@ -911,6 +911,7 @@ static WINE_HIDP_PREPARSED_DATA* build_PreparseData(struct collection *base_coll data->dwSize = size; data->caps.Usage = base_collection->caps.u.NotRange.Usage; data->caps.UsagePage = base_collection->caps.UsagePage; + data->caps.NumberLinkCollectionNodes = 1; data->elementOffset = element_off;
preparse_collection(base_collection, data, &ctx);