From f9d702ebbf81699a94f1dd8a98ea5d3ef48c4583 Mon Sep 17 00:00:00 2001 From: Valentin Radu Date: Wed, 1 Mar 2023 21:19:33 +0200 Subject: [PATCH] Taskbar10: Fixed a bug that crashed `explorer` on OS build 22621.1344 It seems Microsoft updated some stuff in `windowsudk.shellcommon.dll` and has introduced a new interface (`ITaskbarSettings6`), from which they call the `GetEffectiveSearchMode` method. This is not relevant for the Windows 10 taskbar, but the code gets called there anyway as well, so it had to be patched to support this new interface. This fix should address the issue and have ExplorerPatcher still work on newer 22621-based OS builds, like 1344 ("Moment 2" update). --- ExplorerPatcher/StartMenu.c | 69 ++++++++++++++++++++++++++++++++++++- ExplorerPatcher/StartMenu.h | 6 ++++ 2 files changed, 74 insertions(+), 1 deletion(-) diff --git a/ExplorerPatcher/StartMenu.c b/ExplorerPatcher/StartMenu.c index 9063d64..981a721 100644 --- a/ExplorerPatcher/StartMenu.c +++ b/ExplorerPatcher/StartMenu.c @@ -477,6 +477,73 @@ static ULONG STDMETHODCALLTYPE WindowsUdk_UI_Shell_ITaskbarSettings_AddRefReleas return 1; } +static HRESULT STDMETHODCALLTYPE WindowsUdk_UI_Shell_ITaskbarSettings6_GetEffectiveSearchMode( + void* instanceof_WindowsUdk_UI_Shell_ITaskbarSettings6, + DWORD* pEffectiveSearchMode +) +{ + *pEffectiveSearchMode = 1; + return 0; +} + +static void* instanceof_WindowsUdk_UI_Shell_ITaskbarSettings6Vtbl[41] = { // : IInspectableVtbl + WindowsUdk_UI_Shell_ITaskbarSettings_NotImplemented, + WindowsUdk_UI_Shell_ITaskbarSettings_AddRefRelease, + WindowsUdk_UI_Shell_ITaskbarSettings_AddRefRelease, + WindowsUdk_UI_Shell_ITaskbarSettings_NotImplemented, + WindowsUdk_UI_Shell_ITaskbarSettings_NotImplemented, + WindowsUdk_UI_Shell_ITaskbarSettings_NotImplemented, + WindowsUdk_UI_Shell_ITaskbarSettings6_GetEffectiveSearchMode, + WindowsUdk_UI_Shell_ITaskbarSettings_NotImplemented, + WindowsUdk_UI_Shell_ITaskbarSettings_NotImplemented, + WindowsUdk_UI_Shell_ITaskbarSettings_NotImplemented, + WindowsUdk_UI_Shell_ITaskbarSettings_NotImplemented, + WindowsUdk_UI_Shell_ITaskbarSettings_NotImplemented, + WindowsUdk_UI_Shell_ITaskbarSettings_NotImplemented, + WindowsUdk_UI_Shell_ITaskbarSettings_NotImplemented, + WindowsUdk_UI_Shell_ITaskbarSettings_NotImplemented, + WindowsUdk_UI_Shell_ITaskbarSettings_NotImplemented, + WindowsUdk_UI_Shell_ITaskbarSettings_NotImplemented, + WindowsUdk_UI_Shell_ITaskbarSettings_NotImplemented, + WindowsUdk_UI_Shell_ITaskbarSettings_NotImplemented, + WindowsUdk_UI_Shell_ITaskbarSettings_NotImplemented, + WindowsUdk_UI_Shell_ITaskbarSettings_NotImplemented, + WindowsUdk_UI_Shell_ITaskbarSettings_NotImplemented, + WindowsUdk_UI_Shell_ITaskbarSettings_NotImplemented, + WindowsUdk_UI_Shell_ITaskbarSettings_NotImplemented, + WindowsUdk_UI_Shell_ITaskbarSettings_NotImplemented, + WindowsUdk_UI_Shell_ITaskbarSettings_NotImplemented, + WindowsUdk_UI_Shell_ITaskbarSettings_NotImplemented, + WindowsUdk_UI_Shell_ITaskbarSettings_NotImplemented, + WindowsUdk_UI_Shell_ITaskbarSettings_NotImplemented, + WindowsUdk_UI_Shell_ITaskbarSettings_NotImplemented, + WindowsUdk_UI_Shell_ITaskbarSettings_NotImplemented, + WindowsUdk_UI_Shell_ITaskbarSettings_NotImplemented, + WindowsUdk_UI_Shell_ITaskbarSettings_NotImplemented, + WindowsUdk_UI_Shell_ITaskbarSettings_NotImplemented, + WindowsUdk_UI_Shell_ITaskbarSettings_NotImplemented, + WindowsUdk_UI_Shell_ITaskbarSettings_NotImplemented, + WindowsUdk_UI_Shell_ITaskbarSettings_NotImplemented, + WindowsUdk_UI_Shell_ITaskbarSettings_NotImplemented, + WindowsUdk_UI_Shell_ITaskbarSettings_NotImplemented, + WindowsUdk_UI_Shell_ITaskbarSettings_NotImplemented, + WindowsUdk_UI_Shell_ITaskbarSettings_NotImplemented +}; +typedef struct instanceof_WindowsUdk_UI_Shell_ITaskbarSettings6 // : IInspectable +{ + void* lpVtbl; +} WindowsUdk_UI_Shell_ITaskbarSettings6; +static const WindowsUdk_UI_Shell_ITaskbarSettings6 instanceof_WindowsUdk_UI_Shell_ITaskbarSettings6 = { instanceof_WindowsUdk_UI_Shell_ITaskbarSettings6Vtbl }; + +static HRESULT STDMETHODCALLTYPE WindowsUdk_UI_Shell_ITaskbarSettings_QueryInterface(void* instanceof_WindowsUdk_UI_Shell_ITaskbarSettings, REFIID riid, void** ppv) +{ + if (IsEqualIID(riid, &IID_WindowsUdk_UI_Shell_ITaskbarSettings6)) { + *ppv = &instanceof_WindowsUdk_UI_Shell_ITaskbarSettings6; + return S_OK; + } + return E_NOTIMPL; +} + static HRESULT STDMETHODCALLTYPE WindowsUdk_UI_Shell_ITaskbarSettings_GetAlignment_Left( void* instanceof_WindowsUdk_UI_Shell_ITaskbarSettings, DWORD* pAlignment @@ -523,7 +590,7 @@ static HRESULT STDMETHODCALLTYPE WindowsUdk_UI_Shell_ITaskbarSettings_GetSearchM } static void* instanceof_WindowsUdk_UI_Shell_ITaskbarSettingsVtbl[41] = { // : IInspectableVtbl - WindowsUdk_UI_Shell_ITaskbarSettings_NotImplemented, + WindowsUdk_UI_Shell_ITaskbarSettings_QueryInterface, WindowsUdk_UI_Shell_ITaskbarSettings_AddRefRelease, WindowsUdk_UI_Shell_ITaskbarSettings_AddRefRelease, WindowsUdk_UI_Shell_ITaskbarSettings_NotImplemented, diff --git a/ExplorerPatcher/StartMenu.h b/ExplorerPatcher/StartMenu.h index 9008251..87869f3 100644 --- a/ExplorerPatcher/StartMenu.h +++ b/ExplorerPatcher/StartMenu.h @@ -42,6 +42,12 @@ DEFINE_GUID(IID_IImmersiveLauncher10RS, 0x32, 0x1f, 0xd1, 0xb4, 0x98, 0x64 ); +DEFINE_GUID(IID_WindowsUdk_UI_Shell_ITaskbarSettings6, + 0x5CBF9899, + 0x3E66, 0x5556, 0xA1, 0x31, + 0x1E, 0x3E, 0xE8, 0x14, 0x85, 0x90 +); + typedef interface IImmersiveMonitorService IImmersiveMonitorService; typedef struct IImmersiveMonitorServiceVtbl