Ivo Ivanov : hidparse.sys: Preserve the original report_count in parse_new_value_caps.
Alexandre Julliard
julliard at winehq.org
Fri Oct 1 18:02:23 CDT 2021
Module: wine
Branch: master
Commit: d97426be026e16f8dddcc2a003bf19c477668183
URL: https://source.winehq.org/git/wine.git/?a=commit;h=d97426be026e16f8dddcc2a003bf19c477668183
Author: Ivo Ivanov <logos128 at gmail.com>
Date: Fri Oct 1 09:51:04 2021 +0200
hidparse.sys: Preserve the original report_count in parse_new_value_caps.
We force state->items.report_count to 1 while building the alternate
value array, but the item is global and should be preserved across caps.
Wine-Bug: https://bugs.winehq.org/show_bug.cgi?id=51822
Signed-off-by: Ivo Ivanov <logos128 at gmail.com>
Signed-off-by: Rémi Bernon <rbernon at codeweavers.com>
Signed-off-by: Alexandre Julliard <julliard at winehq.org>
---
dlls/dinput8/tests/hid.c | 9 ++++-----
dlls/hidparse.sys/main.c | 2 ++
2 files changed, 6 insertions(+), 5 deletions(-)
diff --git a/dlls/dinput8/tests/hid.c b/dlls/dinput8/tests/hid.c
index e83cc8a3f7b..aac0da88908 100644
--- a/dlls/dinput8/tests/hid.c
+++ b/dlls/dinput8/tests/hid.c
@@ -1771,8 +1771,8 @@ static void test_hidp( HANDLE file, HANDLE async_file, int report_id, BOOL polle
status = HidP_SetUsages( HidP_Input, HID_USAGE_PAGE_KEYBOARD, 0, usages, &value, preparsed_data,
report, caps.InputReportByteLength );
ok( status == HIDP_STATUS_BUFFER_TOO_SMALL, "HidP_SetUsages returned %#x\n", status );
- buffer[6] = 2;
- buffer[7] = 4;
+ buffer[13] = 2;
+ buffer[14] = 4;
ok( !memcmp( buffer, report, caps.InputReportByteLength ), "unexpected report data\n" );
status = HidP_SetUsageValue( HidP_Input, HID_USAGE_PAGE_LED, 0, 6, 1, preparsed_data, report,
@@ -2460,8 +2460,7 @@ static void test_hid_driver( DWORD report_id, DWORD polled )
REPORT_COUNT(1, 8),
REPORT_SIZE(1, 1),
INPUT(1, Cnst|Var|Abs),
- REPORT_COUNT(1, 8),
- REPORT_SIZE(1, 1),
+ REPORT_SIZE(1, 8),
INPUT(1, Cnst|Var|Abs),
/* needs to be 8 bit aligned as next has Buff */
@@ -2682,7 +2681,7 @@ static void test_hid_driver( DWORD report_id, DWORD polled )
{
.Usage = HID_USAGE_GENERIC_JOYSTICK,
.UsagePage = HID_USAGE_PAGE_GENERIC,
- .InputReportByteLength = report_id ? 25 : 26,
+ .InputReportByteLength = report_id ? 32 : 33,
.OutputReportByteLength = report_id ? 2 : 3,
.FeatureReportByteLength = report_id ? 21 : 22,
.NumberLinkCollectionNodes = 10,
diff --git a/dlls/hidparse.sys/main.c b/dlls/hidparse.sys/main.c
index ca15a91c75a..18ee23974f0 100644
--- a/dlls/hidparse.sys/main.c
+++ b/dlls/hidparse.sys/main.c
@@ -360,6 +360,7 @@ static BOOL parse_new_value_caps( struct hid_parser_state *state, HIDP_REPORT_TY
{
struct hid_value_caps *values;
USAGE usage_page = state->items.usage_page;
+ USHORT report_count = state->items.report_count;
DWORD i, usages_size = max( 1, state->usages_size );
USHORT *byte_length = &state->byte_length[type];
ULONG start_bit, *bit_size = &state->bit_size[type][state->items.report_id];
@@ -408,6 +409,7 @@ static BOOL parse_new_value_caps( struct hid_parser_state *state, HIDP_REPORT_TY
state->data_count[type] = state->items.data_index_max + 1;
state->items.usage_page = usage_page;
+ state->items.report_count = report_count;
reset_local_items( state );
return TRUE;
}
More information about the wine-cvs
mailing list