Skip to content

Commit d11445a

Browse files
committed
Start10: Fixed user tile menu not working on later 22H2/23H2 builds and 24H2
1 parent 0976666 commit d11445a

File tree

1 file changed

+43
-0
lines changed

1 file changed

+43
-0
lines changed

ExplorerPatcher/dllmain.c

Lines changed: 43 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -13519,6 +13519,43 @@ static BOOL StartMenu_FixContextMenuXbfHijackMethod()
1351913519
return TRUE;
1352013520
}
1352113521

13522+
// void StartUI::UserTileView::AppendMenuFlyoutItemCommand(class Windows::UI::Xaml::Controls::MenuFlyout^, class Windows::Internal::Shell::StartUI::UserTileCommand^, enum Windows::Internal::Shell::StartUI::UserTileCommandId)
13523+
void (*StartUI_UserTileView_AppendMenuFlyoutItemCommandFunc)(void* _this, void* menuFlyout, void* userTileCommand, int id);
13524+
void StartUI_UserTileView_AppendMenuFlyoutItemCommandHook(void* _this, void* menuFlyout, void* userTileCommand, int id)
13525+
{
13526+
// 4 = UserTile_LaunchAccountBadging
13527+
// 5 = UserTile_AccountBadgingSecondary
13528+
if (id == 4 || id == 5)
13529+
{
13530+
return;
13531+
}
13532+
StartUI_UserTileView_AppendMenuFlyoutItemCommandFunc(_this, menuFlyout, userTileCommand, id);
13533+
}
13534+
13535+
static void StartMenu_FixUserTileMenu(MODULEINFO* mi)
13536+
{
13537+
// 41 B9 03 00 00 00 4D 8B C4 ?? 8B D6 49 8B CD E8 ?? ?? ?? ??
13538+
// ^^^^^^^^^^^
13539+
// Ref: <lambda_3a9b433356e31b02e54fffbca0ecf3fa>::operator()
13540+
PBYTE match = FindPattern(
13541+
mi->lpBaseOfDll,
13542+
mi->SizeOfImage,
13543+
"\x41\xB9\x03\x00\x00\x00\x4D\x8B\xC4\x00\x8B\xD6\x49\x8B\xCD\xE8",
13544+
"xxxxxxxxx?xxxxxx"
13545+
);
13546+
if (match)
13547+
{
13548+
match += 15;
13549+
match += 5 + *(int*)(match + 1);
13550+
StartUI_UserTileView_AppendMenuFlyoutItemCommandFunc = match;
13551+
funchook_prepare(
13552+
funchook,
13553+
(void**)&StartUI_UserTileView_AppendMenuFlyoutItemCommandFunc,
13554+
StartUI_UserTileView_AppendMenuFlyoutItemCommandHook
13555+
);
13556+
}
13557+
}
13558+
1352213559
LSTATUS StartUI_RegOpenKeyExW(HKEY hKey, LPCWSTR lpSubKey, DWORD ulOptions, REGSAM samDesired, PHKEY phkResult)
1352313560
{
1352413561
if (wcsstr(lpSubKey, L"$start.tilegrid$windows.data.curatedtilecollection.tilecollection\\Current"))
@@ -14159,13 +14196,19 @@ DWORD InjectStartMenu()
1415914196

1416014197
if (IsWindows11())
1416114198
{
14199+
MODULEINFO miStartUI;
14200+
GetModuleInformation(GetCurrentProcess(), hStartUI, &miStartUI, sizeof(miStartUI));
14201+
1416214202
// Fixes Pin to Start/Unpin from Start
1416314203
PatchAppResolver();
1416414204
PatchStartTileData(TRUE);
1416514205

1416614206
// Fixes context menu crashes
1416714207
StartMenu_FixContextMenuXbfHijackMethod();
1416814208

14209+
// Fixes user tile menu
14210+
StartMenu_FixUserTileMenu(&miStartUI);
14211+
1416914212
// Enables "Show more tiles" setting
1417014213
LoadLibraryW(L"Windows.CloudStore.dll");
1417114214
HANDLE hWindowsCloudStore = GetModuleHandleW(L"Windows.CloudStore.dll");

0 commit comments

Comments
 (0)