@@ -37,7 +37,7 @@ extern HRESULT RuntimeInvokeHostAssemblyResolver(INT_PTR pManagedAssemblyLoadCon
37
37
38
38
STDAPI BinderAcquirePEImage (LPCTSTR szAssemblyPath,
39
39
PEImage** ppPEImage,
40
- ProbeExtensionResult probeExtensionResult );
40
+ BundleFileLocation bundleFileLocation );
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
- ProbeExtensionResult probeExtensionResult = AssemblyProbeExtension::Probe (sCoreLibName , /* pathIsBundleRelative */ true );
275
- if (!probeExtensionResult .IsValid ())
274
+ BundleFileLocation bundleFileLocation = Bundle::ProbeAppBundle (sCoreLibName , /* pathIsBundleRelative */ true );
275
+ if (!bundleFileLocation .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
- probeExtensionResult );
285
+ bundleFileLocation );
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
- probeExtensionResult );
325
+ bundleFileLocation );
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
- ProbeExtensionResult probeExtensionResult = AssemblyProbeExtension::Probe (relativePath, /* pathIsBundleRelative */ true );
371
- if (!probeExtensionResult .IsValid ())
370
+ BundleFileLocation bundleFileLocation = Bundle::ProbeAppBundle (relativePath, /* pathIsBundleRelative */ true );
371
+ if (!bundleFileLocation .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
- probeExtensionResult ));
382
+ bundleFileLocation ));
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 BindSatelliteResourceByProbeExtension (
593
+ HRESULT BindSatelliteResourceFromBundle (
594
594
AssemblyName* pRequestedAssemblyName,
595
595
SString &relativePath,
596
596
BindResult* pBindResult)
597
597
{
598
598
HRESULT hr = S_OK;
599
599
600
- ProbeExtensionResult probeExtensionResult = AssemblyProbeExtension::Probe (relativePath, /* pathIsBundleRelative */ true );
601
- if (!probeExtensionResult .IsValid ())
600
+ BundleFileLocation bundleFileLocation = Bundle::ProbeAppBundle (relativePath, /* pathIsBundleRelative */ true );
601
+ if (!bundleFileLocation .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
- probeExtensionResult );
610
+ bundleFileLocation );
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 via probe extensions ( single-file bundle, external data)
695
+ // * First within the single-file bundle
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 = BindSatelliteResourceByProbeExtension (pRequestedAssemblyName, fileName, pBindResult);
715
+ hr = BindSatelliteResourceFromBundle (pRequestedAssemblyName, fileName, pBindResult);
716
716
717
717
if (pBindResult->HaveResult () || FAILED (hr))
718
718
{
@@ -841,9 +841,12 @@ namespace BINDER_SPACE
841
841
ReleaseHolder<Assembly> pTPAAssembly;
842
842
const SString& simpleName = pRequestedAssemblyName->GetSimpleName ();
843
843
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 ())
847
850
{
848
851
// Search Assembly.ni.dll, then Assembly.dll
849
852
// The Assembly.ni.dll paths are rare, and intended for supporting managed C++ R2R assemblies.
@@ -855,16 +858,16 @@ namespace BINDER_SPACE
855
858
SString assemblyFileName (simpleName);
856
859
assemblyFileName.Append (candidates[i]);
857
860
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);
863
863
864
+ BundleFileLocation bundleFileLocation = Bundle::ProbeAppBundle (assemblyFileName, /* pathIsBundleRelative */ true );
865
+ if (bundleFileLocation.IsValid ())
866
+ {
864
867
hr = GetAssembly (assemblyFilePath,
865
868
TRUE , // fIsInTPA
866
869
&pTPAAssembly,
867
- probeExtensionResult );
870
+ bundleFileLocation );
868
871
869
872
BinderTracing::PathProbed (assemblyFilePath, BinderTracing::PathSource::Bundle, hr);
870
873
@@ -993,7 +996,7 @@ namespace BINDER_SPACE
993
996
HRESULT AssemblyBinderCommon::GetAssembly (SString &assemblyPath,
994
997
BOOL fIsInTPA ,
995
998
Assembly **ppAssembly,
996
- ProbeExtensionResult probeExtensionResult )
999
+ BundleFileLocation bundleFileLocation )
997
1000
{
998
1001
HRESULT hr = S_OK;
999
1002
@@ -1009,7 +1012,7 @@ namespace BINDER_SPACE
1009
1012
{
1010
1013
LPCTSTR szAssemblyPath = const_cast <LPCTSTR>(assemblyPath.GetUnicode ());
1011
1014
1012
- hr = BinderAcquirePEImage (szAssemblyPath, &pPEImage, probeExtensionResult );
1015
+ hr = BinderAcquirePEImage (szAssemblyPath, &pPEImage, bundleFileLocation );
1013
1016
IF_FAIL_GO (hr);
1014
1017
}
1015
1018
0 commit comments