@@ -37,7 +37,7 @@ extern HRESULT RuntimeInvokeHostAssemblyResolver(INT_PTR pManagedAssemblyLoadCon
3737
3838STDAPI BinderAcquirePEImage (LPCTSTR szAssemblyPath,
3939 PEImage** ppPEImage,
40- BundleFileLocation bundleFileLocation );
40+ ProbeExtensionResult probeExtensionResult );
4141
4242namespace BINDER_SPACE
4343{
@@ -271,8 +271,8 @@ namespace BINDER_SPACE
271271 StackSString sCoreLibName (CoreLibName_IL_W);
272272 StackSString sCoreLib ;
273273 BinderTracing::PathSource pathSource = BinderTracing::PathSource::Bundle;
274- BundleFileLocation bundleFileLocation = Bundle::ProbeAppBundle (sCoreLibName , /* pathIsBundleRelative */ true );
275- if (!bundleFileLocation .IsValid ())
274+ ProbeExtensionResult probeExtensionResult = AssemblyProbeExtension::Probe (sCoreLibName , /* pathIsBundleRelative */ true );
275+ if (!probeExtensionResult .IsValid ())
276276 {
277277 pathSource = BinderTracing::PathSource::ApplicationAssemblies;
278278 }
@@ -282,7 +282,7 @@ namespace BINDER_SPACE
282282 hr = AssemblyBinderCommon::GetAssembly (sCoreLib ,
283283 TRUE /* fIsInTPA */ ,
284284 &pSystemAssembly,
285- bundleFileLocation );
285+ probeExtensionResult );
286286
287287 BinderTracing::PathProbed (sCoreLib , pathSource, hr);
288288
@@ -322,7 +322,7 @@ namespace BINDER_SPACE
322322 hr = AssemblyBinderCommon::GetAssembly (sCoreLib ,
323323 TRUE /* fIsInTPA */ ,
324324 &pSystemAssembly,
325- bundleFileLocation );
325+ probeExtensionResult );
326326
327327 BinderTracing::PathProbed (sCoreLib , BinderTracing::PathSource::ApplicationAssemblies, hr);
328328 }
@@ -367,8 +367,8 @@ namespace BINDER_SPACE
367367 StackSString sCoreLibSatellite ;
368368
369369 BinderTracing::PathSource pathSource = BinderTracing::PathSource::Bundle;
370- BundleFileLocation bundleFileLocation = Bundle::ProbeAppBundle (relativePath, /* pathIsBundleRelative */ true );
371- if (!bundleFileLocation .IsValid ())
370+ ProbeExtensionResult probeExtensionResult = AssemblyProbeExtension::Probe (relativePath, /* pathIsBundleRelative */ true );
371+ if (!probeExtensionResult .IsValid ())
372372 {
373373 sCoreLibSatellite .Set (systemDirectory);
374374 pathSource = BinderTracing::PathSource::ApplicationAssemblies;
@@ -379,7 +379,7 @@ namespace BINDER_SPACE
379379 IF_FAIL_GO (AssemblyBinderCommon::GetAssembly (sCoreLibSatellite ,
380380 TRUE /* fIsInTPA */ ,
381381 &pSystemAssembly,
382- bundleFileLocation ));
382+ probeExtensionResult ));
383383 BinderTracing::PathProbed (sCoreLibSatellite , pathSource, hr);
384384
385385 *ppSystemAssembly = pSystemAssembly.Extract ();
@@ -590,15 +590,15 @@ namespace BINDER_SPACE
590590
591591 namespace
592592 {
593- HRESULT BindSatelliteResourceFromBundle (
593+ HRESULT BindSatelliteResourceByProbeExtension (
594594 AssemblyName* pRequestedAssemblyName,
595595 SString &relativePath,
596596 BindResult* pBindResult)
597597 {
598598 HRESULT hr = S_OK;
599599
600- BundleFileLocation bundleFileLocation = Bundle::ProbeAppBundle (relativePath, /* pathIsBundleRelative */ true );
601- if (!bundleFileLocation .IsValid ())
600+ ProbeExtensionResult probeExtensionResult = AssemblyProbeExtension::Probe (relativePath, /* pathIsBundleRelative */ true );
601+ if (!probeExtensionResult .IsValid ())
602602 {
603603 return hr;
604604 }
@@ -607,7 +607,7 @@ namespace BINDER_SPACE
607607 hr = AssemblyBinderCommon::GetAssembly (relativePath,
608608 FALSE /* fIsInTPA */ ,
609609 &pAssembly,
610- bundleFileLocation );
610+ probeExtensionResult );
611611
612612 BinderTracing::PathProbed (relativePath, BinderTracing::PathSource::Bundle, hr);
613613
@@ -692,7 +692,7 @@ namespace BINDER_SPACE
692692 BindResult* pBindResult)
693693 {
694694 // Satellite resource probing strategy is to look:
695- // * First within the single-file bundle
695+ // * First via probe extensions ( single-file bundle, external data)
696696 // * Then under each of the Platform Resource Roots
697697 // * Then under each of the App Paths.
698698 //
@@ -712,7 +712,7 @@ namespace BINDER_SPACE
712712 CombinePath (fileName, simpleNameRef, fileName);
713713 fileName.Append (W (" .dll" ));
714714
715- hr = BindSatelliteResourceFromBundle (pRequestedAssemblyName, fileName, pBindResult);
715+ hr = BindSatelliteResourceByProbeExtension (pRequestedAssemblyName, fileName, pBindResult);
716716
717717 if (pBindResult->HaveResult () || FAILED (hr))
718718 {
@@ -841,12 +841,9 @@ namespace BINDER_SPACE
841841 ReleaseHolder<Assembly> pTPAAssembly;
842842 const SString& simpleName = pRequestedAssemblyName->GetSimpleName ();
843843
844- // Is assembly in the bundle?
845- // Single-file bundle contents take precedence over TPA.
846- // The list of bundled assemblies is contained in the bundle manifest, and NOT in the TPA.
847- // Therefore the bundle is first probed using the assembly's simple name.
848- // If found, the assembly is loaded from the bundle.
849- if (Bundle::AppIsBundle ())
844+ // Probing extensions (single-file, external probe) take precedence over TPA.
845+ // For single-file, bundled assemblies should only be in the bundle manifest, not in the TPA.
846+ if (AssemblyProbeExtension::IsEnabled ())
850847 {
851848 // Search Assembly.ni.dll, then Assembly.dll
852849 // The Assembly.ni.dll paths are rare, and intended for supporting managed C++ R2R assemblies.
@@ -858,16 +855,16 @@ namespace BINDER_SPACE
858855 SString assemblyFileName (simpleName);
859856 assemblyFileName.Append (candidates[i]);
860857
861- SString assemblyFilePath (Bundle::AppBundle->BasePath ());
862- assemblyFilePath.Append (assemblyFileName);
863-
864- BundleFileLocation bundleFileLocation = Bundle::ProbeAppBundle (assemblyFileName, /* pathIsBundleRelative */ true );
865- if (bundleFileLocation.IsValid ())
858+ ProbeExtensionResult probeExtensionResult = AssemblyProbeExtension::Probe (assemblyFileName, /* pathIsBundleRelative */ true );
859+ if (probeExtensionResult.IsValid ())
866860 {
861+ SString assemblyFilePath (Bundle::AppIsBundle () ? Bundle::AppBundle->BasePath () : SString::Empty ());
862+ assemblyFilePath.Append (assemblyFileName);
863+
867864 hr = GetAssembly (assemblyFilePath,
868865 TRUE , // fIsInTPA
869866 &pTPAAssembly,
870- bundleFileLocation );
867+ probeExtensionResult );
871868
872869 BinderTracing::PathProbed (assemblyFilePath, BinderTracing::PathSource::Bundle, hr);
873870
@@ -996,7 +993,7 @@ namespace BINDER_SPACE
996993 HRESULT AssemblyBinderCommon::GetAssembly (SString &assemblyPath,
997994 BOOL fIsInTPA ,
998995 Assembly **ppAssembly,
999- BundleFileLocation bundleFileLocation )
996+ ProbeExtensionResult probeExtensionResult )
1000997 {
1001998 HRESULT hr = S_OK;
1002999
@@ -1012,7 +1009,7 @@ namespace BINDER_SPACE
10121009 {
10131010 LPCTSTR szAssemblyPath = const_cast <LPCTSTR>(assemblyPath.GetUnicode ());
10141011
1015- hr = BinderAcquirePEImage (szAssemblyPath, &pPEImage, bundleFileLocation );
1012+ hr = BinderAcquirePEImage (szAssemblyPath, &pPEImage, probeExtensionResult );
10161013 IF_FAIL_GO (hr);
10171014 }
10181015
0 commit comments