From: Rahul Kumar Date: Tue, 28 Mar 2017 20:25:27 +0000 (-0700) Subject: return TPA assembly if loadfrom is passed a path to assembly with same identity X-Git-Tag: accepted/tizen/base/20180629.140029~1670^2 X-Git-Url: http://review.tizen.org/git/?a=commitdiff_plain;h=c28d9e33054c3052b8be4742711cecd524005a22;p=platform%2Fupstream%2Fcoreclr.git return TPA assembly if loadfrom is passed a path to assembly with same identity --- diff --git a/src/binder/clrprivbindercoreclr.cpp b/src/binder/clrprivbindercoreclr.cpp index b7a6807..d756454 100644 --- a/src/binder/clrprivbindercoreclr.cpp +++ b/src/binder/clrprivbindercoreclr.cpp @@ -159,8 +159,8 @@ HRESULT CLRPrivBinderCoreCLR::BindUsingPEImage( /* in */ PEImage *pPEImage, { if (pCoreCLRFoundAssembly->GetIsInGAC()) { - // If we were able to bind to a TPA assembly, then fail the load - IF_FAIL_GO(HRESULT_FROM_WIN32(ERROR_FILE_NOT_FOUND)); + *ppAssembly = pCoreCLRFoundAssembly.Extract(); + goto Exit; } } } diff --git a/src/vm/assemblynative.cpp b/src/vm/assemblynative.cpp index ed5cd72..b9079ec 100644 --- a/src/vm/assemblynative.cpp +++ b/src/vm/assemblynative.cpp @@ -507,9 +507,12 @@ Assembly* AssemblyNative::LoadFromPEImage(ICLRPrivBinder* pBinderContext, PEImag spec.GetFileOrDisplayName(0, name); COMPlusThrowHR(COR_E_FILELOAD, dwMessageID, name); } + + BINDER_SPACE::Assembly* assem; + assem = BINDER_SPACE::GetAssemblyFromPrivAssemblyFast(pAssembly); - PEAssemblyHolder pPEAssembly(PEAssembly::Open(pParentAssembly, pILImage, pNIImage, pAssembly, FALSE)); - + PEAssemblyHolder pPEAssembly(PEAssembly::Open(pParentAssembly, assem->GetPEImage(), assem->GetNativePEImage(), pAssembly, FALSE)); + GCX_COOP(); IApplicationSecurityDescriptor *pDomainSecDesc = pCurDomain->GetSecurityDescriptor();