diff options
author | Gaurav Khanna <gkhanna@microsoft.com> | 2016-08-01 12:03:26 -0700 |
---|---|---|
committer | Gaurav Khanna <gkhanna@microsoft.com> | 2016-08-09 12:59:46 -0700 |
commit | 4ed1a0cb90d85afb4a5c60be4e9f412048c5e187 (patch) | |
tree | b4015ffa0889515097d33efeb46072c053e045b2 /src/vm/assemblynative.cpp | |
parent | 17ced7fea35cb89ce6fe6c0a614c9fe15171bdea (diff) | |
download | coreclr-4ed1a0cb90d85afb4a5c60be4e9f412048c5e187.tar.gz coreclr-4ed1a0cb90d85afb4a5c60be4e9f412048c5e187.tar.bz2 coreclr-4ed1a0cb90d85afb4a5c60be4e9f412048c5e187.zip |
Fix LoadFromAssemblyName to invoke fallback context (analogous to static assembly loads within the context)
Diffstat (limited to 'src/vm/assemblynative.cpp')
-rw-r--r-- | src/vm/assemblynative.cpp | 18 |
1 files changed, 13 insertions, 5 deletions
diff --git a/src/vm/assemblynative.cpp b/src/vm/assemblynative.cpp index 29e0a451f0..90c58fc59c 100644 --- a/src/vm/assemblynative.cpp +++ b/src/vm/assemblynative.cpp @@ -137,7 +137,7 @@ FCIMPL1(FC_BOOL_RET, AssemblyNative::IsNewPortableAssembly, AssemblyNameBaseObje FCIMPLEND #endif // FEATURE_FUSION -FCIMPL9(Object*, AssemblyNative::Load, AssemblyNameBaseObject* assemblyNameUNSAFE, +FCIMPL10(Object*, AssemblyNative::Load, AssemblyNameBaseObject* assemblyNameUNSAFE, StringObject* codeBaseUNSAFE, Object* securityUNSAFE, AssemblyBaseObject* requestingAssemblyUNSAFE, @@ -145,7 +145,8 @@ FCIMPL9(Object*, AssemblyNative::Load, AssemblyNameBaseObject* assemblyNameUNSAF ICLRPrivBinder * pPrivHostBinder, CLR_BOOL fThrowOnFileNotFound, CLR_BOOL fForIntrospection, - CLR_BOOL fSuppressSecurityChecks) + CLR_BOOL fSuppressSecurityChecks, + INT_PTR ptrLoadContextBinder) { FCALL_CONTRACT; @@ -243,10 +244,17 @@ FCIMPL9(Object*, AssemblyNative::Load, AssemblyNameBaseObject* assemblyNameUNSAF spec.SetParentAssembly(pParentAssembly); #if defined(FEATURE_HOST_ASSEMBLY_RESOLVER) - // If the requesting assembly has Fallback LoadContext binder available, - // then set it up in the AssemblySpec. - if (pRefAssembly != NULL) + // Have we been passed the reference to the binder against which this load should be triggered? + // If so, then use it to set the fallback load context binder. + if (ptrLoadContextBinder != NULL) { + spec.SetFallbackLoadContextBinderForRequestingAssembly(reinterpret_cast<ICLRPrivBinder *>(ptrLoadContextBinder)); + spec.SetPreferFallbackLoadContextBinder(); + } + else if (pRefAssembly != NULL) + { + // If the requesting assembly has Fallback LoadContext binder available, + // then set it up in the AssemblySpec. PEFile *pRefAssemblyManifestFile = pRefAssembly->GetManifestFile(); spec.SetFallbackLoadContextBinderForRequestingAssembly(pRefAssemblyManifestFile->GetFallbackLoadContextBinder()); } |