Commit df90c379 authored by Rémi Bernon's avatar Rémi Bernon Committed by Alexandre Julliard

dinput: Use 4 bytes for every object user state in SetActionMap.

parent 8e069f0b
......@@ -2052,7 +2052,7 @@ static HRESULT WINAPI dinput_device_SetActionMap( IDirectInputDevice8W *iface, D
action_map = malloc( sizeof(ActionMap) * num_actions );
for (i = 0; i < format->dwNumActions; i++)
for (i = 0; i < format->dwNumActions; i++, offset += sizeof(ULONG))
{
if (IsEqualGUID( &impl->guid, &format->rgoAction[i].guidInstance ))
{
......@@ -2070,9 +2070,7 @@ static HRESULT WINAPI dinput_device_SetActionMap( IDirectInputDevice8W *iface, D
action_map[action].uAppData = format->rgoAction[i].uAppData;
action_map[action].offset = offset;
obj_df[action].dwOfs = offset;
offset += (type & DIDFT_BUTTON) ? 1 : 4;
data_format.dwNumObjs++;
action++;
}
}
......
......@@ -1046,13 +1046,13 @@ static void test_action_map( IDirectInputDevice8W *device, HANDLE file, HANDLE e
hr = IDirectInputDevice8_GetDeviceState( device, sizeof(state), state );
ok( hr == DI_OK, "GetDeviceState returned: %#lx\n", hr );
todo_wine
todo_wine_if( i > 5 )
ok( state[0] == expect_state[i][0], "got state[0] %+ld\n", state[0] );
todo_wine_if( i != 2 )
todo_wine_if( i == 2 || i > 4 )
ok( state[1] == expect_state[i][1], "got state[1] %+ld\n", state[1] );
todo_wine_if( expect_state[i][2] )
ok( state[2] == expect_state[i][2], "got state[2] %+ld\n", state[2] );
todo_wine_if( expect_state[i][3] )
todo_wine_if( i > 5 )
ok( state[3] == expect_state[i][3], "got state[3] %+ld\n", state[3] );
todo_wine_if( expect_state[i][4] )
ok( state[4] == expect_state[i][4], "got state[4] %+ld\n", state[4] );
......@@ -1082,7 +1082,7 @@ static void test_action_map( IDirectInputDevice8W *device, HANDLE file, HANDLE e
while (res--)
{
winetest_push_context( "%lu", res );
todo_wine
todo_wine_if( res != 1 && res != 4 )
check_member( objdata[res], expect_objdata[res], "%#lx", dwOfs );
todo_wine_if( res == 0 || res == 3 || res == 6 )
ok( objdata[res].dwData == expect_objdata[res].dwData ||
......
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