Commit b36b2999 authored by Rémi Bernon's avatar Rémi Bernon Committed by Alexandre Julliard

hid: Return HIDP_STATUS_SUCCESS even if no usages are found.

parent 5679e006
......@@ -328,7 +328,6 @@ NTSTATUS WINAPI HidP_GetUsages( HIDP_REPORT_TYPE report_type, USAGE usage_page,
*usages_len = params.usages - usages;
if (status != HIDP_STATUS_SUCCESS) return status;
if (*usages_len == 0) return HIDP_STATUS_USAGE_NOT_FOUND;
if (params.usages > params.usages_end) return HIDP_STATUS_BUFFER_TOO_SMALL;
return status;
}
......@@ -672,7 +671,6 @@ NTSTATUS WINAPI HidP_GetUsagesEx( HIDP_REPORT_TYPE report_type, USHORT collectio
*usages_len = params.usages - usages;
if (status != HIDP_STATUS_SUCCESS) return status;
if (*usages_len == 0) return HIDP_STATUS_USAGE_NOT_FOUND;
if (params.usages > params.usages_end) return HIDP_STATUS_BUFFER_TOO_SMALL;
return status;
}
......
......@@ -2220,6 +2220,12 @@ static void test_hidp(HANDLE file, HANDLE async_file, int report_id, BOOL polled
report, caps.InputReportByteLength);
ok(status == HIDP_STATUS_SUCCESS, "HidP_SetUsages returned %#x\n", status);
value = ARRAY_SIZE(usages);
status = HidP_GetUsages(HidP_Input, HID_USAGE_PAGE_KEYBOARD, 0, usages, &value, preparsed_data,
report, caps.InputReportByteLength);
ok(status == HIDP_STATUS_SUCCESS, "HidP_GetUsages returned %#x\n", status);
ok(value == 0, "got usage count %d, expected %d\n", value, 2);
usages[0] = 0x9;
usages[1] = 0xb;
usages[2] = 0xa;
......
......@@ -678,7 +678,6 @@ static void check_hid_caps(DWORD index, HANDLE device, PHIDP_PREPARSED_DATA pre
length = ARRAY_SIZE(usages);
status = HidP_GetUsages(HidP_Input, HID_USAGE_PAGE_BUTTON, 0, usages, &length, preparsed, buffer, hid_caps->InputReportByteLength);
todo_wine
ok(status == HIDP_STATUS_SUCCESS, "HidP_GetUsages returned %#x\n", status);
ok(length == 0, "got length %u\n", length);
......
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