Commit Graph

214 Commits

Author SHA1 Message Date
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
Rémi Bernon 06fb03378d hidclass.sys: Use realloc instead of HeapReAlloc.
Wine-Bug: https://bugs.winehq.org/show_bug.cgi?id=51223
Signed-off-by: Rémi Bernon <rbernon@codeweavers.com>
Signed-off-by: Alexandre Julliard <julliard@winehq.org>
2021-06-08 22:28:44 +02:00
Rémi Bernon 9f2518b47c hidclass.sys: Dump HID descriptor with 16 byte columns.
Signed-off-by: Rémi Bernon <rbernon@codeweavers.com>
Signed-off-by: Alexandre Julliard <julliard@winehq.org>
2021-06-08 10:18:53 +02:00
Rémi Bernon dc501024ca hidclass.sys: Fix incorrect feature report debug print.
Signed-off-by: Rémi Bernon <rbernon@codeweavers.com>
Signed-off-by: Alexandre Julliard <julliard@winehq.org>
2021-06-08 10:18:51 +02:00
Rémi Bernon f43c01fa82 hidclass.sys: Don't crash when no buffer was provided.
Signed-off-by: Rémi Bernon <rbernon@codeweavers.com>
Signed-off-by: Alexandre Julliard <julliard@winehq.org>
2021-06-07 21:23:35 +02:00
Rémi Bernon 45958834b8 hid: Use caps.BitSize to differenciate buttons from values.
Signed-off-by: Rémi Bernon <rbernon@codeweavers.com>
Signed-off-by: Alexandre Julliard <julliard@winehq.org>
2021-06-07 21:23:20 +02:00
Rémi Bernon c3d8a9803c hidclass.sys: Factor all HIDP_VALUE_CAPS debug helpers.
Signed-off-by: Rémi Bernon <rbernon@codeweavers.com>
Signed-off-by: Alexandre Julliard <julliard@winehq.org>
2021-06-07 21:23:15 +02:00
Rémi Bernon ca9bb8a23d hidclass.sys: Use HIDP_VALUE_CAPS instead of struct caps.
Signed-off-by: Rémi Bernon <rbernon@codeweavers.com>
Signed-off-by: Alexandre Julliard <julliard@winehq.org>
2021-06-07 21:23:09 +02:00
Rémi Bernon 1f0b48abf2 hidclass.sys: Remove Delim member from struct caps.
Signed-off-by: Rémi Bernon <rbernon@codeweavers.com>
Signed-off-by: Alexandre Julliard <julliard@winehq.org>
2021-06-07 21:23:03 +02:00
Rémi Bernon 4c6c8c5456 hidclass.sys: Handle failures when parsing descriptor.
Signed-off-by: Rémi Bernon <rbernon@codeweavers.com>
Signed-off-by: Alexandre Julliard <julliard@winehq.org>
2021-06-07 21:22:57 +02:00
Rémi Bernon dc7547a84b hidclass.sys: Factor HIDP_BUTTON_CAPS with HIDP_VALUE_CAPS.
Buttons are really just values with BitSize == 1, and having a union for
that makes the code more complicated than it needs.

We'll simplify the code a lot using HIDP_VALUE_CAPS everywhere, as the
two structure types are compatible.

Signed-off-by: Rémi Bernon <rbernon@codeweavers.com>
Signed-off-by: Alexandre Julliard <julliard@winehq.org>
2021-06-04 20:00:30 +02:00
Rémi Bernon 975e33c7e7 hidclass.sys: Use nameless unions.
Signed-off-by: Rémi Bernon <rbernon@codeweavers.com>
Signed-off-by: Alexandre Julliard <julliard@winehq.org>
2021-06-04 20:00:30 +02:00
Rémi Bernon 1c5e57fc75 hidclass.sys: Use msvcrt allocation functions.
Signed-off-by: Rémi Bernon <rbernon@codeweavers.com>
Signed-off-by: Alexandre Julliard <julliard@winehq.org>
2021-06-04 20:00:30 +02:00
Rémi Bernon 9a4fa43a81 hidclass.sys: Send rawinput messages with HID report.
Wine-Bug: https://bugs.winehq.org/show_bug.cgi?id=50506
Signed-off-by: Rémi Bernon <rbernon@codeweavers.com>
Signed-off-by: Alexandre Julliard <julliard@winehq.org>
2021-05-13 10:49:16 +02:00
Rémi Bernon c0fc89991b hidclass.sys: Use __wine_send_input to send device notifications.
When INPUT type is INPUT_HARDWARE and hi.uMsg is WM_INPUT_DEVICE_CHANGE,
the RAWINPUT structure usage is a non-standard extension for Wine
internal usage:

* header.wParam contains the message GIDC_ARRIVAL / GIDC_REMOVAL wparam,

* hid.bRawData contains two words, which are the HID device UsagePage
  and Usage words, instead of a real HID report.

This will let us use the same entry point and structures to send device
notifications as for the HID reports in the future (which will be sent
with INPUT_HARDWARE type / WM_INPUT uMsg instead).

This currently does nothing, because the INPUT_HARDWARE messages are
currently dropped, and because winedevice.exe desktop is different from
the default desktop.

Wine-Bug: https://bugs.winehq.org/show_bug.cgi?id=50506
Signed-off-by: Rémi Bernon <rbernon@codeweavers.com>
Signed-off-by: Alexandre Julliard <julliard@winehq.org>
2021-05-10 22:02:09 +02:00
Rémi Bernon af2b2d0433 hidclass.sys: Call IoInvalidateDeviceRelations before IoSetDevicePropertyData.
Otherwise setupapi may fail to find the device on which to set the
property. This triggers messages like the following the first time a
device is created (on prefix creation for mouse and keyboard devices):

  IoSetDevicePropertyData Failed to open device, error 0xe000020b.

Some IoSetDevicePropertyData implementation detail makes it always
return successfully but it's not doing anything and user32 will then
ignore the device when it enumerates rawinput devices.

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-05-05 21:52:23 +02:00
Rémi Bernon 3532d666b9 hidclass.sys: Assign rawinput handles through device properties.
Signed-off-by: Rémi Bernon <rbernon@codeweavers.com>
Signed-off-by: Arkadiusz Hiler <ahiler@codeweavers.com>
Signed-off-by: Alexandre Julliard <julliard@winehq.org>
2021-05-03 23:19:54 +02:00
Rémi Bernon 8e4d668e34 hidclass.sys: Register GUID_DEVINTERFACE_KEYBOARD interface.
Signed-off-by: Rémi Bernon <rbernon@codeweavers.com>
Signed-off-by: Alexandre Julliard <julliard@winehq.org>
2021-04-23 20:02:06 +02:00
Zebediah Figura c5565a74c3 hidclass.sys: Defer creating a child device until IRP_MN_START_DEVICE.
This is necessary to allow the Hauppauge CIR receiver driver for cx2310x drivers
(hcw10cir.sys) to start.

Signed-off-by: Zebediah Figura <z.figura12@gmail.com>
Signed-off-by: Alexandre Julliard <julliard@winehq.org>
2021-04-20 21:07:09 +02:00
Zebediah Figura 06ab067758 hidclass.sys: Set PhysicalDeviceObject to the bus PDO.
Signed-off-by: Zebediah Figura <z.figura12@gmail.com>
Signed-off-by: Alexandre Julliard <julliard@winehq.org>
2021-04-19 22:06:56 +02:00
Zebediah Figura a173672911 hidclass.sys: Stop creating a setupapi device.
Signed-off-by: Zebediah Figura <z.figura12@gmail.com>
Signed-off-by: Alexandre Julliard <julliard@winehq.org>
2021-04-19 22:06:56 +02:00
Zebediah Figura aff72f2253 hidclass.sys: Pass a KEVENT to IoBuildSynchronousFsdRequest() in get_device_id().
Signed-off-by: Zebediah Figura <z.figura12@gmail.com>
Signed-off-by: Alexandre Julliard <julliard@winehq.org>
2021-04-19 22:06:56 +02:00
Zebediah Figura f34b735eba hidclass.sys: Create separate parent FDO and child PDO objects.
Signed-off-by: Zebediah Figura <z.figura12@gmail.com>
Signed-off-by: Alexandre Julliard <julliard@winehq.org>
2021-04-16 22:39:45 +02:00
Zebediah Figura 902696de93 hidclass.sys: Use GUID_DEVINTERFACE_HID directly.
Signed-off-by: Zebediah Figura <z.figura12@gmail.com>
Signed-off-by: Alexandre Julliard <julliard@winehq.org>
2021-04-16 12:17:01 +02:00
Zebediah Figura a85d0f576a hidclass.sys: Remove the unused device_name field.
Signed-off-by: Zebediah Figura <z.figura12@gmail.com>
Signed-off-by: Alexandre Julliard <julliard@winehq.org>
2021-04-16 12:16:53 +02:00
Zebediah Figura e30a14525e hidclass.sys: Merge main.c into pnp.c.
Signed-off-by: Zebediah Figura <z.figura12@gmail.com>
Signed-off-by: Alexandre Julliard <julliard@winehq.org>
2021-04-16 12:16:49 +02:00
Zebediah Figura 5cc9c5ab51 hidclass.sys: Pass a KEVENT to IoBuildDeviceIoControlRequest() in hid_device_thread().
Signed-off-by: Zebediah Figura <z.figura12@gmail.com>
Signed-off-by: Alexandre Julliard <julliard@winehq.org>
2021-04-16 12:16:43 +02:00
Rémi Bernon f4d5f7e88a hidclass.sys: Assign rawinput device handle in HID_LinkDevice.
The handles are just numeric values and not real object handles, they
are used in the hDevice field of the RAWINPUTHEADER struct.

They will also be used as an HID rawinput device array index on the
server side.

Wine-Bug: https://bugs.winehq.org/show_bug.cgi?id=50506
Signed-off-by: Rémi Bernon <rbernon@codeweavers.com>
Signed-off-by: Arkadiusz Hiler <ahiler@codeweavers.com>
Signed-off-by: Alexandre Julliard <julliard@winehq.org>
2021-04-15 10:37:55 +02:00
Zebediah Figura fd25cc3c3b hidclass.sys: Always wait for the lower driver in hid_device_thread().
Doing otherwise may result in memory corruption. The lower driver should complete its IRPs on device removal anyway.

Signed-off-by: Zebediah Figura <z.figura12@gmail.com>
Signed-off-by: Alexandre Julliard <julliard@winehq.org>
2021-04-15 10:34:03 +02:00
Zebediah Figura 8c87a2618e hidclass.sys: Zero-initialize the HID_DEVICE_ATTRIBUTES structure.
Signed-off-by: Zebediah Figura <z.figura12@gmail.com>
Signed-off-by: Alexandre Julliard <julliard@winehq.org>
2021-04-14 20:51:13 +02:00
Zebediah Figura 5e63c849b4 ntoskrnl/tests: Test child device enumeration.
Signed-off-by: Zebediah Figura <z.figura12@gmail.com>
Signed-off-by: Alexandre Julliard <julliard@winehq.org>
2021-04-12 19:32:15 +02:00
Rémi Bernon 75dd9b9236 hidclass.sys: Fix parsed report descriptor length index.
Signed-off-by: Rémi Bernon <rbernon@codeweavers.com>
Signed-off-by: Alexandre Julliard <julliard@winehq.org>
2021-03-24 20:46:22 +01:00
Zebediah Figura 5294ebc9a0 hidclass.sys: No longer track devices in a list.
Signed-off-by: Zebediah Figura <z.figura12@gmail.com>
Signed-off-by: Alexandre Julliard <julliard@winehq.org>
2021-02-12 14:41:43 +01:00
Zebediah Figura 76daa6b70c hidclass.sys: Do not manually clean up devices on unload.
We can rely on ntoskrnl to do this for us.

Signed-off-by: Zebediah Figura <z.figura12@gmail.com>
Signed-off-by: Alexandre Julliard <julliard@winehq.org>
2021-02-12 14:41:33 +01:00
Zebediah Figura 0d406f09ee hidclass.sys: Pass a KEVENT to IoBuildDeviceIoControlRequest() in call_minidriver().
Signed-off-by: Zebediah Figura <z.figura12@gmail.com>
Signed-off-by: Alexandre Julliard <julliard@winehq.org>
2021-02-11 22:26:36 +01:00
Arkadiusz Hiler 5a32339dc8 hidclass.sys: Calculate correct bitCount for vendor-specific 1 bit repeated elements.
DualSense controller's report descriptor comes with a 1 bit vendor specific
(Usage Page & Usage) element repeated through 'report count'.

Those were correctly interpreted as non-ranged buttons (exposed as button caps
with appropriate usage values) but their size was incorrectly assumed to be 1
ignoring the 'report count'.

Because of that the InputReportByteLength is miscalculated as 63 instead of
64. If the buffer passed to HidD_GetInputReport() is allocated using that
value the call will fail with ERROR_INSUFFICIENT_BUFFER.

This change fixes the above and cleans up the code a bit so the size for each
case is calculated directly from the count and size instead of using the
values that were derived from them.

Signed-off-by: Arkadiusz Hiler <ahiler@codeweavers.com>
Signed-off-by: Aric Stewart <aric@codeweavers.com>
Signed-off-by: Alexandre Julliard <julliard@winehq.org>
2021-01-21 20:46:13 +01:00
Michael Stefaniuc f073d9a9d3 hidclass.sys: Use wide-char string literals.
Signed-off-by: Michael Stefaniuc <mstefani@winehq.org>
Signed-off-by: Alexandre Julliard <julliard@winehq.org>
2020-11-16 11:25:18 +01:00
Zebediah Figura 4c1ff566dd hidclass.sys: Don't reset the report count when recording a main item.
The report count is global and should be preserved.

This fixes the Logitech Extreme 3D Pro controller when used with hidraw.

Signed-off-by: Zebediah Figura <zfigura@codeweavers.com>
Signed-off-by: Aric Stewart <aric@codeweavers.com>
Signed-off-by: Alexandre Julliard <julliard@winehq.org>
2020-03-18 19:37:44 +01:00
Rémi Bernon 56d529694b hid: Implement HidP_GetLinkCollectionNodes.
Signed-off-by: Rémi Bernon <rbernon@codeweavers.com>
Signed-off-by: Aric Stewart <aric@codeweavers.com>
Signed-off-by: Alexandre Julliard <julliard@winehq.org>
2020-02-12 20:02:40 +01:00
Andrew Eikum b466419c32 hid: Move preparsed data definition to global header.
PHIDP_PREPARSED_DATA is supposed to be an opaque pointer, but the size
is accessible through user32.GetRawInputDeviceInfo(RIDI_PREPARSEDDATA),
so we will need to know the struct layout in user32, too.

Signed-off-by: Andrew Eikum <aeikum@codeweavers.com>
Signed-off-by: Alexandre Julliard <julliard@winehq.org>
2019-11-04 22:43:01 +01:00
Sven Baars 1413f577c5 hidclass.sys: Fix some memory leaks on error path (Coverity).
Signed-off-by: Sven Baars <sven.wine@gmail.com>
Signed-off-by: Alexandre Julliard <julliard@winehq.org>
2019-09-10 23:20:41 +02:00
Zebediah Figura 6a6081fc93 hidclass.sys: Avoid freeing pool memory with HeapFree().
Signed-off-by: Zebediah Figura <z.figura12@gmail.com>
Signed-off-by: Alexandre Julliard <julliard@winehq.org>
2019-08-22 09:50:16 +02:00
Francois Gouget 7c44f3dcd6 hidclass.sys: A spelling fix in an ERR() message.
Signed-off-by: Francois Gouget <fgouget@free.fr>
Signed-off-by: Alexandre Julliard <julliard@winehq.org>
2019-08-08 17:53:36 +02:00
Zebediah Figura b84334d2bd hidclass.sys: Create a mouse device interface for HID mouse devices.
Signed-off-by: Zebediah Figura <zfigura@codeweavers.com>
Signed-off-by: Alexandre Julliard <julliard@winehq.org>
2019-07-04 21:14:54 +02:00
Zebediah Figura 878a1f5cea hidclass.sys: Detach the HID device before deleting it.
Signed-off-by: Zebediah Figura <z.figura12@gmail.com>
Signed-off-by: Alexandre Julliard <julliard@winehq.org>
2019-06-27 09:29:13 +02:00
Zebediah Figura 3d011fcdff hidclass.sys: Get rid of unused minidriver parameter to HID_DeleteDevice().
Signed-off-by: Zebediah Figura <z.figura12@gmail.com>
Signed-off-by: Alexandre Julliard <julliard@winehq.org>
2019-06-06 17:41:27 +02:00
Zebediah Figura 700633ee0f hidclass.sys: Use PDRIVER_ADD_DEVICE.
Signed-off-by: Zebediah Figura <z.figura12@gmail.com>
Signed-off-by: Alexandre Julliard <julliard@winehq.org>
2019-06-06 17:41:23 +02:00
Zebediah Figura 6c6aeea8a8 ntoskrnl.exe: Correctly handle instance IDs.
The instance ID is only the third part of the "A\B\C" form, and must be
combined with the device ID to form the whole name for setupapi (the "device
instance ID").

Signed-off-by: Zebediah Figura <z.figura12@gmail.com>
Signed-off-by: Alexandre Julliard <julliard@winehq.org>
2019-06-05 16:46:20 +02:00
Zebediah Figura 1e05e96c47 hidclass.sys: Allocate IRP return buffers from paged pool.
Signed-off-by: Zebediah Figura <z.figura12@gmail.com>
Signed-off-by: Alexandre Julliard <julliard@winehq.org>
2019-06-05 16:44:52 +02:00
Alexandre Julliard af0e0d9b62 hidclass.sys: Build with msvcrt.
Signed-off-by: Alexandre Julliard <julliard@winehq.org>
2019-06-05 08:36:39 +02:00
Piotr Caban 99114803b8 hidclass.sys: Limit written data to the actual report size.
Linux hidraw devices are not accepting to large set feature ioctls.

Signed-off-by: Piotr Caban <piotr@codeweavers.com>
Signed-off-by: Aric Stewart <aric@codeweavers.com>
Signed-off-by: Alexandre Julliard <julliard@winehq.org>
2019-05-14 21:19:37 +02:00
Piotr Caban f57b869124 hidclass.sys: Support descriptors with over 10 individual usages in feature.
Signed-off-by: Piotr Caban <piotr@codeweavers.com>
Signed-off-by: Aric Stewart <aric@codeweavers.com>
Signed-off-by: Alexandre Julliard <julliard@winehq.org>
2019-05-13 18:49:35 +02:00
Piotr Caban 84a248c1dd hidclass.sys: Remove no longer used features list.
Signed-off-by: Piotr Caban <piotr@codeweavers.com>
Signed-off-by: Aric Stewart <aric@codeweavers.com>
Signed-off-by: Alexandre Julliard <julliard@winehq.org>
2019-05-13 18:49:24 +02:00
Piotr Caban 395d268565 hid: Change format of preparsed data.
Advantages of this format:
  - all table elements have constant size, that makes iterating table easier
  - allow report lookup by report ID in O(1) time
  - doesn't sort reports, it makes it possible to preserve original order
  of elements making output of functions more similar to native
  - preparsed data is created from collection, this will allow to add
  support for multiple top-most collections

Signed-off-by: Piotr Caban <piotr@codeweavers.com>
Signed-off-by: Aric Stewart <aric@codeweavers.com>
Signed-off-by: Alexandre Julliard <julliard@winehq.org>
2019-05-13 18:48:51 +02:00
Piotr Caban 24b0faaf41 hidclass.sys: Fill some reserved fields when building HIDP_{BUTTON,VALUE}_CAPS.
Signed-off-by: Piotr Caban <piotr@codeweavers.com>
Signed-off-by: Aric Stewart <aric@codeweavers.com>
Signed-off-by: Alexandre Julliard <julliard@winehq.org>
2019-05-10 16:04:25 +02:00
Jacek Caban f7bc649598 hidclass.sys: Support canceling read IRPs.
Signed-off-by: Jacek Caban <jacek@codeweavers.com>
Signed-off-by: Aric Stewart <aric@codeweavers.com>
Signed-off-by: Alexandre Julliard <julliard@winehq.org>
2019-05-09 08:14:35 -05:00
Jacek Caban 85082e8bd3 hidclass.sys: Make read IRP queue thread safe.
Signed-off-by: Jacek Caban <jacek@codeweavers.com>
Signed-off-by: Aric Stewart <aric@codeweavers.com>
Signed-off-by: Alexandre Julliard <julliard@winehq.org>
2019-05-09 08:14:31 -05:00
Piotr Caban 4316373998 hidclass.sys: Treat all one-bit fields as buttons.
Signed-off-by: Piotr Caban <piotr@codeweavers.com>
Signed-off-by: Aric Stewart <aric@codeweavers.com>
Signed-off-by: Alexandre Julliard <julliard@winehq.org>
2019-05-06 08:04:36 -05:00
Piotr Caban 37d129e8fe hidclass.sys: Set LinkUsage field in build_elements function.
Signed-off-by: Piotr Caban <piotr@codeweavers.com>
Signed-off-by: Aric Stewart <aric@codeweavers.com>
Signed-off-by: Alexandre Julliard <julliard@winehq.org>
2019-05-06 08:04:32 -05:00
Piotr Caban 31cd586c8c hidclass.sys: Set LinkUsagePage field in build_elements function.
Signed-off-by: Piotr Caban <piotr@codeweavers.com>
Signed-off-by: Aric Stewart <aric@codeweavers.com>
Signed-off-by: Alexandre Julliard <julliard@winehq.org>
2019-05-06 08:04:29 -05:00
Piotr Caban 5c01898c9d hidclass.sys: Set LinkCollection field in build_elements function.
Signed-off-by: Piotr Caban <piotr@codeweavers.com>
Signed-off-by: Aric Stewart <aric@codeweavers.com>
Signed-off-by: Alexandre Julliard <julliard@winehq.org>
2019-05-06 08:04:25 -05:00
Zhiyi Zhang 56b509a84a hidclass.sys: Handle create existent device failure.
Signed-off-by: Zhiyi Zhang <zzhang@codeweavers.com>
Signed-off-by: Aric Stewart <aric@codeweavers.com>
Signed-off-by: Alexandre Julliard <julliard@winehq.org>
2019-03-21 19:32:35 +01:00
Aric Stewart 5040b8d534 hidclass.sys: Prevent buffer overrun.
Signed-off-by: Aric Stewart <aric@codeweavers.com>
Signed-off-by: Alexandre Julliard <julliard@winehq.org>
2019-02-06 19:57:27 +01:00
Aric Stewart 7229893493 hidclass.sys: Move IoSetDeviceInterfaceState to PNP_RemoveDevice.
Signed-off-by: Aric Stewart <aric@codeweavers.com>
Signed-off-by: Alexandre Julliard <julliard@winehq.org>
2018-11-20 17:05:08 +01:00
Aric Stewart 5b31b764c0 hidclass.sys: IoCreateSymbolicLink is now called by IoSetDeviceInterfaceState.
Signed-off-by: Aric Stewart <aric@codeweavers.com>
Signed-off-by: Alexandre Julliard <julliard@winehq.org>
2018-11-20 17:05:02 +01:00
Aric Stewart ec2234102a hidclass.sys: Use IoRegisterDeviceInterface.
Signed-off-by: Aric Stewart <aric@codeweavers.com>
Signed-off-by: Alexandre Julliard <julliard@winehq.org>
2018-11-13 09:56:18 +01:00
Zebediah Figura 91ac8eb00a hidclass.sys: Update the interface state when a device is added or removed.
Signed-off-by: Zebediah Figura <zfigura@codeweavers.com>
Signed-off-by: Aric Stewart <aric@codeweavers.com>
Signed-off-by: Alexandre Julliard <julliard@winehq.org>
2018-08-19 17:46:39 +02:00
Aric Stewart f97bbef0e5 hidclass.sys: Unload all devices before unloading a minidriver.
Signed-off-by: Aric Stewart <aric@codeweavers.com>
Signed-off-by: Alexandre Julliard <julliard@winehq.org>
2018-08-15 20:55:09 +02:00
Aric Stewart 0e6d749a0e hidclass: Properly NULL terminate device_deviceid_fmtW.
Signed-off-by: Aric Stewart <aric@codeweavers.com>
Signed-off-by: Alexandre Julliard <julliard@winehq.org>
2017-11-21 23:07:05 +01:00
Aric Stewart 97c925957c hidclass.sys: Handle opportunistic reads.
Signed-off-by: Aric Stewart <aric@codeweavers.com>
Signed-off-by: Alexandre Julliard <julliard@winehq.org>
2017-11-08 22:17:06 +01:00