dinput: Return DI_SETTINGSNOTSAVED when DIDSAM_FORCESAVE is used.

This commit is contained in:
Rémi Bernon 2023-03-20 16:57:27 +01:00 committed by Alexandre Julliard
parent 5d3f2d18ad
commit bf22424e2a
2 changed files with 1 additions and 5 deletions

View file

@ -2022,6 +2022,7 @@ static HRESULT WINAPI dinput_device_SetActionMap( IDirectInputDevice8W *iface, D
free( data_format.rgodf );
if (FAILED(hr)) return hr;
if (flags == DIDSAM_FORCESAVE) return DI_SETTINGSNOTSAVED;
if (!data_format.dwNumObjs) return DI_NOEFFECT;
return hr;
}

View file

@ -818,7 +818,6 @@ static void test_action_map( IDirectInputDevice8W *device, HANDLE file, HANDLE e
/* first SetActionMap call for a user always return DI_SETTINGSNOTSAVED */
hr = IDirectInputDevice8_SetActionMap( device, &voice_action_format, NULL, DIDSAM_FORCESAVE );
todo_wine
ok( hr == DI_SETTINGSNOTSAVED, "SetActionMap returned %#lx\n", hr );
memset( prop_username.wsz, 0, sizeof(prop_username.wsz) );
@ -829,7 +828,6 @@ static void test_action_map( IDirectInputDevice8W *device, HANDLE file, HANDLE e
hr = IDirectInputDevice8_SetActionMap( device, &voice_action_format, NULL, DIDSAM_DEFAULT );
ok( hr == DI_NOEFFECT, "SetActionMap returned %#lx\n", hr );
hr = IDirectInputDevice8_SetActionMap( device, &voice_action_format, NULL, DIDSAM_FORCESAVE );
todo_wine
ok( hr == DI_SETTINGSNOTSAVED, "SetActionMap returned %#lx\n", hr );
memset( prop_username.wsz, 0, sizeof(prop_username.wsz) );
@ -874,10 +872,8 @@ static void test_action_map( IDirectInputDevice8W *device, HANDLE file, HANDLE e
/* DIDSAM_FORCESAVE always returns DI_SETTINGSNOTSAVED */
hr = IDirectInputDevice8_SetActionMap( device, &action_format, L"username", DIDSAM_FORCESAVE );
todo_wine
ok( hr == DI_SETTINGSNOTSAVED, "SetActionMap returned %#lx\n", hr );
hr = IDirectInputDevice8_SetActionMap( device, &action_format, L"username", DIDSAM_FORCESAVE );
todo_wine
ok( hr == DI_SETTINGSNOTSAVED, "SetActionMap returned %#lx\n", hr );
check_diactionformatw( &action_format, &expect_action_format_1 );
@ -946,7 +942,6 @@ static void test_action_map( IDirectInputDevice8W *device, HANDLE file, HANDLE e
ok( hr == DI_OK, "SetActionMap returned %#lx\n", hr );
check_diactionformatw( &action_format, &expect_action_format_2_filled );
hr = IDirectInputDevice8_SetActionMap( device, &action_format, L"username", DIDSAM_FORCESAVE );
todo_wine
ok( hr == DI_SETTINGSNOTSAVED, "SetActionMap returned %#lx\n", hr );
check_diactionformatw( &action_format, &expect_action_format_2_filled );