hid: Refine initialization of UsageLength in HidP_GetUsages.

Signed-off-by: Aric Stewart <aric@codeweavers.com>
Signed-off-by: Alexandre Julliard <julliard@winehq.org>
This commit is contained in:
Aric Stewart 2016-12-08 08:34:02 -06:00 committed by Alexandre Julliard
parent c86bf9dc81
commit e724d67fb4
1 changed files with 5 additions and 4 deletions

View File

@ -278,10 +278,11 @@ NTSTATUS WINAPI HidP_GetUsages(HIDP_REPORT_TYPE ReportType, USAGE UsagePage, USH
TRACE("(%i, %x, %i, %p, %p, %p, %p, %i)\n", ReportType, UsagePage, LinkCollection, UsageList,
UsageLength, PreparsedData, Report, ReportLength);
*UsageLength = 0;
if (data->magic != HID_MAGIC)
{
*UsageLength = 0;
return HIDP_STATUS_INVALID_PREPARSED_DATA;
}
switch(ReportType)
{
@ -344,11 +345,11 @@ NTSTATUS WINAPI HidP_GetUsages(HIDP_REPORT_TYPE ReportType, USAGE UsagePage, USH
}
}
*UsageLength = uCount;
if (!found)
return HIDP_STATUS_USAGE_NOT_FOUND;
*UsageLength = uCount;
return HIDP_STATUS_SUCCESS;
}