Module: wine Branch: master Commit: bf22424e2af276d0e1b9641bcbbfe63f25159824 URL: https://gitlab.winehq.org/wine/wine/-/commit/bf22424e2af276d0e1b9641bcbbfe63...
Author: Rémi Bernon rbernon@codeweavers.com Date: Mon Mar 20 16:57:27 2023 +0100
dinput: Return DI_SETTINGSNOTSAVED when DIDSAM_FORCESAVE is used.
---
dlls/dinput/device.c | 1 + dlls/dinput/tests/joystick8.c | 5 ----- 2 files changed, 1 insertion(+), 5 deletions(-)
diff --git a/dlls/dinput/device.c b/dlls/dinput/device.c index 0df0199317b..41baa630989 100644 --- a/dlls/dinput/device.c +++ b/dlls/dinput/device.c @@ -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; } diff --git a/dlls/dinput/tests/joystick8.c b/dlls/dinput/tests/joystick8.c index 7947e6e33cc..a74dab6dc52 100644 --- a/dlls/dinput/tests/joystick8.c +++ b/dlls/dinput/tests/joystick8.c @@ -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 );