Signed-off-by: Rémi Bernon rbernon@codeweavers.com --- dlls/hidclass.sys/device.c | 17 +++++++++++++++-- dlls/ntoskrnl.exe/tests/driver_hid.c | 4 ---- dlls/ntoskrnl.exe/tests/ntoskrnl.c | 8 -------- 3 files changed, 15 insertions(+), 14 deletions(-)
diff --git a/dlls/hidclass.sys/device.c b/dlls/hidclass.sys/device.c index 83c0c1159ff..44965e118a2 100644 --- a/dlls/hidclass.sys/device.c +++ b/dlls/hidclass.sys/device.c @@ -303,7 +303,7 @@ static void hid_device_xfer_report( BASE_DEVICE_EXTENSION *ext, ULONG code, IRP { const WINE_HIDP_PREPARSED_DATA *preparsed = ext->u.pdo.preparsed_data; IO_STACK_LOCATION *stack = IoGetCurrentIrpStackLocation( irp ); - BYTE report_id = HID_INPUT_VALUE_CAPS( preparsed )->report_id; + struct hid_value_caps *caps = NULL, *caps_end = NULL; ULONG report_len = 0, buffer_len = 0; HID_XFER_PACKET packet; BYTE *buffer = NULL; @@ -326,13 +326,19 @@ static void hid_device_xfer_report( BASE_DEVICE_EXTENSION *ext, ULONG code, IRP { case IOCTL_HID_GET_INPUT_REPORT: report_len = preparsed->caps.InputReportByteLength; + caps = HID_INPUT_VALUE_CAPS( preparsed ); + caps_end = caps + preparsed->value_caps_count[HidP_Input]; break; case IOCTL_HID_SET_OUTPUT_REPORT: report_len = preparsed->caps.OutputReportByteLength; + caps = HID_OUTPUT_VALUE_CAPS( preparsed ); + caps_end = caps + preparsed->value_caps_count[HidP_Output]; break; case IOCTL_HID_GET_FEATURE: case IOCTL_HID_SET_FEATURE: report_len = preparsed->caps.FeatureReportByteLength; + caps = HID_FEATURE_VALUE_CAPS( preparsed ); + caps_end = caps + preparsed->value_caps_count[HidP_Feature]; break; }
@@ -347,11 +353,18 @@ static void hid_device_xfer_report( BASE_DEVICE_EXTENSION *ext, ULONG code, IRP return; }
+ for (; caps != caps_end; ++caps) if (!caps->report_id || caps->report_id == buffer[0]) break; + if (caps == caps_end) + { + irp->IoStatus.Status = STATUS_INVALID_PARAMETER; + return; + } + packet.reportId = buffer[0]; packet.reportBuffer = buffer; packet.reportBufferLen = buffer_len;
- if (!report_id) + if (!caps->report_id) { packet.reportId = 0; packet.reportBuffer++; diff --git a/dlls/ntoskrnl.exe/tests/driver_hid.c b/dlls/ntoskrnl.exe/tests/driver_hid.c index 4f0a8591299..83f546aa972 100644 --- a/dlls/ntoskrnl.exe/tests/driver_hid.c +++ b/dlls/ntoskrnl.exe/tests/driver_hid.c @@ -532,7 +532,6 @@ static NTSTATUS WINAPI driver_internal_ioctl(DEVICE_OBJECT *device, IRP *irp) ok(!in_size, "got input size %u\n", in_size); ok(out_size == sizeof(*packet), "got output size %u\n", out_size);
- todo_wine_if(packet->reportId == 0x5a) ok(packet->reportId == report_id, "got id %u\n", packet->reportId); ok(packet->reportBufferLen >= expected_size, "got len %u\n", packet->reportBufferLen); ok(!!packet->reportBuffer, "got buffer %p\n", packet->reportBuffer); @@ -552,7 +551,6 @@ static NTSTATUS WINAPI driver_internal_ioctl(DEVICE_OBJECT *device, IRP *irp) ok(in_size == sizeof(*packet), "got input size %u\n", in_size); ok(!out_size, "got output size %u\n", out_size);
- todo_wine_if(packet->reportId == 0x5a) ok(packet->reportId == report_id, "got id %u\n", packet->reportId); ok(packet->reportBufferLen >= expected_size, "got len %u\n", packet->reportBufferLen); ok(!!packet->reportBuffer, "got buffer %p\n", packet->reportBuffer); @@ -569,7 +567,6 @@ static NTSTATUS WINAPI driver_internal_ioctl(DEVICE_OBJECT *device, IRP *irp) ok(!in_size, "got input size %u\n", in_size); ok(out_size == sizeof(*packet), "got output size %u\n", out_size);
- todo_wine_if(packet->reportId == 0x5a) ok(packet->reportId == report_id, "got id %u\n", packet->reportId); ok(packet->reportBufferLen >= expected_size, "got len %u\n", packet->reportBufferLen); ok(!!packet->reportBuffer, "got buffer %p\n", packet->reportBuffer); @@ -588,7 +585,6 @@ static NTSTATUS WINAPI driver_internal_ioctl(DEVICE_OBJECT *device, IRP *irp) ok(in_size == sizeof(*packet), "got input size %u\n", in_size); ok(!out_size, "got output size %u\n", out_size);
- todo_wine_if(packet->reportId == 0x5a) ok(packet->reportId == report_id, "got id %u\n", packet->reportId); ok(packet->reportBufferLen >= expected_size, "got len %u\n", packet->reportBufferLen); ok(!!packet->reportBuffer, "got buffer %p\n", packet->reportBuffer); diff --git a/dlls/ntoskrnl.exe/tests/ntoskrnl.c b/dlls/ntoskrnl.exe/tests/ntoskrnl.c index 128a81a5f83..4909ab202a6 100644 --- a/dlls/ntoskrnl.exe/tests/ntoskrnl.c +++ b/dlls/ntoskrnl.exe/tests/ntoskrnl.c @@ -2454,9 +2454,7 @@ static void test_hidp(HANDLE file, HANDLE async_file, int report_id, BOOL polled ret = HidD_GetInputReport(file, buffer, caps.InputReportByteLength); if (report_id || broken(!ret) /* w7u */) { - todo_wine ok(!ret, "HidD_GetInputReport succeeded, last error %u\n", GetLastError()); - todo_wine ok(GetLastError() == ERROR_INVALID_PARAMETER || broken(GetLastError() == ERROR_CRC), "HidD_GetInputReport returned error %u\n", GetLastError()); } @@ -2499,9 +2497,7 @@ static void test_hidp(HANDLE file, HANDLE async_file, int report_id, BOOL polled ret = HidD_GetFeature(file, buffer, caps.FeatureReportByteLength); if (report_id || broken(!ret)) { - todo_wine ok(!ret, "HidD_GetFeature succeeded, last error %u\n", GetLastError()); - todo_wine ok(GetLastError() == ERROR_INVALID_PARAMETER || broken(GetLastError() == ERROR_CRC), "HidD_GetFeature returned error %u\n", GetLastError()); } @@ -2544,9 +2540,7 @@ static void test_hidp(HANDLE file, HANDLE async_file, int report_id, BOOL polled ret = HidD_SetFeature(file, buffer, caps.FeatureReportByteLength); if (report_id || broken(!ret)) { - todo_wine ok(!ret, "HidD_SetFeature succeeded, last error %u\n", GetLastError()); - todo_wine ok(GetLastError() == ERROR_INVALID_PARAMETER || broken(GetLastError() == ERROR_CRC), "HidD_SetFeature returned error %u\n", GetLastError()); } @@ -2593,9 +2587,7 @@ static void test_hidp(HANDLE file, HANDLE async_file, int report_id, BOOL polled ret = HidD_SetOutputReport(file, buffer, caps.OutputReportByteLength); if (report_id || broken(!ret)) { - todo_wine ok(!ret, "HidD_SetOutputReport succeeded, last error %u\n", GetLastError()); - todo_wine ok(GetLastError() == ERROR_INVALID_PARAMETER || broken(GetLastError() == ERROR_CRC), "HidD_SetOutputReport returned error %u\n", GetLastError()); }
Signed-off-by: Rémi Bernon rbernon@codeweavers.com --- dlls/hidclass.sys/device.c | 69 ++++------------------------ dlls/ntoskrnl.exe/tests/driver_hid.c | 8 ---- dlls/ntoskrnl.exe/tests/ntoskrnl.c | 5 +- 3 files changed, 9 insertions(+), 73 deletions(-)
diff --git a/dlls/hidclass.sys/device.c b/dlls/hidclass.sys/device.c index 44965e118a2..8c0883bbec4 100644 --- a/dlls/hidclass.sys/device.c +++ b/dlls/hidclass.sys/device.c @@ -320,6 +320,10 @@ static void hid_device_xfer_report( BASE_DEVICE_EXTENSION *ext, ULONG code, IRP buffer_len = stack->Parameters.DeviceIoControl.InputBufferLength; buffer = irp->AssociatedIrp.SystemBuffer; break; + case IOCTL_HID_WRITE_REPORT: + buffer_len = stack->Parameters.Write.Length; + buffer = irp->AssociatedIrp.SystemBuffer; + break; }
switch (code) @@ -330,6 +334,7 @@ static void hid_device_xfer_report( BASE_DEVICE_EXTENSION *ext, ULONG code, IRP caps_end = caps + preparsed->value_caps_count[HidP_Input]; break; case IOCTL_HID_SET_OUTPUT_REPORT: + case IOCTL_HID_WRITE_REPORT: report_len = preparsed->caps.OutputReportByteLength; caps = HID_OUTPUT_VALUE_CAPS( preparsed ); caps_end = caps + preparsed->value_caps_count[HidP_Output]; @@ -379,7 +384,9 @@ static void hid_device_xfer_report( BASE_DEVICE_EXTENSION *ext, ULONG code, IRP break; case IOCTL_HID_SET_FEATURE: case IOCTL_HID_SET_OUTPUT_REPORT: + case IOCTL_HID_WRITE_REPORT: call_minidriver( code, ext->u.pdo.parent_fdo, NULL, sizeof(packet), &packet, 0, &irp->IoStatus ); + if (code == IOCTL_HID_WRITE_REPORT && packet.reportId) irp->IoStatus.Information--; break; } } @@ -611,70 +618,10 @@ NTSTATUS WINAPI pdo_read(DEVICE_OBJECT *device, IRP *irp)
NTSTATUS WINAPI pdo_write(DEVICE_OBJECT *device, IRP *irp) { - IO_STACK_LOCATION *irpsp = IoGetCurrentIrpStackLocation( irp ); BASE_DEVICE_EXTENSION *ext = device->DeviceExtension; - const WINE_HIDP_PREPARSED_DATA *data = ext->u.pdo.preparsed_data; - HID_XFER_PACKET packet; NTSTATUS status; - ULONG max_len; - BOOL removed; - KIRQL irql; - - KeAcquireSpinLock(&ext->u.pdo.lock, &irql); - removed = ext->u.pdo.removed; - KeReleaseSpinLock(&ext->u.pdo.lock, irql); - - if (removed) - { - irp->IoStatus.Status = STATUS_DELETE_PENDING; - IoCompleteRequest(irp, IO_NO_INCREMENT); - return STATUS_DELETE_PENDING; - } - - if (!irpsp->Parameters.Write.Length) - { - irp->IoStatus.Status = STATUS_INVALID_USER_BUFFER; - IoCompleteRequest( irp, IO_NO_INCREMENT ); - return STATUS_INVALID_USER_BUFFER; - } - - if (irpsp->Parameters.Write.Length < data->caps.OutputReportByteLength) - { - irp->IoStatus.Status = STATUS_INVALID_PARAMETER; - IoCompleteRequest( irp, IO_NO_INCREMENT ); - return STATUS_INVALID_PARAMETER; - } - - irp->IoStatus.Information = 0; - - TRACE_(hid_report)("Device %p Buffer length %i Buffer %p\n", device, irpsp->Parameters.Write.Length, irp->AssociatedIrp.SystemBuffer); - packet.reportId = ((BYTE*)irp->AssociatedIrp.SystemBuffer)[0]; - if (packet.reportId == 0) - { - packet.reportBuffer = &((BYTE*)irp->AssociatedIrp.SystemBuffer)[1]; - packet.reportBufferLen = irpsp->Parameters.Write.Length - 1; - max_len = data->caps.OutputReportByteLength; - } - else - { - packet.reportBuffer = irp->AssociatedIrp.SystemBuffer; - packet.reportBufferLen = irpsp->Parameters.Write.Length; - max_len = (data->reports[data->reportIdx[HidP_Output][packet.reportId]].bitSize + 7) / 8; - } - if (packet.reportBufferLen > max_len) - packet.reportBufferLen = max_len; - - TRACE_(hid_report)("(id %i, len %i buffer %p)\n", packet.reportId, packet.reportBufferLen, packet.reportBuffer); - - call_minidriver( IOCTL_HID_WRITE_REPORT, ext->u.pdo.parent_fdo, NULL, 0, &packet, - sizeof(packet), &irp->IoStatus ); - - if (irp->IoStatus.Status == STATUS_SUCCESS) - irp->IoStatus.Information = irpsp->Parameters.Write.Length; - else - irp->IoStatus.Information = 0;
- TRACE_(hid_report)( "Result 0x%x wrote %li bytes\n", irp->IoStatus.Status, irp->IoStatus.Information ); + hid_device_xfer_report( ext, IOCTL_HID_WRITE_REPORT, irp );
status = irp->IoStatus.Status; IoCompleteRequest( irp, IO_NO_INCREMENT ); diff --git a/dlls/ntoskrnl.exe/tests/driver_hid.c b/dlls/ntoskrnl.exe/tests/driver_hid.c index 83f546aa972..8111af23c06 100644 --- a/dlls/ntoskrnl.exe/tests/driver_hid.c +++ b/dlls/ntoskrnl.exe/tests/driver_hid.c @@ -503,22 +503,14 @@ static NTSTATUS WINAPI driver_internal_ioctl(DEVICE_OBJECT *device, IRP *irp) HID_XFER_PACKET *packet = irp->UserBuffer; ULONG expected_size = 2;
- todo_wine ok(in_size == sizeof(*packet), "got input size %u\n", in_size); - todo_wine ok(!out_size, "got output size %u\n", out_size); ok(packet->reportBufferLen >= expected_size, "got report size %u\n", packet->reportBufferLen);
if (report_id) - { - todo_wine_if(packet->reportBuffer[0] == 0xa5) ok(packet->reportBuffer[0] == report_id, "got report id %x\n", packet->reportBuffer[0]); - } else - { - todo_wine ok(packet->reportBuffer[0] == 0xcd, "got first byte %x\n", packet->reportBuffer[0]); - }
irp->IoStatus.Information = 3; ret = STATUS_SUCCESS; diff --git a/dlls/ntoskrnl.exe/tests/ntoskrnl.c b/dlls/ntoskrnl.exe/tests/ntoskrnl.c index 4909ab202a6..d49f6fe3c7e 100644 --- a/dlls/ntoskrnl.exe/tests/ntoskrnl.c +++ b/dlls/ntoskrnl.exe/tests/ntoskrnl.c @@ -2630,11 +2630,8 @@ static void test_hidp(HANDLE file, HANDLE async_file, int report_id, BOOL polled ret = WriteFile(file, report, caps.OutputReportByteLength * 2, &value, NULL); if (report_id || broken(!ret) /* w7u */) { - todo_wine ok(!ret, "WriteFile succeeded\n"); - todo_wine ok(GetLastError() == ERROR_INVALID_PARAMETER, "WriteFile returned error %u\n", GetLastError()); - todo_wine ok(value == 0, "WriteFile wrote %u\n", value); SetLastError(0xdeadbeef); report[0] = report_id; @@ -2649,7 +2646,7 @@ static void test_hidp(HANDLE file, HANDLE async_file, int report_id, BOOL polled else { ok(ret, "WriteFile failed, last error %u\n", GetLastError()); - todo_wine ok(value == 3, "WriteFile wrote %u\n", value); + ok(value == 3, "WriteFile wrote %u\n", value); }
Hi,
While running your changed tests, I think I found new failures. Being a bot and all I'm not very good at pattern recognition, so I might be wrong, but could you please double-check?
Full results can be found at: https://testbot.winehq.org/JobDetails.pl?Key=95286
Your paranoid android.
=== w7u_2qxl (32 bit report) ===
ntoskrnl.exe: ntoskrnl.c:2927: Test failed: failed to register device, error 0xe000020b ntoskrnl.c:2760: Test failed: id 0 poll: didn't find device ntoskrnl.c:2764: Test failed: id 0 poll: got error 5 ntoskrnl.c:2769: Test failed: id 0 poll: HidD_GetNumInputBuffers failed last error 6 ntoskrnl.c:2770: Test failed: id 0 poll: HidD_GetNumInputBuffers returned 3735928559 ntoskrnl.c:2775: Test failed: id 0 poll: HidD_SetNumInputBuffers returned error 6 ntoskrnl.c:2779: Test failed: id 0 poll: HidD_SetNumInputBuffers returned error 6 ntoskrnl.c:2783: Test failed: id 0 poll: HidD_SetNumInputBuffers failed last error 6 ntoskrnl.c:2788: Test failed: id 0 poll: HidD_GetNumInputBuffers failed last error 6 ntoskrnl.c:2789: Test failed: id 0 poll: HidD_GetNumInputBuffers returned 3735928559 ntoskrnl.c:2794: Test failed: id 0 poll: got error 5 ntoskrnl.c:2799: Test failed: id 0 poll: HidD_GetNumInputBuffers failed last error 6 ntoskrnl.c:2800: Test failed: id 0 poll: HidD_GetNumInputBuffers returned 3735928559 ntoskrnl.c:2804: Test failed: id 0 poll: HidD_SetNumInputBuffers failed last error 6 ntoskrnl.c:2809: Test failed: id 0 poll: HidD_GetNumInputBuffers failed last error 6 ntoskrnl.c:2810: Test failed: id 0 poll: HidD_GetNumInputBuffers returned 3735928559 ntoskrnl.c:2814: Test failed: id 0 poll: HidD_GetNumInputBuffers failed last error 6 ntoskrnl.c:2815: Test failed: id 0 poll: HidD_GetNumInputBuffers returned 3735928559 ntoskrnl.c:2822: Test failed: id 0 poll: IOCTL_HID_GET_POLL_FREQUENCY_MSEC failed last error 6 ntoskrnl.c:2824: Test failed: id 0 poll: got poll_freq 6108304, expected 5 ntoskrnl.c:2830: Test failed: id 0 poll: IOCTL_HID_GET_POLL_FREQUENCY_MSEC failed last error 6 ntoskrnl.c:2836: Test failed: id 0 poll: IOCTL_HID_GET_POLL_FREQUENCY_MSEC failed last error 6 ntoskrnl.c:2843: Test failed: id 0 poll: IOCTL_HID_GET_POLL_FREQUENCY_MSEC failed last error 6 ntoskrnl.c:1890: Test failed: id 0 poll: HidD_GetPreparsedData failed with error 6 ntoskrnl.c:1896: Test failed: id 0 poll: HidP_GetCaps returned 0xc0110001 ntoskrnl.c:1897: Test failed: id 0 poll: got InputReportByteLength 23, expected 24 ntoskrnl.c:1897: Test failed: id 0 poll: got OutputReportByteLength 2, expected 3 ntoskrnl.c:1897: Test failed: id 0 poll: got FeatureReportByteLength 17, expected 18 ntoskrnl.c:1901: Test failed: id 0 poll: HidP_GetLinkCollectionNodes returned 0xc0110001 ntoskrnl.c:1902: Test failed: id 0 poll: got 0 collection nodes, expected 10 ntoskrnl.c:1908: Test failed: id 0 poll: HidP_GetLinkCollectionNodes returned 0xc0110001 ntoskrnl.c:1909: Test failed: id 0 poll: got 16 collection nodes, expected 10 ntoskrnl.c:1915: Test failed: id 0 poll: collections[0]: got LinkUsage 0074, expected 0004 ntoskrnl.c:1915: Test failed: id 0 poll: collections[0]: got LinkUsagePage 0076, expected 0001 ntoskrnl.c:1915: Test failed: id 0 poll: collections[0]: got Parent 56000, expected 0 ntoskrnl.c:1915: Test failed: id 0 poll: collections[0]: got NumberOfChildren 65, expected 7 ntoskrnl.c:1921: Test failed: id 0 poll: HidP_GetButtonCaps returned 0xc0110001 ntoskrnl.c:1923: Test failed: id 0 poll: HidP_GetButtonCaps returned 0xc0110001 ntoskrnl.c:1926: Test failed: id 0 poll: HidP_GetButtonCaps returned 0xc0110001 ntoskrnl.c:1927: Test failed: id 0 poll: HidP_GetButtonCaps returned count 0, expected 13 ntoskrnl.c:1934: Test failed: id 0 poll: HidP_GetButtonCaps returned 0xc0110001 ntoskrnl.c:1935: Test failed: id 0 poll: HidP_GetButtonCaps returned count 16, expected 13 ntoskrnl.c:1941: Test failed: id 0 poll: button_caps[0]: got UsagePage 0000, expected 0009 ntoskrnl.c:1941: Test failed: id 0 poll: button_caps[0]: got BitField 0, expected 2 ntoskrnl.c:1941: Test failed: id 0 poll: button_caps[0]: got LinkCollection 0, expected 1 ntoskrnl.c:1941: Test failed: id 0 poll: button_caps[0]: got LinkUsage 0000, expected 0004 ntoskrnl.c:1941: Test failed: id 0 poll: button_caps[0]: got LinkUsagePage 0000, expected 0001 ntoskrnl.c:1941: Test failed: id 0 poll: button_caps[0]: got IsRange 0, expected 1 ntoskrnl.c:1941: Test failed: id 0 poll: button_caps[0]: got IsAbsolute 0, expected 1 ntoskrnl.c:1941: Test failed: id 0 poll: button_caps[1]: got UsagePage 0000, expected 0009 ntoskrnl.c:1941: Test failed: id 0 poll: button_caps[1]: got BitField 0, expected 3 ntoskrnl.c:1941: Test failed: id 0 poll: button_caps[1]: got LinkCollection 0, expected 1 ntoskrnl.c:1941: Test failed: id 0 poll: button_caps[1]: got LinkUsage 0000, expected 0004 ntoskrnl.c:1941: Test failed: id 0 poll: button_caps[1]: got LinkUsagePage 0000, expected 0001 ntoskrnl.c:1941: Test failed: id 0 poll: button_caps[1]: got IsRange 0, expected 1 ntoskrnl.c:1941: Test failed: id 0 poll: button_caps[1]: got IsAbsolute 0, expected 1 ntoskrnl.c:1941: Test failed: id 0 poll: button_caps[2]: got UsagePage 0000, expected 0007 ntoskrnl.c:1941: Test failed: id 0 poll: button_caps[2]: got BitField 0, expected 508 ntoskrnl.c:1941: Test failed: id 0 poll: button_caps[2]: got LinkCollection 0, expected 1 ntoskrnl.c:1941: Test failed: id 0 poll: button_caps[2]: got LinkUsage 0000, expected 0004 ntoskrnl.c:1941: Test failed: id 0 poll: button_caps[2]: got LinkUsagePage 0000, expected 0001 ntoskrnl.c:1941: Test failed: id 0 poll: button_caps[2]: got IsRange 0, expected 1 ntoskrnl.c:1941: Test failed: id 0 poll: button_caps[3]: got UsagePage 0000, expected 0009 ntoskrnl.c:1941: Test failed: id 0 poll: button_caps[3]: got BitField 0, expected 2 ntoskrnl.c:1941: Test failed: id 0 poll: button_caps[3]: got LinkCollection 0, expected 1 ntoskrnl.c:1941: Test failed: id 0 poll: button_caps[3]: got LinkUsage 0000, expected 0004 ntoskrnl.c:1941: Test failed: id 0 poll: button_caps[3]: got LinkUsagePage 0000, expected 0001 ntoskrnl.c:1941: Test failed: id 0 poll: button_caps[3]: got IsAbsolute 0, expected 1 ntoskrnl.c:1941: Test failed: id 0 poll: button_caps[3]: got NotRange.Usage 0000, expected 0020 ntoskrnl.c:1941: Test failed: id 0 poll: button_caps[3]: got NotRange.DataIndex 0, expected 26 ntoskrnl.c:1947: Test failed: id 0 poll: HidP_GetSpecificButtonCaps returned 0xc0110001 ntoskrnl.c:1949: Test failed: id 0 poll: HidP_GetSpecificButtonCaps returned 0xc0110001 ntoskrnl.c:1952: Test failed: id 0 poll: HidP_GetSpecificButtonCaps returned 0xc0110001 ntoskrnl.c:1953: Test failed: id 0 poll: HidP_GetSpecificButtonCaps returned count 0, expected 13 ntoskrnl.c:1960: Test failed: id 0 poll: HidP_GetSpecificButtonCaps returned 0xc0110001 ntoskrnl.c:1961: Test failed: id 0 poll: HidP_GetSpecificButtonCaps returned count 15, expected 13 ntoskrnl.c:1967: Test failed: id 0 poll: HidP_GetSpecificButtonCaps returned 0xc0110001 ntoskrnl.c:1968: Test failed: id 0 poll: HidP_GetSpecificButtonCaps returned count 15, expected 1 ntoskrnl.c:1973: Test failed: id 0 poll: HidP_GetSpecificButtonCaps returned 0xc0110001 ntoskrnl.c:1974: Test failed: id 0 poll: HidP_GetSpecificButtonCaps returned count 48879, expected 0 ntoskrnl.c:1977: Test failed: id 0 poll: HidP_GetSpecificButtonCaps returned 0xc0110001 ntoskrnl.c:1978: Test failed: id 0 poll: HidP_GetSpecificButtonCaps returned count 48879, expected 0 ntoskrnl.c:1981: Test failed: id 0 poll: HidP_GetSpecificButtonCaps returned 0xc0110001 ntoskrnl.c:1982: Test failed: id 0 poll: HidP_GetSpecificButtonCaps returned count 48879, expected 0 ntoskrnl.c:1986: Test failed: id 0 poll: HidP_GetValueCaps returned 0xc0110001 ntoskrnl.c:1988: Test failed: id 0 poll: HidP_GetValueCaps returned 0xc0110001 ntoskrnl.c:1991: Test failed: id 0 poll: HidP_GetValueCaps returned 0xc0110001 ntoskrnl.c:1992: Test failed: id 0 poll: HidP_GetValueCaps returned count 0, expected 7 ntoskrnl.c:1998: Test failed: id 0 poll: HidP_GetValueCaps returned 0xc0110001 ntoskrnl.c:1999: Test failed: id 0 poll: HidP_GetValueCaps returned count 16, expected 7 ntoskrnl.c:2005: Test failed: id 0 poll: value_caps[0]: got UsagePage 3a43, expected 0001 ntoskrnl.c:2005: Test failed: id 0 poll: value_caps[0]: got ReportID 92, expected 0 ntoskrnl.c:2005: Test failed: id 0 poll: value_caps[0]: got IsAlias 87, expected 0 ntoskrnl.c:2005: Test failed: id 0 poll: value_caps[0]: got BitField 28265, expected 2 ntoskrnl.c:2005: Test failed: id 0 poll: value_caps[0]: got LinkCollection 28516, expected 1 ntoskrnl.c:2005: Test failed: id 0 poll: value_caps[0]: got LinkUsage 29559, expected 4 ntoskrnl.c:2005: Test failed: id 0 poll: value_caps[0]: got LinkUsagePage 18780, expected 1 ntoskrnl.c:2005: Test failed: id 0 poll: value_caps[0]: got IsRange 78, expected 0 ntoskrnl.c:2005: Test failed: id 0 poll: value_caps[0]: got IsStringRange 70, expected 0 ntoskrnl.c:2005: Test failed: id 0 poll: value_caps[0]: got IsDesignatorRange 92, expected 0 ntoskrnl.c:2005: Test failed: id 0 poll: value_caps[0]: got IsAbsolute 111, expected 1 ntoskrnl.c:2005: Test failed: id 0 poll: value_caps[0]: got HasNull 101, expected 0 ntoskrnl.c:2005: Test failed: id 0 poll: value_caps[0]: got BitSize 11830, expected 8 ntoskrnl.c:2005: Test failed: id 0 poll: value_caps[0]: got ReportCount 28265, expected 1 ntoskrnl.c:2005: Test failed: id 0 poll: value_caps[1]: got ReportID 1, expected 0 ntoskrnl.c:2005: Test failed: id 0 poll: value_caps[2]: got ReportID 1, expected 0 ntoskrnl.c:2005: Test failed: id 0 poll: value_caps[3]: got ReportID 1, expected 0 ntoskrnl.c:2011: Test failed: id 0 poll: HidP_GetSpecificValueCaps returned 0xc0110001 ntoskrnl.c:2013: Test failed: id 0 poll: HidP_GetSpecificValueCaps returned 0xc0110001 ntoskrnl.c:2016: Test failed: id 0 poll: HidP_GetSpecificValueCaps returned 0xc0110001 ntoskrnl.c:2017: Test failed: id 0 poll: HidP_GetSpecificValueCaps returned count 0, expected 7 ntoskrnl.c:2024: Test failed: id 0 poll: HidP_GetSpecificValueCaps returned 0xc0110001 ntoskrnl.c:2025: Test failed: id 0 poll: HidP_GetSpecificValueCaps returned count 12, expected 7 ntoskrnl.c:2027: Test failed: id 0 poll: got UsagePage 0001, expected 3a43 ntoskrnl.c:2027: Test failed: id 0 poll: got ReportID 1, expected 92 ntoskrnl.c:2027: Test failed: id 0 poll: got IsAlias 0, expected 87 ntoskrnl.c:2027: Test failed: id 0 poll: got BitField 2, expected 28265 ntoskrnl.c:2027: Test failed: id 0 poll: got LinkCollection 1, expected 28516 ntoskrnl.c:2027: Test failed: id 0 poll: got LinkUsage 4, expected 29559 ntoskrnl.c:2027: Test failed: id 0 poll: got LinkUsagePage 1, expected 18780 ntoskrnl.c:2027: Test failed: id 0 poll: got IsRange 0, expected 78 ntoskrnl.c:2027: Test failed: id 0 poll: got IsStringRange 0, expected 70 ntoskrnl.c:2027: Test failed: id 0 poll: got IsDesignatorRange 0, expected 92 ntoskrnl.c:2027: Test failed: id 0 poll: got IsAbsolute 1, expected 111 ntoskrnl.c:2027: Test failed: id 0 poll: got HasNull 0, expected 101 ntoskrnl.c:2027: Test failed: id 0 poll: got BitSize 4, expected 11830 ntoskrnl.c:2027: Test failed: id 0 poll: got ReportCount 2, expected 28265 ntoskrnl.c:2027: Test failed: id 0 poll: got LogicalMin 1, expected -128 ntoskrnl.c:2027: Test failed: id 0 poll: got LogicalMax 8, expected 127 ntoskrnl.c:2035: Test failed: id 0 poll: HidP_GetSpecificValueCaps returned 0xc0110001 ntoskrnl.c:2041: Test failed: id 0 poll: HidP_GetSpecificValueCaps returned 0xc0110001 ntoskrnl.c:2042: Test failed: id 0 poll: HidP_GetSpecificValueCaps returned count 57005, expected 0 ntoskrnl.c:2045: Test failed: id 0 poll: HidP_GetSpecificValueCaps returned 0xc0110001 ntoskrnl.c:2046: Test failed: id 0 poll: HidP_GetSpecificValueCaps returned count 57005, expected 0 ntoskrnl.c:2049: Test failed: id 0 poll: HidP_GetSpecificValueCaps returned 0xc0110001 ntoskrnl.c:2050: Test failed: id 0 poll: HidP_GetSpecificValueCaps returned count 57005, expected 0 ntoskrnl.c:2055: Test failed: id 0 poll: HidP_InitializeReportForID returned 0xc0110001 ntoskrnl.c:2057: Test failed: id 0 poll: HidP_InitializeReportForID returned 0xc0110001 ntoskrnl.c:2059: Test failed: id 0 poll: HidP_InitializeReportForID returned 0xc0110001 ntoskrnl.c:2061: Test failed: id 0 poll: HidP_InitializeReportForID returned 0xc0110001 ntoskrnl.c:2065: Test failed: id 0 poll: HidP_InitializeReportForID returned 0xc0110001 ntoskrnl.c:2070: Test failed: id 0 poll: unexpected report data ntoskrnl.c:2074: Test failed: id 0 poll: HidP_SetUsageValueArray returned 0xc0110001 ntoskrnl.c:2078: Test failed: id 0 poll: HidP_SetUsageValueArray returned 0xc0110001 ntoskrnl.c:2082: Test failed: id 0 poll: HidP_SetUsageValueArray returned 0xc0110001 ntoskrnl.c:2086: Test failed: id 0 poll: HidP_GetUsageValueArray returned 0xc0110001 ntoskrnl.c:2090: Test failed: id 0 poll: HidP_GetUsageValueArray returned 0xc0110001 ntoskrnl.c:2094: Test failed: id 0 poll: HidP_GetUsageValueArray returned 0xc0110001 ntoskrnl.c:2099: Test failed: id 0 poll: HidP_SetUsageValue returned 0xc0110001 ntoskrnl.c:2103: Test failed: id 0 poll: HidP_GetUsageValue returned 0xc0110001 ntoskrnl.c:2104: Test failed: id 0 poll: got value deadbeef, expected 0x80 ntoskrnl.c:2108: Test failed: id 0 poll: HidP_GetScaledUsageValue returned 0xc0110001 ntoskrnl.c:2109: Test failed: id 0 poll: got value deadbeef, expected 0xffffff80 ntoskrnl.c:2114: Test failed: id 0 poll: HidP_SetUsageValue returned 0xc0110001 ntoskrnl.c:2118: Test failed: id 0 poll: HidP_GetScaledUsageValue returned 0xc0110001 ntoskrnl.c:2119: Test failed: id 0 poll: got value deadbeef, expected 0x7f ntoskrnl.c:2124: Test failed: id 0 poll: HidP_SetUsageValue returned 0xc0110001 ntoskrnl.c:2128: Test failed: id 0 poll: HidP_GetScaledUsageValue returned 0xc0110001 ntoskrnl.c:2129: Test failed: id 0 poll: got value deadbeef, expected 0 ntoskrnl.c:2134: Test failed: id 0 poll: HidP_SetUsageValue returned 0xc0110001 ntoskrnl.c:2138: Test failed: id 0 poll: HidP_GetScaledUsageValue returned 0xc0110001 ntoskrnl.c:2139: Test failed: id 0 poll: got value deadbeef, expected 0 ntoskrnl.c:2143: Test failed: id 0 poll: HidP_GetUsageValue returned 0xc0110001 ntoskrnl.c:2144: Test failed: id 0 poll: got value deadbeef, expected 0x7fffffff ntoskrnl.c:2149: Test failed: id 0 poll: HidP_SetUsageValue returned 0xc0110001 ntoskrnl.c:2153: Test failed: id 0 poll: HidP_GetScaledUsageValue returned 0xc0110001 ntoskrnl.c:2154: Test failed: id 0 poll: got value deadbeef, expected 0x7fffffff ntoskrnl.c:2159: Test failed: id 0 poll: HidP_SetUsageValue returned 0xc0110001 ntoskrnl.c:2163: Test failed: id 0 poll: HidP_GetScaledUsageValue returned 0xc0110001 ntoskrnl.c:2164: Test failed: id 0 poll: got value deadbeef, expected 0x80000000 ntoskrnl.c:2169: Test failed: id 0 poll: HidP_SetUsageValue returned 0xc0110001 ntoskrnl.c:2173: Test failed: id 0 poll: HidP_GetScaledUsageValue returned 0xc0110001 ntoskrnl.c:2174: Test failed: id 0 poll: got value deadbeef, expected 0 ntoskrnl.c:2179: Test failed: id 0 poll: HidP_SetUsageValue returned 0xc0110001 ntoskrnl.c:2183: Test failed: id 0 poll: HidP_GetScaledUsageValue returned 0xc0110001 ntoskrnl.c:2184: Test failed: id 0 poll: got value deadbeef, expected 0 ntoskrnl.c:2189: Test failed: id 0 poll: HidP_MaxUsageListLength(HidP_Input, 0) returned 0, expected 42 ntoskrnl.c:2191: Test failed: id 0 poll: HidP_MaxUsageListLength(HidP_Input, HID_USAGE_PAGE_BUTTON) returned 0, expected 32 ntoskrnl.c:2193: Test failed: id 0 poll: HidP_MaxUsageListLength(HidP_Input, HID_USAGE_PAGE_LED) returned 0, expected 8 ntoskrnl.c:2195: Test failed: id 0 poll: HidP_MaxUsageListLength(HidP_Feature, HID_USAGE_PAGE_BUTTON) returned 0, expected 8 ntoskrnl.c:2203: Test failed: id 0 poll: HidP_SetUsages returned 0xc0110001 ntoskrnl.c:2209: Test failed: id 0 poll: HidP_SetUsages returned 0xc0110001 ntoskrnl.c:2215: Test failed: id 0 poll: HidP_SetUsages returned 0xc0110001 ntoskrnl.c:2221: Test failed: id 0 poll: HidP_SetUsages returned 0xc0110001 ntoskrnl.c:2227: Test failed: id 0 poll: got report[6] ffffffcd expected 0 ntoskrnl.c:2228: Test failed: id 0 poll: got report[7] ffffffcd expected 0 ntoskrnl.c:2232: Test failed: id 0 poll: HidP_SetUsages returned 0xc0110001 ntoskrnl.c:2235: Test failed: id 0 poll: unexpected report data ntoskrnl.c:2239: Test failed: id 0 poll: HidP_SetUsageValue returned 0xc0110001 ntoskrnl.c:2244: Test failed: id 0 poll: HidP_SetUsageValue returned 0xc0110001 ntoskrnl.c:2250: Test failed: id 0 poll: HidP_GetUsages returned 0xc0110001 ntoskrnl.c:2251: Test failed: id 0 poll: got usage count 1, expected 2 ntoskrnl.c:2256: Test failed: id 0 poll: HidP_GetUsages returned 0xc0110001 ntoskrnl.c:2257: Test failed: id 0 poll: got usage count 16, expected 2 ntoskrnl.c:2258: Test failed: id 0 poll: got usages[0] cdcd, expected 4 ntoskrnl.c:2259: Test failed: id 0 poll: got usages[1] cdcd, expected 6 ntoskrnl.c:2265: Test failed: id 0 poll: HidP_GetUsages returned 0xc0110001 ntoskrnl.c:2266: Test failed: id 0 poll: got usage count 16, expected 2 ntoskrnl.c:2267: Test failed: id 0 poll: got usages[0] cdcd, expected 6 ntoskrnl.c:2268: Test failed: id 0 poll: got usages[1] cdcd, expected 4 ntoskrnl.c:2274: Test failed: id 0 poll: HidP_GetUsagesEx returned 0xc0110001 ntoskrnl.c:2275: Test failed: id 0 poll: got usage count 16, expected 4 ntoskrnl.c:2276: Test failed: id 0 poll: got usage_and_pages[0] UsagePage cdcd, expected 9 ntoskrnl.c:2278: Test failed: id 0 poll: got usage_and_pages[1] UsagePage cdcd, expected 9 ntoskrnl.c:2280: Test failed: id 0 poll: got usage_and_pages[2] UsagePage cdcd, expected 7 ntoskrnl.c:2282: Test failed: id 0 poll: got usage_and_pages[3] UsagePage cdcd, expected 7 ntoskrnl.c:2284: Test failed: id 0 poll: got usage_and_pages[4] UsagePage cdcd, expected 8 ntoskrnl.c:2286: Test failed: id 0 poll: got usage_and_pages[5] UsagePage cdcd, expected 8 ntoskrnl.c:2288: Test failed: id 0 poll: got usage_and_pages[0] Usage cdcd, expected 4 ntoskrnl.c:2290: Test failed: id 0 poll: got usage_and_pages[1] Usage cdcd, expected 6 ntoskrnl.c:2292: Test failed: id 0 poll: got usage_and_pages[2] Usage cdcd, expected 9 ntoskrnl.c:2294: Test failed: id 0 poll: got usage_and_pages[3] Usage cdcd, expected b ntoskrnl.c:2296: Test failed: id 0 poll: got usage_and_pages[4] Usage cdcd, expected 6 ntoskrnl.c:2298: Test failed: id 0 poll: got usage_and_pages[5] Usage cdcd, expected 4 ntoskrnl.c:2304: Test failed: id 0 poll: HidP_MaxDataListLength(HidP_Input) returned 0, expected 50 ntoskrnl.c:2308: Test failed: id 0 poll: HidP_MaxDataListLength(HidP_Feature) returned 0, expected 13 ntoskrnl.c:2312: Test failed: id 0 poll: HidP_GetData returned 0xc0110001 ntoskrnl.c:2313: Test failed: id 0 poll: got data count 1, expected 11 ntoskrnl.c:2316: Test failed: id 0 poll: HidP_GetData returned 0xc0110001 ntoskrnl.c:2320: Test failed: id 0 poll: data[1]: got DataIndex 0, expected 1 ntoskrnl.c:2320: Test failed: id 0 poll: data[2]: got DataIndex 0, expected 5 ntoskrnl.c:2321: Test failed: id 0 poll: data[2]: got RawValue 0, expected 1 ntoskrnl.c:2320: Test failed: id 0 poll: data[3]: got DataIndex 0, expected 7 ntoskrnl.c:2321: Test failed: id 0 poll: data[3]: got RawValue 0, expected 1 ntoskrnl.c:2320: Test failed: id 0 poll: data[4]: got DataIndex 0, expected 19 ntoskrnl.c:2321: Test failed: id 0 poll: data[4]: got RawValue 0, expected 1 ntoskrnl.c:2320: Test failed: id 0 poll: data[5]: got DataIndex 0, expected 21 ntoskrnl.c:2321: Test failed: id 0 poll: data[5]: got RawValue 0, expected 1 ntoskrnl.c:2320: Test failed: id 0 poll: data[6]: got DataIndex 0, expected 30 ntoskrnl.c:2320: Test failed: id 0 poll: data[7]: got DataIndex 0, expected 31 ntoskrnl.c:2320: Test failed: id 0 poll: data[8]: got DataIndex 0, expected 32 ntoskrnl.c:2321: Test failed: id 0 poll: data[8]: got RawValue 0, expected -17970434 ntoskrnl.c:2320: Test failed: id 0 poll: data[9]: got DataIndex 0, expected 37 ntoskrnl.c:2321: Test failed: id 0 poll: data[9]: got RawValue 0, expected 1 ntoskrnl.c:2320: Test failed: id 0 poll: data[10]: got DataIndex 0, expected 39 ntoskrnl.c:2321: Test failed: id 0 poll: data[10]: got RawValue 0, expected 1 ntoskrnl.c:2327: Test failed: id 0 poll: HidP_InitializeReportForID returned 0xc0110001 ntoskrnl.c:2331: Test failed: id 0 poll: HidP_InitializeReportForID returned 0xc0110001 ntoskrnl.c:2336: Test failed: id 0 poll: unexpected report data ntoskrnl.c:2354: Test failed: id 0 poll: HidP_SetUsageValue returned 0xc0110001 ntoskrnl.c:2358: Test failed: id 0 poll: HidP_SetUsageValue returned 0xc0110001 ntoskrnl.c:2363: Test failed: id 0 poll: HidP_SetUsageValue returned 0xc0110001 ntoskrnl.c:2369: Test failed: id 0 poll: HidP_SetUsageValue returned 0xc0110001 ntoskrnl.c:2373: Test failed: id 0 poll: HidP_SetUsageValue returned 0xc0110001 ntoskrnl.c:2378: Test failed: id 0 poll: HidP_SetUsageValue returned 0xc0110001 ntoskrnl.c:2385: Test failed: id 0 poll: unexpected report data ntoskrnl.c:2392: Test failed: id 0 poll: HidP_GetUsageValue returned 0xc0110001 ntoskrnl.c:2395: Test failed: id 0 poll: HidP_GetUsageValue returned 0xc0110001 ntoskrnl.c:2399: Test failed: id 0 poll: HidP_GetUsageValue returned 0xc0110001 ntoskrnl.c:2404: Test failed: id 0 poll: HidP_GetUsageValue returned 0xc0110001 ntoskrnl.c:2408: Test failed: id 0 poll: HidP_GetUsageValue returned 0xc0110001 ntoskrnl.c:2413: Test failed: id 0 poll: HidP_GetUsageValue returned 0xc0110001 ntoskrnl.c:2414: Test failed: id 0 poll: got value deadbeef, expected 0x1005 ntoskrnl.c:2420: Test failed: id 0 poll: HidP_SetUsageValueArray returned 0xc0110001 ntoskrnl.c:2423: Test failed: id 0 poll: HidP_SetUsageValueArray returned 0xc0110001 ntoskrnl.c:2424: Test failed: id 0 poll: unexpected report data ntoskrnl.c:2429: Test failed: id 0 poll: HidP_GetUsageValueArray returned 0xc0110001 ntoskrnl.c:2432: Test failed: id 0 poll: HidP_GetUsageValueArray returned 0xc0110001 ntoskrnl.c:2434: Test failed: id 0 poll: unexpected report value ntoskrnl.c:2439: Test failed: id 0 poll: HidP_InitializeReportForID returned 0xc0110001 ntoskrnl.c:2444: Test failed: id 0 poll: HidD_GetInputReport returned error 6 ntoskrnl.c:2449: Test failed: id 0 poll: HidD_GetInputReport returned error 6 ntoskrnl.c:2458: Test failed: id 0 poll: HidD_GetInputReport returned error 6 ntoskrnl.c:2469: Test failed: id 0 poll: HidD_GetInputReport failed, last error 6 ntoskrnl.c:2470: Test failed: id 0 poll: got report[0] ffffffcd, expected 00 ntoskrnl.c:2475: Test failed: id 0 poll: IOCTL_HID_GET_INPUT_REPORT failed, last error 6 ntoskrnl.c:2476: Test failed: id 0 poll: got length 46, expected 3 ntoskrnl.c:2477: Test failed: id 0 poll: got report[0] ffffffcd, expected 00 ntoskrnl.c:2482: Test failed: id 0 poll: HidP_InitializeReportForID returned 0xc0110001 ntoskrnl.c:2487: Test failed: id 0 poll: HidD_GetFeature returned error 6 ntoskrnl.c:2492: Test failed: id 0 poll: HidD_GetFeature returned error 6 ntoskrnl.c:2501: Test failed: id 0 poll: HidD_GetFeature returned error 6 ntoskrnl.c:2512: Test failed: id 0 poll: HidD_GetFeature failed, last error 6 ntoskrnl.c:2513: Test failed: id 0 poll: got report[0] ffffffcd, expected 00 ntoskrnl.c:2518: Test failed: id 0 poll: IOCTL_HID_GET_FEATURE failed, last error 6 ntoskrnl.c:2519: Test failed: id 0 poll: got length 34, expected 3 ntoskrnl.c:2520: Test failed: id 0 poll: got report[0] ffffffcd, expected 00 ntoskrnl.c:2525: Test failed: id 0 poll: HidP_InitializeReportForID returned 0xc0110001 ntoskrnl.c:2530: Test failed: id 0 poll: HidD_SetFeature returned error 6 ntoskrnl.c:2535: Test failed: id 0 poll: HidD_SetFeature returned error 6 ntoskrnl.c:2544: Test failed: id 0 poll: HidD_SetFeature returned error 6 ntoskrnl.c:2554: Test failed: id 0 poll: HidD_SetFeature failed, last error 6 ntoskrnl.c:2560: Test failed: id 0 poll: IOCTL_HID_SET_FEATURE returned error 6 ntoskrnl.c:2564: Test failed: id 0 poll: IOCTL_HID_SET_FEATURE failed, last error 6 ntoskrnl.c:2565: Test failed: id 0 poll: got length 0, expected 3 ntoskrnl.c:2570: Test failed: id 0 poll: HidP_InitializeReportForID returned 0xc0110001 ntoskrnl.c:2577: Test failed: id 0 poll: HidD_SetOutputReport returned error 6 ntoskrnl.c:2582: Test failed: id 0 poll: HidD_SetOutputReport returned error 6 ntoskrnl.c:2591: Test failed: id 0 poll: HidD_SetOutputReport returned error 6 ntoskrnl.c:2601: Test failed: id 0 poll: HidD_SetOutputReport failed, last error 6 ntoskrnl.c:2607: Test failed: id 0 poll: IOCTL_HID_SET_OUTPUT_REPORT returned error 6 ntoskrnl.c:2611: Test failed: id 0 poll: IOCTL_HID_SET_OUTPUT_REPORT failed, last error 6 ntoskrnl.c:2612: Test failed: id 0 poll: got length 0, expected 3 ntoskrnl.c:2618: Test failed: id 0 poll: WriteFile returned error 6 ntoskrnl.c:2623: Test failed: id 0 poll: WriteFile returned error 6 ntoskrnl.c:2634: Test failed: id 0 poll: WriteFile returned error 6 ntoskrnl.c:2648: Test failed: id 0 poll: WriteFile failed, last error 6 ntoskrnl.c:2649: Test failed: id 0 poll: WriteFile wrote 0 ntoskrnl.c:2656: Test failed: id 0 poll: ReadFile failed, last error 6 ntoskrnl.c:2660: Test failed: id 0 poll: ReadFile failed, last error 6 ntoskrnl.c:2668: Test failed: id 0 poll: ReadFile failed, last error 6 ntoskrnl.c:2669: Test failed: id 0 poll: ReadFile returned 0 ntoskrnl.c:2670: Test failed: id 0 poll: unexpected report data ntoskrnl.c:2679: Test failed: id 0 poll: ReadFile returned error 6 ntoskrnl: Timeout
On 8/9/21 10:48 AM, Marvin wrote:
Hi,
While running your changed tests, I think I found new failures. Being a bot and all I'm not very good at pattern recognition, so I might be wrong, but could you please double-check?
Full results can be found at: https://testbot.winehq.org/JobDetails.pl?Key=95286
Your paranoid android.
=== w7u_2qxl (32 bit report) ===
ntoskrnl.exe: ntoskrnl.c:2927: Test failed: failed to register device, error 0xe000020b ntoskrnl.c:2760: Test failed: id 0 poll: didn't find device ntoskrnl.c:2764: Test failed: id 0 poll: got error 5 ntoskrnl.c:2769: Test failed: id 0 poll: HidD_GetNumInputBuffers failed last error 6 ntoskrnl.c:2770: Test failed: id 0 poll: HidD_GetNumInputBuffers returned 3735928559 ntoskrnl.c:2775: Test failed: id 0 poll: HidD_SetNumInputBuffers returned error 6 ntoskrnl.c:2779: Test failed: id 0 poll: HidD_SetNumInputBuffers returned error 6 ntoskrnl.c:2783: Test failed: id 0 poll: HidD_SetNumInputBuffers failed last error 6 ntoskrnl.c:2788: Test failed: id 0 poll: HidD_GetNumInputBuffers failed last error 6 ntoskrnl.c:2789: Test failed: id 0 poll: HidD_GetNumInputBuffers returned 3735928559 ntoskrnl.c:2794: Test failed: id 0 poll: got error 5 ntoskrnl.c:2799: Test failed: id 0 poll: HidD_GetNumInputBuffers failed last error 6 ntoskrnl.c:2800: Test failed: id 0 poll: HidD_GetNumInputBuffers returned 3735928559 ntoskrnl.c:2804: Test failed: id 0 poll: HidD_SetNumInputBuffers failed last error 6 ntoskrnl.c:2809: Test failed: id 0 poll: HidD_GetNumInputBuffers failed last error 6 ntoskrnl.c:2810: Test failed: id 0 poll: HidD_GetNumInputBuffers returned 3735928559 ntoskrnl.c:2814: Test failed: id 0 poll: HidD_GetNumInputBuffers failed last error 6 ntoskrnl.c:2815: Test failed: id 0 poll: HidD_GetNumInputBuffers returned 3735928559 ntoskrnl.c:2822: Test failed: id 0 poll: IOCTL_HID_GET_POLL_FREQUENCY_MSEC failed last error 6 ntoskrnl.c:2824: Test failed: id 0 poll: got poll_freq 6108304, expected 5 ntoskrnl.c:2830: Test failed: id 0 poll: IOCTL_HID_GET_POLL_FREQUENCY_MSEC failed last error 6 ntoskrnl.c:2836: Test failed: id 0 poll: IOCTL_HID_GET_POLL_FREQUENCY_MSEC failed last error 6 ntoskrnl.c:2843: Test failed: id 0 poll: IOCTL_HID_GET_POLL_FREQUENCY_MSEC failed last error 6 ntoskrnl.c:1890: Test failed: id 0 poll: HidD_GetPreparsedData failed with error 6 ntoskrnl.c:1896: Test failed: id 0 poll: HidP_GetCaps returned 0xc0110001 ntoskrnl.c:1897: Test failed: id 0 poll: got InputReportByteLength 23, expected 24 ntoskrnl.c:1897: Test failed: id 0 poll: got OutputReportByteLength 2, expected 3 ntoskrnl.c:1897: Test failed: id 0 poll: got FeatureReportByteLength 17, expected 18 ntoskrnl.c:1901: Test failed: id 0 poll: HidP_GetLinkCollectionNodes returned 0xc0110001 ntoskrnl.c:1902: Test failed: id 0 poll: got 0 collection nodes, expected 10 ntoskrnl.c:1908: Test failed: id 0 poll: HidP_GetLinkCollectionNodes returned 0xc0110001 ntoskrnl.c:1909: Test failed: id 0 poll: got 16 collection nodes, expected 10 ntoskrnl.c:1915: Test failed: id 0 poll: collections[0]: got LinkUsage 0074, expected 0004 ntoskrnl.c:1915: Test failed: id 0 poll: collections[0]: got LinkUsagePage 0076, expected 0001 ntoskrnl.c:1915: Test failed: id 0 poll: collections[0]: got Parent 56000, expected 0 ntoskrnl.c:1915: Test failed: id 0 poll: collections[0]: got NumberOfChildren 65, expected 7 ntoskrnl.c:1921: Test failed: id 0 poll: HidP_GetButtonCaps returned 0xc0110001 ntoskrnl.c:1923: Test failed: id 0 poll: HidP_GetButtonCaps returned 0xc0110001 ntoskrnl.c:1926: Test failed: id 0 poll: HidP_GetButtonCaps returned 0xc0110001 ntoskrnl.c:1927: Test failed: id 0 poll: HidP_GetButtonCaps returned count 0, expected 13 ntoskrnl.c:1934: Test failed: id 0 poll: HidP_GetButtonCaps returned 0xc0110001 ntoskrnl.c:1935: Test failed: id 0 poll: HidP_GetButtonCaps returned count 16, expected 13 ntoskrnl.c:1941: Test failed: id 0 poll: button_caps[0]: got UsagePage 0000, expected 0009 ntoskrnl.c:1941: Test failed: id 0 poll: button_caps[0]: got BitField 0, expected 2 ntoskrnl.c:1941: Test failed: id 0 poll: button_caps[0]: got LinkCollection 0, expected 1 ntoskrnl.c:1941: Test failed: id 0 poll: button_caps[0]: got LinkUsage 0000, expected 0004 ntoskrnl.c:1941: Test failed: id 0 poll: button_caps[0]: got LinkUsagePage 0000, expected 0001 ntoskrnl.c:1941: Test failed: id 0 poll: button_caps[0]: got IsRange 0, expected 1 ntoskrnl.c:1941: Test failed: id 0 poll: button_caps[0]: got IsAbsolute 0, expected 1 ntoskrnl.c:1941: Test failed: id 0 poll: button_caps[1]: got UsagePage 0000, expected 0009 ntoskrnl.c:1941: Test failed: id 0 poll: button_caps[1]: got BitField 0, expected 3 ntoskrnl.c:1941: Test failed: id 0 poll: button_caps[1]: got LinkCollection 0, expected 1 ntoskrnl.c:1941: Test failed: id 0 poll: button_caps[1]: got LinkUsage 0000, expected 0004 ntoskrnl.c:1941: Test failed: id 0 poll: button_caps[1]: got LinkUsagePage 0000, expected 0001 ntoskrnl.c:1941: Test failed: id 0 poll: button_caps[1]: got IsRange 0, expected 1 ntoskrnl.c:1941: Test failed: id 0 poll: button_caps[1]: got IsAbsolute 0, expected 1 ntoskrnl.c:1941: Test failed: id 0 poll: button_caps[2]: got UsagePage 0000, expected 0007 ntoskrnl.c:1941: Test failed: id 0 poll: button_caps[2]: got BitField 0, expected 508 ntoskrnl.c:1941: Test failed: id 0 poll: button_caps[2]: got LinkCollection 0, expected 1 ntoskrnl.c:1941: Test failed: id 0 poll: button_caps[2]: got LinkUsage 0000, expected 0004 ntoskrnl.c:1941: Test failed: id 0 poll: button_caps[2]: got LinkUsagePage 0000, expected 0001 ntoskrnl.c:1941: Test failed: id 0 poll: button_caps[2]: got IsRange 0, expected 1 ntoskrnl.c:1941: Test failed: id 0 poll: button_caps[3]: got UsagePage 0000, expected 0009 ntoskrnl.c:1941: Test failed: id 0 poll: button_caps[3]: got BitField 0, expected 2 ntoskrnl.c:1941: Test failed: id 0 poll: button_caps[3]: got LinkCollection 0, expected 1 ntoskrnl.c:1941: Test failed: id 0 poll: button_caps[3]: got LinkUsage 0000, expected 0004 ntoskrnl.c:1941: Test failed: id 0 poll: button_caps[3]: got LinkUsagePage 0000, expected 0001 ntoskrnl.c:1941: Test failed: id 0 poll: button_caps[3]: got IsAbsolute 0, expected 1 ntoskrnl.c:1941: Test failed: id 0 poll: button_caps[3]: got NotRange.Usage 0000, expected 0020 ntoskrnl.c:1941: Test failed: id 0 poll: button_caps[3]: got NotRange.DataIndex 0, expected 26 ntoskrnl.c:1947: Test failed: id 0 poll: HidP_GetSpecificButtonCaps returned 0xc0110001 ntoskrnl.c:1949: Test failed: id 0 poll: HidP_GetSpecificButtonCaps returned 0xc0110001 ntoskrnl.c:1952: Test failed: id 0 poll: HidP_GetSpecificButtonCaps returned 0xc0110001 ntoskrnl.c:1953: Test failed: id 0 poll: HidP_GetSpecificButtonCaps returned count 0, expected 13 ntoskrnl.c:1960: Test failed: id 0 poll: HidP_GetSpecificButtonCaps returned 0xc0110001 ntoskrnl.c:1961: Test failed: id 0 poll: HidP_GetSpecificButtonCaps returned count 15, expected 13 ntoskrnl.c:1967: Test failed: id 0 poll: HidP_GetSpecificButtonCaps returned 0xc0110001 ntoskrnl.c:1968: Test failed: id 0 poll: HidP_GetSpecificButtonCaps returned count 15, expected 1 ntoskrnl.c:1973: Test failed: id 0 poll: HidP_GetSpecificButtonCaps returned 0xc0110001 ntoskrnl.c:1974: Test failed: id 0 poll: HidP_GetSpecificButtonCaps returned count 48879, expected 0 ntoskrnl.c:1977: Test failed: id 0 poll: HidP_GetSpecificButtonCaps returned 0xc0110001 ntoskrnl.c:1978: Test failed: id 0 poll: HidP_GetSpecificButtonCaps returned count 48879, expected 0 ntoskrnl.c:1981: Test failed: id 0 poll: HidP_GetSpecificButtonCaps returned 0xc0110001 ntoskrnl.c:1982: Test failed: id 0 poll: HidP_GetSpecificButtonCaps returned count 48879, expected 0 ntoskrnl.c:1986: Test failed: id 0 poll: HidP_GetValueCaps returned 0xc0110001 ntoskrnl.c:1988: Test failed: id 0 poll: HidP_GetValueCaps returned 0xc0110001 ntoskrnl.c:1991: Test failed: id 0 poll: HidP_GetValueCaps returned 0xc0110001 ntoskrnl.c:1992: Test failed: id 0 poll: HidP_GetValueCaps returned count 0, expected 7 ntoskrnl.c:1998: Test failed: id 0 poll: HidP_GetValueCaps returned 0xc0110001 ntoskrnl.c:1999: Test failed: id 0 poll: HidP_GetValueCaps returned count 16, expected 7 ntoskrnl.c:2005: Test failed: id 0 poll: value_caps[0]: got UsagePage 3a43, expected 0001 ntoskrnl.c:2005: Test failed: id 0 poll: value_caps[0]: got ReportID 92, expected 0 ntoskrnl.c:2005: Test failed: id 0 poll: value_caps[0]: got IsAlias 87, expected 0 ntoskrnl.c:2005: Test failed: id 0 poll: value_caps[0]: got BitField 28265, expected 2 ntoskrnl.c:2005: Test failed: id 0 poll: value_caps[0]: got LinkCollection 28516, expected 1 ntoskrnl.c:2005: Test failed: id 0 poll: value_caps[0]: got LinkUsage 29559, expected 4 ntoskrnl.c:2005: Test failed: id 0 poll: value_caps[0]: got LinkUsagePage 18780, expected 1 ntoskrnl.c:2005: Test failed: id 0 poll: value_caps[0]: got IsRange 78, expected 0 ntoskrnl.c:2005: Test failed: id 0 poll: value_caps[0]: got IsStringRange 70, expected 0 ntoskrnl.c:2005: Test failed: id 0 poll: value_caps[0]: got IsDesignatorRange 92, expected 0 ntoskrnl.c:2005: Test failed: id 0 poll: value_caps[0]: got IsAbsolute 111, expected 1 ntoskrnl.c:2005: Test failed: id 0 poll: value_caps[0]: got HasNull 101, expected 0 ntoskrnl.c:2005: Test failed: id 0 poll: value_caps[0]: got BitSize 11830, expected 8 ntoskrnl.c:2005: Test failed: id 0 poll: value_caps[0]: got ReportCount 28265, expected 1 ntoskrnl.c:2005: Test failed: id 0 poll: value_caps[1]: got ReportID 1, expected 0 ntoskrnl.c:2005: Test failed: id 0 poll: value_caps[2]: got ReportID 1, expected 0 ntoskrnl.c:2005: Test failed: id 0 poll: value_caps[3]: got ReportID 1, expected 0 ntoskrnl.c:2011: Test failed: id 0 poll: HidP_GetSpecificValueCaps returned 0xc0110001 ntoskrnl.c:2013: Test failed: id 0 poll: HidP_GetSpecificValueCaps returned 0xc0110001 ntoskrnl.c:2016: Test failed: id 0 poll: HidP_GetSpecificValueCaps returned 0xc0110001 ntoskrnl.c:2017: Test failed: id 0 poll: HidP_GetSpecificValueCaps returned count 0, expected 7 ntoskrnl.c:2024: Test failed: id 0 poll: HidP_GetSpecificValueCaps returned 0xc0110001 ntoskrnl.c:2025: Test failed: id 0 poll: HidP_GetSpecificValueCaps returned count 12, expected 7 ntoskrnl.c:2027: Test failed: id 0 poll: got UsagePage 0001, expected 3a43 ntoskrnl.c:2027: Test failed: id 0 poll: got ReportID 1, expected 92 ntoskrnl.c:2027: Test failed: id 0 poll: got IsAlias 0, expected 87 ntoskrnl.c:2027: Test failed: id 0 poll: got BitField 2, expected 28265 ntoskrnl.c:2027: Test failed: id 0 poll: got LinkCollection 1, expected 28516 ntoskrnl.c:2027: Test failed: id 0 poll: got LinkUsage 4, expected 29559 ntoskrnl.c:2027: Test failed: id 0 poll: got LinkUsagePage 1, expected 18780 ntoskrnl.c:2027: Test failed: id 0 poll: got IsRange 0, expected 78 ntoskrnl.c:2027: Test failed: id 0 poll: got IsStringRange 0, expected 70 ntoskrnl.c:2027: Test failed: id 0 poll: got IsDesignatorRange 0, expected 92 ntoskrnl.c:2027: Test failed: id 0 poll: got IsAbsolute 1, expected 111 ntoskrnl.c:2027: Test failed: id 0 poll: got HasNull 0, expected 101 ntoskrnl.c:2027: Test failed: id 0 poll: got BitSize 4, expected 11830 ntoskrnl.c:2027: Test failed: id 0 poll: got ReportCount 2, expected 28265 ntoskrnl.c:2027: Test failed: id 0 poll: got LogicalMin 1, expected -128 ntoskrnl.c:2027: Test failed: id 0 poll: got LogicalMax 8, expected 127 ntoskrnl.c:2035: Test failed: id 0 poll: HidP_GetSpecificValueCaps returned 0xc0110001 ntoskrnl.c:2041: Test failed: id 0 poll: HidP_GetSpecificValueCaps returned 0xc0110001 ntoskrnl.c:2042: Test failed: id 0 poll: HidP_GetSpecificValueCaps returned count 57005, expected 0 ntoskrnl.c:2045: Test failed: id 0 poll: HidP_GetSpecificValueCaps returned 0xc0110001 ntoskrnl.c:2046: Test failed: id 0 poll: HidP_GetSpecificValueCaps returned count 57005, expected 0 ntoskrnl.c:2049: Test failed: id 0 poll: HidP_GetSpecificValueCaps returned 0xc0110001 ntoskrnl.c:2050: Test failed: id 0 poll: HidP_GetSpecificValueCaps returned count 57005, expected 0 ntoskrnl.c:2055: Test failed: id 0 poll: HidP_InitializeReportForID returned 0xc0110001 ntoskrnl.c:2057: Test failed: id 0 poll: HidP_InitializeReportForID returned 0xc0110001 ntoskrnl.c:2059: Test failed: id 0 poll: HidP_InitializeReportForID returned 0xc0110001 ntoskrnl.c:2061: Test failed: id 0 poll: HidP_InitializeReportForID returned 0xc0110001 ntoskrnl.c:2065: Test failed: id 0 poll: HidP_InitializeReportForID returned 0xc0110001 ntoskrnl.c:2070: Test failed: id 0 poll: unexpected report data ntoskrnl.c:2074: Test failed: id 0 poll: HidP_SetUsageValueArray returned 0xc0110001 ntoskrnl.c:2078: Test failed: id 0 poll: HidP_SetUsageValueArray returned 0xc0110001 ntoskrnl.c:2082: Test failed: id 0 poll: HidP_SetUsageValueArray returned 0xc0110001 ntoskrnl.c:2086: Test failed: id 0 poll: HidP_GetUsageValueArray returned 0xc0110001 ntoskrnl.c:2090: Test failed: id 0 poll: HidP_GetUsageValueArray returned 0xc0110001 ntoskrnl.c:2094: Test failed: id 0 poll: HidP_GetUsageValueArray returned 0xc0110001 ntoskrnl.c:2099: Test failed: id 0 poll: HidP_SetUsageValue returned 0xc0110001 ntoskrnl.c:2103: Test failed: id 0 poll: HidP_GetUsageValue returned 0xc0110001 ntoskrnl.c:2104: Test failed: id 0 poll: got value deadbeef, expected 0x80 ntoskrnl.c:2108: Test failed: id 0 poll: HidP_GetScaledUsageValue returned 0xc0110001 ntoskrnl.c:2109: Test failed: id 0 poll: got value deadbeef, expected 0xffffff80 ntoskrnl.c:2114: Test failed: id 0 poll: HidP_SetUsageValue returned 0xc0110001 ntoskrnl.c:2118: Test failed: id 0 poll: HidP_GetScaledUsageValue returned 0xc0110001 ntoskrnl.c:2119: Test failed: id 0 poll: got value deadbeef, expected 0x7f ntoskrnl.c:2124: Test failed: id 0 poll: HidP_SetUsageValue returned 0xc0110001 ntoskrnl.c:2128: Test failed: id 0 poll: HidP_GetScaledUsageValue returned 0xc0110001 ntoskrnl.c:2129: Test failed: id 0 poll: got value deadbeef, expected 0 ntoskrnl.c:2134: Test failed: id 0 poll: HidP_SetUsageValue returned 0xc0110001 ntoskrnl.c:2138: Test failed: id 0 poll: HidP_GetScaledUsageValue returned 0xc0110001 ntoskrnl.c:2139: Test failed: id 0 poll: got value deadbeef, expected 0 ntoskrnl.c:2143: Test failed: id 0 poll: HidP_GetUsageValue returned 0xc0110001 ntoskrnl.c:2144: Test failed: id 0 poll: got value deadbeef, expected 0x7fffffff ntoskrnl.c:2149: Test failed: id 0 poll: HidP_SetUsageValue returned 0xc0110001 ntoskrnl.c:2153: Test failed: id 0 poll: HidP_GetScaledUsageValue returned 0xc0110001 ntoskrnl.c:2154: Test failed: id 0 poll: got value deadbeef, expected 0x7fffffff ntoskrnl.c:2159: Test failed: id 0 poll: HidP_SetUsageValue returned 0xc0110001 ntoskrnl.c:2163: Test failed: id 0 poll: HidP_GetScaledUsageValue returned 0xc0110001 ntoskrnl.c:2164: Test failed: id 0 poll: got value deadbeef, expected 0x80000000 ntoskrnl.c:2169: Test failed: id 0 poll: HidP_SetUsageValue returned 0xc0110001 ntoskrnl.c:2173: Test failed: id 0 poll: HidP_GetScaledUsageValue returned 0xc0110001 ntoskrnl.c:2174: Test failed: id 0 poll: got value deadbeef, expected 0 ntoskrnl.c:2179: Test failed: id 0 poll: HidP_SetUsageValue returned 0xc0110001 ntoskrnl.c:2183: Test failed: id 0 poll: HidP_GetScaledUsageValue returned 0xc0110001 ntoskrnl.c:2184: Test failed: id 0 poll: got value deadbeef, expected 0 ntoskrnl.c:2189: Test failed: id 0 poll: HidP_MaxUsageListLength(HidP_Input, 0) returned 0, expected 42 ntoskrnl.c:2191: Test failed: id 0 poll: HidP_MaxUsageListLength(HidP_Input, HID_USAGE_PAGE_BUTTON) returned 0, expected 32 ntoskrnl.c:2193: Test failed: id 0 poll: HidP_MaxUsageListLength(HidP_Input, HID_USAGE_PAGE_LED) returned 0, expected 8 ntoskrnl.c:2195: Test failed: id 0 poll: HidP_MaxUsageListLength(HidP_Feature, HID_USAGE_PAGE_BUTTON) returned 0, expected 8 ntoskrnl.c:2203: Test failed: id 0 poll: HidP_SetUsages returned 0xc0110001 ntoskrnl.c:2209: Test failed: id 0 poll: HidP_SetUsages returned 0xc0110001 ntoskrnl.c:2215: Test failed: id 0 poll: HidP_SetUsages returned 0xc0110001 ntoskrnl.c:2221: Test failed: id 0 poll: HidP_SetUsages returned 0xc0110001 ntoskrnl.c:2227: Test failed: id 0 poll: got report[6] ffffffcd expected 0 ntoskrnl.c:2228: Test failed: id 0 poll: got report[7] ffffffcd expected 0 ntoskrnl.c:2232: Test failed: id 0 poll: HidP_SetUsages returned 0xc0110001 ntoskrnl.c:2235: Test failed: id 0 poll: unexpected report data ntoskrnl.c:2239: Test failed: id 0 poll: HidP_SetUsageValue returned 0xc0110001 ntoskrnl.c:2244: Test failed: id 0 poll: HidP_SetUsageValue returned 0xc0110001 ntoskrnl.c:2250: Test failed: id 0 poll: HidP_GetUsages returned 0xc0110001 ntoskrnl.c:2251: Test failed: id 0 poll: got usage count 1, expected 2 ntoskrnl.c:2256: Test failed: id 0 poll: HidP_GetUsages returned 0xc0110001 ntoskrnl.c:2257: Test failed: id 0 poll: got usage count 16, expected 2 ntoskrnl.c:2258: Test failed: id 0 poll: got usages[0] cdcd, expected 4 ntoskrnl.c:2259: Test failed: id 0 poll: got usages[1] cdcd, expected 6 ntoskrnl.c:2265: Test failed: id 0 poll: HidP_GetUsages returned 0xc0110001 ntoskrnl.c:2266: Test failed: id 0 poll: got usage count 16, expected 2 ntoskrnl.c:2267: Test failed: id 0 poll: got usages[0] cdcd, expected 6 ntoskrnl.c:2268: Test failed: id 0 poll: got usages[1] cdcd, expected 4 ntoskrnl.c:2274: Test failed: id 0 poll: HidP_GetUsagesEx returned 0xc0110001 ntoskrnl.c:2275: Test failed: id 0 poll: got usage count 16, expected 4 ntoskrnl.c:2276: Test failed: id 0 poll: got usage_and_pages[0] UsagePage cdcd, expected 9 ntoskrnl.c:2278: Test failed: id 0 poll: got usage_and_pages[1] UsagePage cdcd, expected 9 ntoskrnl.c:2280: Test failed: id 0 poll: got usage_and_pages[2] UsagePage cdcd, expected 7 ntoskrnl.c:2282: Test failed: id 0 poll: got usage_and_pages[3] UsagePage cdcd, expected 7 ntoskrnl.c:2284: Test failed: id 0 poll: got usage_and_pages[4] UsagePage cdcd, expected 8 ntoskrnl.c:2286: Test failed: id 0 poll: got usage_and_pages[5] UsagePage cdcd, expected 8 ntoskrnl.c:2288: Test failed: id 0 poll: got usage_and_pages[0] Usage cdcd, expected 4 ntoskrnl.c:2290: Test failed: id 0 poll: got usage_and_pages[1] Usage cdcd, expected 6 ntoskrnl.c:2292: Test failed: id 0 poll: got usage_and_pages[2] Usage cdcd, expected 9 ntoskrnl.c:2294: Test failed: id 0 poll: got usage_and_pages[3] Usage cdcd, expected b ntoskrnl.c:2296: Test failed: id 0 poll: got usage_and_pages[4] Usage cdcd, expected 6 ntoskrnl.c:2298: Test failed: id 0 poll: got usage_and_pages[5] Usage cdcd, expected 4 ntoskrnl.c:2304: Test failed: id 0 poll: HidP_MaxDataListLength(HidP_Input) returned 0, expected 50 ntoskrnl.c:2308: Test failed: id 0 poll: HidP_MaxDataListLength(HidP_Feature) returned 0, expected 13 ntoskrnl.c:2312: Test failed: id 0 poll: HidP_GetData returned 0xc0110001 ntoskrnl.c:2313: Test failed: id 0 poll: got data count 1, expected 11 ntoskrnl.c:2316: Test failed: id 0 poll: HidP_GetData returned 0xc0110001 ntoskrnl.c:2320: Test failed: id 0 poll: data[1]: got DataIndex 0, expected 1 ntoskrnl.c:2320: Test failed: id 0 poll: data[2]: got DataIndex 0, expected 5 ntoskrnl.c:2321: Test failed: id 0 poll: data[2]: got RawValue 0, expected 1 ntoskrnl.c:2320: Test failed: id 0 poll: data[3]: got DataIndex 0, expected 7 ntoskrnl.c:2321: Test failed: id 0 poll: data[3]: got RawValue 0, expected 1 ntoskrnl.c:2320: Test failed: id 0 poll: data[4]: got DataIndex 0, expected 19 ntoskrnl.c:2321: Test failed: id 0 poll: data[4]: got RawValue 0, expected 1 ntoskrnl.c:2320: Test failed: id 0 poll: data[5]: got DataIndex 0, expected 21 ntoskrnl.c:2321: Test failed: id 0 poll: data[5]: got RawValue 0, expected 1 ntoskrnl.c:2320: Test failed: id 0 poll: data[6]: got DataIndex 0, expected 30 ntoskrnl.c:2320: Test failed: id 0 poll: data[7]: got DataIndex 0, expected 31 ntoskrnl.c:2320: Test failed: id 0 poll: data[8]: got DataIndex 0, expected 32 ntoskrnl.c:2321: Test failed: id 0 poll: data[8]: got RawValue 0, expected -17970434 ntoskrnl.c:2320: Test failed: id 0 poll: data[9]: got DataIndex 0, expected 37 ntoskrnl.c:2321: Test failed: id 0 poll: data[9]: got RawValue 0, expected 1 ntoskrnl.c:2320: Test failed: id 0 poll: data[10]: got DataIndex 0, expected 39 ntoskrnl.c:2321: Test failed: id 0 poll: data[10]: got RawValue 0, expected 1 ntoskrnl.c:2327: Test failed: id 0 poll: HidP_InitializeReportForID returned 0xc0110001 ntoskrnl.c:2331: Test failed: id 0 poll: HidP_InitializeReportForID returned 0xc0110001 ntoskrnl.c:2336: Test failed: id 0 poll: unexpected report data ntoskrnl.c:2354: Test failed: id 0 poll: HidP_SetUsageValue returned 0xc0110001 ntoskrnl.c:2358: Test failed: id 0 poll: HidP_SetUsageValue returned 0xc0110001 ntoskrnl.c:2363: Test failed: id 0 poll: HidP_SetUsageValue returned 0xc0110001 ntoskrnl.c:2369: Test failed: id 0 poll: HidP_SetUsageValue returned 0xc0110001 ntoskrnl.c:2373: Test failed: id 0 poll: HidP_SetUsageValue returned 0xc0110001 ntoskrnl.c:2378: Test failed: id 0 poll: HidP_SetUsageValue returned 0xc0110001 ntoskrnl.c:2385: Test failed: id 0 poll: unexpected report data ntoskrnl.c:2392: Test failed: id 0 poll: HidP_GetUsageValue returned 0xc0110001 ntoskrnl.c:2395: Test failed: id 0 poll: HidP_GetUsageValue returned 0xc0110001 ntoskrnl.c:2399: Test failed: id 0 poll: HidP_GetUsageValue returned 0xc0110001 ntoskrnl.c:2404: Test failed: id 0 poll: HidP_GetUsageValue returned 0xc0110001 ntoskrnl.c:2408: Test failed: id 0 poll: HidP_GetUsageValue returned 0xc0110001 ntoskrnl.c:2413: Test failed: id 0 poll: HidP_GetUsageValue returned 0xc0110001 ntoskrnl.c:2414: Test failed: id 0 poll: got value deadbeef, expected 0x1005 ntoskrnl.c:2420: Test failed: id 0 poll: HidP_SetUsageValueArray returned 0xc0110001 ntoskrnl.c:2423: Test failed: id 0 poll: HidP_SetUsageValueArray returned 0xc0110001 ntoskrnl.c:2424: Test failed: id 0 poll: unexpected report data ntoskrnl.c:2429: Test failed: id 0 poll: HidP_GetUsageValueArray returned 0xc0110001 ntoskrnl.c:2432: Test failed: id 0 poll: HidP_GetUsageValueArray returned 0xc0110001 ntoskrnl.c:2434: Test failed: id 0 poll: unexpected report value ntoskrnl.c:2439: Test failed: id 0 poll: HidP_InitializeReportForID returned 0xc0110001 ntoskrnl.c:2444: Test failed: id 0 poll: HidD_GetInputReport returned error 6 ntoskrnl.c:2449: Test failed: id 0 poll: HidD_GetInputReport returned error 6 ntoskrnl.c:2458: Test failed: id 0 poll: HidD_GetInputReport returned error 6 ntoskrnl.c:2469: Test failed: id 0 poll: HidD_GetInputReport failed, last error 6 ntoskrnl.c:2470: Test failed: id 0 poll: got report[0] ffffffcd, expected 00 ntoskrnl.c:2475: Test failed: id 0 poll: IOCTL_HID_GET_INPUT_REPORT failed, last error 6 ntoskrnl.c:2476: Test failed: id 0 poll: got length 46, expected 3 ntoskrnl.c:2477: Test failed: id 0 poll: got report[0] ffffffcd, expected 00 ntoskrnl.c:2482: Test failed: id 0 poll: HidP_InitializeReportForID returned 0xc0110001 ntoskrnl.c:2487: Test failed: id 0 poll: HidD_GetFeature returned error 6 ntoskrnl.c:2492: Test failed: id 0 poll: HidD_GetFeature returned error 6 ntoskrnl.c:2501: Test failed: id 0 poll: HidD_GetFeature returned error 6 ntoskrnl.c:2512: Test failed: id 0 poll: HidD_GetFeature failed, last error 6 ntoskrnl.c:2513: Test failed: id 0 poll: got report[0] ffffffcd, expected 00 ntoskrnl.c:2518: Test failed: id 0 poll: IOCTL_HID_GET_FEATURE failed, last error 6 ntoskrnl.c:2519: Test failed: id 0 poll: got length 34, expected 3 ntoskrnl.c:2520: Test failed: id 0 poll: got report[0] ffffffcd, expected 00 ntoskrnl.c:2525: Test failed: id 0 poll: HidP_InitializeReportForID returned 0xc0110001 ntoskrnl.c:2530: Test failed: id 0 poll: HidD_SetFeature returned error 6 ntoskrnl.c:2535: Test failed: id 0 poll: HidD_SetFeature returned error 6 ntoskrnl.c:2544: Test failed: id 0 poll: HidD_SetFeature returned error 6 ntoskrnl.c:2554: Test failed: id 0 poll: HidD_SetFeature failed, last error 6 ntoskrnl.c:2560: Test failed: id 0 poll: IOCTL_HID_SET_FEATURE returned error 6 ntoskrnl.c:2564: Test failed: id 0 poll: IOCTL_HID_SET_FEATURE failed, last error 6 ntoskrnl.c:2565: Test failed: id 0 poll: got length 0, expected 3 ntoskrnl.c:2570: Test failed: id 0 poll: HidP_InitializeReportForID returned 0xc0110001 ntoskrnl.c:2577: Test failed: id 0 poll: HidD_SetOutputReport returned error 6 ntoskrnl.c:2582: Test failed: id 0 poll: HidD_SetOutputReport returned error 6 ntoskrnl.c:2591: Test failed: id 0 poll: HidD_SetOutputReport returned error 6 ntoskrnl.c:2601: Test failed: id 0 poll: HidD_SetOutputReport failed, last error 6 ntoskrnl.c:2607: Test failed: id 0 poll: IOCTL_HID_SET_OUTPUT_REPORT returned error 6 ntoskrnl.c:2611: Test failed: id 0 poll: IOCTL_HID_SET_OUTPUT_REPORT failed, last error 6 ntoskrnl.c:2612: Test failed: id 0 poll: got length 0, expected 3 ntoskrnl.c:2618: Test failed: id 0 poll: WriteFile returned error 6 ntoskrnl.c:2623: Test failed: id 0 poll: WriteFile returned error 6 ntoskrnl.c:2634: Test failed: id 0 poll: WriteFile returned error 6 ntoskrnl.c:2648: Test failed: id 0 poll: WriteFile failed, last error 6 ntoskrnl.c:2649: Test failed: id 0 poll: WriteFile wrote 0 ntoskrnl.c:2656: Test failed: id 0 poll: ReadFile failed, last error 6 ntoskrnl.c:2660: Test failed: id 0 poll: ReadFile failed, last error 6 ntoskrnl.c:2668: Test failed: id 0 poll: ReadFile failed, last error 6 ntoskrnl.c:2669: Test failed: id 0 poll: ReadFile returned 0 ntoskrnl.c:2670: Test failed: id 0 poll: unexpected report data ntoskrnl.c:2679: Test failed: id 0 poll: ReadFile returned error 6 ntoskrnl: Timeout
This is again one of the pre-existing spurious failure cases. Re-running the job passes fine, as shown here:
https://testbot.winehq.org/JobDetails.pl?Key=95291
Signed-off-by: Rémi Bernon rbernon@codeweavers.com --- dlls/hid/hidp.c | 2 +- dlls/hidclass.sys/descriptor.c | 482 ++++----------------------------- dlls/hidclass.sys/device.c | 2 +- include/wine/hid.h | 31 +-- 4 files changed, 60 insertions(+), 457 deletions(-)
diff --git a/dlls/hid/hidp.c b/dlls/hid/hidp.c index a4e5afbbfcc..6259e0f56a9 100644 --- a/dlls/hid/hidp.c +++ b/dlls/hid/hidp.c @@ -169,7 +169,7 @@ NTSTATUS WINAPI HidP_GetCaps( PHIDP_PREPARSED_DATA preparsed_data, HIDP_CAPS *ca
if (preparsed->magic != HID_MAGIC) return HIDP_STATUS_INVALID_PREPARSED_DATA;
- *caps = preparsed->new_caps; + *caps = preparsed->caps; return HIDP_STATUS_SUCCESS; }
diff --git a/dlls/hidclass.sys/descriptor.c b/dlls/hidclass.sys/descriptor.c index f8bacbbbc1a..3042c0b421b 100644 --- a/dlls/hidclass.sys/descriptor.c +++ b/dlls/hidclass.sys/descriptor.c @@ -85,132 +85,15 @@ enum { TAG_LOCAL_DELIMITER };
- -static const char* const feature_string[] = - { "Input", "Output", "Feature" }; - -struct feature { - struct list entry; - HIDP_VALUE_CAPS caps; - - HIDP_REPORT_TYPE type; - BOOLEAN isData; -}; - -static const char* const collection_string[] = { - "Physical", - "Application", - "Logical", - "Report", - "Named Array", - "Usage Switch", - "Usage Modifier", -}; - -struct collection { - struct list entry; - unsigned int type; - struct collection *parent; - struct list features; - struct list collections; -}; - -static inline const char *debugstr_hidp_value_caps( HIDP_VALUE_CAPS *caps ) +static inline const char *debugstr_hid_value_caps( struct hid_value_caps *caps ) { if (!caps) return "(null)"; return wine_dbg_sprintf( "RId %d, Usg %02x:%02x-%02x Dat %02x-%02x (%d), Str %d-%d (%d), Des %d-%d (%d), " - "Bits %02x, Als %d, Abs %d, Nul %d, LCol %d LUsg %02x:%02x, BitSz %d, RCnt %d, " - "Unit %x E%+d, Log %+d-%+d, Phy %+d-%+d", - caps->ReportID, caps->UsagePage, caps->Range.UsageMin, caps->Range.UsageMax, caps->Range.DataIndexMin, caps->Range.DataIndexMax, caps->IsRange, - caps->Range.StringMin, caps->Range.StringMax, caps->IsStringRange, caps->Range.DesignatorMin, caps->Range.DesignatorMax, caps->IsDesignatorRange, - caps->BitField, caps->IsAlias, caps->IsAbsolute, caps->HasNull, caps->LinkCollection, caps->LinkUsagePage, caps->LinkUsage, caps->BitSize, caps->ReportCount, - caps->Units, caps->UnitsExp, caps->LogicalMin, caps->LogicalMax, caps->PhysicalMin, caps->PhysicalMax ); -} - -static void copy_hidp_value_caps( HIDP_VALUE_CAPS *out, const struct hid_value_caps *in ) -{ - out->UsagePage = in->usage_page; - out->ReportID = in->report_id; - out->LinkCollection = in->link_collection; - out->LinkUsagePage = in->link_usage_page; - out->LinkUsage = in->link_usage; - out->BitField = in->bit_field; - out->IsAlias = FALSE; - out->IsAbsolute = HID_VALUE_CAPS_IS_ABSOLUTE( in ); - out->HasNull = HID_VALUE_CAPS_HAS_NULL( in ); - out->BitSize = in->bit_size; - out->ReportCount = in->report_count; - out->UnitsExp = in->units_exp; - out->Units = in->units; - out->LogicalMin = in->logical_min; - out->LogicalMax = in->logical_max; - out->PhysicalMin = in->physical_min; - out->PhysicalMax = in->physical_max; - if (!(out->IsRange = in->is_range)) - out->NotRange.Usage = in->usage_min; - else - { - out->Range.UsageMin = in->usage_min; - out->Range.UsageMax = in->usage_max; - } - if (!(out->IsStringRange = in->is_string_range)) - out->NotRange.StringIndex = in->string_min; - else - { - out->Range.StringMin = in->string_min; - out->Range.StringMax = in->string_max; - } - if ((out->IsDesignatorRange = in->is_designator_range)) - out->NotRange.DesignatorIndex = in->designator_min; - else - { - out->Range.DesignatorMin = in->designator_min; - out->Range.DesignatorMax = in->designator_max; - } -} - -static void debug_feature(struct feature *feature) -{ - if (!feature) - return; - TRACE( "[Feature type %s %s]\n", feature_string[feature->type], (feature->isData) ? "Data" : "Const" ); - - TRACE("Feature %s\n", debugstr_hidp_value_caps(&feature->caps)); -} - -static void debug_collection(struct collection *collection) -{ - struct feature *fentry; - struct collection *centry; - if (TRACE_ON(hid)) - { - TRACE( "START Collection <<< %s, parent: %p, %i features, %i collections\n", - collection_string[collection->type], collection->parent, - list_count( &collection->features ), list_count( &collection->collections ) ); - LIST_FOR_EACH_ENTRY(fentry, &collection->features, struct feature, entry) - debug_feature(fentry); - LIST_FOR_EACH_ENTRY(centry, &collection->collections, struct collection, entry) - debug_collection(centry); - TRACE( ">>> END Collection\n" ); - } -} - -static void debug_print_report(const char* type, WINE_HIDP_PREPARSED_DATA *data, - WINE_HID_REPORT *report) -{ - WINE_HID_ELEMENT *elems = HID_ELEMS(data); - unsigned int i; - TRACE("START Report %i <<< %s report : bitSize: %i elementCount: %i\n", - report->reportID, - type, - report->bitSize, - report->elementCount); - for (i = 0; i < report->elementCount; i++) - { - WINE_HID_ELEMENT *elem = elems + report->elementIdx + i; - TRACE("%s: %s, StartBit %d, BitCount %d\n", type, debugstr_hidp_value_caps(&elem->caps), elem->valueStartBit, elem->bitCount); - } - TRACE(">>> END Report %i\n",report->reportID); + "Bits %02x, LCol %d LUsg %02x:%02x, BitSz %d, RCnt %d, Unit %x E%+d, Log %+d-%+d, Phy %+d-%+d", + caps->report_id, caps->usage_page, caps->usage_min, caps->usage_max, caps->data_index_min, caps->data_index_max, caps->is_range, + caps->string_min, caps->string_max, caps->is_string_range, caps->designator_min, caps->designator_max, caps->is_designator_range, + caps->bit_field, caps->link_collection, caps->link_usage_page, caps->link_usage, caps->bit_size, caps->report_count, + caps->units, caps->units_exp, caps->logical_min, caps->logical_max, caps->physical_min, caps->physical_max ); }
static void debug_print_preparsed(WINE_HIDP_PREPARSED_DATA *data) @@ -218,52 +101,29 @@ static void debug_print_preparsed(WINE_HIDP_PREPARSED_DATA *data) unsigned int i, end; if (TRACE_ON(hid)) { - TRACE("START PREPARSED Data <<< dwSize: %i Usage: %i, UsagePage: %i, " - "InputReportByteLength: %i, tOutputReportByteLength: %i, " - "FeatureReportByteLength: %i, NumberLinkCollectionNodes: %i, " - "NumberInputButtonCaps: %i, NumberInputValueCaps: %i, " - "NumberInputDataIndices: %i, NumberOutputButtonCaps: %i, " - "NumberOutputValueCaps: %i, NumberOutputDataIndices: %i, " - "NumberFeatureButtonCaps: %i, NumberFeatureValueCaps: %i, " - "NumberFeatureDataIndices: %i, reportCount[HidP_Input]: %i, " - "reportCount[HidP_Output]: %i, reportCount[HidP_Feature]: %i, " - "elementOffset: %i\n", - data->dwSize, - data->caps.Usage, - data->caps.UsagePage, - data->caps.InputReportByteLength, - data->caps.OutputReportByteLength, - data->caps.FeatureReportByteLength, - data->caps.NumberLinkCollectionNodes, - data->caps.NumberInputButtonCaps, - data->caps.NumberInputValueCaps, - data->caps.NumberInputDataIndices, - data->caps.NumberOutputButtonCaps, - data->caps.NumberOutputValueCaps, - data->caps.NumberOutputDataIndices, - data->caps.NumberFeatureButtonCaps, - data->caps.NumberFeatureValueCaps, - data->caps.NumberFeatureDataIndices, - data->reportCount[HidP_Input], - data->reportCount[HidP_Output], - data->reportCount[HidP_Feature], - data->elementOffset); - - end = data->reportCount[HidP_Input]; - for (i = 0; i < end; i++) - { - debug_print_report("INPUT", data, &data->reports[i]); - } - end += data->reportCount[HidP_Output]; - for (; i < end; i++) - { - debug_print_report("OUTPUT", data, &data->reports[i]); - } - end += data->reportCount[HidP_Feature]; - for (; i < end; i++) - { - debug_print_report("FEATURE", data, &data->reports[i]); - } + TRACE( "START PREPARSED Data <<< Usage: %i, UsagePage: %i, " + "InputReportByteLength: %i, tOutputReportByteLength: %i, " + "FeatureReportByteLength: %i, NumberLinkCollectionNodes: %i, " + "NumberInputButtonCaps: %i, NumberInputValueCaps: %i, " + "NumberInputDataIndices: %i, NumberOutputButtonCaps: %i, " + "NumberOutputValueCaps: %i, NumberOutputDataIndices: %i, " + "NumberFeatureButtonCaps: %i, NumberFeatureValueCaps: %i, " + "NumberFeatureDataIndices: %i\n", + data->caps.Usage, data->caps.UsagePage, data->caps.InputReportByteLength, + data->caps.OutputReportByteLength, data->caps.FeatureReportByteLength, + data->caps.NumberLinkCollectionNodes, data->caps.NumberInputButtonCaps, + data->caps.NumberInputValueCaps, data->caps.NumberInputDataIndices, + data->caps.NumberOutputButtonCaps, data->caps.NumberOutputValueCaps, + data->caps.NumberOutputDataIndices, data->caps.NumberFeatureButtonCaps, + data->caps.NumberFeatureValueCaps, data->caps.NumberFeatureDataIndices ); + end = data->value_caps_count[HidP_Input]; + for (i = 0; i < end; i++) TRACE( "INPUT: %s\n", debugstr_hid_value_caps( HID_INPUT_VALUE_CAPS( data ) + i ) ); + end = data->value_caps_count[HidP_Output]; + for (i = 0; i < end; i++) TRACE( "OUTPUT: %s\n", debugstr_hid_value_caps( HID_OUTPUT_VALUE_CAPS( data ) + i ) ); + end = data->value_caps_count[HidP_Feature]; + for (i = 0; i < end; i++) TRACE( "FEATURE: %s\n", debugstr_hid_value_caps( HID_FEATURE_VALUE_CAPS( data ) + i ) ); + end = data->caps.NumberLinkCollectionNodes; + for (i = 0; i < end; i++) TRACE( "COLLECTION: %s\n", debugstr_hid_value_caps( HID_COLLECTION_VALUE_CAPS( data ) + i ) ); TRACE(">>> END Preparsed Data\n"); } } @@ -450,7 +310,7 @@ static BOOL parse_end_collection( struct hid_parser_state *state ) return TRUE; }
-static BOOL parse_new_value_caps( struct hid_parser_state *state, HIDP_REPORT_TYPE type, struct collection *collection ) +static BOOL parse_new_value_caps( struct hid_parser_state *state, HIDP_REPORT_TYPE type ) { struct hid_value_caps *value; USAGE usage_page = state->items.usage_page; @@ -459,25 +319,7 @@ static BOOL parse_new_value_caps( struct hid_parser_state *state, HIDP_REPORT_TY USHORT *value_idx = state->value_idx[type]; USHORT *data_idx = state->data_idx[type]; ULONG *bit_size = &state->bit_size[type][state->items.report_id]; - struct feature *feature; BOOL is_array; - int j; - - for (j = 0; j < state->items.report_count; j++) - { - if (!(feature = calloc( 1, sizeof(*feature) ))) return -1; - list_add_tail( &collection->features, &feature->entry ); - feature->type = type; - feature->isData = ((state->items.bit_field & INPUT_DATA_CONST) == 0); - copy_hidp_value_caps( &feature->caps, &state->items ); - if (j < state->usages_size) feature->caps.NotRange.Usage = state->usages_min[j]; - feature->caps.ReportCount = 1; - if (j + 1 >= state->usages_size) - { - feature->caps.ReportCount += state->items.report_count - (j + 1); - break; - } - }
if (!*bit_size) *bit_size = 8; *bit_size += state->items.bit_size * state->items.report_count; @@ -549,24 +391,8 @@ static void free_parser_state( struct hid_parser_state *state ) free( state ); }
-static void parse_collection(unsigned int bSize, int itemVal, - struct collection *collection) -{ - if (bSize) - { - collection->type = itemVal; - - if (itemVal >= 0x07 && itemVal <= 0x7F) { - ERR(" (Reserved 0x%x )\n", itemVal); - } - else if (itemVal >= 0x80 && itemVal <= 0xFF) { - ERR(" (Vendor Defined 0x%x )\n", itemVal); - } - } -} - static int parse_descriptor( BYTE *descriptor, unsigned int index, unsigned int length, - struct collection *collection, struct hid_parser_state *state ) + struct hid_parser_state *state ) { int i; UINT32 value; @@ -601,33 +427,20 @@ static int parse_descriptor( BYTE *descriptor, unsigned int index, unsigned int switch (item & SHORT_ITEM(0xf,0x3)) { case SHORT_ITEM(TAG_MAIN_INPUT, TAG_TYPE_MAIN): - if (!parse_new_value_caps( state, HidP_Input, collection )) return -1; + if (!parse_new_value_caps( state, HidP_Input )) return -1; break; case SHORT_ITEM(TAG_MAIN_OUTPUT, TAG_TYPE_MAIN): - if (!parse_new_value_caps( state, HidP_Output, collection )) return -1; + if (!parse_new_value_caps( state, HidP_Output )) return -1; break; case SHORT_ITEM(TAG_MAIN_FEATURE, TAG_TYPE_MAIN): - if (!parse_new_value_caps( state, HidP_Feature, collection )) return -1; + if (!parse_new_value_caps( state, HidP_Feature )) return -1; break; case SHORT_ITEM(TAG_MAIN_COLLECTION, TAG_TYPE_MAIN): - { - struct collection *subcollection; - if (!(subcollection = calloc(1, sizeof(struct collection)))) return -1; - list_add_tail(&collection->collections, &subcollection->entry); - subcollection->parent = collection; - /* Only set our collection once... - We do not properly handle composite devices yet. */ - list_init(&subcollection->features); - list_init(&subcollection->collections); - parse_collection(size, value, subcollection); if (!parse_new_collection( state )) return -1; - - if ((i = parse_descriptor( descriptor, i, length, subcollection, state )) < 0) return i; - continue; - } + break; case SHORT_ITEM(TAG_MAIN_END_COLLECTION, TAG_TYPE_MAIN): if (!parse_end_collection( state )) return -1; - return i; + break;
case SHORT_ITEM(TAG_GLOBAL_USAGE_PAGE, TAG_TYPE_GLOBAL): state->items.usage_page = value; @@ -712,234 +525,68 @@ static int parse_descriptor( BYTE *descriptor, unsigned int index, unsigned int return i; }
-static void build_elements(WINE_HID_REPORT *wine_report, WINE_HID_ELEMENT *elems, - struct feature* feature, USHORT *data_index) -{ - WINE_HID_ELEMENT *wine_element = elems + wine_report->elementIdx + wine_report->elementCount; - ULONG index_count; - - if (!feature->isData) - { - wine_report->bitSize += feature->caps.BitSize * feature->caps.ReportCount; - return; - } - - wine_element->valueStartBit = wine_report->bitSize; - - wine_element->bitCount = (feature->caps.BitSize * feature->caps.ReportCount); - wine_report->bitSize += wine_element->bitCount; - - wine_element->caps = feature->caps; - - if (wine_element->caps.IsRange) - { - if (wine_element->caps.BitSize == 1) index_count = wine_element->bitCount - 1; - else index_count = wine_element->caps.Range.UsageMax - wine_element->caps.Range.UsageMin; - wine_element->caps.Range.DataIndexMin = *data_index; - wine_element->caps.Range.DataIndexMax = *data_index + index_count; - *data_index = *data_index + index_count + 1; - } - else - { - wine_element->caps.NotRange.DataIndex = *data_index; - wine_element->caps.NotRange.Reserved4 = *data_index; - *data_index = *data_index + 1; - } - - wine_report->elementCount++; -} - -static void count_elements(struct feature* feature, USHORT *buttons, USHORT *values) -{ - if (!feature->isData) - return; - - if (feature->caps.BitSize == 1) - (*buttons)++; - else - (*values)++; -} - -struct preparse_ctx -{ - int report_count[3]; - int elem_count; - int report_elem_count[3][256]; - - int elem_alloc; - BOOL report_created[3][256]; -}; - -static void create_preparse_ctx(const struct collection *base, struct preparse_ctx *ctx) -{ - struct feature *f; - struct collection *c; - - LIST_FOR_EACH_ENTRY(f, &base->features, struct feature, entry) - { - ctx->elem_count++; - ctx->report_elem_count[f->type][f->caps.ReportID]++; - if (ctx->report_elem_count[f->type][f->caps.ReportID] != 1) - continue; - ctx->report_count[f->type]++; - } - - LIST_FOR_EACH_ENTRY(c, &base->collections, struct collection, entry) - create_preparse_ctx(c, ctx); -} - -static void preparse_collection(const struct collection *root, const struct collection *base, - WINE_HIDP_PREPARSED_DATA *data, struct preparse_ctx *ctx) -{ - WINE_HID_ELEMENT *elem = HID_ELEMS(data); - struct feature *f; - struct collection *c; - - LIST_FOR_EACH_ENTRY(f, &base->features, struct feature, entry) - { - WINE_HID_REPORT *report; - - if (!ctx->report_created[f->type][f->caps.ReportID]) - { - ctx->report_created[f->type][f->caps.ReportID] = TRUE; - data->reportIdx[f->type][f->caps.ReportID] = data->reportCount[f->type]++; - if (f->type > 0) data->reportIdx[f->type][f->caps.ReportID] += ctx->report_count[0]; - if (f->type > 1) data->reportIdx[f->type][f->caps.ReportID] += ctx->report_count[1]; - - report = &data->reports[data->reportIdx[f->type][f->caps.ReportID]]; - report->reportID = f->caps.ReportID; - /* Room for the reportID */ - report->bitSize = 8; - report->elementIdx = ctx->elem_alloc; - ctx->elem_alloc += ctx->report_elem_count[f->type][f->caps.ReportID]; - } - - report = &data->reports[data->reportIdx[f->type][f->caps.ReportID]]; - switch (f->type) - { - case HidP_Input: - build_elements(report, elem, f, &data->caps.NumberInputDataIndices); - count_elements(f, &data->caps.NumberInputButtonCaps, &data->caps.NumberInputValueCaps); - break; - case HidP_Output: - build_elements(report, elem, f, &data->caps.NumberOutputDataIndices); - count_elements(f, &data->caps.NumberOutputButtonCaps, &data->caps.NumberOutputValueCaps); - break; - case HidP_Feature: - build_elements(report, elem, f, &data->caps.NumberFeatureDataIndices); - count_elements(f, &data->caps.NumberFeatureButtonCaps, &data->caps.NumberFeatureValueCaps); - break; - } - } - - LIST_FOR_EACH_ENTRY(c, &base->collections, struct collection, entry) - preparse_collection(root, c, data, ctx); -} - -static WINE_HIDP_PREPARSED_DATA *build_preparsed_data( struct collection *base_collection, - struct hid_parser_state *state ) +static WINE_HIDP_PREPARSED_DATA *build_preparsed_data( struct hid_parser_state *state ) { WINE_HIDP_PREPARSED_DATA *data; struct hid_value_caps *caps; - unsigned int report_count; - unsigned int size; - DWORD i, button, filler, caps_len, caps_off; - - struct preparse_ctx ctx; - unsigned int element_off; - - memset(&ctx, 0, sizeof(ctx)); - create_preparse_ctx(base_collection, &ctx); - - report_count = ctx.report_count[HidP_Input] + ctx.report_count[HidP_Output] - + ctx.report_count[HidP_Feature]; - element_off = FIELD_OFFSET(WINE_HIDP_PREPARSED_DATA, reports[report_count]); - size = element_off + (ctx.elem_count * sizeof(WINE_HID_ELEMENT)); + DWORD i, button, filler, caps_len, size;
caps_len = state->caps.NumberInputValueCaps + state->caps.NumberOutputValueCaps + state->caps.NumberFeatureValueCaps + state->caps.NumberLinkCollectionNodes; - caps_off = size; - size += caps_len * sizeof(*caps); + size = FIELD_OFFSET( WINE_HIDP_PREPARSED_DATA, value_caps[caps_len] );
if (!(data = calloc(1, size))) return NULL; data->magic = HID_MAGIC; data->dwSize = size; data->caps = state->caps; - data->new_caps = state->caps; - data->elementOffset = element_off; - - data->value_caps_offset = caps_off; data->value_caps_count[HidP_Input] = state->caps.NumberInputValueCaps; data->value_caps_count[HidP_Output] = state->caps.NumberOutputValueCaps; data->value_caps_count[HidP_Feature] = state->caps.NumberFeatureValueCaps;
- data->caps.NumberInputValueCaps = data->caps.NumberInputButtonCaps = data->caps.NumberInputDataIndices = 0; - data->caps.NumberOutputValueCaps = data->caps.NumberOutputButtonCaps = data->caps.NumberOutputDataIndices = 0; - data->caps.NumberFeatureValueCaps = data->caps.NumberFeatureButtonCaps = data->caps.NumberFeatureDataIndices = 0; - preparse_collection(base_collection, base_collection, data, &ctx); - /* fixup value vs button vs filler counts */
caps = HID_INPUT_VALUE_CAPS( data ); - memcpy( caps, state->values[0], data->new_caps.NumberInputValueCaps * sizeof(*caps) ); - for (i = 0, button = 0, filler = 0; i < data->new_caps.NumberInputValueCaps; ++i) + memcpy( caps, state->values[0], data->caps.NumberInputValueCaps * sizeof(*caps) ); + for (i = 0, button = 0, filler = 0; i < data->caps.NumberInputValueCaps; ++i) { if (!caps[i].usage_min && !caps[i].usage_max) filler++; else if (HID_VALUE_CAPS_IS_BUTTON( caps + i )) button++; } - data->new_caps.NumberInputButtonCaps = button; - data->new_caps.NumberInputValueCaps -= filler + button; + data->caps.NumberInputButtonCaps = button; + data->caps.NumberInputValueCaps -= filler + button;
caps = HID_OUTPUT_VALUE_CAPS( data ); - memcpy( caps, state->values[1], data->new_caps.NumberOutputValueCaps * sizeof(*caps) ); - for (i = 0, button = 0, filler = 0; i < data->new_caps.NumberOutputValueCaps; ++i) + memcpy( caps, state->values[1], data->caps.NumberOutputValueCaps * sizeof(*caps) ); + for (i = 0, button = 0, filler = 0; i < data->caps.NumberOutputValueCaps; ++i) { if (!caps[i].usage_min && !caps[i].usage_max) filler++; else if (HID_VALUE_CAPS_IS_BUTTON( caps + i )) button++; } - caps += data->new_caps.NumberOutputValueCaps; - data->new_caps.NumberOutputButtonCaps = button; - data->new_caps.NumberOutputValueCaps -= filler + button; + caps += data->caps.NumberOutputValueCaps; + data->caps.NumberOutputButtonCaps = button; + data->caps.NumberOutputValueCaps -= filler + button;
caps = HID_FEATURE_VALUE_CAPS( data ); - memcpy( caps, state->values[2], data->new_caps.NumberFeatureValueCaps * sizeof(*caps) ); - for (i = 0, button = 0, filler = 0; i < data->new_caps.NumberFeatureValueCaps; ++i) + memcpy( caps, state->values[2], data->caps.NumberFeatureValueCaps * sizeof(*caps) ); + for (i = 0, button = 0, filler = 0; i < data->caps.NumberFeatureValueCaps; ++i) { if (!caps[i].usage_min && !caps[i].usage_max) filler++; else if (HID_VALUE_CAPS_IS_BUTTON( caps + i )) button++; } - caps += data->new_caps.NumberFeatureValueCaps; - data->new_caps.NumberFeatureButtonCaps = button; - data->new_caps.NumberFeatureValueCaps -= filler + button; + caps += data->caps.NumberFeatureValueCaps; + data->caps.NumberFeatureButtonCaps = button; + data->caps.NumberFeatureValueCaps -= filler + button;
caps = HID_COLLECTION_VALUE_CAPS( data ); - memcpy( caps, state->collections, data->new_caps.NumberLinkCollectionNodes * sizeof(*caps) ); + memcpy( caps, state->collections, data->caps.NumberLinkCollectionNodes * sizeof(*caps) );
return data; }
-static void free_collection(struct collection *collection) -{ - struct feature *fentry, *fnext; - struct collection *centry, *cnext; - LIST_FOR_EACH_ENTRY_SAFE(centry, cnext, &collection->collections, struct collection, entry) - { - list_remove(¢ry->entry); - free_collection(centry); - } - LIST_FOR_EACH_ENTRY_SAFE(fentry, fnext, &collection->features, struct feature, entry) - { - list_remove(&fentry->entry); - free(fentry); - } - free(collection); -} - WINE_HIDP_PREPARSED_DATA* ParseDescriptor(BYTE *descriptor, unsigned int length) { WINE_HIDP_PREPARSED_DATA *data = NULL; struct hid_parser_state *state; - struct collection *base; int i;
if (TRACE_ON(hid)) @@ -954,27 +601,10 @@ WINE_HIDP_PREPARSED_DATA* ParseDescriptor(BYTE *descriptor, unsigned int length) }
if (!(state = calloc( 1, sizeof(*state) ))) return NULL; - if (!(base = calloc( 1, sizeof(*base) ))) - { - free( state ); - return NULL; - } - list_init(&base->features); - list_init(&base->collections); init_parser_state( state );
- if (parse_descriptor( descriptor, 0, length, base, state ) < 0) - { - free_collection(base); - free_parser_state( state ); - return NULL; - } - - debug_collection(base); - - if ((data = build_preparsed_data( base, state ))) - debug_print_preparsed(data); - free_collection(base); + if (parse_descriptor( descriptor, 0, length, state ) >= 0 && (data = build_preparsed_data( state ))) + debug_print_preparsed( data );
free_parser_state( state ); return data; diff --git a/dlls/hidclass.sys/device.c b/dlls/hidclass.sys/device.c index 8c0883bbec4..1990142f955 100644 --- a/dlls/hidclass.sys/device.c +++ b/dlls/hidclass.sys/device.c @@ -301,7 +301,7 @@ static void handle_minidriver_string( BASE_DEVICE_EXTENSION *ext, IRP *irp, SHOR
static void hid_device_xfer_report( BASE_DEVICE_EXTENSION *ext, ULONG code, IRP *irp ) { - const WINE_HIDP_PREPARSED_DATA *preparsed = ext->u.pdo.preparsed_data; + WINE_HIDP_PREPARSED_DATA *preparsed = ext->u.pdo.preparsed_data; IO_STACK_LOCATION *stack = IoGetCurrentIrpStackLocation( irp ); struct hid_value_caps *caps = NULL, *caps_end = NULL; ULONG report_len = 0, buffer_len = 0; diff --git a/include/wine/hid.h b/include/wine/hid.h index ade9681ab7d..2bb26ff280e 100644 --- a/include/wine/hid.h +++ b/include/wine/hid.h @@ -31,13 +31,6 @@
#define HID_MAGIC 0x8491759
-typedef struct __WINE_ELEMENT -{ - UINT valueStartBit; - UINT bitCount; - HIDP_VALUE_CAPS caps; -} WINE_HID_ELEMENT; - struct hid_value_caps { USAGE usage_page; @@ -74,36 +67,16 @@ struct hid_value_caps #define HID_VALUE_CAPS_IS_ARRAY(c) (((c)->bit_field & 2) == 0) #define HID_VALUE_CAPS_IS_BUTTON(c) ((c)->bit_size == 1 || HID_VALUE_CAPS_IS_ARRAY(c))
-typedef struct __WINE_HID_REPORT -{ - UCHAR reportID; - DWORD bitSize; - DWORD elementCount; - DWORD elementIdx; -} WINE_HID_REPORT; - typedef struct __WINE_HIDP_PREPARSED_DATA { DWORD magic; DWORD dwSize; HIDP_CAPS caps; - HIDP_CAPS new_caps; - - DWORD elementOffset; - DWORD reportCount[3]; - BYTE reportIdx[3][256]; - - DWORD value_caps_offset; USHORT value_caps_count[3]; - WINE_HID_REPORT reports[1]; + struct hid_value_caps value_caps[1]; } WINE_HIDP_PREPARSED_DATA, *PWINE_HIDP_PREPARSED_DATA;
-#define HID_INPUT_REPORTS(d) ((d)->reports) -#define HID_OUTPUT_REPORTS(d) ((d)->reports + (d)->reportCount[0]) -#define HID_FEATURE_REPORTS(d) ((d)->reports + (d)->reportCount[0] + (d)->reportCount[1]) -#define HID_ELEMS(d) ((WINE_HID_ELEMENT*)((BYTE*)(d) + (d)->elementOffset)) - -#define HID_INPUT_VALUE_CAPS(d) ((struct hid_value_caps*)((char *)(d) + (d)->value_caps_offset)) +#define HID_INPUT_VALUE_CAPS(d) ((d)->value_caps) #define HID_OUTPUT_VALUE_CAPS(d) (HID_INPUT_VALUE_CAPS(d) + (d)->value_caps_count[0]) #define HID_FEATURE_VALUE_CAPS(d) (HID_OUTPUT_VALUE_CAPS(d) + (d)->value_caps_count[1]) #define HID_COLLECTION_VALUE_CAPS(d) (HID_FEATURE_VALUE_CAPS(d) + (d)->value_caps_count[2])
Signed-off-by: Rémi Bernon rbernon@codeweavers.com --- dlls/hidclass.sys/descriptor.c | 116 ++++++++++++++++----------------- 1 file changed, 58 insertions(+), 58 deletions(-)
diff --git a/dlls/hidclass.sys/descriptor.c b/dlls/hidclass.sys/descriptor.c index 3042c0b421b..7375f3d3214 100644 --- a/dlls/hidclass.sys/descriptor.c +++ b/dlls/hidclass.sys/descriptor.c @@ -391,6 +391,64 @@ static void free_parser_state( struct hid_parser_state *state ) free( state ); }
+static WINE_HIDP_PREPARSED_DATA *build_preparsed_data( struct hid_parser_state *state ) +{ + WINE_HIDP_PREPARSED_DATA *data; + struct hid_value_caps *caps; + DWORD i, button, filler, caps_len, size; + + caps_len = state->caps.NumberInputValueCaps + state->caps.NumberOutputValueCaps + + state->caps.NumberFeatureValueCaps + state->caps.NumberLinkCollectionNodes; + size = FIELD_OFFSET( WINE_HIDP_PREPARSED_DATA, value_caps[caps_len] ); + + if (!(data = calloc( 1, size ))) return NULL; + data->magic = HID_MAGIC; + data->dwSize = size; + data->caps = state->caps; + data->value_caps_count[HidP_Input] = state->caps.NumberInputValueCaps; + data->value_caps_count[HidP_Output] = state->caps.NumberOutputValueCaps; + data->value_caps_count[HidP_Feature] = state->caps.NumberFeatureValueCaps; + + /* fixup value vs button vs filler counts */ + + caps = HID_INPUT_VALUE_CAPS( data ); + memcpy( caps, state->values[0], data->caps.NumberInputValueCaps * sizeof(*caps) ); + for (i = 0, button = 0, filler = 0; i < data->caps.NumberInputValueCaps; ++i) + { + if (!caps[i].usage_min && !caps[i].usage_max) filler++; + else if (HID_VALUE_CAPS_IS_BUTTON( caps + i )) button++; + } + data->caps.NumberInputButtonCaps = button; + data->caps.NumberInputValueCaps -= filler + button; + + caps = HID_OUTPUT_VALUE_CAPS( data ); + memcpy( caps, state->values[1], data->caps.NumberOutputValueCaps * sizeof(*caps) ); + for (i = 0, button = 0, filler = 0; i < data->caps.NumberOutputValueCaps; ++i) + { + if (!caps[i].usage_min && !caps[i].usage_max) filler++; + else if (HID_VALUE_CAPS_IS_BUTTON( caps + i )) button++; + } + caps += data->caps.NumberOutputValueCaps; + data->caps.NumberOutputButtonCaps = button; + data->caps.NumberOutputValueCaps -= filler + button; + + caps = HID_FEATURE_VALUE_CAPS( data ); + memcpy( caps, state->values[2], data->caps.NumberFeatureValueCaps * sizeof(*caps) ); + for (i = 0, button = 0, filler = 0; i < data->caps.NumberFeatureValueCaps; ++i) + { + if (!caps[i].usage_min && !caps[i].usage_max) filler++; + else if (HID_VALUE_CAPS_IS_BUTTON( caps + i )) button++; + } + caps += data->caps.NumberFeatureValueCaps; + data->caps.NumberFeatureButtonCaps = button; + data->caps.NumberFeatureValueCaps -= filler + button; + + caps = HID_COLLECTION_VALUE_CAPS( data ); + memcpy( caps, state->collections, data->caps.NumberLinkCollectionNodes * sizeof(*caps) ); + + return data; +} + static int parse_descriptor( BYTE *descriptor, unsigned int index, unsigned int length, struct hid_parser_state *state ) { @@ -525,64 +583,6 @@ static int parse_descriptor( BYTE *descriptor, unsigned int index, unsigned int return i; }
-static WINE_HIDP_PREPARSED_DATA *build_preparsed_data( struct hid_parser_state *state ) -{ - WINE_HIDP_PREPARSED_DATA *data; - struct hid_value_caps *caps; - DWORD i, button, filler, caps_len, size; - - caps_len = state->caps.NumberInputValueCaps + state->caps.NumberOutputValueCaps + - state->caps.NumberFeatureValueCaps + state->caps.NumberLinkCollectionNodes; - size = FIELD_OFFSET( WINE_HIDP_PREPARSED_DATA, value_caps[caps_len] ); - - if (!(data = calloc(1, size))) return NULL; - data->magic = HID_MAGIC; - data->dwSize = size; - data->caps = state->caps; - data->value_caps_count[HidP_Input] = state->caps.NumberInputValueCaps; - data->value_caps_count[HidP_Output] = state->caps.NumberOutputValueCaps; - data->value_caps_count[HidP_Feature] = state->caps.NumberFeatureValueCaps; - - /* fixup value vs button vs filler counts */ - - caps = HID_INPUT_VALUE_CAPS( data ); - memcpy( caps, state->values[0], data->caps.NumberInputValueCaps * sizeof(*caps) ); - for (i = 0, button = 0, filler = 0; i < data->caps.NumberInputValueCaps; ++i) - { - if (!caps[i].usage_min && !caps[i].usage_max) filler++; - else if (HID_VALUE_CAPS_IS_BUTTON( caps + i )) button++; - } - data->caps.NumberInputButtonCaps = button; - data->caps.NumberInputValueCaps -= filler + button; - - caps = HID_OUTPUT_VALUE_CAPS( data ); - memcpy( caps, state->values[1], data->caps.NumberOutputValueCaps * sizeof(*caps) ); - for (i = 0, button = 0, filler = 0; i < data->caps.NumberOutputValueCaps; ++i) - { - if (!caps[i].usage_min && !caps[i].usage_max) filler++; - else if (HID_VALUE_CAPS_IS_BUTTON( caps + i )) button++; - } - caps += data->caps.NumberOutputValueCaps; - data->caps.NumberOutputButtonCaps = button; - data->caps.NumberOutputValueCaps -= filler + button; - - caps = HID_FEATURE_VALUE_CAPS( data ); - memcpy( caps, state->values[2], data->caps.NumberFeatureValueCaps * sizeof(*caps) ); - for (i = 0, button = 0, filler = 0; i < data->caps.NumberFeatureValueCaps; ++i) - { - if (!caps[i].usage_min && !caps[i].usage_max) filler++; - else if (HID_VALUE_CAPS_IS_BUTTON( caps + i )) button++; - } - caps += data->caps.NumberFeatureValueCaps; - data->caps.NumberFeatureButtonCaps = button; - data->caps.NumberFeatureValueCaps -= filler + button; - - caps = HID_COLLECTION_VALUE_CAPS( data ); - memcpy( caps, state->collections, data->caps.NumberLinkCollectionNodes * sizeof(*caps) ); - - return data; -} - WINE_HIDP_PREPARSED_DATA* ParseDescriptor(BYTE *descriptor, unsigned int length) { WINE_HIDP_PREPARSED_DATA *data = NULL;
Signed-off-by: Rémi Bernon rbernon@codeweavers.com --- dlls/hidclass.sys/descriptor.c | 91 +++++++++++++++------------------- dlls/hidclass.sys/hid.h | 2 +- dlls/hidclass.sys/pnp.c | 2 +- 3 files changed, 43 insertions(+), 52 deletions(-)
diff --git a/dlls/hidclass.sys/descriptor.c b/dlls/hidclass.sys/descriptor.c index 7375f3d3214..f8a26d87c9f 100644 --- a/dlls/hidclass.sys/descriptor.c +++ b/dlls/hidclass.sys/descriptor.c @@ -449,55 +449,68 @@ static WINE_HIDP_PREPARSED_DATA *build_preparsed_data( struct hid_parser_state * return data; }
-static int parse_descriptor( BYTE *descriptor, unsigned int index, unsigned int length, - struct hid_parser_state *state ) +WINE_HIDP_PREPARSED_DATA *parse_descriptor( BYTE *descriptor, unsigned int length ) { - int i; - UINT32 value; + WINE_HIDP_PREPARSED_DATA *data = NULL; + struct hid_parser_state *state; + UINT32 size, value; INT32 signed_value; + BYTE *ptr, *end; + int i;
- for (i = index; i < length;) + if (TRACE_ON( hid )) { - BYTE item = descriptor[i++]; - int size = item & 0x03; + TRACE( "descriptor %p, length %u:\n", descriptor, length ); + for (i = 0; i < length;) + { + TRACE( "%08x ", i ); + do { TRACE( " %02x", descriptor[i] ); } while (++i % 16 && i < length); + TRACE( "\n" ); + } + } + + if (!(state = calloc( 1, sizeof(*state) ))) return NULL; + init_parser_state( state );
+ for (ptr = descriptor, end = descriptor + length; ptr != end; ptr += size + 1) + { + size = (*ptr & 0x03); if (size == 3) size = 4; - if (length - i < size) + if (ptr + size > end) { ERR("Need %d bytes to read item value\n", size); - return -1; + goto done; }
if (size == 0) signed_value = value = 0; - else if (size == 1) signed_value = (INT8)(value = *(UINT8 *)(descriptor + i)); - else if (size == 2) signed_value = (INT16)(value = *(UINT16 *)(descriptor + i)); - else if (size == 4) signed_value = (INT32)(value = *(UINT32 *)(descriptor + i)); + else if (size == 1) signed_value = (INT8)(value = *(UINT8 *)(ptr + 1)); + else if (size == 2) signed_value = (INT16)(value = *(UINT16 *)(ptr + 1)); + else if (size == 4) signed_value = (INT32)(value = *(UINT32 *)(ptr + 1)); else { ERR("Unexpected item value size %d.\n", size); - return -1; + goto done; } - i += size;
state->items.bit_field = value;
#define SHORT_ITEM(tag,type) (((tag)<<4)|((type)<<2)) - switch (item & SHORT_ITEM(0xf,0x3)) + switch (*ptr & SHORT_ITEM(0xf,0x3)) { case SHORT_ITEM(TAG_MAIN_INPUT, TAG_TYPE_MAIN): - if (!parse_new_value_caps( state, HidP_Input )) return -1; + if (!parse_new_value_caps( state, HidP_Input )) goto done; break; case SHORT_ITEM(TAG_MAIN_OUTPUT, TAG_TYPE_MAIN): - if (!parse_new_value_caps( state, HidP_Output )) return -1; + if (!parse_new_value_caps( state, HidP_Output )) goto done; break; case SHORT_ITEM(TAG_MAIN_FEATURE, TAG_TYPE_MAIN): - if (!parse_new_value_caps( state, HidP_Feature )) return -1; + if (!parse_new_value_caps( state, HidP_Feature )) goto done; break; case SHORT_ITEM(TAG_MAIN_COLLECTION, TAG_TYPE_MAIN): - if (!parse_new_collection( state )) return -1; + if (!parse_new_collection( state )) goto done; break; case SHORT_ITEM(TAG_MAIN_END_COLLECTION, TAG_TYPE_MAIN): - if (!parse_end_collection( state )) return -1; + if (!parse_end_collection( state )) goto done; break;
case SHORT_ITEM(TAG_GLOBAL_USAGE_PAGE, TAG_TYPE_GLOBAL): @@ -531,14 +544,14 @@ static int parse_descriptor( BYTE *descriptor, unsigned int index, unsigned int state->items.report_count = value; break; case SHORT_ITEM(TAG_GLOBAL_PUSH, TAG_TYPE_GLOBAL): - if (!parse_global_push( state )) return -1; + if (!parse_global_push( state )) goto done; break; case SHORT_ITEM(TAG_GLOBAL_POP, TAG_TYPE_GLOBAL): - if (!parse_global_pop( state )) return -1; + if (!parse_global_pop( state )) goto done; break;
case SHORT_ITEM(TAG_LOCAL_USAGE, TAG_TYPE_LOCAL): - if (!parse_local_usage( state, value >> 16, value & 0xffff )) return -1; + if (!parse_local_usage( state, value >> 16, value & 0xffff )) goto done; break; case SHORT_ITEM(TAG_LOCAL_USAGE_MINIMUM, TAG_TYPE_LOCAL): parse_local_usage_min( state, value >> 16, value & 0xffff ); @@ -572,40 +585,18 @@ static int parse_descriptor( BYTE *descriptor, unsigned int index, unsigned int break; case SHORT_ITEM(TAG_LOCAL_DELIMITER, TAG_TYPE_LOCAL): FIXME("delimiter %d not implemented!\n", value); - return -1; + goto done;
default: - FIXME("item type %x not implemented!\n", item); - return -1; + FIXME( "item type %x not implemented!\n", *ptr ); + goto done; } #undef SHORT_ITEM } - return i; -} - -WINE_HIDP_PREPARSED_DATA* ParseDescriptor(BYTE *descriptor, unsigned int length) -{ - WINE_HIDP_PREPARSED_DATA *data = NULL; - struct hid_parser_state *state; - int i; - - if (TRACE_ON(hid)) - { - TRACE("descriptor %p, length %u:\n", descriptor, length); - for (i = 0; i < length;) - { - TRACE("%08x ", i); - do { TRACE(" %02x", descriptor[i]); } while (++i % 16 && i < length); - TRACE("\n"); - } - } - - if (!(state = calloc( 1, sizeof(*state) ))) return NULL; - init_parser_state( state );
- if (parse_descriptor( descriptor, 0, length, state ) >= 0 && (data = build_preparsed_data( state ))) - debug_print_preparsed( data ); + if ((data = build_preparsed_data( state ))) debug_print_preparsed( data );
+done: free_parser_state( state ); return data; } diff --git a/dlls/hidclass.sys/hid.h b/dlls/hidclass.sys/hid.h index f0982d508e3..c00f014bb2c 100644 --- a/dlls/hidclass.sys/hid.h +++ b/dlls/hidclass.sys/hid.h @@ -123,4 +123,4 @@ NTSTATUS WINAPI pdo_create(DEVICE_OBJECT *device, IRP *irp) DECLSPEC_HIDDEN; NTSTATUS WINAPI pdo_close(DEVICE_OBJECT *device, IRP *irp) DECLSPEC_HIDDEN;
/* Parsing HID Report Descriptors into preparsed data */ -WINE_HIDP_PREPARSED_DATA* ParseDescriptor(BYTE *descriptor, unsigned int length) DECLSPEC_HIDDEN; +WINE_HIDP_PREPARSED_DATA *parse_descriptor( BYTE *descriptor, unsigned int length ) DECLSPEC_HIDDEN; diff --git a/dlls/hidclass.sys/pnp.c b/dlls/hidclass.sys/pnp.c index e5a38dafc1c..d792e5d3ddd 100644 --- a/dlls/hidclass.sys/pnp.c +++ b/dlls/hidclass.sys/pnp.c @@ -251,7 +251,7 @@ static void create_child(minidriver *minidriver, DEVICE_OBJECT *fdo) return; }
- pdo_ext->u.pdo.preparsed_data = ParseDescriptor(reportDescriptor, descriptor.DescriptorList[i].wReportLength); + pdo_ext->u.pdo.preparsed_data = parse_descriptor( reportDescriptor, descriptor.DescriptorList[i].wReportLength ); free(reportDescriptor); if (!pdo_ext->u.pdo.preparsed_data) {