@@ -37,7 +37,7 @@ extern HRESULT RuntimeInvokeHostAssemblyResolver(INT_PTR pManagedAssemblyLoadCon
37
37
38
38
STDAPI BinderAcquirePEImage (LPCTSTR szAssemblyPath,
39
39
PEImage** ppPEImage,
40
- BundleFileLocation bundleFileLocation );
40
+ ProbeExtensionResult probeExtensionResult );
41
41
42
42
namespace BINDER_SPACE
43
43
{
@@ -271,8 +271,8 @@ namespace BINDER_SPACE
271
271
StackSString sCoreLibName (CoreLibName_IL_W);
272
272
StackSString sCoreLib ;
273
273
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 ())
276
276
{
277
277
pathSource = BinderTracing::PathSource::ApplicationAssemblies;
278
278
}
@@ -282,7 +282,7 @@ namespace BINDER_SPACE
282
282
hr = AssemblyBinderCommon::GetAssembly (sCoreLib ,
283
283
TRUE /* fIsInTPA */ ,
284
284
&pSystemAssembly,
285
- bundleFileLocation );
285
+ probeExtensionResult );
286
286
287
287
BinderTracing::PathProbed (sCoreLib , pathSource, hr);
288
288
@@ -322,7 +322,7 @@ namespace BINDER_SPACE
322
322
hr = AssemblyBinderCommon::GetAssembly (sCoreLib ,
323
323
TRUE /* fIsInTPA */ ,
324
324
&pSystemAssembly,
325
- bundleFileLocation );
325
+ probeExtensionResult );
326
326
327
327
BinderTracing::PathProbed (sCoreLib , BinderTracing::PathSource::ApplicationAssemblies, hr);
328
328
}
@@ -367,8 +367,8 @@ namespace BINDER_SPACE
367
367
StackSString sCoreLibSatellite ;
368
368
369
369
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 ())
372
372
{
373
373
sCoreLibSatellite .Set (systemDirectory);
374
374
pathSource = BinderTracing::PathSource::ApplicationAssemblies;
@@ -379,7 +379,7 @@ namespace BINDER_SPACE
379
379
IF_FAIL_GO (AssemblyBinderCommon::GetAssembly (sCoreLibSatellite ,
380
380
TRUE /* fIsInTPA */ ,
381
381
&pSystemAssembly,
382
- bundleFileLocation ));
382
+ probeExtensionResult ));
383
383
BinderTracing::PathProbed (sCoreLibSatellite , pathSource, hr);
384
384
385
385
*ppSystemAssembly = pSystemAssembly.Extract ();
@@ -590,15 +590,15 @@ namespace BINDER_SPACE
590
590
591
591
namespace
592
592
{
593
- HRESULT BindSatelliteResourceFromBundle (
593
+ HRESULT BindSatelliteResourceByProbeExtension (
594
594
AssemblyName* pRequestedAssemblyName,
595
595
SString &relativePath,
596
596
BindResult* pBindResult)
597
597
{
598
598
HRESULT hr = S_OK;
599
599
600
- BundleFileLocation bundleFileLocation = Bundle::ProbeAppBundle (relativePath, /* pathIsBundleRelative */ true );
601
- if (!bundleFileLocation .IsValid ())
600
+ ProbeExtensionResult probeExtensionResult = AssemblyProbeExtension::Probe (relativePath, /* pathIsBundleRelative */ true );
601
+ if (!probeExtensionResult .IsValid ())
602
602
{
603
603
return hr;
604
604
}
@@ -607,7 +607,7 @@ namespace BINDER_SPACE
607
607
hr = AssemblyBinderCommon::GetAssembly (relativePath,
608
608
FALSE /* fIsInTPA */ ,
609
609
&pAssembly,
610
- bundleFileLocation );
610
+ probeExtensionResult );
611
611
612
612
BinderTracing::PathProbed (relativePath, BinderTracing::PathSource::Bundle, hr);
613
613
@@ -692,7 +692,7 @@ namespace BINDER_SPACE
692
692
BindResult* pBindResult)
693
693
{
694
694
// Satellite resource probing strategy is to look:
695
- // * First within the single-file bundle
695
+ // * First via probe extensions ( single-file bundle, external data)
696
696
// * Then under each of the Platform Resource Roots
697
697
// * Then under each of the App Paths.
698
698
//
@@ -712,7 +712,7 @@ namespace BINDER_SPACE
712
712
CombinePath (fileName, simpleNameRef, fileName);
713
713
fileName.Append (W (" .dll" ));
714
714
715
- hr = BindSatelliteResourceFromBundle (pRequestedAssemblyName, fileName, pBindResult);
715
+ hr = BindSatelliteResourceByProbeExtension (pRequestedAssemblyName, fileName, pBindResult);
716
716
717
717
if (pBindResult->HaveResult () || FAILED (hr))
718
718
{
@@ -841,12 +841,9 @@ namespace BINDER_SPACE
841
841
ReleaseHolder<Assembly> pTPAAssembly;
842
842
const SString& simpleName = pRequestedAssemblyName->GetSimpleName ();
843
843
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 ())
850
847
{
851
848
// Search Assembly.ni.dll, then Assembly.dll
852
849
// The Assembly.ni.dll paths are rare, and intended for supporting managed C++ R2R assemblies.
@@ -858,16 +855,16 @@ namespace BINDER_SPACE
858
855
SString assemblyFileName (simpleName);
859
856
assemblyFileName.Append (candidates[i]);
860
857
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 ())
866
860
{
861
+ SString assemblyFilePath (Bundle::AppIsBundle () ? Bundle::AppBundle->BasePath () : SString::Empty ());
862
+ assemblyFilePath.Append (assemblyFileName);
863
+
867
864
hr = GetAssembly (assemblyFilePath,
868
865
TRUE , // fIsInTPA
869
866
&pTPAAssembly,
870
- bundleFileLocation );
867
+ probeExtensionResult );
871
868
872
869
BinderTracing::PathProbed (assemblyFilePath, BinderTracing::PathSource::Bundle, hr);
873
870
@@ -996,7 +993,7 @@ namespace BINDER_SPACE
996
993
HRESULT AssemblyBinderCommon::GetAssembly (SString &assemblyPath,
997
994
BOOL fIsInTPA ,
998
995
Assembly **ppAssembly,
999
- BundleFileLocation bundleFileLocation )
996
+ ProbeExtensionResult probeExtensionResult )
1000
997
{
1001
998
HRESULT hr = S_OK;
1002
999
@@ -1012,7 +1009,7 @@ namespace BINDER_SPACE
1012
1009
{
1013
1010
LPCTSTR szAssemblyPath = const_cast <LPCTSTR>(assemblyPath.GetUnicode ());
1014
1011
1015
- hr = BinderAcquirePEImage (szAssemblyPath, &pPEImage, bundleFileLocation );
1012
+ hr = BinderAcquirePEImage (szAssemblyPath, &pPEImage, probeExtensionResult );
1016
1013
IF_FAIL_GO (hr);
1017
1014
}
1018
1015
0 commit comments