From 98c906f84348b1e45a650d99ec84155f48c7578d Mon Sep 17 00:00:00 2001 From: Alistair Leslie-Hughes Date: Tue, 4 Jan 2022 11:45:19 +1100 Subject: [PATCH] Rebase against 529e4154a34a5a774fe7036552ffbb060740da90. --- ...dinput-Allow-empty-Joystick-mappings.patch | 36 +++++++++---------- patches/patchinstall.sh | 4 +-- staging/upstream-commit | 2 +- 3 files changed, 21 insertions(+), 21 deletions(-) diff --git a/patches/dinput-joy-mappings/0001-dinput-Allow-empty-Joystick-mappings.patch b/patches/dinput-joy-mappings/0001-dinput-Allow-empty-Joystick-mappings.patch index 253d8452..a9899bb7 100644 --- a/patches/dinput-joy-mappings/0001-dinput-Allow-empty-Joystick-mappings.patch +++ b/patches/dinput-joy-mappings/0001-dinput-Allow-empty-Joystick-mappings.patch @@ -1,18 +1,18 @@ -From ef0da9342b0ced44da1ed8532941d53f48ead602 Mon Sep 17 00:00:00 2001 +From 8528d4181967d00a7711d32bdaf7ecde5fe7208f Mon Sep 17 00:00:00 2001 From: Jetro Jormalainen Date: Tue, 30 Apr 2019 09:20:54 +1000 Subject: [PATCH] dinput: Allow empty Joystick mappings. --- dlls/dinput/device.c | 77 ++++++++++++++++++++++++++++++------- - dlls/dinput8/tests/device.c | 50 ++++++++++++++++++++++++ + dlls/dinput/tests/device8.c | 50 ++++++++++++++++++++++++ 2 files changed, 113 insertions(+), 14 deletions(-) diff --git a/dlls/dinput/device.c b/dlls/dinput/device.c -index b423337c9ce..c9466655ce4 100644 +index 1dc3c311f2b..63e6abb54eb 100644 --- a/dlls/dinput/device.c +++ b/dlls/dinput/device.c -@@ -356,12 +356,26 @@ static DWORD semantic_to_obj_id( struct dinput_device *This, DWORD dwSemantic ) +@@ -357,12 +357,26 @@ static DWORD semantic_to_obj_id( struct dinput_device *This, DWORD dwSemantic ) return type | (0x0000ff00 & (instance << 8)); } @@ -40,7 +40,7 @@ index b423337c9ce..c9466655ce4 100644 { static const WCHAR *subkey = L"Software\\Wine\\DirectInput\\Mappings\\%s\\%s\\%s"; HKEY hkey; -@@ -372,8 +386,11 @@ static HKEY get_mapping_key(const WCHAR *device, const WCHAR *username, const WC +@@ -373,8 +387,11 @@ static HKEY get_mapping_key(const WCHAR *device, const WCHAR *username, const WC swprintf( keyname, len, subkey, username, device, guid ); /* The key used is HKCU\Software\Wine\DirectInput\Mappings\[username]\[device]\[mapping_guid] */ @@ -54,7 +54,7 @@ index b423337c9ce..c9466655ce4 100644 free( keyname ); -@@ -393,7 +410,9 @@ static HRESULT save_mapping_settings(IDirectInputDevice8W *iface, LPDIACTIONFORM +@@ -394,7 +411,9 @@ static HRESULT save_mapping_settings(IDirectInputDevice8W *iface, LPDIACTIONFORM if (StringFromCLSID(&lpdiaf->guidActionMap, &guid_str) != S_OK) return DI_SETTINGSNOTSAVED; @@ -65,7 +65,7 @@ index b423337c9ce..c9466655ce4 100644 if (!hkey) { -@@ -428,7 +447,7 @@ static BOOL load_mapping_settings( struct dinput_device *This, LPDIACTIONFORMATW +@@ -429,7 +448,7 @@ static BOOL load_mapping_settings( struct dinput_device *This, LPDIACTIONFORMATW HKEY hkey; WCHAR *guid_str; DIDEVICEINSTANCEW didev; @@ -74,7 +74,7 @@ index b423337c9ce..c9466655ce4 100644 didev.dwSize = sizeof(didev); IDirectInputDevice8_GetDeviceInfo(&This->IDirectInputDevice8W_iface, &didev); -@@ -436,7 +455,7 @@ static BOOL load_mapping_settings( struct dinput_device *This, LPDIACTIONFORMATW +@@ -437,7 +456,7 @@ static BOOL load_mapping_settings( struct dinput_device *This, LPDIACTIONFORMATW if (StringFromCLSID(&lpdiaf->guidActionMap, &guid_str) != S_OK) return FALSE; @@ -83,7 +83,7 @@ index b423337c9ce..c9466655ce4 100644 if (!hkey) { -@@ -456,15 +475,20 @@ static BOOL load_mapping_settings( struct dinput_device *This, LPDIACTIONFORMATW +@@ -457,15 +476,20 @@ static BOOL load_mapping_settings( struct dinput_device *This, LPDIACTIONFORMATW { lpdiaf->rgoAction[i].dwObjID = id; lpdiaf->rgoAction[i].guidInstance = didev.guidInstance; @@ -107,7 +107,7 @@ index b423337c9ce..c9466655ce4 100644 } static BOOL set_app_data( struct dinput_device *dev, int offset, UINT_PTR app_data ) -@@ -1607,13 +1631,18 @@ static HRESULT WINAPI dinput_device_BuildActionMap( IDirectInputDevice8W *iface, +@@ -1914,13 +1938,18 @@ static HRESULT WINAPI dinput_device_BuildActionMap( IDirectInputDevice8W *iface, load_success = load_mapping_settings( impl, format, username_buf ); } @@ -130,7 +130,7 @@ index b423337c9ce..c9466655ce4 100644 genre = format->rgoAction[i].dwSemantic & DIGENRE_ANY; if (devMask == genre || (devMask == DIGENRE_ANY && genre != DIMOUSE_MASK && genre != DIKEYBOARD_MASK)) { -@@ -1645,6 +1674,14 @@ static HRESULT WINAPI dinput_device_BuildActionMap( IDirectInputDevice8W *iface, +@@ -1952,6 +1981,14 @@ static HRESULT WINAPI dinput_device_BuildActionMap( IDirectInputDevice8W *iface, } } @@ -145,7 +145,7 @@ index b423337c9ce..c9466655ce4 100644 if (!has_actions) return DI_NOEFFECT; if (flags & (DIDBAM_DEFAULT|DIDBAM_PRESERVE|DIDBAM_INITIALIZE|DIDBAM_HWDEFAULTS)) FIXME("Unimplemented flags %#x\n", flags); -@@ -1662,6 +1699,7 @@ static HRESULT WINAPI dinput_device_SetActionMap( IDirectInputDevice8W *iface, D +@@ -1969,6 +2006,7 @@ static HRESULT WINAPI dinput_device_SetActionMap( IDirectInputDevice8W *iface, D DIPROPSTRING dps; WCHAR username_buf[MAX_PATH]; DWORD username_len = MAX_PATH; @@ -153,7 +153,7 @@ index b423337c9ce..c9466655ce4 100644 int i, action = 0, num_actions = 0; unsigned int offset = 0; const DIDATAFORMAT *df; -@@ -1694,12 +1732,23 @@ static HRESULT WINAPI dinput_device_SetActionMap( IDirectInputDevice8W *iface, D +@@ -2001,12 +2039,23 @@ static HRESULT WINAPI dinput_device_SetActionMap( IDirectInputDevice8W *iface, D data_format.dwFlags = DIDF_RELAXIS; data_format.dwDataSize = format->dwDataSize; @@ -178,10 +178,10 @@ index b423337c9ce..c9466655ce4 100644 /* Construct the dataformat and actionmap */ obj_df = malloc( sizeof(DIOBJECTDATAFORMAT) * num_actions ); -diff --git a/dlls/dinput8/tests/device.c b/dlls/dinput8/tests/device.c -index 5ae9e225dc9..d3e86c68176 100644 ---- a/dlls/dinput8/tests/device.c -+++ b/dlls/dinput8/tests/device.c +diff --git a/dlls/dinput/tests/device8.c b/dlls/dinput/tests/device8.c +index 817e843e33c..ad9ee1f006b 100644 +--- a/dlls/dinput/tests/device8.c ++++ b/dlls/dinput/tests/device8.c @@ -48,6 +48,8 @@ struct enum_data { /* Dummy GUID */ static const GUID ACTION_MAPPING_GUID = { 0x1, 0x2, 0x3, { 0x4, 0x5, 0x6, 0x7, 0x8, 0x9, 0xa, 0xb } }; @@ -254,5 +254,5 @@ index 5ae9e225dc9..d3e86c68176 100644 IDirectInput_Release(pDI); } -- -2.33.0 +2.34.1 diff --git a/patches/patchinstall.sh b/patches/patchinstall.sh index 1b02e12a..f33946e7 100755 --- a/patches/patchinstall.sh +++ b/patches/patchinstall.sh @@ -51,7 +51,7 @@ usage() # Get the upstream commit sha upstream_commit() { - echo "2318484e1e33cb30f00eb9a62cb9aa5f83e5dc99" + echo "529e4154a34a5a774fe7036552ffbb060740da90" } # Show version information @@ -1732,7 +1732,7 @@ fi # | * [#35815] dinput: Allow remapping of joystick buttons. # | # | Modified files: -# | * dlls/dinput/config.c, dlls/dinput/device.c, dlls/dinput/dinput_private.h, dlls/dinput8/tests/device.c +# | * dlls/dinput/config.c, dlls/dinput/device.c, dlls/dinput/dinput_private.h, dlls/dinput/tests/device8.c # | if test "$enable_dinput_joy_mappings" -eq 1; then patch_apply dinput-joy-mappings/0001-dinput-Allow-empty-Joystick-mappings.patch diff --git a/staging/upstream-commit b/staging/upstream-commit index 24e1349a..41a9df45 100644 --- a/staging/upstream-commit +++ b/staging/upstream-commit @@ -1 +1 @@ -2318484e1e33cb30f00eb9a62cb9aa5f83e5dc99 +529e4154a34a5a774fe7036552ffbb060740da90