Skip to content

Commit

Permalink
Start10: Remove the need to CoInitialize() in PatchStartTileData()
Browse files Browse the repository at this point in the history
  • Loading branch information
Amrsatrio committed Apr 25, 2024
1 parent bae9fd6 commit 0976666
Show file tree
Hide file tree
Showing 3 changed files with 11 additions and 5 deletions.
4 changes: 2 additions & 2 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -9,8 +9,8 @@ Tested on OS builds 22621.3296, 22621.3447, and 22621.3527. (Note: 22621 and 226
##### 1

* Taskbar10: The Windows 10 taskbar option is now no longer available on 26002+. (#3053, e57a6b0)
* This is to comply with Microsoft's removal of the stock Windows 10 taskbar in explorer.exe of said builds.
* Start10: Fixed Pin to Start with a 50/50 chance of success on 226xx.3420+ (22H2, 23H2) and 25169+ (24H2). (232fe6b)
* This is to comply with Microsoft's removal of the stock Windows 10 taskbar in `explorer.exe` of said builds.
* Start10: Fixed Pin to Start on 226xx.3420+ (22H2, 23H2) and 25169+ (24H2). (232fe6b)
* Start10: Reverted the menu closing delay fix when EP is injected only into `StartMenuExperienceHost.exe` for now. (e59c34c)

## 22621.3296.64
Expand Down
4 changes: 3 additions & 1 deletion ExplorerPatcher/StartMenuSettings.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -634,6 +634,7 @@ namespace ABI::WindowsInternal::Shell::UnifiedTile::CuratedTileCollections
};
}

#if 0
HRESULT StartTileData_Windows__Internal__ApplicationModel__StartPinnableSurface__GetUnifiedIdentifierForAumid(
void* _this,
const WCHAR* pszAumid,
Expand Down Expand Up @@ -898,6 +899,7 @@ HRESULT PatchStartPinnableSurface(HMODULE hModule, ABI::Windows::Internal::Appli

return S_OK;
}
#endif

namespace VerbGlyphs::SegoeMDL2Assets
{
Expand Down Expand Up @@ -1208,7 +1210,7 @@ extern "C" {
void PatchStartTileDataFurther(HMODULE hModule, BOOL bSMEH)
{
// ComPtr<ABI::Windows::Internal::ApplicationModel::IPinnableSurfaceFactory> pPinnableSurfaceFactory;
PatchStartPinnableSurface(hModule, nullptr /*&pPinnableSurfaceFactory*/); // We might not need to patch this but just in case
// PatchStartPinnableSurface(hModule, nullptr /*&pPinnableSurfaceFactory*/);

// if (bSMEH)
// pPinnableSurfaceFactory->AddRef(); // Pin in memory so that StartTileData.dll doesn't get unloaded
Expand Down
8 changes: 6 additions & 2 deletions ExplorerPatcher/dllmain.c
Original file line number Diff line number Diff line change
Expand Up @@ -11048,18 +11048,22 @@ static void PatchStartTileData(BOOL bSMEH)

VnPatchIAT(hStartTileData, "api-ms-win-core-winrt-l1-1-0.dll", "RoGetActivationFactory", AppResolver_StartTileData_RoGetActivationFactory);

if (!bSMEH)
return;

if ((global_rovi.dwBuildNumber >= 22621 && global_rovi.dwBuildNumber <= 22635) && global_ubr >= 3420
|| global_rovi.dwBuildNumber >= 25169)
{
HRESULT hr = CoInitialize(NULL);
PatchStartTileDataFurther(hStartTileData, bSMEH);
/*HRESULT hr = CoInitialize(NULL);
if (SUCCEEDED(hr))
{
PatchStartTileDataFurther(hStartTileData, bSMEH);
}
if (hr == S_OK)
{
CoUninitialize();
}
}*/
}
}
#endif
Expand Down

0 comments on commit 0976666

Please sign in to comment.