hidparse.sys: Output array caps data indexes in the correct order.

Signed-off-by: Rémi Bernon <rbernon@codeweavers.com>
Signed-off-by: Alexandre Julliard <julliard@winehq.org>
This commit is contained in:
Rémi Bernon 2021-09-22 10:08:34 +02:00 committed by Alexandre Julliard
parent d6c47adc32
commit 9aaea0c17d
2 changed files with 2 additions and 4 deletions

View File

@ -3174,9 +3174,7 @@ static void test_hidp_kdr(void)
check_member( kdr->caps[i], expect_caps[i], "%d", string_max );
check_member( kdr->caps[i], expect_caps[i], "%d", designator_min );
check_member( kdr->caps[i], expect_caps[i], "%d", designator_max );
todo_wine_if( !(kdr->caps[i].bit_field & 2) && !(kdr->caps[i].flags & HIDP_KDR_CAPS_IS_RANGE) )
check_member( kdr->caps[i], expect_caps[i], "%#x", data_index_min );
todo_wine_if( !(kdr->caps[i].bit_field & 2) && !(kdr->caps[i].flags & HIDP_KDR_CAPS_IS_RANGE) )
check_member( kdr->caps[i], expect_caps[i], "%#x", data_index_max );
todo_wine_if( expect_caps[i].null_value )
check_member( kdr->caps[i], expect_caps[i], "%d", null_value );

View File

@ -384,9 +384,9 @@ static BOOL parse_new_value_caps( struct hid_parser_state *state, HIDP_REPORT_TY
for (i = 0; i < usages_size; ++i)
{
if (!is_array) start_bit -= state->items.report_count * state->items.bit_size;
else if (i < usages_size - 1) state->items.flags |= HID_VALUE_CAPS_ARRAY_HAS_MORE;
else if (i) state->items.flags |= HID_VALUE_CAPS_ARRAY_HAS_MORE;
else state->items.flags &= ~HID_VALUE_CAPS_ARRAY_HAS_MORE;
add_new_value_caps( state, values, i, start_bit );
add_new_value_caps( state, values, is_array ? usages_size - i - 1 : i, start_bit );
if (!is_array) state->items.report_count = 1;
}
state->caps_count[type] += usages_size;