Commit Graph

73 Commits

Author SHA1 Message Date
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
Francois Gouget 742d8f4808 hidclass.sys: Fix spelling of a private struct's name.
Signed-off-by: Francois Gouget <fgouget@free.fr>
Signed-off-by: Aric Stewart <aric@codeweavers.com>
Signed-off-by: Alexandre Julliard <julliard@winehq.org>
2016-04-13 23:01:11 +09:00
Aric Stewart 0564257349 hidclass.sys: Use the instance id for the device link.
Signed-off-by: Aric Stewart <aric@codeweavers.com>
Signed-off-by: Alexandre Julliard <julliard@winehq.org>
2016-04-06 14:59:48 +09:00
Aric Stewart 4b5bed4557 hidclass.sys: Implement IRP_MN_QUERY_ID for HID devices.
Signed-off-by: Aric Stewart <aric@codeweavers.com>
Signed-off-by: Alexandre Julliard <julliard@winehq.org>
2016-04-06 14:59:46 +09:00
Aric Stewart be91fcd879 hidclass.sys: Improvements for IOCTL_HID_GET_FEATURE handling.
Signed-off-by: Aric Stewart <aric@codeweavers.com>
Signed-off-by: Alexandre Julliard <julliard@winehq.org>
2016-04-06 00:37:06 +09:00
Aric Stewart 1b62b7f3c9 hidclass.sys: Correct input vs output parameters for IOCTL_HID_SET_FEATURE.
Signed-off-by: Aric Stewart <aric@codeweavers.com>
Signed-off-by: Alexandre Julliard <julliard@winehq.org>
2016-04-06 00:37:03 +09:00
Aric Stewart 5fb6a94bb9 hidclass.sys: Handle failure to parse preparseData.
Signed-off-by: Aric Stewart <aric@codeweavers.com>
Signed-off-by: Alexandre Julliard <julliard@winehq.org>
2016-03-04 18:43:03 +09:00
Changhui Liu 3f2055b1cf hidclass.sys: Properly quit hid_device_thread when both completion event and halt event are signaled.
Signed-off-by: Changhui Liu <liuchanghui@linuxdeepin.com>
Signed-off-by: Aric Stewart <aric@codeweavers.com>
Signed-off-by: Alexandre Julliard <julliard@winehq.org>
2016-01-20 23:58:04 +09:00
Aric Stewart d24239efdf hidclass.sys: Implement IOCTL_HID_SET_FEATURE.
Signed-off-by: Aric Stewart <aric@codeweavers.com>
Signed-off-by: Alexandre Julliard <julliard@winehq.org>
2016-01-14 21:23:28 +09:00
Aric Stewart 5a06668488 hidclass.sys: Implement IOCTL_HID_GET_FEATURE.
Signed-off-by: Aric Stewart <aric@codeweavers.com>
Signed-off-by: Alexandre Julliard <julliard@winehq.org>
2016-01-14 21:23:22 +09:00
Aric Stewart ba84b6472e hidclass.sys: Implement HID_Device_write.
Signed-off-by: Aric Stewart <aric@codeweavers.com>
Signed-off-by: Alexandre Julliard <julliard@winehq.org>
2016-01-14 21:23:11 +09:00