Commit Graph

789 Commits

Author SHA1 Message Date
Alex Henrie c5c9c58974 ntoskrnl: Add MmGetPhysicalAddress semi-stub.
Wine-Bug: https://bugs.winehq.org/show_bug.cgi?id=47047
Signed-off-by: Alex Henrie <alexhenrie24@gmail.com>
Signed-off-by: Alexandre Julliard <julliard@winehq.org>
2021-08-10 19:58:31 +02:00
Rémi Bernon ae01a6f6ad ntoskrnl.exe/tests: Restore default mute threshold.
Signed-off-by: Rémi Bernon <rbernon@codeweavers.com>
Signed-off-by: Alexandre Julliard <julliard@winehq.org>
2021-08-10 17:53:55 +02:00
Rémi Bernon 3a3e0ed2e9 hidclass.sys: Create separate report queue for each opened handle.
Signed-off-by: Rémi Bernon <rbernon@codeweavers.com>
Signed-off-by: Alexandre Julliard <julliard@winehq.org>
2021-08-10 17:53:55 +02:00
Rémi Bernon 94e5945102 hidclass.sys: Rewrite IOCTL_HID_WRITE_REPORT using hid_device_xfer_report.
Signed-off-by: Rémi Bernon <rbernon@codeweavers.com>
Signed-off-by: Alexandre Julliard <julliard@winehq.org>
2021-08-09 11:41:45 +02:00
Rémi Bernon e653a2e0b3 hidclass.sys: Validate report IDs in hid_device_xfer_report.
Signed-off-by: Rémi Bernon <rbernon@codeweavers.com>
Signed-off-by: Alexandre Julliard <julliard@winehq.org>
2021-08-09 11:41:36 +02:00
Rémi Bernon 3708bae09b hidclass.sys: Use hid_device_xfer_report for IOCTL_HID_SET_FEATURE.
Signed-off-by: Rémi Bernon <rbernon@codeweavers.com>
Signed-off-by: Alexandre Julliard <julliard@winehq.org>
2021-08-06 19:59:47 +02:00
Rémi Bernon 25409b899c hidclass.sys: Return STATUS_INVALID_USER_BUFFER if buffer_len is 0.
Signed-off-by: Rémi Bernon <rbernon@codeweavers.com>
Signed-off-by: Alexandre Julliard <julliard@winehq.org>
2021-08-06 19:59:44 +02:00
Rémi Bernon 98c512e026 hidclass.sys: Pass sizeof(packet) as input for IOCTL_HID_SET_OUTPUT_REPORT.
Signed-off-by: Rémi Bernon <rbernon@codeweavers.com>
Signed-off-by: Alexandre Julliard <julliard@winehq.org>
2021-08-06 19:59:41 +02:00
Rémi Bernon ada3ec64a6 hidclass.sys: Use hid_device_xfer_report for IOCTL_HID_SET_OUTPUT_REPORT.
Signed-off-by: Rémi Bernon <rbernon@codeweavers.com>
Signed-off-by: Alexandre Julliard <julliard@winehq.org>
2021-08-06 19:59:37 +02:00
Rémi Bernon a2c902e68d ntoskrnl.exe/tests: Wait for second report first.
And increasing the polling period, so that first queued read is unlikely
to complete before we queued the second one.

This was meant to test that all pending reads are satisfied at once
after a poll, but it causes some spurious failures as they aren't
satisfied atomically (especially on Wine). As there's an increasing seq
counter in each poll it should be enough to compare the report data.

Signed-off-by: Rémi Bernon <rbernon@codeweavers.com>
Signed-off-by: Alexandre Julliard <julliard@winehq.org>
2021-08-06 19:59:31 +02:00
Rémi Bernon 6fd356e009 hidclass.sys: Introduce new hid_device_xfer_report helper.
From HID_IOCTL_GET_INPUT_REPORT code, to factor report buffer transfer,
and use it for HID_IOCTL_GET_FEATURE.

Signed-off-by: Rémi Bernon <rbernon@codeweavers.com>
Signed-off-by: Alexandre Julliard <julliard@winehq.org>
2021-08-05 23:11:23 +02:00
Rémi Bernon 1f3fdb3cb6 hidclass.sys: Adjust buffer length according to report IDs usage.
Signed-off-by: Rémi Bernon <rbernon@codeweavers.com>
Signed-off-by: Alexandre Julliard <julliard@winehq.org>
2021-08-05 23:11:23 +02:00
Rémi Bernon e8c6f13071 hidclass.sys: Always copy InputReportByteLength bytes into read buffer.
Signed-off-by: Rémi Bernon <rbernon@codeweavers.com>
Signed-off-by: Alexandre Julliard <julliard@winehq.org>
2021-08-05 23:11:23 +02:00
Rémi Bernon ecf6a16b8e hidclass.sys: Return irp->IoStatus.Information from minidriver.
Signed-off-by: Rémi Bernon <rbernon@codeweavers.com>
Signed-off-by: Alexandre Julliard <julliard@winehq.org>
2021-08-04 21:48:28 +02:00
Rémi Bernon a8ab0fe08f hidclass.sys: Return STATUS_INVALID_PARAMETER when appropriate.
Instead of STATUS_BUFFER_TOO_SMALL when input report buffer length is
less than InputReportByteLength.

Signed-off-by: Rémi Bernon <rbernon@codeweavers.com>
Signed-off-by: Alexandre Julliard <julliard@winehq.org>
2021-08-04 21:48:28 +02:00
Rémi Bernon 9c5ab964e9 hidclass.sys: Return STATUS_INVALID_USER_BUFFER when appropriate.
Signed-off-by: Rémi Bernon <rbernon@codeweavers.com>
Signed-off-by: Alexandre Julliard <julliard@winehq.org>
2021-08-04 21:48:28 +02:00
Rémi Bernon 7096c26a2e hidclass.sys: Implement button array value caps.
Signed-off-by: Rémi Bernon <rbernon@codeweavers.com>
Signed-off-by: Alexandre Julliard <julliard@winehq.org>
2021-08-04 21:48:28 +02:00
Rémi Bernon 76b4d09afd ntoskrnl.exe/tests: Add some tests with concurrent reads in polled mode.
Signed-off-by: Rémi Bernon <rbernon@codeweavers.com>
Signed-off-by: Alexandre Julliard <julliard@winehq.org>
2021-08-02 22:59:23 +02:00
Rémi Bernon 80fa6850d6 ntoskrnl.exe/tests: Add some IOCTL_HID_(GET|SET)_POLL_FREQUENCY_MSEC tests.
Signed-off-by: Rémi Bernon <rbernon@codeweavers.com>
Signed-off-by: Alexandre Julliard <julliard@winehq.org>
2021-08-02 22:59:23 +02:00
Rémi Bernon 3eb8c6cd4d hidclass.sys: Set IoStatus.Information in IOCTL_GET_NUM_DEVICE_INPUT_BUFFERS.
Signed-off-by: Rémi Bernon <rbernon@codeweavers.com>
Signed-off-by: Alexandre Julliard <julliard@winehq.org>
2021-08-02 22:59:23 +02:00
Rémi Bernon 5e57887bca ntoskrnl.exe/tests: Add some HidD_(Get|Set)NumInputBuffers tests.
Signed-off-by: Rémi Bernon <rbernon@codeweavers.com>
Signed-off-by: Alexandre Julliard <julliard@winehq.org>
2021-08-02 22:59:23 +02:00
Rémi Bernon e9c3dc02e8 ntoskrnl.exe/tests: Don't close HID device file twice.
Signed-off-by: Rémi Bernon <rbernon@codeweavers.com>
Signed-off-by: Alexandre Julliard <julliard@winehq.org>
2021-08-02 22:59:23 +02:00
Rémi Bernon be09039646 ntoskrnl.exe/tests: Return success from IOCTL_HID_GET_STRING.
Signed-off-by: Rémi Bernon <rbernon@codeweavers.com>
Signed-off-by: Alexandre Julliard <julliard@winehq.org>
2021-08-02 22:59:23 +02:00
Rémi Bernon 2a7b714471 ntoskrnl.exe/tests: Reduce todo_wine test verbosity.
Reducing the failure message and mute driver todos after first failure.

Signed-off-by: Rémi Bernon <rbernon@codeweavers.com>
Signed-off-by: Alexandre Julliard <julliard@winehq.org>
2021-08-02 22:59:23 +02:00
Rémi Bernon f24c8c75fe ntoskrnl.exe/tests: Add some IOCTL_HID_READ_REPORT tests.
Signed-off-by: Rémi Bernon <rbernon@codeweavers.com>
Signed-off-by: Zebediah Figura <zfigura@codeweavers.com>
Signed-off-by: Alexandre Julliard <julliard@winehq.org>
2021-07-06 17:48:55 +02:00
Rémi Bernon d9d982df86 ntoskrnl.exe/tests: Add some IOCTL_HID_WRITE_REPORT tests.
Signed-off-by: Rémi Bernon <rbernon@codeweavers.com>
Signed-off-by: Zebediah Figura <zfigura@codeweavers.com>
Signed-off-by: Alexandre Julliard <julliard@winehq.org>
2021-07-06 17:48:50 +02:00
Rémi Bernon e63bd6db23 ntoskrnl.exe/tests: Add HID driver test in polled mode.
Signed-off-by: Rémi Bernon <rbernon@codeweavers.com>
Signed-off-by: Zebediah Figura <zfigura@codeweavers.com>
Signed-off-by: Alexandre Julliard <julliard@winehq.org>
2021-07-06 17:48:45 +02:00
Rémi Bernon 005504969e ntoskrnl.exe/tests: Return STATUS_PENDING from IOCTL_HID_READ_REPORT.
Marking input report read requests as pending and queueing them instead
of returning STATUS_NOT_IMPLEMENTED.

Windows also calls IRP_MN_(QUERY|CANCEL)_REMOVE_DEVICE on device
initialization and we have to implement them for the test to not
timeout.

Signed-off-by: Rémi Bernon <rbernon@codeweavers.com>
Signed-off-by: Zebediah Figura <zfigura@codeweavers.com>
Signed-off-by: Alexandre Julliard <julliard@winehq.org>
2021-07-06 17:48:42 +02:00
Rémi Bernon b065daa600 ntoskrnl.exe: Send IRP_MN_SURPRISE_REMOVAL to the device stack first.
Instead of sending both IRP_MN_SURPRISE_REMOVAL and IRP_MN_REMOVE_DEVICE
to all children first.

They may have pending IRPs sent to their parent PDO driver, which need
to be cancelled before IRP_MN_REMOVE_DEVICE can complete. This is the
case for hidclass.sys and its thread calling the lower driver for
instance.

Signed-off-by: Rémi Bernon <rbernon@codeweavers.com>
Signed-off-by: Zebediah Figura <zfigura@codeweavers.com>
Signed-off-by: Alexandre Julliard <julliard@winehq.org>
2021-07-06 17:48:34 +02:00
Rémi Bernon d5c9b26538 ntoskrnl.exe/tests: Add some HidD_SetOutputReport tests.
Signed-off-by: Rémi Bernon <rbernon@codeweavers.com>
Signed-off-by: Alexandre Julliard <julliard@winehq.org>
2021-07-05 19:56:43 +02:00
Rémi Bernon d2ad6274a2 ntoskrnl.exe/tests: Add some HidD_SetFeature tests.
Signed-off-by: Rémi Bernon <rbernon@codeweavers.com>
Signed-off-by: Alexandre Julliard <julliard@winehq.org>
2021-07-05 19:56:40 +02:00
Rémi Bernon 48b4b99f8f ntoskrnl.exe/tests: Add some HidD_GetFeature tests.
Signed-off-by: Rémi Bernon <rbernon@codeweavers.com>
Signed-off-by: Alexandre Julliard <julliard@winehq.org>
2021-07-05 19:56:38 +02:00
Rémi Bernon 8d63ccd199 ntoskrnl.exe/tests: Add some HidD_GetInputReport tests.
Signed-off-by: Rémi Bernon <rbernon@codeweavers.com>
Signed-off-by: Alexandre Julliard <julliard@winehq.org>
2021-07-05 19:56:35 +02:00
Rémi Bernon e2e0e5aae4 ntoskrnl.exe/tests: Add more tests for button array caps.
Signed-off-by: Rémi Bernon <rbernon@codeweavers.com>
Signed-off-by: Alexandre Julliard <julliard@winehq.org>
2021-07-05 19:56:33 +02:00
Rémi Bernon ebb161243e ntoskrnl.exe/tests: Sync test utils with wine/test.h.
Adding support for thread local test data and context.

Signed-off-by: Rémi Bernon <rbernon@codeweavers.com>
Signed-off-by: Alexandre Julliard <julliard@winehq.org>
2021-07-05 19:56:01 +02:00
Rémi Bernon 7c7e77da9d ntoskrnl.exe/tests: Only count test driver load notify.
Sometimes Windows loads other drivers when we don't expect it, and
this causes spurious failures.

Signed-off-by: Rémi Bernon <rbernon@codeweavers.com>
Signed-off-by: Alexandre Julliard <julliard@winehq.org>
2021-07-05 19:55:42 +02:00
Rémi Bernon 2862ff6ba7 ntoskrnl.exe: Implement Ke(Initialize|Insert|Remove)DeviceQueue.
Signed-off-by: Rémi Bernon <rbernon@codeweavers.com>
Signed-off-by: Zebediah Figura <zfigura@codeweavers.com>
Signed-off-by: Alexandre Julliard <julliard@winehq.org>
2021-06-30 20:01:20 +02:00
Rémi Bernon 19d1375bce ntoskrnl.exe/tests: Add some pending / remove tests.
This shows that removing a device should send IRP_MN_SURPRISE_REMOVAL
only, and that it's still possible to use DeviceIoControl on already
opened handles.

IRP_MN_REMOVE_DEVICE should only be sent when all then opened handles
are closed.

Signed-off-by: Rémi Bernon <rbernon@codeweavers.com>
Signed-off-by: Zebediah Figura <zfigura@codeweavers.com>
Signed-off-by: Alexandre Julliard <julliard@winehq.org>
2021-06-30 20:01:20 +02:00
Rémi Bernon bd26083162 include: Declare KeInitializeSpinLock as static FORCEINLINE.
And internally rename the ntoskrnl.exe export.

Signed-off-by: Rémi Bernon <rbernon@codeweavers.com>
Signed-off-by: Zebediah Figura <zfigura@codeweavers.com>
Signed-off-by: Alexandre Julliard <julliard@winehq.org>
2021-06-30 20:01:20 +02:00
Rémi Bernon c2e9ee36d3 ntoskrnl.exe/tests: Retry timer wait to address spurious failures.
Signed-off-by: Rémi Bernon <rbernon@codeweavers.com>
Signed-off-by: Zebediah Figura <zfigura@codeweavers.com>
Signed-off-by: Alexandre Julliard <julliard@winehq.org>
2021-06-29 19:55:22 +02:00
Rémi Bernon 7f0e91f5aa hid: Always return node count in HidP_GetLinkCollectionNodes.
Signed-off-by: Rémi Bernon <rbernon@codeweavers.com>
Signed-off-by: Alexandre Julliard <julliard@winehq.org>
2021-06-28 19:43:28 +02:00
Rémi Bernon b860281d32 hid: Rewrite HidP_GetData using enum_value_caps.
Signed-off-by: Rémi Bernon <rbernon@codeweavers.com>
Signed-off-by: Alexandre Julliard <julliard@winehq.org>
2021-06-28 19:43:28 +02:00
Rémi Bernon 1c4e7a00a3 hid: Rewrite HidP_MaxDataListLength using enum_value_caps.
Signed-off-by: Rémi Bernon <rbernon@codeweavers.com>
Signed-off-by: Alexandre Julliard <julliard@winehq.org>
2021-06-28 19:43:28 +02:00
Rémi Bernon 28bbaf6707 hid: Return HIDP_STATUS_INCOMPATIBLE_REPORT_ID when id mismatches.
Signed-off-by: Rémi Bernon <rbernon@codeweavers.com>
Signed-off-by: Alexandre Julliard <julliard@winehq.org>
2021-06-28 19:43:27 +02:00
Rémi Bernon 38d863f1f7 hid: Rewrite HidP_GetScaledUsageValue using enum_value_caps.
Signed-off-by: Rémi Bernon <rbernon@codeweavers.com>
Signed-off-by: Alexandre Julliard <julliard@winehq.org>
2021-06-25 10:34:22 +02:00
Rémi Bernon 7650f87737 hid: Rewrite HidP_GetUsageValue using enum_value_caps.
Signed-off-by: Rémi Bernon <rbernon@codeweavers.com>
Signed-off-by: Alexandre Julliard <julliard@winehq.org>
2021-06-25 10:34:17 +02:00
Rémi Bernon cb5856695c hid: Rewrite HidP_SetUsageValue using enum_value_caps.
Signed-off-by: Rémi Bernon <rbernon@codeweavers.com>
Signed-off-by: Alexandre Julliard <julliard@winehq.org>
2021-06-25 10:34:13 +02:00
Rémi Bernon 0a192647fe hid: Rewrite HidP_GetUsageValueArray using enum_value_caps.
Signed-off-by: Rémi Bernon <rbernon@codeweavers.com>
Signed-off-by: Alexandre Julliard <julliard@winehq.org>
2021-06-25 10:34:09 +02:00
Rémi Bernon 334c6cf8f4 hid: Introduce new copy_bits helper for HidP_SetUsageValueArray.
Signed-off-by: Rémi Bernon <rbernon@codeweavers.com>
Signed-off-by: Alexandre Julliard <julliard@winehq.org>
2021-06-25 10:34:05 +02:00
Rémi Bernon f8e6965036 hid: Rewrite HidP_GetUsagesEx using enum_value_caps.
Signed-off-by: Rémi Bernon <rbernon@codeweavers.com>
Signed-off-by: Alexandre Julliard <julliard@winehq.org>
2021-06-24 22:03:07 +02:00