From 5b648e7e5db10dc5e495a912210b988f2b0b1b5f Mon Sep 17 00:00:00 2001 From: =?utf8?q?R=C3=A9mi=20Bernon?= Date: Fri, 19 May 2023 17:28:40 +0200 Subject: [PATCH] dinput: Reset action map mapping before loading the registry mapping. Wine-Bug: https://bugs.winehq.org/show_bug.cgi?id=54917 --- dlls/dinput/device.c | 13 ++----------- 1 file changed, 2 insertions(+), 11 deletions(-) diff --git a/dlls/dinput/device.c b/dlls/dinput/device.c index 4f76168a1a3..8fc54d8ce32 100644 --- a/dlls/dinput/device.c +++ b/dlls/dinput/device.c @@ -1850,6 +1850,8 @@ static HRESULT WINAPI dinput_device_BuildActionMap( IDirectInputDevice8W *iface, !IsEqualCLSID( &action->guidInstance, &impl->guid )) continue; if (action->dwFlags & DIA_APPMAPPED) action->dwHow = DIAH_APPREQUESTED; else action->dwHow = 0; + if (action->dwHow == DIAH_APPREQUESTED || action->dwHow == DIAH_USERCONFIG) continue; + if (!(action->dwFlags & DIA_APPNOMAP)) action->guidInstance = GUID_NULL; } /* Unless asked the contrary by these flags, try to load a previous mapping */ @@ -1861,17 +1863,6 @@ static HRESULT WINAPI dinput_device_BuildActionMap( IDirectInputDevice8W *iface, load_mapping_settings( impl, format, username_buf ); } - action_end = format->rgoAction + format->dwNumActions; - for (action = format->rgoAction; action < action_end; action++) - { - if (action->dwHow == DIAH_APPREQUESTED || action->dwHow == DIAH_USERCONFIG) continue; - if (flags == DIDBAM_PRESERVE && !IsEqualCLSID( &action->guidInstance, &GUID_NULL ) && - !IsEqualCLSID( &action->guidInstance, &impl->guid )) continue; - if (action->dwFlags & DIA_APPNOMAP) continue; - action->guidInstance = GUID_NULL; - action->dwHow = 0; - } - if (!(mapped = calloc( impl->device_format.dwNumObjs, sizeof(*mapped) ))) return DIERR_OUTOFMEMORY; action_end = format->rgoAction + format->dwNumActions; -- 2.11.4.GIT