@@ -37,7 +37,7 @@ extern HRESULT RuntimeInvokeHostAssemblyResolver(INT_PTR pManagedAssemblyLoadCon
3737
3838STDAPI BinderAcquirePEImage (LPCTSTR szAssemblyPath,
3939 PEImage** ppPEImage,
40- ProbeExtensionResult probeExtensionResult );
40+ BundleFileLocation bundleFileLocation );
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- ProbeExtensionResult probeExtensionResult = AssemblyProbeExtension::Probe (sCoreLibName , /* pathIsBundleRelative */ true );
275- if (!probeExtensionResult .IsValid ())
274+ BundleFileLocation bundleFileLocation = Bundle::ProbeAppBundle (sCoreLibName , /* pathIsBundleRelative */ true );
275+ if (!bundleFileLocation .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- probeExtensionResult );
285+ bundleFileLocation );
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- probeExtensionResult );
325+ bundleFileLocation );
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- ProbeExtensionResult probeExtensionResult = AssemblyProbeExtension::Probe (relativePath, /* pathIsBundleRelative */ true );
371- if (!probeExtensionResult .IsValid ())
370+ BundleFileLocation bundleFileLocation = Bundle::ProbeAppBundle (relativePath, /* pathIsBundleRelative */ true );
371+ if (!bundleFileLocation .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- probeExtensionResult ));
382+ bundleFileLocation ));
383383 BinderTracing::PathProbed (sCoreLibSatellite , pathSource, hr);
384384
385385 *ppSystemAssembly = pSystemAssembly.Extract ();
@@ -590,15 +590,15 @@ namespace BINDER_SPACE
590590
591591 namespace
592592 {
593- HRESULT BindSatelliteResourceByProbeExtension (
593+ HRESULT BindSatelliteResourceFromBundle (
594594 AssemblyName* pRequestedAssemblyName,
595595 SString &relativePath,
596596 BindResult* pBindResult)
597597 {
598598 HRESULT hr = S_OK;
599599
600- ProbeExtensionResult probeExtensionResult = AssemblyProbeExtension::Probe (relativePath, /* pathIsBundleRelative */ true );
601- if (!probeExtensionResult .IsValid ())
600+ BundleFileLocation bundleFileLocation = Bundle::ProbeAppBundle (relativePath, /* pathIsBundleRelative */ true );
601+ if (!bundleFileLocation .IsValid ())
602602 {
603603 return hr;
604604 }
@@ -607,7 +607,7 @@ namespace BINDER_SPACE
607607 hr = AssemblyBinderCommon::GetAssembly (relativePath,
608608 FALSE /* fIsInTPA */ ,
609609 &pAssembly,
610- probeExtensionResult );
610+ bundleFileLocation );
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 via probe extensions ( single-file bundle, external data)
695+ // * First within the single-file bundle
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 = BindSatelliteResourceByProbeExtension (pRequestedAssemblyName, fileName, pBindResult);
715+ hr = BindSatelliteResourceFromBundle (pRequestedAssemblyName, fileName, pBindResult);
716716
717717 if (pBindResult->HaveResult () || FAILED (hr))
718718 {
@@ -841,9 +841,12 @@ namespace BINDER_SPACE
841841 ReleaseHolder<Assembly> pTPAAssembly;
842842 const SString& simpleName = pRequestedAssemblyName->GetSimpleName ();
843843
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 ())
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 ())
847850 {
848851 // Search Assembly.ni.dll, then Assembly.dll
849852 // The Assembly.ni.dll paths are rare, and intended for supporting managed C++ R2R assemblies.
@@ -855,16 +858,16 @@ namespace BINDER_SPACE
855858 SString assemblyFileName (simpleName);
856859 assemblyFileName.Append (candidates[i]);
857860
858- ProbeExtensionResult probeExtensionResult = AssemblyProbeExtension::Probe (assemblyFileName, /* pathIsBundleRelative */ true );
859- if (probeExtensionResult.IsValid ())
860- {
861- SString assemblyFilePath (Bundle::AppIsBundle () ? Bundle::AppBundle->BasePath () : SString::Empty ());
862- assemblyFilePath.Append (assemblyFileName);
861+ SString assemblyFilePath (Bundle::AppBundle->BasePath ());
862+ assemblyFilePath.Append (assemblyFileName);
863863
864+ BundleFileLocation bundleFileLocation = Bundle::ProbeAppBundle (assemblyFileName, /* pathIsBundleRelative */ true );
865+ if (bundleFileLocation.IsValid ())
866+ {
864867 hr = GetAssembly (assemblyFilePath,
865868 TRUE , // fIsInTPA
866869 &pTPAAssembly,
867- probeExtensionResult );
870+ bundleFileLocation );
868871
869872 BinderTracing::PathProbed (assemblyFilePath, BinderTracing::PathSource::Bundle, hr);
870873
@@ -993,7 +996,7 @@ namespace BINDER_SPACE
993996 HRESULT AssemblyBinderCommon::GetAssembly (SString &assemblyPath,
994997 BOOL fIsInTPA ,
995998 Assembly **ppAssembly,
996- ProbeExtensionResult probeExtensionResult )
999+ BundleFileLocation bundleFileLocation )
9971000 {
9981001 HRESULT hr = S_OK;
9991002
@@ -1009,7 +1012,7 @@ namespace BINDER_SPACE
10091012 {
10101013 LPCTSTR szAssemblyPath = const_cast <LPCTSTR>(assemblyPath.GetUnicode ());
10111014
1012- hr = BinderAcquirePEImage (szAssemblyPath, &pPEImage, probeExtensionResult );
1015+ hr = BinderAcquirePEImage (szAssemblyPath, &pPEImage, bundleFileLocation );
10131016 IF_FAIL_GO (hr);
10141017 }
10151018
0 commit comments