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
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
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
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
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
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
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
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
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
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
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
Changhui Liu
0125ef6dd7
hidclass.sys: Properly print 80 bytes in first line when tracing ParseDescriptor.
...
Signed-off-by: Changhui Liu <liuchanghui@linuxdeepin.com>
Signed-off-by: Aric Stewart <aric@codeweavers.com>
Signed-off-by: Alexandre Julliard <julliard@winehq.org>
2015-12-21 19:50:30 +01:00
Aric Stewart
91d46cb3a1
hidclass.sys: Break the report descriptor into multiple lines.
...
Signed-off-by: Aric Stewart <aric@codeweavers.com>
Signed-off-by: Alexandre Julliard <julliard@winehq.org>
2015-11-16 22:39:58 +09:00
Francois Gouget
af0288d419
hidclass.sys: Make a few functions static.
...
Signed-off-by: Francois Gouget <fgouget@free.fr>
Signed-off-by: Alexandre Julliard <julliard@winehq.org>
2015-10-27 21:45:45 +09:00
Michael Stefaniuc
428925eeee
hidclass.sys: Fix a misplaced closing bracket (PVS-Studio).
...
Signed-off-by: Michael Stefaniuc <mstefani@redhat.de>
Signed-off-by: Alexandre Julliard <julliard@winehq.org>
2015-10-13 22:24:32 +09:00
Aric Stewart
2183b8ac21
hidclass.sys: Help make the logic around feature input flags more apparent.
...
Signed-off-by: Aric Stewart <aric@codeweavers.com>
2015-10-07 13:27:23 +09:00
Marcus Meissner
4b74e9dfa7
hidclass.sys: Fixed copy/paste error (Coverity).
...
Signed-off-by: Marcus Meissner <marcus@jet.franken.de>
Signed-off-by: Aric Stewart <aric@codeweavers.com>
2015-10-05 22:27:16 +09:00
Aric Stewart
b7f43c99ee
hidclass.sys: Add USB Descriptor parsing.
2015-09-15 18:01:23 +09:00