From 437f7a372205e9218e279abed1f9ad85980c3d49 Mon Sep 17 00:00:00 2001 From: Aric Stewart Date: Mon, 14 Nov 2016 07:18:34 -0600 Subject: [PATCH] hidclass.sys: Handle descriptors with a usage count less than the report bits. Signed-off-by: Aric Stewart Signed-off-by: Alexandre Julliard --- dlls/hidclass.sys/descriptor.c | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/dlls/hidclass.sys/descriptor.c b/dlls/hidclass.sys/descriptor.c index e1c48ddcd0b..9a80f68ae36 100644 --- a/dlls/hidclass.sys/descriptor.c +++ b/dlls/hidclass.sys/descriptor.c @@ -752,7 +752,12 @@ static void build_elements(WINE_HID_REPORT *wine_report, struct feature* feature wine_element->caps.value.HasNull = feature->HasNull; wine_element->caps.value.BitSize = feature->caps.BitSize; if (feature->caps.usage_count > 1) - wine_element->caps.value.ReportCount = 1; + { + if (feature->caps.ReportCount > feature->caps.usage_count) + wine_element->caps.value.ReportCount = feature->caps.ReportCount / feature->caps.usage_count; + else + wine_element->caps.value.ReportCount = 1; + } else wine_element->caps.value.ReportCount = feature->caps.ReportCount; wine_element->bitCount = (feature->caps.BitSize * wine_element->caps.value.ReportCount); -- 2.11.4.GIT