Commit d97426be authored by Ivo Ivanov's avatar Ivo Ivanov Committed by Alexandre Julliard

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=51822Signed-off-by: 's avatarIvo Ivanov <logos128@gmail.com> Signed-off-by: 's avatarRémi Bernon <rbernon@codeweavers.com> Signed-off-by: 's avatarAlexandre Julliard <julliard@winehq.org>
parent 11fe73ed
......@@ -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,
......
......@@ -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;
}
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment