Commit Graph

183 Commits

Author SHA1 Message Date
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
Andrey Gusev 495ade93ba hidclass.sys: Remove check for negative value.
Signed-off-by: Andrey Gusev <andrey.goosev@gmail.com>
Signed-off-by: Aric Stewart <aric@codeweavers.com>
Signed-off-by: Alexandre Julliard <julliard@winehq.org>
2017-11-02 19:12:07 +01:00
Aric Stewart 1ccb1719cb hidclass.sys: IOCTL_HID_GET_INPUT_REPORT has report ID as first byte.
Signed-off-by: Aric Stewart <aric@codeweavers.com>
Signed-off-by: Alexandre Julliard <julliard@winehq.org>
2017-02-02 20:40:13 +01:00
Aric Stewart b46e15568c hidclass.sys: BSize will never be negative.
Found by Bruno Jesus and cppcheck.

Signed-off-by: Aric Stewart <aric@codeweavers.com>
Signed-off-by: Alexandre Julliard <julliard@winehq.org>
2017-01-31 08:56:22 +01:00
Aric Stewart a8ab3107cf hid: Implement HidP_GetData.
Signed-off-by: Aric Stewart <aric@codeweavers.com>
Signed-off-by: Alexandre Julliard <julliard@winehq.org>
2017-01-30 13:07:49 +01:00
Aric Stewart 68ecd3b76a hidclass.sys: When processing reads fill all the buffers.
Signed-off-by: Aric Stewart <aric@codeweavers.com>
Signed-off-by: Sebastian Lackner <sebastian@fds-team.de>
Signed-off-by: Alexandre Julliard <julliard@winehq.org>
2017-01-26 16:57:56 +01:00
André Hentschel 902b8a2b6d hidclass.sys: Fix compilation on systems that don't support nameless structs.
Signed-off-by: André Hentschel <nerv@dawncrow.de>
Signed-off-by: Aric Stewart <aric@codeweavers.com>
Signed-off-by: Alexandre Julliard <julliard@winehq.org>
2017-01-26 10:38:00 +01:00
Aric Stewart 3af89f1d96 hidclass.sys: Do not use device after free.
Spotted by Marcus Meissner (Coverity issue 1372459).

Signed-off-by: Aric Stewart <aric@codeweavers.com>
Signed-off-by: Alexandre Julliard <julliard@winehq.org>
2016-12-19 11:06:40 +01:00
Aric Stewart b5646efe39 hidclass.sys: Some descriptor values should be unsigned.
Signed-off-by: Aric Stewart <aric@codeweavers.com>
Signed-off-by: Alexandre Julliard <julliard@winehq.org>
2016-12-07 14:45:17 +01:00
Aric Stewart d0039106de hidclass: All reports read or written to user space lead with a reportId.
Signed-off-by: Aric Stewart <aric@codeweavers.com>
Signed-off-by: Alexandre Julliard <julliard@winehq.org>
2016-12-01 15:28:23 +01:00
Aric Stewart 437f7a3722 hidclass.sys: Handle descriptors with a usage count less than the report bits.
Signed-off-by: Aric Stewart <aric@codeweavers.com>
Signed-off-by: Alexandre Julliard <julliard@winehq.org>
2016-11-15 16:33:25 -06:00
Aric Stewart 3b3b7670ec hidclass.sys: Handle POP and PUSH in device descriptors.
Signed-off-by: Aric Stewart <aric@codeweavers.com>
Signed-off-by: Alexandre Julliard <julliard@winehq.org>
2016-11-15 16:33:20 -06:00
Sebastian Lackner b22aa57ab9 hidclass.sys: Only return new reports when reading data from ringbuffer.
Signed-off-by: Sebastian Lackner <sebastian@fds-team.de>
Signed-off-by: Aric Stewart <aric@codeweavers.com>
Signed-off-by: Alexandre Julliard <julliard@winehq.org>
2016-10-27 20:58:07 +02:00
Sebastian Lackner 74a79a7722 hidclass.sys: Do not return failure when trying to set same ringbuffer size.
Signed-off-by: Sebastian Lackner <sebastian@fds-team.de>
Signed-off-by: Aric Stewart <aric@codeweavers.com>
Signed-off-by: Alexandre Julliard <julliard@winehq.org>
2016-10-27 20:58:00 +02:00
Sebastian Lackner 115c69110d hidclass.sys: Avoid magic constants in ringbuffer implementation.
Signed-off-by: Sebastian Lackner <sebastian@fds-team.de>
Signed-off-by: Aric Stewart <aric@codeweavers.com>
Signed-off-by: Alexandre Julliard <julliard@winehq.org>
2016-10-27 20:57:41 +02:00
Sebastian Lackner 3f5e8715b3 hidclass.sys: Fix memory leak in hid_device_thread.
Signed-off-by: Sebastian Lackner <sebastian@fds-team.de>
Signed-off-by: Aric Stewart <aric@codeweavers.com>
Signed-off-by: Alexandre Julliard <julliard@winehq.org>
2016-10-27 09:36:44 +02:00
Sebastian Lackner b70dd1aa86 hidclass.sys: Fix memory leak in call_minidriver.
Before 5400210376, the output buffer
was released because UserIosb != NULL.

Signed-off-by: Sebastian Lackner <sebastian@fds-team.de>
Signed-off-by: Aric Stewart <aric@codeweavers.com>
Signed-off-by: Alexandre Julliard <julliard@winehq.org>
2016-10-27 09:36:41 +02:00
Sebastian Lackner 9581f4c15a hidclass.sys: Update reportBuffer pointer after reading packet from ringbuffer.
Signed-off-by: Sebastian Lackner <sebastian@fds-team.de>
Signed-off-by: Aric Stewart <aric@codeweavers.com>
Signed-off-by: Alexandre Julliard <julliard@winehq.org>
2016-10-27 09:36:38 +02:00
Aric Stewart fc1485b86b hid: Implement HidD_SetOutputReport.
Signed-off-by: Aric Stewart <aric@codeweavers.com>
Signed-off-by: Sebastian Lackner <sebastian@fds-team.de>
Signed-off-by: Alexandre Julliard <julliard@winehq.org>
2016-10-26 20:12:04 +02:00
Aric Stewart b53846b60b hidclass.sys: Watch return for STATUS_PENDING not IRP status.
Signed-off-by: Aric Stewart <aric@codeweavers.com>
Signed-off-by: Alexandre Julliard <julliard@winehq.org>
2016-10-23 18:32:17 +02:00
Aric Stewart c5dde63b19 hidclass.sys: Use IoSetCompletionRoutine.
Signed-off-by: Aric Stewart <aric@codeweavers.com>
Signed-off-by: Sebastian Lackner <sebastian@fds-team.de>
Signed-off-by: Alexandre Julliard <julliard@winehq.org>
2016-10-19 08:10:34 -07:00
Sebastian Lackner 6d8eb8ba0c hidclass.sys: Use MmGetSystemAddressForMdlSafe to access MDL data.
Signed-off-by: Sebastian Lackner <sebastian@fds-team.de>
Signed-off-by: Aric Stewart <aric@codeweavers.com>
Signed-off-by: Alexandre Julliard <julliard@winehq.org>
2016-10-18 06:14:54 -07:00
Aric Stewart 4163642b99 hidclass.sys: Minidriver handling for IRP_MN_REMOVE_DEVICE finished the IRP.
Signed-off-by: Aric Stewart <aric@codeweavers.com>
Signed-off-by: Sebastian Lackner <sebastian@fds-team.de>
Signed-off-by: Alexandre Julliard <julliard@winehq.org>
2016-10-04 16:01:32 +02:00
Sebastian Lackner 8f76052902 hidclass.sys: Do not return last error / HRESULT values in NTSTATUS functions.
Signed-off-by: Sebastian Lackner <sebastian@fds-team.de>
Signed-off-by: Aric Stewart <aric@codeweavers.com>
Signed-off-by: Alexandre Julliard <julliard@winehq.org>
2016-09-12 23:42:15 +09:00
Nikolay Sivov 026353bf7b hidclass: Fix handle leak on error path (Coverity).
Signed-off-by: Nikolay Sivov <nsivov@codeweavers.com>
Signed-off-by: Aric Stewart <aric@codeweavers.com>
Signed-off-by: Alexandre Julliard <julliard@winehq.org>
2016-08-24 12:04:43 +09:00
Aric Stewart b13924a6c9 hidclass.sys: Handle IRP_MN_REMOVE_DEVICE.
We no longer track PNP devices, that is the PNP manager's job.

Signed-off-by: Aric Stewart <aric@codeweavers.com>
Signed-off-by: Alexandre Julliard <julliard@winehq.org>
2016-08-23 14:16:49 +09:00
Aric Stewart b16ba45450 hidclass.sys: Do not send IRP_MJ_POWER ioctls.
That is the Plug and Play Manager's job.

Signed-off-by: Aric Stewart <aric@codeweavers.com>
Signed-off-by: Alexandre Julliard <julliard@winehq.org>
2016-08-17 13:37:24 +09:00
Aric Stewart 3036cfef2f hidclass.sys: Do not send IRP_MJ_PNP ioctls.
That is the Plug and Play Manager's job.

Signed-off-by: Aric Stewart <aric@codeweavers.com>
Signed-off-by: Alexandre Julliard <julliard@winehq.org>
2016-08-17 13:37:14 +09:00
Aric Stewart ab3b9bd84d hidclass.sys: Call IoAttachDeviceToDeviceStack when creating HID device.
Signed-off-by: Aric Stewart <aric@codeweavers.com>
Signed-off-by: Alexandre Julliard <julliard@winehq.org>
2016-08-17 13:37:06 +09:00
Aric Stewart f2392af888 hidclass.sys: Use the PDO instance id for the HID instance id.
Signed-off-by: Aric Stewart <aric@codeweavers.com>
Signed-off-by: Alexandre Julliard <julliard@winehq.org>
2016-08-17 13:36:52 +09:00
Alexandre Julliard f21cb01aa4 makefiles: Don't allow import libraries to have an extension.
Signed-off-by: Alexandre Julliard <julliard@winehq.org>
2016-06-14 14:04:20 +09:00
Marcus Meissner bb590b3f9f hidclass.sys: Add missing case/missing HeapFree (Coverity).
Signed-off-by: Marcus Meissner <marcus@jet.franken.de>
Signed-off-by: Aric Stewart <aric@codeweavers.com>
Signed-off-by: Alexandre Julliard <julliard@winehq.org>
2016-04-26 14:48:34 +09:00