From: Rémi Bernon rbernon@codeweavers.com
--- dlls/dinput/device.c | 4 +--- dlls/dinput/tests/joystick8.c | 8 ++++---- 2 files changed, 5 insertions(+), 7 deletions(-)
diff --git a/dlls/dinput/device.c b/dlls/dinput/device.c index 9dd7a3f478f..fb7be1e2e6d 100644 --- a/dlls/dinput/device.c +++ b/dlls/dinput/device.c @@ -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++; } } diff --git a/dlls/dinput/tests/joystick8.c b/dlls/dinput/tests/joystick8.c index 22a83f911bc..1ca2975a15e 100644 --- a/dlls/dinput/tests/joystick8.c +++ b/dlls/dinput/tests/joystick8.c @@ -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 ||