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:
parent
c86bf9dc81
commit
e724d67fb4
|
@ -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;
|
||||
}
|
||||
|
||||
|
|
Loading…
Reference in New Issue