Sweden-Number/dlls/hidclass.sys
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
..
Makefile.in
buffer.c
descriptor.c hidclass.sys: Calculate correct bitCount for vendor-specific 1 bit repeated elements. 2021-01-21 20:46:13 +01:00
device.c hidclass.sys: Use wide-char string literals. 2020-11-16 11:25:18 +01:00
hid.h
hidclass.sys.spec
main.c
pnp.c hidclass.sys: Use wide-char string literals. 2020-11-16 11:25:18 +01:00