@@ -8102,6 +8102,12 @@ DEFINE_GUID(CLSID_XamlIslandViewAdapter,
81028102 0x8A , 0xE5 , 0xA8 , 0x8E , 0x9A , 0x33
81038103);
81048104
8105+ DEFINE_GUID (CLSID_FileExplorerFolderView ,
8106+ 0x2AA9162E ,
8107+ 0xC906 , 0x4DD9 , 0xAD , 0x0B ,
8108+ 0x3D , 0x24 , 0xA8 , 0xEE , 0xF5 , 0xA0
8109+ );
8110+
81058111DEFINE_GUID (CLSID_UIRibbonFramework ,
81068112 0x926749FA ,
81078113 0x2615 , 0x4987 , 0x88 , 0x45 ,
@@ -8128,6 +8134,16 @@ HRESULT ExplorerFrame_CoCreateInstanceHook(REFCLSID rclsid, LPUNKNOWN pUnkOuter,
81288134 }
81298135 return CoCreateInstance (rclsid , pUnkOuter , dwClsContext , riid , ppv );
81308136}
8137+
8138+ HRESULT shell32_CoCreateInstanceHook (REFCLSID rclsid , LPUNKNOWN pUnkOuter , DWORD dwClsContext , REFIID riid , LPVOID * ppv )
8139+ {
8140+ if (IsEqualCLSID (rclsid , & CLSID_FileExplorerFolderView ))
8141+ {
8142+ if (dwFileExplorerCommandUI != 0 && dwFileExplorerCommandUI != 3 && dwFileExplorerCommandUI != 4 )
8143+ return REGDB_E_CLASSNOTREG ;
8144+ }
8145+ return CoCreateInstance (rclsid , pUnkOuter , dwClsContext , riid , ppv );
8146+ }
81318147#pragma endregion
81328148
81338149
@@ -9215,7 +9231,7 @@ int RtlQueryFeatureConfigurationHook(UINT32 featureId, int sectionType, INT64* c
92159231 }
92169232 break ;
92179233 }
9218- case 40729001 : // WASDKInFileExplorer - Removed in 22635.2915+
9234+ /* case 40729001: // WASDKInFileExplorer - Removed in 22635.2915+
92199235 case 42295138: // XAMLFolderViewSupport - Depends on WASDKInFileExplorer
92209236 {
92219237 if (dwFileExplorerCommandUI == 1 // Windows 10 Ribbon <-- fixes crashing when navigating back to a WASDK view
@@ -9228,15 +9244,13 @@ int RtlQueryFeatureConfigurationHook(UINT32 featureId, int sectionType, INT64* c
92289244 // without WASDK, and returning to a page with WASDK.
92299245 //
92309246 // However this also disables the new Gallery page altogether.
9231- // TODO- We have to find a way to either fix the crashing or make Gallery use the non WASDK view in the
9232- // TODO same way as when Explorer is opened into Control Panel then going to Gallery.
92339247 //
9234- // TODO- We cannot rely on feature flag patches because they will eventually be removed.
9248+ // Fixed by shell32_CoCreateInstanceHook by returning class not registered for CLSID_FileExplorerFolderView
92359249 //
92369250 buffer->enabledState = FEATURE_ENABLED_STATE_DISABLED;
92379251 }
92389252 break;
9239- }
9253+ }*/
92409254 case 40950262 : // FEMNB "File Explorer Modern Navigation Bar"
92419255 {
92429256 if (dwFileExplorerCommandUI == 3 // Windows 11 Command Bar (no Tabs, classic Address Bar)
@@ -9307,15 +9321,14 @@ DWORD InjectBasicFunctions(BOOL bIsExplorer, BOOL bInstall)
93079321 VnPatchIAT (hShell32 , "user32.dll" , "TrackPopupMenu" , shell32_TrackPopupMenu );
93089322 }
93099323 else
9310- {
93119324#endif
9325+ {
93129326 VnPatchIAT (hShell32 , "user32.dll" , "TrackPopupMenu" , TrackPopupMenuHook );
9313- #if WITH_MAIN_PATCHER
93149327 }
9315- #endif
93169328 if (bIsExplorerProcess )
93179329 {
93189330 HOOK_IMMERSIVE_MENUS (Shell32 );
9331+ VnPatchDelayIAT (hShell32 , "api-ms-win-core-com-l1-1-0.dll" , "CoCreateInstance" , shell32_CoCreateInstanceHook );
93199332 }
93209333 VnPatchIAT (hShell32 , "user32.dll" , "SystemParametersInfoW" , DisableImmersiveMenus_SystemParametersInfoW );
93219334 if (!bIsExplorer )
0 commit comments