@ -948,18 +948,29 @@ interface ITaskGroup
CONST_VTBL struct ITaskGroupVtbl * lpVtbl ;
CONST_VTBL struct ITaskGroupVtbl * lpVtbl ;
} ;
} ;
HRESULT ( * CTaskGroup_DoesWindowMatchFunc ) ( LONG_PTR * task_group , HWND hCompareWnd , ITEMIDLIST * pCompareItemIdList ,
typedef enum tagWINDOWMATCHCONFIDENCE
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 ) ;
WMC_None ,
BOOL bDontGroup = FALSE ;
WMC_MatchAppID ,
BOOL bPinned = FALSE ;
WMC_MatchShortcutIDListByAppID ,
if ( bPinnedItemsActAsQuickLaunch & & SUCCEEDED ( hr ) & & * pnMatch > = 1 & & * pnMatch < = 3 ) // itemlist or appid match
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 ) )
{
{
bDontGroup = FALSE ;
BOOL bDontGroup = FALSE ;
bPinned = ( ! task_group [ 4 ] | | ( int ) ( ( LONG_PTR * ) task_group [ 4 ] ) [ 0 ] = = 0 ) ;
PBYTE _this = ( PBYTE ) pTaskGroup - 16 /*sizeof(CTaskUnknown)*/ ;
HDPA hdpaItems = * ( HDPA * ) ( _this + 48 /*offsetof(CTaskGroup, m_hdpaItems)*/ ) ;
BOOL bPinned = ! hdpaItems | | ! DPA_GetPtrCount ( hdpaItems ) ;
if ( bPinned )
if ( bPinned )
{
{
bDontGroup = TRUE ;
bDontGroup = TRUE ;
@ -1023,13 +1034,13 @@ typedef struct ITaskBtnGroupVtbl
HRESULT ( STDMETHODCALLTYPE * CancelRemoveItem ) (
HRESULT ( STDMETHODCALLTYPE * CancelRemoveItem ) (
ITaskBtnGroup * This ) ;
ITaskBtnGroup * This ) ;
LONG_PTR ( STDMETHODCALLTYPE * GetIdealSpan ) (
int ( STDMETHODCALLTYPE * GetIdealSpan ) (
ITaskBtnGroup * This ,
ITaskBtnGroup * This ,
LONG_PTR var2 ,
int var2 ,
LONG_PTR var3 ,
int var3 ,
LONG_PTR var4 ,
int var4 ,
LONG_PTR var5 ,
int var5 ,
LONG_PTR var6 ) ;
int var6 ) ;
// ...
// ...
END_INTERFACE
END_INTERFACE
@ -1040,60 +1051,104 @@ interface ITaskBtnGroup
CONST_VTBL struct ITaskBtnGroupVtbl * lpVtbl ;
CONST_VTBL struct ITaskBtnGroupVtbl * lpVtbl ;
} ;
} ;
LONG_PTR ( * CTaskBtnGroup_GetIdealSpanFunc ) ( ITaskBtnGroup * _this , LONG_PTR var2 , LONG_PTR var3 ,
typedef enum eTBGROUPTYPE
LONG_PTR var4 , LONG_PTR var5 , LONG_PTR var6 ) = NULL ;
{
LONG_PTR __stdcall CTaskBtnGroup_GetIdealSpanHook ( ITaskBtnGroup * _this , LONG_PTR var2 , LONG_PTR var3 ,
TBGROUPTYPE_Unknown ,
LONG_PTR var4 , LONG_PTR var5 , LONG_PTR var6 )
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 ;
BOOL bTypeModified = FALSE ;
int button_group_type = * ( unsigned int * ) ( ( INT64 ) _this + 64 ) ;
PBYTE _this = ( PBYTE ) pTaskBtnGroup - 16 /*sizeof(CTaskUnknown)*/ ;
if ( bRemoveExtraGapAroundPinnedItems & & button_group_type = = 2 )
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 ;
bTypeModified = TRUE ;
}
}
ret = CTaskBtnGroup_GetIdealSpanFunc ( _this , var2 , var3 , var4 , var5 , var6 ) ;
int ret = CTaskBtnGroup_GetIdealSpanFunc ( pTaskBtnGroup , var2 , var3 , var4 , var5 , var6 ) ;
if ( bRemoveExtraGapAroundPinnedItems & & bTypeModified )
if ( bRemoveExtraGapAroundPinnedItems & & bTypeModified )
{
{
* ( unsigned int * ) ( ( INT64 ) _this + 64 ) = button_group_t ype;
* pGroupType = lastGroupT ype;
}
}
return ret ;
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 ( bPinnedItemsActAsQuickLaunch )
if ( SUCCEEDED ( hr ) & & IsEqualGUID ( pqit [ 0 ] . piid , & IID_ITaskGroup ) & & bPinnedItemsActAsQuickLaunch )
{
{
ITaskGroup * pTaskGroup = ( char * ) that + pqit [ 0 ] . dwOffset ;
DWORD flOldProtect = 0 ;
DWORD flOldProtect = 0 ;
if ( VirtualProtect ( pTaskGroup - > lp Vtbl , sizeof ( ITaskGroupVtbl ) , PAGE_EXECUTE_READWRITE , & flOldProtect ) )
if ( VirtualProtect ( pVtbl , sizeof ( ITaskGroupVtbl ) , PAGE_EXECUTE_READWRITE , & flOldProtect ) )
{
{
if ( ! CTaskGroup_DoesWindowMatchFunc )
if ( ! CTaskGroup_DoesWindowMatchFunc )
{
{
CTaskGroup_DoesWindowMatchFunc = pTaskGroup - > lp Vtbl - > DoesWindowMatch ;
CTaskGroup_DoesWindowMatchFunc = pVtbl - > DoesWindowMatch ;
}
}
pTaskGroup - > lp Vtbl - > DoesWindowMatch = CTaskGroup_DoesWindowMatchHook ;
pVtbl - > DoesWindowMatch = CTaskGroup_DoesWindowMatchHook ;
VirtualProtect ( pTaskGroup - > lp Vtbl , sizeof ( ITaskGroupVtbl ) , flOldProtect , & flOldProtect ) ;
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 ;
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 )
if ( ! CTaskBtnGroup_GetIdealSpanFunc )
{
{
CTaskBtnGroup_GetIdealSpanFunc = pTaskBtnGroup - > lpVtbl - > GetIdealSpan ;
CTaskBtnGroup_GetIdealSpanFunc = pVtbl - > GetIdealSpan ;
}
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 ) ;
}
}
pTaskBtnGroup - > lpVtbl - > GetIdealSpan = CTaskBtnGroup_GetIdealSpanHook ;
else if ( IsEqualGUID ( pqit [ 0 ] . piid , & IID_ITaskBtnGroup ) )
VirtualProtect ( pTaskBtnGroup - > lpVtbl , sizeof ( ITaskBtnGroupVtbl ) , flOldProtect , & flOldProtect ) ;
{
ITaskBtnGroup * pTaskBtnGroup = ( char * ) that + pqit [ 0 ] . dwOffset ;
Win10TaskbarHooks_ConditionalPatchITaskBtnGroupVtbl ( pTaskBtnGroup - > lpVtbl ) ;
}
}
}
}
return hr ;
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
# endif
# pragma endregion
# pragma endregion
@ -8102,6 +8157,12 @@ DEFINE_GUID(CLSID_XamlIslandViewAdapter,
0x8A , 0xE5 , 0xA8 , 0x8E , 0x9A , 0x33
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 ,
DEFINE_GUID ( CLSID_UIRibbonFramework ,
0x926749FA ,
0x926749FA ,
0x2615 , 0x4987 , 0x88 , 0x45 ,
0x2615 , 0x4987 , 0x88 , 0x45 ,
@ -8128,6 +8189,165 @@ HRESULT ExplorerFrame_CoCreateInstanceHook(REFCLSID rclsid, LPUNKNOWN pUnkOuter,
}
}
return CoCreateInstance ( rclsid , pUnkOuter , dwClsContext , riid , ppv ) ;
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
# pragma endregion
@ -8224,12 +8444,6 @@ __declspec(dllexport) HRESULT explorer_CoCreateInstanceHook(REFCLSID rclsid, LPU
}
}
return CoCreateInstance ( rclsid , pUnkOuter , dwClsContext , riid , ppv ) ;
return CoCreateInstance ( rclsid , pUnkOuter , dwClsContext , riid , ppv ) ;
}
}
bool ( * DisableWin10TaskbarIsEnabledFunc ) ( void * _this ) ;
bool DisableWin10TaskbarIsEnabledHook ( void * _this )
{
return false ;
}
# endif
# endif
# pragma endregion
# pragma endregion
@ -9203,9 +9417,7 @@ int RtlQueryFeatureConfigurationHook(UINT32 featureId, int sectionType, INT64* c
# endif
# endif
case 37634385 : // TIFE "Tabs in File Explorer"
case 37634385 : // TIFE "Tabs in File Explorer"
{
{
if ( dwFileExplorerCommandUI = = 1 // Windows 10 Ribbon <-- fixes saving of window position and size
if ( dwFileExplorerCommandUI = = 3 ) // Windows 11 Command Bar (no Tabs, classic Address Bar) <-- provides option to disable tabs in File Explorer
| | 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
{
{
// Removed in 23575.1000+
// Removed in 23575.1000+
// Crashing on 22635.2915
// Crashing on 22635.2915
@ -9215,28 +9427,6 @@ int RtlQueryFeatureConfigurationHook(UINT32 featureId, int sectionType, INT64* c
}
}
break ;
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"
case 40950262 : // FEMNB "File Explorer Modern Navigation Bar"
{
{
if ( dwFileExplorerCommandUI = = 3 // Windows 11 Command Bar (no Tabs, classic Address Bar)
if ( dwFileExplorerCommandUI = = 3 // Windows 11 Command Bar (no Tabs, classic Address Bar)
@ -9307,15 +9497,14 @@ DWORD InjectBasicFunctions(BOOL bIsExplorer, BOOL bInstall)
VnPatchIAT ( hShell32 , " user32.dll " , " TrackPopupMenu " , shell32_TrackPopupMenu ) ;
VnPatchIAT ( hShell32 , " user32.dll " , " TrackPopupMenu " , shell32_TrackPopupMenu ) ;
}
}
else
else
{
# endif
# endif
{
VnPatchIAT ( hShell32 , " user32.dll " , " TrackPopupMenu " , TrackPopupMenuHook ) ;
VnPatchIAT ( hShell32 , " user32.dll " , " TrackPopupMenu " , TrackPopupMenuHook ) ;
# if WITH_MAIN_PATCHER
}
}
# endif
if ( bIsExplorerProcess )
if ( bIsExplorerProcess )
{
{
HOOK_IMMERSIVE_MENUS ( Shell32 ) ;
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 ) ;
VnPatchIAT ( hShell32 , " user32.dll " , " SystemParametersInfoW " , DisableImmersiveMenus_SystemParametersInfoW ) ;
if ( ! bIsExplorer )
if ( ! bIsExplorer )
@ -9374,6 +9563,7 @@ DWORD InjectBasicFunctions(BOOL bIsExplorer, BOOL bInstall)
VnPatchIAT ( hExplorerFrame , " user32.dll " , " SetWindowLongPtrW " , SetWindowLongPtrWHook ) ;
VnPatchIAT ( hExplorerFrame , " user32.dll " , " SetWindowLongPtrW " , SetWindowLongPtrWHook ) ;
}
}
VnPatchIAT ( hExplorerFrame , " API-MS-WIN-CORE-STRING-L1-1-0.DLL " , " CompareStringOrdinal " , ExplorerFrame_CompareStringOrdinal ) ;
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 ) ;
VnPatchIAT ( hExplorerFrame , " user32.dll " , " GetSystemMetricsForDpi " , explorerframe_GetSystemMetricsForDpi ) ;
# if WITH_MAIN_PATCHER
# if WITH_MAIN_PATCHER
MODULEINFO mi ;
MODULEINFO mi ;
@ -9385,6 +9575,12 @@ DWORD InjectBasicFunctions(BOOL bIsExplorer, BOOL bInstall)
PatchAddressBarSizing ( & mi ) ;
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
# endif
VnPatchIAT ( hExplorerFrame , " api-ms-win-core-com-l1-1-0.dll " , " CoCreateInstance " , ExplorerFrame_CoCreateInstanceHook ) ;
VnPatchIAT ( hExplorerFrame , " api-ms-win-core-com-l1-1-0.dll " , " CoCreateInstance " , ExplorerFrame_CoCreateInstanceHook ) ;
}
}
@ -10676,45 +10872,6 @@ DWORD Inject(BOOL bIsExplorer)
if ( IsWindows11Version22H2OrHigher ( ) )
if ( IsWindows11Version22H2OrHigher ( ) )
{
{
TryToFindExplorerOffsets ( hExplorer , & miExplorer , symbols_PTRS . explorer_PTRS ) ;
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 ) ;
const WCHAR * pszTaskbarDll = GetTaskbarDllChecked ( & symbols_PTRS ) ;
@ -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-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 , " API-MS-WIN-SHCORE-REGISTRY-L1-1-0.DLL " , " SHGetValueW " , explorer_SHGetValueW ) ;
VnPatchIAT ( hExplorer , " user32.dll " , " LoadMenuW " , explorer_LoadMenuW ) ;
VnPatchIAT ( hExplorer , " user32.dll " , " LoadMenuW " , explorer_LoadMenuW ) ;
if ( bOldTaskbar = = 1 )
{
VnPatchIAT ( hExplorer , " api-ms-win-core-shlwapi-obsolete-l1-1-0.dll " , " QISearch " , explorer_QISearch ) ;
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 ( 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 ) ;
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)
VnPatchIAT ( hMyTaskbar , " user32.dll " , MAKEINTRESOURCEA ( 2005 ) , explorer_SetChildWindowNoActivateHook ) ;
VnPatchIAT ( hMyTaskbar , " user32.dll " , MAKEINTRESOURCEA ( 2005 ) , explorer_SetChildWindowNoActivateHook ) ;
VnPatchIAT ( hMyTaskbar , " uxtheme.dll " , MAKEINTRESOURCEA ( 126 ) , PeopleBand_DrawTextWithGlowHook ) ;
VnPatchIAT ( hMyTaskbar , " uxtheme.dll " , MAKEINTRESOURCEA ( 126 ) , PeopleBand_DrawTextWithGlowHook ) ;
Win10TaskbarHooks_PatchEPTaskbarVtables ( hMyTaskbar ) ;
}
}
HANDLE hCombase = LoadLibraryW ( L " combase.dll " ) ;
HANDLE hCombase = LoadLibraryW ( L " combase.dll " ) ;