From 4c1ff566dd22a16f30f978754d6f82ce50fb79ab Mon Sep 17 00:00:00 2001 From: Zebediah Figura Date: Mon, 16 Mar 2020 21:18:05 -0500 Subject: [PATCH] hidclass.sys: Don't reset the report count when recording a main item. The report count is global and should be preserved. This fixes the Logitech Extreme 3D Pro controller when used with hidraw. Signed-off-by: Zebediah Figura Signed-off-by: Aric Stewart Signed-off-by: Alexandre Julliard --- dlls/hidclass.sys/descriptor.c | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/dlls/hidclass.sys/descriptor.c b/dlls/hidclass.sys/descriptor.c index 876369ad701..56e4da4ad10 100644 --- a/dlls/hidclass.sys/descriptor.c +++ b/dlls/hidclass.sys/descriptor.c @@ -505,7 +505,7 @@ static int parse_descriptor(BYTE *descriptor, unsigned int index, unsigned int l case TAG_MAIN_INPUT: case TAG_MAIN_OUTPUT: case TAG_MAIN_FEATURE: - for (j = 0; caps->ReportCount; j++) + for (j = 0; j < caps->ReportCount; j++) { feature = HeapAlloc(GetProcessHeap(), HEAP_ZERO_MEMORY, sizeof(*feature)); list_add_tail(&collection->features, &feature->entry); @@ -520,13 +520,13 @@ static int parse_descriptor(BYTE *descriptor, unsigned int index, unsigned int l caps->u.NotRange.Usage = usages[j]; feature->caps = *caps; feature->caps.ReportCount = 1; - caps->ReportCount--; feature->collection = collection; if (j+1 >= usages_top) + { + feature->caps.ReportCount += caps->ReportCount - (j + 1); break; + } } - if (caps->ReportCount) - feature->caps.ReportCount += caps->ReportCount; usages_top = 0; new_caps(caps); break;