hid: Fix HidP_MaxUsageListLength to handle UsagePage == 0 properly.
Signed-off-by: Aric Stewart <aric@codeweavers.com> Signed-off-by: Alexandre Julliard <julliard@winehq.org>
This commit is contained in:
parent
20a4842a89
commit
86f4aa1993
@ -510,7 +510,8 @@ ULONG WINAPI HidP_MaxUsageListLength(HIDP_REPORT_TYPE ReportType, USAGE UsagePag
|
||||
int j;
|
||||
for (j = 0; j < report->elementCount; j++)
|
||||
{
|
||||
if (report->Elements[j].caps.button.UsagePage == UsagePage)
|
||||
if (report->Elements[j].ElementType == ButtonElement &&
|
||||
(UsagePage == 0 || report->Elements[j].caps.button.UsagePage == UsagePage))
|
||||
{
|
||||
if (report->Elements[j].caps.button.IsRange)
|
||||
count += (report->Elements[j].caps.button.u.Range.UsageMax -
|
||||
|
Loading…
x
Reference in New Issue
Block a user