Compare commits

..

6 Commits

  1. 12
      CHANGELOG.md
  2. 2
      ExplorerPatcher-L10N
  3. 394
      ExplorerPatcher/dllmain.c
  4. 46
      ExplorerPatcher/utility.h
  5. 2
      ep_setup/resources/ep_setup.rc
  6. 2
      ep_setup/resources/ep_setup_debug.rc
  7. 2
      version.h

12
CHANGELOG.md

@ -40,6 +40,18 @@ Tested on OS builds 26100.4946, 26100.5074, 26200.5751, and 26220.6682. @@ -40,6 +40,18 @@ Tested on OS builds 26100.4946, 26100.5074, 26200.5751, and 26220.6682.
* Start10: Fixed Windows 10 Start menu not opening on 22H2/23H2 ARM64. (c08b0a6)
##### 6
* File Explorer: XAML folder views are now disabled when Windows 11 Command Bar is not used. (80414f5)
* This fixes crashes when navigating away and returning to Home/Gallery on 22H2/23H2 (#3447), and when opening Home on 26xxx.7019+.
* File Explorer: Fixed Alt+D not working on builds with modern (XAML) navigation bar in File Explorer. (#2847) (a80d9dc)
* File Explorer: Mitigated breakages on builds with tabs in File Explorer: (75178ec, df7d604)
* Fixed menu bar behavior when Windows 7 Command Bar is used. Pressing Alt will now summon the menu bar immediately like it used to. (#2676)
* Fixed window position and size saving when Windows 10 Ribbon is used. (#2243)
* Taskbar10: These settings now take effect on ep_taskbar: (#4097) (48e1de3)
* Pinned items act as quick launch (don't group with active apps)
* When the taskbar shows button labels, remove the extra gap around pinned items
Known issues we will address in the short term:
* Changing weather icon pack to "Microsoft" has no effect.
* On Nickel (Windows 11 22H2/23H2), when the new Windows 11 Start menu is enabled, using Windows 10 or Windows 10 (ExplorerPatcher) taskbar will crashloop explorer.exe.

2
ExplorerPatcher-L10N

@ -1 +1 @@ @@ -1 +1 @@
Subproject commit 877f358bd6b7994dd67e074ac302361e0f188711
Subproject commit 5a800eff30fd33da1a641f84175e7293b4b44b96

394
ExplorerPatcher/dllmain.c

@ -948,18 +948,29 @@ interface ITaskGroup @@ -948,18 +948,29 @@ interface ITaskGroup
CONST_VTBL struct ITaskGroupVtbl* lpVtbl;
};
HRESULT(*CTaskGroup_DoesWindowMatchFunc)(LONG_PTR* task_group, HWND hCompareWnd, ITEMIDLIST* pCompareItemIdList,
WCHAR* pCompareAppId, int* pnMatch, LONG_PTR** p_task_item) = NULL;
HRESULT __stdcall CTaskGroup_DoesWindowMatchHook(LONG_PTR* task_group, HWND hCompareWnd, ITEMIDLIST* pCompareItemIdList,
WCHAR* pCompareAppId, int* pnMatch, LONG_PTR** p_task_item)
{
HRESULT hr = CTaskGroup_DoesWindowMatchFunc(task_group, hCompareWnd, pCompareItemIdList, pCompareAppId, pnMatch, p_task_item);
BOOL bDontGroup = FALSE;
BOOL bPinned = FALSE;
if (bPinnedItemsActAsQuickLaunch && SUCCEEDED(hr) && *pnMatch >= 1 && *pnMatch <= 3) // itemlist or appid match
{
bDontGroup = FALSE;
bPinned = (!task_group[4] || (int)((LONG_PTR*)task_group[4])[0] == 0);
typedef enum tagWINDOWMATCHCONFIDENCE
{
WMC_None,
WMC_MatchAppID,
WMC_MatchShortcutIDListByAppID,
WMC_MatchShortcutIDList,
WMC_MatchWindow,
} WINDOWMATCHCONFIDENCE;
HRESULT(STDMETHODCALLTYPE *CTaskGroup_DoesWindowMatchFunc)(ITaskGroup* pTaskGroup, HWND hCompareWnd, ITEMIDLIST* pCompareItemIdList,
WCHAR* pCompareAppId, WINDOWMATCHCONFIDENCE* pnMatch, LONG_PTR** p_task_item) = NULL;
HRESULT STDMETHODCALLTYPE CTaskGroup_DoesWindowMatchHook(ITaskGroup* pTaskGroup, HWND hCompareWnd, ITEMIDLIST* pCompareItemIdList,
WCHAR* pCompareAppId, WINDOWMATCHCONFIDENCE* pnMatch, LONG_PTR** p_task_item)
{
wprintf(L"CTaskGroup_DoesWindowMatchHook called for hwnd 0x%p\n", hCompareWnd);
HRESULT hr = CTaskGroup_DoesWindowMatchFunc(pTaskGroup, hCompareWnd, pCompareItemIdList, pCompareAppId, pnMatch, p_task_item);
if (bPinnedItemsActAsQuickLaunch && SUCCEEDED(hr)
&& (*pnMatch == WMC_MatchAppID || *pnMatch == WMC_MatchShortcutIDListByAppID || *pnMatch == WMC_MatchShortcutIDList))
{
BOOL bDontGroup = FALSE;
PBYTE _this = (PBYTE)pTaskGroup - 16 /*sizeof(CTaskUnknown)*/;
HDPA hdpaItems = *(HDPA*)(_this + 48 /*offsetof(CTaskGroup, m_hdpaItems)*/);
BOOL bPinned = !hdpaItems || !DPA_GetPtrCount(hdpaItems);
if (bPinned)
{
bDontGroup = TRUE;
@ -1023,13 +1034,13 @@ typedef struct ITaskBtnGroupVtbl @@ -1023,13 +1034,13 @@ typedef struct ITaskBtnGroupVtbl
HRESULT(STDMETHODCALLTYPE* CancelRemoveItem)(
ITaskBtnGroup* This);
LONG_PTR(STDMETHODCALLTYPE* GetIdealSpan)(
int(STDMETHODCALLTYPE* GetIdealSpan)(
ITaskBtnGroup* This,
LONG_PTR var2,
LONG_PTR var3,
LONG_PTR var4,
LONG_PTR var5,
LONG_PTR var6);
int var2,
int var3,
int var4,
int var5,
int var6);
// ...
END_INTERFACE
@ -1040,60 +1051,104 @@ interface ITaskBtnGroup @@ -1040,60 +1051,104 @@ interface ITaskBtnGroup
CONST_VTBL struct ITaskBtnGroupVtbl* lpVtbl;
};
LONG_PTR (*CTaskBtnGroup_GetIdealSpanFunc)(ITaskBtnGroup* _this, LONG_PTR var2, LONG_PTR var3,
LONG_PTR var4, LONG_PTR var5, LONG_PTR var6) = NULL;
LONG_PTR __stdcall CTaskBtnGroup_GetIdealSpanHook(ITaskBtnGroup* _this, LONG_PTR var2, LONG_PTR var3,
LONG_PTR var4, LONG_PTR var5, LONG_PTR var6)
typedef enum eTBGROUPTYPE
{
TBGROUPTYPE_Unknown,
TBGROUPTYPE_Normal,
TBGROUPTYPE_Pinned,
TBGROUPTYPE_Stacked,
TBGROUPTYPE_Invisible,
} TBGROUPTYPE;
int (STDMETHODCALLTYPE *CTaskBtnGroup_GetIdealSpanFunc)(ITaskBtnGroup* pTaskBtnGroup, int var2, int var3,
int var4, int var5, int* var6) = NULL;
int STDMETHODCALLTYPE CTaskBtnGroup_GetIdealSpanHook(ITaskBtnGroup* pTaskBtnGroup, int var2, int var3,
int var4, int var5, int* var6)
{
LONG_PTR ret = NULL;
BOOL bTypeModified = FALSE;
int button_group_type = *(unsigned int*)((INT64)_this + 64);
if (bRemoveExtraGapAroundPinnedItems && button_group_type == 2)
PBYTE _this = (PBYTE)pTaskBtnGroup - 16 /*sizeof(CTaskUnknown)*/;
TBGROUPTYPE* pGroupType = (TBGROUPTYPE*)(_this + 80 /*offsetof(CTaskBtnGroup, m_groupType)*/);
TBGROUPTYPE lastGroupType = *pGroupType;
if (bRemoveExtraGapAroundPinnedItems && lastGroupType == TBGROUPTYPE_Pinned)
{
*(unsigned int*)((INT64)_this + 64) = 4;
*pGroupType = TBGROUPTYPE_Invisible;
bTypeModified = TRUE;
}
ret = CTaskBtnGroup_GetIdealSpanFunc(_this, var2, var3, var4, var5, var6);
int ret = CTaskBtnGroup_GetIdealSpanFunc(pTaskBtnGroup, var2, var3, var4, var5, var6);
if (bRemoveExtraGapAroundPinnedItems && bTypeModified)
{
*(unsigned int*)((INT64)_this + 64) = button_group_type;
*pGroupType = lastGroupType;
}
return ret;
}
HRESULT explorer_QISearch(void* that, LPCQITAB pqit, REFIID riid, void** ppv)
void Win10TaskbarHooks_ConditionalPatchITaskGroupVtbl(ITaskGroupVtbl* pVtbl)
{
HRESULT hr = QISearch(that, pqit, riid, ppv);
if (SUCCEEDED(hr) && IsEqualGUID(pqit[0].piid, &IID_ITaskGroup) && bPinnedItemsActAsQuickLaunch)
if (bPinnedItemsActAsQuickLaunch)
{
ITaskGroup* pTaskGroup = (char*)that + pqit[0].dwOffset;
DWORD flOldProtect = 0;
if (VirtualProtect(pTaskGroup->lpVtbl, sizeof(ITaskGroupVtbl), PAGE_EXECUTE_READWRITE, &flOldProtect))
if (VirtualProtect(pVtbl, sizeof(ITaskGroupVtbl), PAGE_EXECUTE_READWRITE, &flOldProtect))
{
if (!CTaskGroup_DoesWindowMatchFunc)
{
CTaskGroup_DoesWindowMatchFunc = pTaskGroup->lpVtbl->DoesWindowMatch;
CTaskGroup_DoesWindowMatchFunc = pVtbl->DoesWindowMatch;
}
pTaskGroup->lpVtbl->DoesWindowMatch = CTaskGroup_DoesWindowMatchHook;
VirtualProtect(pTaskGroup->lpVtbl, sizeof(ITaskGroupVtbl), flOldProtect, &flOldProtect);
pVtbl->DoesWindowMatch = CTaskGroup_DoesWindowMatchHook;
VirtualProtect(pVtbl, sizeof(ITaskGroupVtbl), flOldProtect, &flOldProtect);
}
}
else if (SUCCEEDED(hr) && IsEqualGUID(pqit[0].piid, &IID_ITaskBtnGroup) && bRemoveExtraGapAroundPinnedItems)
}
void Win10TaskbarHooks_ConditionalPatchITaskBtnGroupVtbl(ITaskBtnGroupVtbl* pVtbl)
{
if (bRemoveExtraGapAroundPinnedItems)
{
ITaskBtnGroup* pTaskBtnGroup = (char*)that + pqit[0].dwOffset;
DWORD flOldProtect = 0;
if (VirtualProtect(pTaskBtnGroup->lpVtbl, sizeof(ITaskBtnGroupVtbl), PAGE_EXECUTE_READWRITE, &flOldProtect))
if (VirtualProtect(pVtbl, sizeof(ITaskBtnGroupVtbl), PAGE_EXECUTE_READWRITE, &flOldProtect))
{
if (!CTaskBtnGroup_GetIdealSpanFunc)
{
CTaskBtnGroup_GetIdealSpanFunc = pTaskBtnGroup->lpVtbl->GetIdealSpan;
CTaskBtnGroup_GetIdealSpanFunc = pVtbl->GetIdealSpan;
}
pTaskBtnGroup->lpVtbl->GetIdealSpan = CTaskBtnGroup_GetIdealSpanHook;
VirtualProtect(pTaskBtnGroup->lpVtbl, sizeof(ITaskBtnGroupVtbl), flOldProtect, &flOldProtect);
pVtbl->GetIdealSpan = CTaskBtnGroup_GetIdealSpanHook;
VirtualProtect(pVtbl, sizeof(ITaskBtnGroupVtbl), flOldProtect, &flOldProtect);
}
}
}
HRESULT explorer_QISearch(void* that, LPCQITAB pqit, REFIID riid, void** ppv)
{
HRESULT hr = QISearch(that, pqit, riid, ppv);
if (SUCCEEDED(hr))
{
if (IsEqualGUID(pqit[0].piid, &IID_ITaskGroup))
{
ITaskGroup* pTaskGroup = (char*)that + pqit[0].dwOffset;
Win10TaskbarHooks_ConditionalPatchITaskGroupVtbl(pTaskGroup->lpVtbl);
}
else if (IsEqualGUID(pqit[0].piid, &IID_ITaskBtnGroup))
{
ITaskBtnGroup* pTaskBtnGroup = (char*)that + pqit[0].dwOffset;
Win10TaskbarHooks_ConditionalPatchITaskBtnGroupVtbl(pTaskBtnGroup->lpVtbl);
}
}
return hr;
}
void Win10TaskbarHooks_PatchEPTaskbarVtables(HMODULE hModule)
{
ITaskGroupVtbl* pTaskGroupVtbl = (ITaskGroupVtbl*)GetProcAddress(hModule, "??_7CTaskGroup@@6BITaskGroup@@@");
if (pTaskGroupVtbl)
{
Win10TaskbarHooks_ConditionalPatchITaskGroupVtbl(pTaskGroupVtbl);
}
ITaskBtnGroupVtbl* pTaskBtnGroupVtbl = (ITaskBtnGroupVtbl*)GetProcAddress(hModule, "??_7CTaskBtnGroup@@6BITaskBtnGroup@@@");
if (pTaskBtnGroupVtbl)
{
Win10TaskbarHooks_ConditionalPatchITaskBtnGroupVtbl(pTaskBtnGroupVtbl);
}
}
#endif
#pragma endregion
@ -8102,6 +8157,12 @@ DEFINE_GUID(CLSID_XamlIslandViewAdapter, @@ -8102,6 +8157,12 @@ DEFINE_GUID(CLSID_XamlIslandViewAdapter,
0x8A, 0xE5, 0xA8, 0x8E, 0x9A, 0x33
);
DEFINE_GUID(CLSID_FileExplorerFolderView,
0x2AA9162E,
0xC906, 0x4DD9, 0xAD, 0x0B,
0x3D, 0x24, 0xA8, 0xEE, 0xF5, 0xA0
);
DEFINE_GUID(CLSID_UIRibbonFramework,
0x926749FA,
0x2615, 0x4987, 0x88, 0x45,
@ -8128,6 +8189,165 @@ HRESULT ExplorerFrame_CoCreateInstanceHook(REFCLSID rclsid, LPUNKNOWN pUnkOuter, @@ -8128,6 +8189,165 @@ HRESULT ExplorerFrame_CoCreateInstanceHook(REFCLSID rclsid, LPUNKNOWN pUnkOuter,
}
return CoCreateInstance(rclsid, pUnkOuter, dwClsContext, riid, ppv);
}
HRESULT shell32_CoCreateInstanceHook(REFCLSID rclsid, LPUNKNOWN pUnkOuter, DWORD dwClsContext, REFIID riid, LPVOID* ppv)
{
if (IsEqualCLSID(rclsid, &CLSID_FileExplorerFolderView))
{
if (dwFileExplorerCommandUI != 0 && dwFileExplorerCommandUI != 3 && dwFileExplorerCommandUI != 4)
return REGDB_E_CLASSNOTREG;
}
return CoCreateInstance(rclsid, pUnkOuter, dwClsContext, riid, ppv);
}
HACCEL WINAPI ExplorerFrame_LoadAcceleratorsW(HINSTANCE hInstance, LPCWSTR lpTableName)
{
if (IS_INTRESOURCE(lpTableName))
{
UINT uID = (UINT)(UINT_PTR)lpTableName;
if (uID == 262)
{
// When FEMNB (File Explorer Modern Navigation Bar) feature flag is enabled, restore Alt+D functionality
// when it is not used
if (dwFileExplorerCommandUI != 0)
return NULL;
}
}
return LoadAcceleratorsW(hInstance, lpTableName);
}
/**
* When TIFE feature flag is enabled:
* - Fixes menu bar behavior on Windows 7 Command Bar
* - Fixes window position and size not being saved on Windows 8/10 Ribbon
*/
void FixTIFEBreakagesForLegacyControlInterfaces(const MODULEINFO* pmi)
{
#if defined(_M_X64)
// No TIFE feature flag
// 8B 8B ?? ?? 00 00 8B 83 ?? ?? 00 00 89 8B ?? ?? 00 00 89 83 ?? ?? 00 00 F6 C1 10 <jz/jnz>
// Ref: CInternetToolbar::_CreateBands()
PBYTE match = FindPattern(
pmi->lpBaseOfDll,
pmi->SizeOfImage,
"\x8B\x8B\x00\x00\x00\x00\x8B\x83\x00\x00\x00\x00\x89\x8B\x00\x00\x00\x00\x89\x83\x00\x00\x00\x00\xF6\xC1\x10",
"xx??xxxx??xxxx??xxxx??xxxxx"
);
if (match)
{
match += 27; // Point to jump
}
else
{
// TIFE feature flag present (pattern is fragile!)
// 8B 83 ?? ?? 00 00 A8 10 <jz>
// Ref: CInternetToolbar::_CreateBands()
match = FindPattern(
pmi->lpBaseOfDll,
pmi->SizeOfImage,
"\x8B\x83\x00\x00\x00\x00\xA8\x10",
"xx??xxxx"
);
if (match)
{
match += 8; // Point to jump
}
}
if (match) // Should be pointed to jump at this point
{
PBYTE target = NULL;
DWORD jmpInstrSize = 0;
if (FollowJnz(match, &target, &jmpInstrSize))
{
// Nop the jnz
DWORD dwOldProtect;
if (VirtualProtect(match, jmpInstrSize, PAGE_EXECUTE_READWRITE, &dwOldProtect))
{
memset(match, 0x90, jmpInstrSize);
VirtualProtect(match, jmpInstrSize, dwOldProtect, &dwOldProtect);
}
}
else if (FollowJz(match, &target, &jmpInstrSize))
{
if (jmpInstrSize == 2)
{
// Change short jz to short jmp
DWORD dwOldProtect;
if (VirtualProtect(match, jmpInstrSize, PAGE_EXECUTE_READWRITE, &dwOldProtect))
{
match[0] = 0xEB; // jmp
VirtualProtect(match, jmpInstrSize, dwOldProtect, &dwOldProtect);
}
}
else if (jmpInstrSize == 6)
{
// Change long jz to long jmp
DWORD dwOldProtect;
if (VirtualProtect(match, jmpInstrSize, PAGE_EXECUTE_READWRITE, &dwOldProtect))
{
match[0] = 0xE9; // jmp rel32
*(int*)(match + 1) = (int)(target - (match + 5));
match[5] = 0x90; // nop
VirtualProtect(match, jmpInstrSize, dwOldProtect, &dwOldProtect);
}
}
}
}
#elif defined(_M_ARM64)
// No TIFE feature flag
// 69 ?? ?? B9 68 ?? ?? B9 69 ?? ?? 29 <TBZ/TBNZ>
// Ref: CInternetToolbar::_CreateBands()
PBYTE match = FindPattern(
pmi->lpBaseOfDll,
pmi->SizeOfImage,
"\x69\x00\x00\xB9\x68\x00\x00\xB9\x69\x00\x00\x29",
"x??xx??xx??x"
);
if (match)
{
match += 12; // Point to TBZ/TBNZ
}
else
{
// TIFE feature flag present
// 68 ?? ?? B9 68 00 20 36 08 79 1B 12 68 ?? ?? B9
// ^^^^^^^^^^^ <TBZ>
// Ref: CInternetToolbar::_CreateBands()
match = FindPattern(
pmi->lpBaseOfDll,
pmi->SizeOfImage,
"\x68\x00\x00\xB9\x68\x00\x20\x36\x08\x79\x1B\x12\x68\x00\x00\xB9",
"x??xxxxxxxxxx??x"
);
if (match)
{
match += 4; // Point to TBZ
}
}
if (match) // Should be pointed to TBZ/TBNZ at this point
{
DWORD insnCurrent = *(DWORD*)match;
DWORD insnNew = 0;
if (ARM64_IsTBZ(insnCurrent))
{
insnNew = ARM64_TBZToB(insnCurrent);
}
else if (ARM64_IsTBNZ(insnCurrent))
{
insnNew = 0xD503201F; // NOP
}
if (insnNew != 0)
{
DWORD dwOldProtect;
if (VirtualProtect(match, 4, PAGE_EXECUTE_READWRITE, &dwOldProtect))
{
*(DWORD*)match = insnNew;
VirtualProtect(match, 4, dwOldProtect, &dwOldProtect);
}
}
}
#endif
}
#pragma endregion
@ -8224,12 +8444,6 @@ __declspec(dllexport) HRESULT explorer_CoCreateInstanceHook(REFCLSID rclsid, LPU @@ -8224,12 +8444,6 @@ __declspec(dllexport) HRESULT explorer_CoCreateInstanceHook(REFCLSID rclsid, LPU
}
return CoCreateInstance(rclsid, pUnkOuter, dwClsContext, riid, ppv);
}
bool(*DisableWin10TaskbarIsEnabledFunc)(void* _this);
bool DisableWin10TaskbarIsEnabledHook(void* _this)
{
return false;
}
#endif
#pragma endregion
@ -9203,9 +9417,7 @@ int RtlQueryFeatureConfigurationHook(UINT32 featureId, int sectionType, INT64* c @@ -9203,9 +9417,7 @@ int RtlQueryFeatureConfigurationHook(UINT32 featureId, int sectionType, INT64* c
#endif
case 37634385: // TIFE "Tabs in File Explorer"
{
if (dwFileExplorerCommandUI == 1 // Windows 10 Ribbon <-- fixes saving of window position and size
|| dwFileExplorerCommandUI == 2 // Windows 7 Command Bar <-- fixes menu bar behavior
|| dwFileExplorerCommandUI == 3) // Windows 11 Command Bar (no Tabs, classic Address Bar) <-- provides option to disable tabs in File Explorer
if (dwFileExplorerCommandUI == 3) // Windows 11 Command Bar (no Tabs, classic Address Bar) <-- provides option to disable tabs in File Explorer
{
// Removed in 23575.1000+
// Crashing on 22635.2915
@ -9215,28 +9427,6 @@ int RtlQueryFeatureConfigurationHook(UINT32 featureId, int sectionType, INT64* c @@ -9215,28 +9427,6 @@ int RtlQueryFeatureConfigurationHook(UINT32 featureId, int sectionType, INT64* c
}
break;
}
case 40729001: // WASDKInFileExplorer - Removed in 22635.2915+
case 42295138: // XAMLFolderViewSupport - Depends on WASDKInFileExplorer
{
if (dwFileExplorerCommandUI == 1 // Windows 10 Ribbon <-- fixes crashing when navigating back to a WASDK view
|| dwFileExplorerCommandUI == 2 // Windows 7 Command Bar <-- ditto
|| dwFileExplorerCommandUI == 3) // Windows 11 Command Bar (no Tabs, classic Address Bar) <-- fixes crashing when opening an Explorer window
{
// Disable the new Windows App SDK views (in Home and Gallery) when not using the Windows 11 command bar
//
// There is an issue where Explorer crashes when one goes to a page with WASDK, goes to another page
// without WASDK, and returning to a page with WASDK.
//
// However this also disables the new Gallery page altogether.
// TODO- We have to find a way to either fix the crashing or make Gallery use the non WASDK view in the
// TODO same way as when Explorer is opened into Control Panel then going to Gallery.
//
// TODO- We cannot rely on feature flag patches because they will eventually be removed.
//
buffer->enabledState = FEATURE_ENABLED_STATE_DISABLED;
}
break;
}
case 40950262: // FEMNB "File Explorer Modern Navigation Bar"
{
if (dwFileExplorerCommandUI == 3 // Windows 11 Command Bar (no Tabs, classic Address Bar)
@ -9307,15 +9497,14 @@ DWORD InjectBasicFunctions(BOOL bIsExplorer, BOOL bInstall) @@ -9307,15 +9497,14 @@ DWORD InjectBasicFunctions(BOOL bIsExplorer, BOOL bInstall)
VnPatchIAT(hShell32, "user32.dll", "TrackPopupMenu", shell32_TrackPopupMenu);
}
else
{
#endif
{
VnPatchIAT(hShell32, "user32.dll", "TrackPopupMenu", TrackPopupMenuHook);
#if WITH_MAIN_PATCHER
}
#endif
if (bIsExplorerProcess)
{
HOOK_IMMERSIVE_MENUS(Shell32);
VnPatchDelayIAT(hShell32, "api-ms-win-core-com-l1-1-0.dll", "CoCreateInstance", shell32_CoCreateInstanceHook);
}
VnPatchIAT(hShell32, "user32.dll", "SystemParametersInfoW", DisableImmersiveMenus_SystemParametersInfoW);
if (!bIsExplorer)
@ -9374,6 +9563,7 @@ DWORD InjectBasicFunctions(BOOL bIsExplorer, BOOL bInstall) @@ -9374,6 +9563,7 @@ DWORD InjectBasicFunctions(BOOL bIsExplorer, BOOL bInstall)
VnPatchIAT(hExplorerFrame, "user32.dll", "SetWindowLongPtrW", SetWindowLongPtrWHook);
}
VnPatchIAT(hExplorerFrame, "API-MS-WIN-CORE-STRING-L1-1-0.DLL", "CompareStringOrdinal", ExplorerFrame_CompareStringOrdinal);
VnPatchIAT(hExplorerFrame, "user32.dll", "LoadAcceleratorsW", ExplorerFrame_LoadAcceleratorsW);
VnPatchIAT(hExplorerFrame, "user32.dll", "GetSystemMetricsForDpi", explorerframe_GetSystemMetricsForDpi);
#if WITH_MAIN_PATCHER
MODULEINFO mi;
@ -9385,6 +9575,12 @@ DWORD InjectBasicFunctions(BOOL bIsExplorer, BOOL bInstall) @@ -9385,6 +9575,12 @@ DWORD InjectBasicFunctions(BOOL bIsExplorer, BOOL bInstall)
PatchAddressBarSizing(&mi);
}
}
if ((dwFileExplorerCommandUI == 1 || dwFileExplorerCommandUI == 2)
&& ((global_rovi.dwBuildNumber >= 22621 && global_rovi.dwBuildNumber <= 22635 && global_ubr >= 160)
|| global_rovi.dwBuildNumber >= 25136))
{
FixTIFEBreakagesForLegacyControlInterfaces(&mi);
}
#endif
VnPatchIAT(hExplorerFrame, "api-ms-win-core-com-l1-1-0.dll", "CoCreateInstance", ExplorerFrame_CoCreateInstanceHook);
}
@ -10676,45 +10872,6 @@ DWORD Inject(BOOL bIsExplorer) @@ -10676,45 +10872,6 @@ DWORD Inject(BOOL bIsExplorer)
if (IsWindows11Version22H2OrHigher())
{
TryToFindExplorerOffsets(hExplorer, &miExplorer, symbols_PTRS.explorer_PTRS);
#if 0
if (global_rovi.dwBuildNumber >= 26002)
{
#if defined(_M_X64)
// Please Microsoft 🙏
// 48 8B ?? 78 48 8D 0D ?? ?? ?? ?? E8 ?? ?? ?? ?? 84 C0 0F 85
// ^^^^^^^^^^^
// 26040.1000: C28AE
// 26052.1000: BF052
// 26058.1000: BEFA2
// 26080.1 : 11795C
PBYTE match = FindPattern(
hExplorer,
miExplorer.SizeOfImage,
"\x48\x8B\x00\x78\x48\x8D\x0D\x00\x00\x00\x00\xE8\x00\x00\x00\x00\x84\xC0\x0F\x85",
"xx?xxxx????x????xxxx"
);
if (match)
{
match += 11;
match += 5 + *(int*)(match + 1);
}
#elif defined(_M_ARM64)
PBYTE match = NULL;
#endif
if (match)
{
DisableWin10TaskbarIsEnabledFunc = match;
printf("wil::details::FeatureImpl<__WilFeatureTraits_Feature_DisableWin10Taskbar>::__private_IsEnabled() = %llX\n", match - (PBYTE)hExplorer);
funchook_prepare(
funchook,
(void**)&DisableWin10TaskbarIsEnabledFunc,
DisableWin10TaskbarIsEnabledHook
);
}
}
#endif
}
const WCHAR* pszTaskbarDll = GetTaskbarDllChecked(&symbols_PTRS);
@ -10736,7 +10893,10 @@ DWORD Inject(BOOL bIsExplorer) @@ -10736,7 +10893,10 @@ DWORD Inject(BOOL bIsExplorer)
VnPatchIAT(hExplorer, "API-MS-WIN-CORE-REGISTRY-L1-1-0.DLL", "RegCreateKeyExW", explorer_RegCreateKeyExW);
VnPatchIAT(hExplorer, "API-MS-WIN-SHCORE-REGISTRY-L1-1-0.DLL", "SHGetValueW", explorer_SHGetValueW);
VnPatchIAT(hExplorer, "user32.dll", "LoadMenuW", explorer_LoadMenuW);
VnPatchIAT(hExplorer, "api-ms-win-core-shlwapi-obsolete-l1-1-0.dll", "QISearch", explorer_QISearch);
if (bOldTaskbar == 1)
{
VnPatchIAT(hExplorer, "api-ms-win-core-shlwapi-obsolete-l1-1-0.dll", "QISearch", explorer_QISearch);
}
if (IsOS(OS_ANYSERVER)) VnPatchIAT(hExplorer, "api-ms-win-shcore-sysinfo-l1-1-0.dll", "IsOS", explorer_IsOS);
if (IsWindows11Version22H2OrHigher()) VnPatchDelayIAT(hExplorer, "ext-ms-win-rtcore-ntuser-window-ext-l1-1-0.dll", "CreateWindowExW", Windows11v22H2_explorer_CreateWindowExW);
}
@ -10931,6 +11091,8 @@ DWORD Inject(BOOL bIsExplorer) @@ -10931,6 +11091,8 @@ DWORD Inject(BOOL bIsExplorer)
VnPatchIAT(hMyTaskbar, "user32.dll", MAKEINTRESOURCEA(2005), explorer_SetChildWindowNoActivateHook);
VnPatchIAT(hMyTaskbar, "uxtheme.dll", MAKEINTRESOURCEA(126), PeopleBand_DrawTextWithGlowHook);
Win10TaskbarHooks_PatchEPTaskbarVtables(hMyTaskbar);
}
HANDLE hCombase = LoadLibraryW(L"combase.dll");

46
ExplorerPatcher/utility.h

@ -644,24 +644,34 @@ __forceinline void RDataSectionBeginAndSize(HMODULE hModule, PBYTE* beginSection @@ -644,24 +644,34 @@ __forceinline void RDataSectionBeginAndSize(HMODULE hModule, PBYTE* beginSection
PVOID FindPattern(PVOID pBase, SIZE_T dwSize, LPCSTR lpPattern, LPCSTR lpMask);
#if _M_X64
inline BOOL FollowJnz(PBYTE pJnz, PBYTE* pTarget, DWORD* pJnzSize)
inline BOOL FollowJump(PBYTE pInstr, BYTE shortOpcode, BYTE longOpcodeExt, DWORD* pInstrSize, PBYTE* pTarget)
{
// Check big jnz
if (pJnz[0] == 0x0F && pJnz[1] == 0x85)
// Check long
if (pInstr[0] == 0x0F && pInstr[1] == longOpcodeExt)
{
*pTarget = pJnz + 6 + *(int*)(pJnz + 2);
*pJnzSize = 6;
*pTarget = pInstr + 6 + *(int*)(pInstr + 2);
*pInstrSize = 6;
return TRUE;
}
// Check small jnz
if (pJnz[0] == 0x75)
// Check short
if (pInstr[0] == shortOpcode)
{
*pTarget = pJnz + 2 + *(char*)(pJnz + 1);
*pJnzSize = 2;
*pTarget = pInstr + 2 + *(char*)(pInstr + 1);
*pInstrSize = 2;
return TRUE;
}
return FALSE;
}
inline BOOL FollowJnz(PBYTE pInstr, PBYTE* pTarget, DWORD* pInstrSize)
{
return FollowJump(pInstr, 0x75, 0x85, pInstrSize, pTarget);
}
inline BOOL FollowJz(PBYTE pInstr, PBYTE* pTarget, DWORD* pInstrSize)
{
return FollowJump(pInstr, 0x74, 0x84, pInstrSize, pTarget);
}
#endif
#if _M_ARM64
@ -699,6 +709,8 @@ __forceinline UINT_PTR ARM64_Align(UINT_PTR value, UINT_PTR alignment) @@ -699,6 +709,8 @@ __forceinline UINT_PTR ARM64_Align(UINT_PTR value, UINT_PTR alignment)
__forceinline BOOL ARM64_IsCBZW(DWORD insn) { return ARM64_ReadBits(insn, 31, 24) == 0b00110100; }
__forceinline BOOL ARM64_IsCBNZW(DWORD insn) { return ARM64_ReadBits(insn, 31, 24) == 0b00110101; }
__forceinline BOOL ARM64_IsTBZ(DWORD insn) { return ARM64_ReadBits(insn, 31, 24) == 0b00110110; }
__forceinline BOOL ARM64_IsTBNZ(DWORD insn) { return ARM64_ReadBits(insn, 31, 24) == 0b00110111; }
__forceinline BOOL ARM64_IsBL(DWORD insn) { return ARM64_ReadBits(insn, 31, 26) == 0b100101; }
__forceinline BOOL ARM64_IsADRP(DWORD insn) { return (ARM64_ReadBits(insn, 31, 24) & ~0b01100000) == 0b10010000; }
__forceinline BOOL ARM64_IsMOVZW(DWORD insn) { return ARM64_ReadBits(insn, 31, 23) == 0b010100101; }
@ -745,6 +757,22 @@ __forceinline DWORD ARM64_CBNZWToB(DWORD insnCBNZW) @@ -745,6 +757,22 @@ __forceinline DWORD ARM64_CBNZWToB(DWORD insnCBNZW)
return ARM64_MakeB(imm19);
}
__forceinline DWORD ARM64_TBZToB(DWORD insnTBZ)
{
if (!ARM64_IsTBZ(insnTBZ))
return 0;
int imm14 = ARM64_ReadBitsSignExtend(insnTBZ, 18, 5);
return ARM64_MakeB(imm14);
}
__forceinline DWORD ARM64_TBNZToB(DWORD insnTBNZ)
{
if (!ARM64_IsTBNZ(insnTBNZ))
return 0;
int imm14 = ARM64_ReadBitsSignExtend(insnTBNZ, 18, 5);
return ARM64_MakeB(imm14);
}
__forceinline DWORD ARM64_DecodeADD(DWORD insnADD)
{
DWORD imm12 = ARM64_ReadBits(insnADD, 21, 10);

2
ep_setup/resources/ep_setup.rc

@ -72,7 +72,7 @@ BEGIN @@ -72,7 +72,7 @@ BEGIN
VALUE "FileDescription", "ExplorerPatcher Setup Program"
VER_FILE_STRING
VALUE "InternalName", "ep_setup.exe"
VALUE "LegalCopyright", "(C) 2021-2024 ExplorerPatcher Developers. All rights reserved."
VALUE "LegalCopyright", "(C) 2021-2025 ExplorerPatcher Developers. All rights reserved."
VALUE "OriginalFilename", "ep_setup.exe"
VALUE "ProductName", "ExplorerPatcher"
VER_PRODUCT_STRING

2
ep_setup/resources/ep_setup_debug.rc

@ -72,7 +72,7 @@ BEGIN @@ -72,7 +72,7 @@ BEGIN
VALUE "FileDescription", "ExplorerPatcher Setup Program (Debug Build)"
VER_FILE_STRING
VALUE "InternalName", "ep_setup.exe"
VALUE "LegalCopyright", "(C) 2021-2024 ExplorerPatcher Developers. All rights reserved."
VALUE "LegalCopyright", "(C) 2021-2025 ExplorerPatcher Developers. All rights reserved."
VALUE "OriginalFilename", "ep_setup.exe"
VALUE "ProductName", "ExplorerPatcher"
VER_PRODUCT_STRING

2
version.h

@ -1,7 +1,7 @@ @@ -1,7 +1,7 @@
#define VER_MAJOR 26100
#define VER_MINOR 4946
#define VER_BUILD_HI 69
#define VER_BUILD_LO 5
#define VER_BUILD_LO 6
#define VER_FLAGS VS_FF_PRERELEASE

Loading…
Cancel
Save