From: Zebediah Figura zfigura@codeweavers.com
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 zfigura@codeweavers.com --- 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 876369ad70..56e4da4ad1 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;