Commit 86f4aa19 authored by Aric Stewart's avatar Aric Stewart Committed by Alexandre Julliard

hid: Fix HidP_MaxUsageListLength to handle UsagePage == 0 properly.

parent 20a4842a
......@@ -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 -
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment