Module: wine Branch: master Commit: e724d67fb4406563538f36f3fb512fba2fd679b3 URL: http://source.winehq.org/git/wine.git/?a=commit;h=e724d67fb4406563538f36f3fb...
Author: Aric Stewart aric@codeweavers.com Date: Thu Dec 8 08:34:02 2016 -0600
hid: Refine initialization of UsageLength in HidP_GetUsages.
Signed-off-by: Aric Stewart aric@codeweavers.com Signed-off-by: Alexandre Julliard julliard@winehq.org
---
dlls/hid/hidp.c | 9 +++++---- 1 file changed, 5 insertions(+), 4 deletions(-)
diff --git a/dlls/hid/hidp.c b/dlls/hid/hidp.c index 56616b4..9dcdeb6 100644 --- a/dlls/hid/hidp.c +++ b/dlls/hid/hidp.c @@ -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; }