hidclass.sys: Handle descriptors with a usage count less than the report bits.

Signed-off-by: Aric Stewart <aric@codeweavers.com>
Signed-off-by: Alexandre Julliard <julliard@winehq.org>
This commit is contained in:
Aric Stewart 2016-11-14 07:18:34 -06:00 committed by Alexandre Julliard
parent 3b3b7670ec
commit 437f7a3722
1 changed files with 6 additions and 1 deletions

View File

@ -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);