diff --git a/CHANGELOG.md b/CHANGELOG.md
index 53702b6..bd610a7 100644
--- a/CHANGELOG.md
+++ b/CHANGELOG.md
@@ -22,8 +22,15 @@ Tested on OS builds 22000.2416, 22621.1, 22621.2134, 22621.2361, 22631.2338, and
* Taskbar10: Fixed Wi-Fi flyout buttons on OS build 22621 (0706393)
* Start10: Fixed start menu folders, show recently added, and show frequently used apps settings not being applied on OS builds 22621.2134+ (e28940d)
+##### 3
+
+* Start10: Pin to Start/Unpin from Start has been properly fixed on Start Menu and Explorer (but not Search yet) of all Windows 11 builds. (15c07a0)
+* Start10: Fixed non-UWP apps not appearing on Dev channel builds 23545+. (a4f5bd0)
+
Many thanks to @Amrsatrio for sustained efforts in maintaining and improving ExplorerPatcher.
+Thanks to @ARestrepo228 for hints on fixing Pin to Start/Unpin from Start.
+
## 22621.2283.57
Tested on OS build 22621.2283. Installer requires Internet connectivity.
diff --git a/ExplorerPatcher/ExplorerPatcher.vcxproj b/ExplorerPatcher/ExplorerPatcher.vcxproj
index cb88b18..6943211 100644
--- a/ExplorerPatcher/ExplorerPatcher.vcxproj
+++ b/ExplorerPatcher/ExplorerPatcher.vcxproj
@@ -29,26 +29,26 @@
DynamicLibrary
true
- v143
+ v142
Unicode
DynamicLibrary
true
- v143
+ v142
Unicode
DynamicLibrary
false
- v143
+ v142
true
Unicode
DynamicLibrary
false
- v143
+ v142
true
Unicode
diff --git a/ExplorerPatcher/StartMenuSettings.cpp b/ExplorerPatcher/StartMenuSettings.cpp
index ab4acb3..b0866a8 100644
--- a/ExplorerPatcher/StartMenuSettings.cpp
+++ b/ExplorerPatcher/StartMenuSettings.cpp
@@ -155,6 +155,53 @@ extern "C" BOOL NeedsRo_SyncSettingsFromRegToCDS()
return TRUE;
}
+namespace ABI::WindowsUdk::ApplicationModel::AppExtensions
+{
+ enum AppExtensionOptions {};
+
+ MIDL_INTERFACE("836da1ed-5be8-5365-8452-6af327aa427b")
+ IExtensionFactoryStatics : public IInspectable
+ {
+ virtual HRESULT STDMETHODCALLTYPE IsExtensionAvailable(HSTRING, HSTRING, bool*) = 0;
+ virtual HRESULT STDMETHODCALLTYPE IsExtensionAvailableWithOptions(HSTRING, HSTRING, AppExtensionOptions, bool*) = 0;
+ virtual HRESULT STDMETHODCALLTYPE GetInstance(HSTRING, HSTRING, IInspectable**) = 0;
+ virtual HRESULT STDMETHODCALLTYPE GetInstanceWithOptions(HSTRING, HSTRING, AppExtensionOptions, IInspectable**) = 0;
+ virtual HRESULT STDMETHODCALLTYPE GetFactory(HSTRING, HSTRING, IInspectable**) = 0;
+ virtual HRESULT STDMETHODCALLTYPE GetFactoryWithOptions(HSTRING, HSTRING, AppExtensionOptions, IInspectable**) = 0;
+ };
+}
+
+class DummyExtensionFactory : ABI::WindowsUdk::ApplicationModel::AppExtensions::IExtensionFactoryStatics
+{
+public:
+ HRESULT QueryInterface(REFIID riid, void** ppvObject) override { return E_NOINTERFACE; }
+ ULONG AddRef() override { return 1; }
+ ULONG Release() override { return 1; }
+ HRESULT GetIids(ULONG* iidCount, IID** iids) override { return E_NOTIMPL; }
+ HRESULT GetRuntimeClassName(HSTRING* className) override { return E_NOTIMPL; }
+ HRESULT GetTrustLevel(TrustLevel* trustLevel) override { return E_NOTIMPL; }
+
+ // Keep the value of result as zero (set by the caller) and return S_OK to make the Windows 10 code run
+ HRESULT IsExtensionAvailable(HSTRING, HSTRING, bool*) override { return S_OK; }
+ HRESULT IsExtensionAvailableWithOptions(HSTRING, HSTRING, ABI::WindowsUdk::ApplicationModel::AppExtensions::AppExtensionOptions, bool*) override { return S_OK; }
+ HRESULT GetInstance(HSTRING, HSTRING, IInspectable**) override { return S_OK; }
+ HRESULT GetInstanceWithOptions(HSTRING, HSTRING, ABI::WindowsUdk::ApplicationModel::AppExtensions::AppExtensionOptions, IInspectable**) override { return S_OK; }
+ HRESULT GetFactory(HSTRING, HSTRING, IInspectable**) override { return S_OK; }
+ HRESULT GetFactoryWithOptions(HSTRING, HSTRING, ABI::WindowsUdk::ApplicationModel::AppExtensions::AppExtensionOptions, IInspectable**) override { return S_OK; }
+};
+
+static const DummyExtensionFactory instanceof_WindowsUdk_ApplicationModel_AppExtensions_IExtensionFactoryStatics;
+
+extern "C" HRESULT AppResolver_StartTileData_RoGetActivationFactory(HSTRING activatableClassId, REFIID iid, void** factory)
+{
+ if (dwStartShowClassicMode && IsEqualGUID(iid, __uuidof(ABI::WindowsUdk::ApplicationModel::AppExtensions::IExtensionFactoryStatics)))
+ {
+ *factory = const_cast(&instanceof_WindowsUdk_ApplicationModel_AppExtensions_IExtensionFactoryStatics);
+ return S_OK;
+ }
+ return RoGetActivationFactory(activatableClassId, iid, factory);
+}
+
namespace ABI::WindowsInternal::Shell::UnifiedTile
{
MIDL_INTERFACE("d3653510-4fff-4bfa-905b-ea038b142fa5")
@@ -284,18 +331,17 @@ namespace ABI::WindowsInternal::Shell::UnifiedTile::CuratedTileCollections
struct CCacheShortcut
{
-public:
const wchar_t* GetAppID(const void* a2) const
{
- DWORD dwOffset = *((DWORD*)this + 11); // Same offset in Windows 10 and 11
+ DWORD dwOffset = *(DWORD*)((PBYTE)this + 44); // Same offset in Windows 10 and 11
return dwOffset != -1 ? (wchar_t*)((char*)a2 + dwOffset) : nullptr;
}
};
extern "C"
{
-HRESULT(*AppResolver_CAppResolverCacheBuilder__AddUserPinnedShortcutToStartFunc)(const CCacheShortcut* a2, const void* a3);
-HRESULT AppResolver_CAppResolverCacheBuilder__AddUserPinnedShortcutToStart(const CCacheShortcut* a2, const void* a3)
+HRESULT(*AppResolver_CAppResolverCacheBuilder__AddUserPinnedShortcutToStartFunc)(void* _this, const CCacheShortcut* a2, const void* a3);
+HRESULT AppResolver_CAppResolverCacheBuilder__AddUserPinnedShortcutToStart(void* _this, const CCacheShortcut* a2, const void* a3)
{
using namespace ABI::WindowsInternal::Shell::UnifiedTile;
using namespace ABI::WindowsInternal::Shell::UnifiedTile::Private;
@@ -303,7 +349,7 @@ HRESULT AppResolver_CAppResolverCacheBuilder__AddUserPinnedShortcutToStart(const
if (!dwStartShowClassicMode)
{
- return AppResolver_CAppResolverCacheBuilder__AddUserPinnedShortcutToStartFunc(a2, a3);
+ return AppResolver_CAppResolverCacheBuilder__AddUserPinnedShortcutToStartFunc(_this, a2, a3);
}
Microsoft::WRL::ComPtr pTileIdentifierFactory;
diff --git a/ExplorerPatcher/dllmain.c b/ExplorerPatcher/dllmain.c
index 89f832c..1af3d82 100644
--- a/ExplorerPatcher/dllmain.c
+++ b/ExplorerPatcher/dllmain.c
@@ -10602,37 +10602,11 @@ void TryToFindTwinuiPCShellOffsets(DWORD* pOffsets)
#pragma region "Fix Pin to Start from Explorer not working when using Windows 10 start menu"
#ifdef _WIN64
-HRESULT(*AppResolver_StartDocked_GetStartScreenManagerExtensionStaticsFunc)(void** out);
-HRESULT(*StartTileData_StartDocked_GetStartScreenManagerExtensionStaticsFunc)(void** out);
-HRESULT StartDocked_GetStartScreenManagerExtensionStaticsHook(void** out)
-{
- if (dwStartShowClassicMode)
- {
- // Keep the value of out as NULL and return S_OK to execute the old code
- return S_OK;
- }
- return AppResolver_StartDocked_GetStartScreenManagerExtensionStaticsFunc(out);
-}
+extern HRESULT AppResolver_StartTileData_RoGetActivationFactory(HSTRING activatableClassId, REFIID iid, void** factory);
typedef struct CCacheShortcut CCacheShortcut;
-extern HRESULT(*AppResolver_CAppResolverCacheBuilder__AddUserPinnedShortcutToStartFunc)(const CCacheShortcut* a2, const void* a3);
-extern HRESULT AppResolver_CAppResolverCacheBuilder__AddUserPinnedShortcutToStart(const CCacheShortcut* a2, const void* a3);
-
-static void FindGetStartScreenManagerExtensionStatics(const MODULEINFO* pModuleInfo, HRESULT(**ppfnOut)(void**))
-{
- // StartDocked::GetStartScreenManagerExtensionStatics
- // 48 89 5C 24 ? 48 89 74 24 ? 55 57 41 56 48 8D 6C 24 ? 48 81 EC ? ? ? ? 48 8B 05 ? ? ? ? 48 33 C4 48 89 45 37 ?? 8B F1 48 83 21 00
- PBYTE match = FindPattern(
- pModuleInfo->lpBaseOfDll,
- pModuleInfo->SizeOfImage,
- "\x48\x89\x5C\x24\x00\x48\x89\x74\x24\x00\x55\x57\x41\x56\x48\x8D\x6C\x24\x00\x48\x81\xEC\x00\x00\x00\x00\x48\x8B\x05\x00\x00\x00\x00\x48\x33\xC4\x48\x89\x45\x37\x00\x8B\xF1\x48\x83\x21\x00",
- "xxxx?xxxx?xxxxxxxx?xxx????xxx????xxxxxxx?xxxxxx"
- );
- if (match)
- {
- *ppfnOut = match;
- }
-}
+extern HRESULT(*AppResolver_CAppResolverCacheBuilder__AddUserPinnedShortcutToStartFunc)(void* _this, const CCacheShortcut* a2, const void* a3);
+extern HRESULT AppResolver_CAppResolverCacheBuilder__AddUserPinnedShortcutToStart(void* _this, const CCacheShortcut* a2, const void* a3);
static void PatchAppResolver()
{
@@ -10640,11 +10614,7 @@ static void PatchAppResolver()
MODULEINFO miAppResolver;
GetModuleInformation(GetCurrentProcess(), hAppResolver, &miAppResolver, sizeof(MODULEINFO));
- FindGetStartScreenManagerExtensionStatics(&miAppResolver, &AppResolver_StartDocked_GetStartScreenManagerExtensionStaticsFunc);
- if (AppResolver_StartDocked_GetStartScreenManagerExtensionStaticsFunc)
- {
- printf("AppResolver.dll!StartDocked::GetStartScreenManagerExtensionStatics() = %llX\n", (PBYTE)AppResolver_StartDocked_GetStartScreenManagerExtensionStaticsFunc - (PBYTE)hAppResolver);
- }
+ VnPatchDelayIAT(hAppResolver, "api-ms-win-core-winrt-l1-1-0.dll", "RoGetActivationFactory", AppResolver_StartTileData_RoGetActivationFactory);
// CAppResolverCacheBuilder::_AddUserPinnedShortcutToStart()
// 8B ? 48 8B D3 E8 ? ? ? ? 48 8B 8D
@@ -10675,49 +10645,14 @@ static void PatchAppResolver()
if (rv != 0)
{
printf("Failed to hook CAppResolverCacheBuilder::_AddUserPinnedShortcutToStart(). rv = %d\n", rv);
- return; // Must be hooked properly otherwise our GetStartScreenManagerExtensionStatics hook will make it crash
- }
-
- rv = -1;
- if (AppResolver_StartDocked_GetStartScreenManagerExtensionStaticsFunc)
- {
- rv = funchook_prepare(
- funchook,
- (void**)&AppResolver_StartDocked_GetStartScreenManagerExtensionStaticsFunc,
- StartDocked_GetStartScreenManagerExtensionStaticsHook
- );
- }
- if (rv != 0)
- {
- printf("Failed to hook AppResolver.dll!StartDocked::GetStartScreenManagerExtensionStatics(). rv = %d\n", rv);
}
}
static void PatchStartTileData()
{
HANDLE hStartTileData = LoadLibraryW(L"StartTileData.dll");
- MODULEINFO miStartTileData;
- GetModuleInformation(GetCurrentProcess(), hStartTileData, &miStartTileData, sizeof(MODULEINFO));
-
- FindGetStartScreenManagerExtensionStatics(&miStartTileData, &StartTileData_StartDocked_GetStartScreenManagerExtensionStaticsFunc);
- if (StartTileData_StartDocked_GetStartScreenManagerExtensionStaticsFunc)
- {
- printf("StartTileData.dll!StartDocked::GetStartScreenManagerExtensionStatics() = %llX\n", (PBYTE)StartTileData_StartDocked_GetStartScreenManagerExtensionStaticsFunc - (PBYTE)hStartTileData);
- }
- int rv = -1;
- if (StartTileData_StartDocked_GetStartScreenManagerExtensionStaticsFunc)
- {
- rv = funchook_prepare(
- funchook,
- (void**)&StartTileData_StartDocked_GetStartScreenManagerExtensionStaticsFunc,
- StartDocked_GetStartScreenManagerExtensionStaticsHook
- );
- }
- if (rv != 0)
- {
- printf("Failed to hook StartTileData.dll!StartDocked::GetStartScreenManagerExtensionStatics(). rv = %d\n", rv);
- }
+ VnPatchIAT(hStartTileData, "api-ms-win-core-winrt-l1-1-0.dll", "RoGetActivationFactory", AppResolver_StartTileData_RoGetActivationFactory);
}
#endif
#pragma endregion
diff --git a/version.h b/version.h
index b7769ea..1f8b99f 100644
--- a/version.h
+++ b/version.h
@@ -1,7 +1,7 @@
#define VER_MAJOR 22621
#define VER_MINOR 2361
#define VER_BUILD_HI 58
-#define VER_BUILD_LO 2
+#define VER_BUILD_LO 3
#define VER_FLAGS VS_FF_PRERELEASE