Commit Graph

183 Commits

Author SHA1 Message Date
Rémi Bernon ed63e1bcf0 hidclass.sys: Use a separate class for devices matching WINEXINPUT\*&XI_*.
Although these devices will be HID compatible we need to not have them
listed on the HID class, as they should only be used internally by Wine
XInput implementation.

Signed-off-by: Rémi Bernon <rbernon@codeweavers.com>
Signed-off-by: Alexandre Julliard <julliard@winehq.org>
2021-09-03 21:43:03 +02:00
Rémi Bernon de0fb2adfd hidclass.sys: Use hidparse.sys instead of internal parser.
Signed-off-by: Rémi Bernon <rbernon@codeweavers.com>
Signed-off-by: Alexandre Julliard <julliard@winehq.org>
2021-08-16 23:28:45 +02:00
Rémi Bernon 7a47a1f5d2 hidclass.sys: Factor poll / non-polled read loops together.
Signed-off-by: Rémi Bernon <rbernon@codeweavers.com>
Signed-off-by: Alexandre Julliard <julliard@winehq.org>
2021-08-16 23:27:31 +02:00
Rémi Bernon 6f9bec436c hidclass.sys: Remove unnecessary poll_interval == 0 cases.
Signed-off-by: Rémi Bernon <rbernon@codeweavers.com>
Signed-off-by: Alexandre Julliard <julliard@winehq.org>
2021-08-16 23:27:26 +02:00
Rémi Bernon 286999a9ea hidclass.sys: Enforce POLL_FREQUENCY_MSEC value range.
Signed-off-by: Rémi Bernon <rbernon@codeweavers.com>
Signed-off-by: Alexandre Julliard <julliard@winehq.org>
2021-08-16 23:27:21 +02:00
Rémi Bernon 325984ded5 hidclass.sys: Use a simpler ring buffer with ref-counted reports.
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 0a104844eb hidclass.sys: Process pending IRP queue using last read packet.
Instead of requiring the ring buffer to keep previously read packets.

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 2e3a0dac84 hidclass.sys: Rename WINE_HIDP_PREPARSED_DATA to struct hid_preparsed_data.
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 a5e2d821e2 hidclass.sys: Merge parse_descriptor and ParseDescriptor.
Signed-off-by: Rémi Bernon <rbernon@codeweavers.com>
Signed-off-by: Alexandre Julliard <julliard@winehq.org>
2021-08-09 11:42:05 +02:00
Rémi Bernon e15916cf1d hidclass.sys: Move build_preparsed_data before parse_descriptor.
Signed-off-by: Rémi Bernon <rbernon@codeweavers.com>
Signed-off-by: Alexandre Julliard <julliard@winehq.org>
2021-08-09 11:42:00 +02:00
Rémi Bernon 9ef00c9353 hidclass.sys: Remove old reports from WINE_HIDP_PREPARSED_DATA.
Signed-off-by: Rémi Bernon <rbernon@codeweavers.com>
Signed-off-by: Alexandre Julliard <julliard@winehq.org>
2021-08-09 11:41: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 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 88bc48fbac hidclass.sys: Rename IO_STATUS_BLOCK irp_status to io.
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 b87b6a96e0 hidclass.sys: Use call_minidriver for IOCTL_HID_READ_REPORT.
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 a6435b3dda hidclass.sys: Use call_minidriver for IOCTL_HID_GET_INPUT_REPORT.
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 00008c9d48 hidclass.sys: Pass IO_STATUS_BLOCK parameter to call_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 6f4ccd04cd hidclass.sys: Return irp->IoStatus.Status consistently.
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 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 5a62d0dbca hidclass.sys: Return error on invalid read buffer size.
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:53 +02:00
Rémi Bernon 881b2d6583 hidclass.sys: Return error on invalid write buffer size.
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:48 +02:00
Rémi Bernon fb7a5e660e hidclass.sys: Stop accepting IRPs after device removal.
Handle IRP_MN_SURPRISE_REMOVAL and notify device thread to stop it, but
only wait for it in IRP_MN_REMOVE_DEVICE, as it's probably waiting for
an IRP sent to the lower driver, which needs to be notified of removal
too first.

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-01 22:34:31 +02:00
Rémi Bernon 9a56ba0336 hidclass.sys: Disable the keyboard device interface on removal.
Instead of enabling it.

Signed-off-by: Rémi Bernon <rbernon@codeweavers.com>
Signed-off-by: Alexandre Julliard <julliard@winehq.org>
2021-06-30 20:01:20 +02:00
Rémi Bernon 37009031bb hid: Build link collection nodes 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 8f5b49c0c4 hid: Rewrite HidP_SetUsages 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:02:56 +02:00
Rémi Bernon 51560aabcb hidclass.sys: Build an alternate value array.
Signed-off-by: Rémi Bernon <rbernon@codeweavers.com>
Signed-off-by: Alexandre Julliard <julliard@winehq.org>
2021-06-23 22:27:16 +02:00
Rémi Bernon 7af8ca6371 hidclass.sys: Compute report sizes during parsing.
Signed-off-by: Rémi Bernon <rbernon@codeweavers.com>
Signed-off-by: Alexandre Julliard <julliard@winehq.org>
2021-06-23 22:27:09 +02:00
Rémi Bernon 9c77c44509 hidclass.sys: Support parsing of explicit usage page.
Signed-off-by: Rémi Bernon <rbernon@codeweavers.com>
Signed-off-by: Alexandre Julliard <julliard@winehq.org>
2021-06-23 22:27:05 +02:00
Rémi Bernon ef1247d77a hidclass.sys: Split feature parsing to separate helper.
Signed-off-by: Rémi Bernon <rbernon@codeweavers.com>
Signed-off-by: Alexandre Julliard <julliard@winehq.org>
2021-06-18 16:48:48 +02:00
Rémi Bernon 54936bba46 hidclass.sys: Remove unused struct collection members.
Signed-off-by: Rémi Bernon <rbernon@codeweavers.com>
Signed-off-by: Alexandre Julliard <julliard@winehq.org>
2021-06-18 16:48:48 +02:00
Rémi Bernon 28c37bbdba hidclass.sys: Remove unused struct feature members.
Signed-off-by: Rémi Bernon <rbernon@codeweavers.com>
Signed-off-by: Alexandre Julliard <julliard@winehq.org>
2021-06-18 16:48:48 +02:00
Rémi Bernon f266b2b5d4 hidclass.sys: Create link collection caps during parsing.
Signed-off-by: Rémi Bernon <rbernon@codeweavers.com>
Signed-off-by: Alexandre Julliard <julliard@winehq.org>
2021-06-18 16:48:48 +02:00
Rémi Bernon 152aafc73f hidclass.sys: Set BitField item to current value.
As documented on MSDN, and as testing shows.

Signed-off-by: Rémi Bernon <rbernon@codeweavers.com>
Signed-off-by: Alexandre Julliard <julliard@winehq.org>
2021-06-17 20:03:15 +02:00
Rémi Bernon bf0ab04b10 hidclass.sys: Use the stack to store collection items.
Signed-off-by: Rémi Bernon <rbernon@codeweavers.com>
Signed-off-by: Alexandre Julliard <julliard@winehq.org>
2021-06-17 20:03:08 +02:00
Rémi Bernon 34cbc202f3 hidclass.sys: Add a stack to parser_state to store global items.
Signed-off-by: Rémi Bernon <rbernon@codeweavers.com>
Signed-off-by: Alexandre Julliard <julliard@winehq.org>
2021-06-17 20:03:01 +02:00
Rémi Bernon 08deef6a51 hidclass.sys: Introduce new hid_parser_state struct.
And internal hid_value_caps struct, and use them to store items and
usages.

Signed-off-by: Rémi Bernon <rbernon@codeweavers.com>
Signed-off-by: Alexandre Julliard <julliard@winehq.org>
2021-06-17 20:02:55 +02:00
Rémi Bernon 81e2106e57 hidclass.sys: Use a single switch to parse all item types.
Signed-off-by: Rémi Bernon <rbernon@codeweavers.com>
Signed-off-by: Alexandre Julliard <julliard@winehq.org>
2021-06-17 20:02:47 +02:00
Rémi Bernon e7423a054d hidclass.sys: Simplify signed / unsigned item value parsing.
Signed-off-by: Rémi Bernon <rbernon@codeweavers.com>
Signed-off-by: Alexandre Julliard <julliard@winehq.org>
2021-06-17 20:02:40 +02:00