diff --git a/src/coreclr/System.Private.CoreLib/src/System/Reflection/AssemblyName.CoreCLR.cs b/src/coreclr/System.Private.CoreLib/src/System/Reflection/AssemblyName.CoreCLR.cs index bfe5bcce8db99..f8505830748e7 100644 --- a/src/coreclr/System.Private.CoreLib/src/System/Reflection/AssemblyName.CoreCLR.cs +++ b/src/coreclr/System.Private.CoreLib/src/System/Reflection/AssemblyName.CoreCLR.cs @@ -16,19 +16,14 @@ internal AssemblyName(string? name, byte[]? publicKeyToken, Version? version, CultureInfo? cultureInfo, - AssemblyHashAlgorithm hashAlgorithm, - AssemblyVersionCompatibility versionCompatibility, - string? codeBase, AssemblyNameFlags flags) + : this() { _name = name; _publicKey = publicKey; _publicKeyToken = publicKeyToken; _version = version; _cultureInfo = cultureInfo; - _hashAlgorithm = hashAlgorithm; - _versionCompatibility = versionCompatibility; - _codeBase = codeBase; _flags = flags; } diff --git a/src/coreclr/System.Private.CoreLib/src/System/Reflection/RuntimeAssembly.cs b/src/coreclr/System.Private.CoreLib/src/System/Reflection/RuntimeAssembly.cs index 69fb562d2d72f..af78adf38bcc2 100644 --- a/src/coreclr/System.Private.CoreLib/src/System/Reflection/RuntimeAssembly.cs +++ b/src/coreclr/System.Private.CoreLib/src/System/Reflection/RuntimeAssembly.cs @@ -123,11 +123,16 @@ public override AssemblyName GetName(bool copiedName) null, // public key token GetVersion(), GetLocale(), - GetHashAlgorithm(), - AssemblyVersionCompatibility.SameMachine, - codeBase, GetFlags() | AssemblyNameFlags.PublicKey); +#pragma warning disable IL3000 // System.Reflection.AssemblyName.CodeBase' always returns an empty string for assemblies embedded in a single-file app. + an.CodeBase = codeBase; +#pragma warning restore IL3000 + +#pragma warning disable SYSLIB0037 // AssemblyName.HashAlgorithm is obsolete + an.HashAlgorithm = GetHashAlgorithm(); +#pragma warning restore SYSLIB0037 + Module manifestModule = ManifestModule; if (manifestModule.MDStreamVersion > 0x10000) { diff --git a/src/coreclr/binder/assemblybindercommon.cpp b/src/coreclr/binder/assemblybindercommon.cpp index 617bd16a9a07f..112cbcf7fa9ff 100644 --- a/src/coreclr/binder/assemblybindercommon.cpp +++ b/src/coreclr/binder/assemblybindercommon.cpp @@ -107,53 +107,6 @@ namespace BINDER_SPACE return true; } - const WCHAR* s_httpURLPrefix = W("http://"); - HRESULT URLToFullPath(PathString &assemblyPath) - { - HRESULT hr = S_OK; - - SString::Iterator pos = assemblyPath.Begin(); - if (assemblyPath.MatchCaseInsensitive(pos, s_httpURLPrefix)) - { - // HTTP downloads are unsupported - hr = FUSION_E_CODE_DOWNLOAD_DISABLED; - } - else - { - SString fullAssemblyPath; - WCHAR *pwzFullAssemblyPath = fullAssemblyPath.OpenUnicodeBuffer(MAX_LONGPATH); - DWORD dwCCFullAssemblyPath = MAX_LONGPATH + 1; // SString allocates extra byte for null. - - MutateUrlToPath(assemblyPath); - - dwCCFullAssemblyPath = WszGetFullPathName(assemblyPath.GetUnicode(), - dwCCFullAssemblyPath, - pwzFullAssemblyPath, - NULL); - if (dwCCFullAssemblyPath > MAX_LONGPATH) - { - fullAssemblyPath.CloseBuffer(); - pwzFullAssemblyPath = fullAssemblyPath.OpenUnicodeBuffer(dwCCFullAssemblyPath - 1); - dwCCFullAssemblyPath = WszGetFullPathName(assemblyPath.GetUnicode(), - dwCCFullAssemblyPath, - pwzFullAssemblyPath, - NULL); - } - fullAssemblyPath.CloseBuffer(dwCCFullAssemblyPath); - - if (dwCCFullAssemblyPath == 0) - { - hr = HRESULT_FROM_GetLastError(); - } - else - { - assemblyPath.Set(fullAssemblyPath); - } - } - - return hr; - } - HRESULT CreateImageAssembly(PEImage *pPEImage, BindResult *pBindResult) { @@ -238,7 +191,6 @@ namespace BINDER_SPACE HRESULT AssemblyBinderCommon::BindAssembly(/* in */ AssemblyBinder *pBinder, /* in */ AssemblyName *pAssemblyName, - /* in */ LPCWSTR szCodeBase, /* in */ bool excludeAppPaths, /* out */ Assembly **ppAssembly) { @@ -255,28 +207,13 @@ namespace BINDER_SPACE // Lock the binding application context CRITSEC_Holder contextLock(pApplicationContext->GetCriticalSectionCookie()); - if (szCodeBase == NULL) - { - _ASSERTE(pAssemblyName != NULL); - IF_FAIL_GO(BindByName(pApplicationContext, - pAssemblyName, - false, // skipFailureCaching - false, // skipVersionCompatibilityCheck - excludeAppPaths, - &bindResult)); - } - else - { - PathString assemblyPath(szCodeBase); - - // Convert URL to full path and block HTTP downloads - IF_FAIL_GO(URLToFullPath(assemblyPath)); - - IF_FAIL_GO(BindWhereRef(pApplicationContext, - assemblyPath, - excludeAppPaths, - &bindResult)); - } + _ASSERTE(pAssemblyName != NULL); + IF_FAIL_GO(BindByName(pApplicationContext, + pAssemblyName, + false, // skipFailureCaching + false, // skipVersionCompatibilityCheck + excludeAppPaths, + &bindResult)); // Remember the post-bind version kContextVersion = pApplicationContext->GetVersion(); @@ -526,61 +463,6 @@ namespace BINDER_SPACE return hr; } - /* static */ - HRESULT AssemblyBinderCommon::BindWhereRef(ApplicationContext *pApplicationContext, - PathString &assemblyPath, - bool excludeAppPaths, - BindResult *pBindResult) - { - HRESULT hr = S_OK; - - ReleaseHolder pAssembly; - BindResult lockedBindResult; - - // Look for already cached binding failure - hr = pApplicationContext->GetFailureCache()->Lookup(assemblyPath); - if (FAILED(hr)) - { - goto LogExit; - } - - // If we return this assembly, then it is guaranteed to be not in GAC - // Design decision. For now, keep the V2 model of Fusion being oblivious of the strong name. - // Security team did not see any security concern with interpreting the version information. - IF_FAIL_GO(GetAssembly(assemblyPath, - FALSE /* fIsInTPA */, - &pAssembly, - Bundle::ProbeAppBundle(assemblyPath))); - - AssemblyName *pAssemblyName; - pAssemblyName = pAssembly->GetAssemblyName(); - - IF_FAIL_GO(BindLocked(pApplicationContext, - pAssemblyName, - false, // skipVersionCompatibilityCheck - excludeAppPaths, - &lockedBindResult)); - if (lockedBindResult.HaveResult()) - { - pBindResult->SetResult(&lockedBindResult); - GO_WITH_HRESULT(S_OK); - } - - hr = S_OK; - pBindResult->SetResult(pAssembly); - - Exit: - - if (FAILED(hr)) - { - // Always cache binding failures - hr = pApplicationContext->AddToFailureCache(assemblyPath, hr); - } - - LogExit: - return hr; - } - /* static */ HRESULT AssemblyBinderCommon::BindLocked(ApplicationContext *pApplicationContext, AssemblyName *pAssemblyName, diff --git a/src/coreclr/binder/bindertracing.cpp b/src/coreclr/binder/bindertracing.cpp index e349b99b3c14e..9e540e725aa33 100644 --- a/src/coreclr/binder/bindertracing.cpp +++ b/src/coreclr/binder/bindertracing.cpp @@ -138,9 +138,6 @@ namespace AssemblySpec *spec = request.AssemblySpec; _ASSERTE(spec != nullptr); - if (request.AssemblyPath.IsEmpty()) - request.AssemblyPath = spec->GetCodeBase(); - if (spec->GetName() != nullptr) spec->GetDisplayName(ASM_DISPLAYF_VERSION | ASM_DISPLAYF_CULTURE | ASM_DISPLAYF_PUBLIC_KEY_TOKEN, request.AssemblyName); diff --git a/src/coreclr/binder/customassemblybinder.cpp b/src/coreclr/binder/customassemblybinder.cpp index 13d10d94fbb63..d82e150c13237 100644 --- a/src/coreclr/binder/customassemblybinder.cpp +++ b/src/coreclr/binder/customassemblybinder.cpp @@ -27,7 +27,6 @@ HRESULT CustomAssemblyBinder::BindAssemblyByNameWorker(BINDER_SPACE::AssemblyNam // Do we have the assembly already loaded in the context of the current binder? hr = AssemblyBinderCommon::BindAssembly(this, pAssemblyName, - NULL, // szCodeBase false, //excludeAppPaths, ppCoreCLRFoundAssembly); if (!FAILED(hr)) diff --git a/src/coreclr/binder/defaultassemblybinder.cpp b/src/coreclr/binder/defaultassemblybinder.cpp index 33eb404164d51..096b3a508458a 100644 --- a/src/coreclr/binder/defaultassemblybinder.cpp +++ b/src/coreclr/binder/defaultassemblybinder.cpp @@ -25,7 +25,6 @@ HRESULT DefaultAssemblyBinder::BindAssemblyByNameWorker(BINDER_SPACE::AssemblyNa hr = AssemblyBinderCommon::BindAssembly(this, pAssemblyName, - NULL, // szCodeBase excludeAppPaths, ppCoreCLRFoundAssembly); if (!FAILED(hr)) @@ -187,32 +186,6 @@ HRESULT DefaultAssemblyBinder::SetupBindingPaths(SString &sTrustedPlatformAssem return hr; } -HRESULT DefaultAssemblyBinder::Bind(LPCWSTR wszCodeBase, - BINDER_SPACE::Assembly **ppAssembly) -{ - HRESULT hr = S_OK; - VALIDATE_ARG_RET(wszCodeBase != NULL && ppAssembly != NULL); - - EX_TRY - { - ReleaseHolder pAsm; - hr = AssemblyBinderCommon::BindAssembly(this, - NULL, // pAssemblyName - wszCodeBase, - false, // excludeAppPaths - &pAsm); - if(SUCCEEDED(hr)) - { - _ASSERTE(pAsm != NULL); - pAsm->SetBinder(this); - *ppAssembly = pAsm.Extract(); - } - } - EX_CATCH_HRESULT(hr); - - return hr; -} - HRESULT DefaultAssemblyBinder::BindToSystem(BINDER_SPACE::Assembly** ppSystemAssembly) { HRESULT hr = S_OK; diff --git a/src/coreclr/binder/inc/assemblybindercommon.hpp b/src/coreclr/binder/inc/assemblybindercommon.hpp index b708d6d204e57..4c2f1db618e94 100644 --- a/src/coreclr/binder/inc/assemblybindercommon.hpp +++ b/src/coreclr/binder/inc/assemblybindercommon.hpp @@ -32,7 +32,6 @@ namespace BINDER_SPACE public: static HRESULT BindAssembly(/* in */ AssemblyBinder *pBinder, /* in */ AssemblyName *pAssemblyName, - /* in */ LPCWSTR szCodeBase, /* in */ bool excludeAppPaths, /* out */ Assembly **ppAssembly); @@ -75,11 +74,6 @@ namespace BINDER_SPACE /* in */ bool excludeAppPaths, /* out */ BindResult *pBindResult); - static HRESULT BindWhereRef(/* in */ ApplicationContext *pApplicationContext, - /* in */ PathString &assemblyPath, - /* in */ bool excludeAppPaths, - /* out */ BindResult *pBindResult); - static HRESULT BindLocked(/* in */ ApplicationContext *pApplicationContext, /* in */ AssemblyName *pAssemblyName, /* in */ bool skipVersionCompatibilityCheck, diff --git a/src/coreclr/binder/inc/defaultassemblybinder.h b/src/coreclr/binder/inc/defaultassemblybinder.h index 9394fd9b7f8b5..398174c65a078 100644 --- a/src/coreclr/binder/inc/defaultassemblybinder.h +++ b/src/coreclr/binder/inc/defaultassemblybinder.h @@ -38,8 +38,6 @@ class DefaultAssemblyBinder final : public AssemblyBinder SString &sPlatformResourceRoots, SString &sAppPaths); - HRESULT Bind(LPCWSTR wszCodeBase, BINDER_SPACE::Assembly **ppAssembly); - HRESULT BindToSystem(BINDER_SPACE::Assembly **ppSystemAssembly); private: diff --git a/src/coreclr/binder/inc/utils.hpp b/src/coreclr/binder/inc/utils.hpp index 24730b7ea3fb1..54a6c79d853bd 100644 --- a/src/coreclr/binder/inc/utils.hpp +++ b/src/coreclr/binder/inc/utils.hpp @@ -18,8 +18,6 @@ namespace BINDER_SPACE { - void MutateUrlToPath(SString &urlOrPath); - // It is safe to use either A or B as CombinedPath. void CombinePath(const SString &pathA, const SString &pathB, diff --git a/src/coreclr/binder/utils.cpp b/src/coreclr/binder/utils.cpp index 0dc7b7dc5c18d..44d44dc9c0a7b 100644 --- a/src/coreclr/binder/utils.cpp +++ b/src/coreclr/binder/utils.cpp @@ -32,48 +32,6 @@ namespace BINDER_SPACE } } - void MutateUrlToPath(SString &urlOrPath) - { - const SString fileUrlPrefix(SString::Literal, W("file://")); - SString::Iterator i = urlOrPath.Begin(); - - if (urlOrPath.MatchCaseInsensitive(i, fileUrlPrefix)) - { - urlOrPath.Delete(i, fileUrlPrefix.GetCount()); - - i = urlOrPath.Begin() + 1; - if (i[0] == W(':')) - { - // CLR erroneously passes in file:// prepended to file paths, - // so we can't tell the difference between UNC and local file. - goto Exit; - } - - i = urlOrPath.Begin(); -#if !defined(TARGET_UNIX) - if (i[0] == W('/')) - { - // Disk path file:/// - urlOrPath.Delete(i, 1); - } - else if (i[0] != W('\\')) - { - // UNC Path, re-insert "//" if not the wrong file://\\... - urlOrPath.Insert(i, W("//")); - } -#else - // Unix doesn't have a distinction between local and network path - _ASSERTE(i[0] == W('\\') || i[0] == W('/')); -#endif - } - - Exit: - while (urlOrPath.Find(i, W('/'))) - { - urlOrPath.Replace(i, W('\\')); - } - } - void CombinePath(const SString &pathA, const SString &pathB, SString &combinedPath) diff --git a/src/coreclr/debug/daccess/request.cpp b/src/coreclr/debug/daccess/request.cpp index e99f58fe9ba38..79d6e4749397c 100644 --- a/src/coreclr/debug/daccess/request.cpp +++ b/src/coreclr/debug/daccess/request.cpp @@ -2380,22 +2380,11 @@ ClrDataAccess::GetFailedAssemblyLocation(CLRDATA_ADDRESS assembly, unsigned int SOSDacEnter(); FailedAssembly* pAssembly = PTR_FailedAssembly(TO_TADDR(assembly)); - // Turn from bytes to wide characters - if (!pAssembly->location.IsEmpty()) - { - if (!pAssembly->location.DacGetUnicode(count, location, pNeeded)) - { - hr = E_FAIL; - } - } - else - { - if (pNeeded) - *pNeeded = 1; + if (pNeeded) + *pNeeded = 1; - if (location) - location[0] = 0; - } + if (location) + location[0] = 0; SOSDacLeave(); return hr; diff --git a/src/coreclr/vm/appdomain.cpp b/src/coreclr/vm/appdomain.cpp index e53000ceddb5e..7c6f55a242a8c 100644 --- a/src/coreclr/vm/appdomain.cpp +++ b/src/coreclr/vm/appdomain.cpp @@ -2762,7 +2762,7 @@ DomainAssembly* AppDomain::LoadDomainAssembly(AssemblySpec* pSpec, if (!EEFileLoadException::CheckType(pEx)) { StackSString name; - pSpec->GetFileOrDisplayName(0, name); + pSpec->GetDisplayName(0, name); pEx=new EEFileLoadException(name, pEx->GetHR(), pEx); AddExceptionToCache(pSpec, pEx); PAL_CPP_THROW(Exception *, pEx); @@ -3773,7 +3773,7 @@ PEAssembly * AppDomain::BindAssemblySpec( StackSString exceptionDisplayName, failedSpecDisplayName; ((EEFileLoadException*)ex)->GetName(exceptionDisplayName); - pFailedSpec->GetFileOrDisplayName(0, failedSpecDisplayName); + pFailedSpec->GetDisplayName(0, failedSpecDisplayName); if (exceptionDisplayName.CompareCaseInsensitive(failedSpecDisplayName) == 0) { @@ -4598,7 +4598,7 @@ AppDomain::RaiseAssemblyResolveEvent( CONTRACT_END; StackSString ssName; - pSpec->GetFileOrDisplayName(0, ssName); + pSpec->GetDisplayName(0, ssName); // Elevate threads allowed loading level. This allows the host to load an assembly even in a restricted // condition. Note, however, that this exposes us to possible recursion failures, if the host tries to diff --git a/src/coreclr/vm/appdomain.hpp b/src/coreclr/vm/appdomain.hpp index fbe728ff7e1c0..d82d6701794c7 100644 --- a/src/coreclr/vm/appdomain.hpp +++ b/src/coreclr/vm/appdomain.hpp @@ -1453,7 +1453,6 @@ class CollectibleAssemblyHolder : public BaseWrapper<_Type, CollectibleAssemblyH // struct FailedAssembly { SString displayName; - SString location; HRESULT error; void Initialize(AssemblySpec *pSpec, Exception *ex) @@ -1467,7 +1466,6 @@ struct FailedAssembly { CONTRACTL_END; displayName.SetASCII(pSpec->GetName()); - location.Set(pSpec->GetCodeBase()); error = ex->GetHR(); // diff --git a/src/coreclr/vm/assemblynative.cpp b/src/coreclr/vm/assemblynative.cpp index c8d0c1318a8ca..c511651e88ac6 100644 --- a/src/coreclr/vm/assemblynative.cpp +++ b/src/coreclr/vm/assemblynative.cpp @@ -89,8 +89,6 @@ extern "C" void QCALLTYPE AssemblyNative_InternalLoad(QCall::ObjectHandleOnStack GCPROTECT_END(); - spec.SetCodeBase(NULL); - if (pParentAssembly != NULL) spec.SetParentAssembly(pParentAssembly); @@ -163,7 +161,7 @@ Assembly* AssemblyNative::LoadFromPEImage(AssemblyBinder* pBinder, PEImage *pIma } StackSString name; - spec.GetFileOrDisplayName(0, name); + spec.GetDisplayName(0, name); COMPlusThrowHR(COR_E_FILELOAD, dwMessageID, name); } @@ -999,7 +997,7 @@ FCIMPL1(Object*, AssemblyNative::GetReferencedAssemblies, AssemblyBaseObject * p spec.InitializeSpec(mdAssemblyRef, pImport); gc.pObj = (ASSEMBLYNAMEREF) AllocateObject(pAsmNameClass); - spec.AssemblyNameInit(&gc.pObj,NULL); + spec.AssemblyNameInit(&gc.pObj); gc.ItemArray->SetAt(i, (OBJECTREF) gc.pObj); } diff --git a/src/coreclr/vm/assemblyspec.cpp b/src/coreclr/vm/assemblyspec.cpp index cce0b240105d3..a956df310d86d 100644 --- a/src/coreclr/vm/assemblyspec.cpp +++ b/src/coreclr/vm/assemblyspec.cpp @@ -22,6 +22,7 @@ #include "strongnameinternal.h" #include "strongnameholders.h" #include "eventtrace.h" +#include "assemblynative.hpp" #include "../binder/inc/bindertracing.h" @@ -146,38 +147,6 @@ AssemblySpecHash::~AssemblySpecHash() } } -// Check assembly name for invalid characters -// Return value: -// TRUE: If no invalid characters were found, or if the assembly name isn't set -// FALSE: If invalid characters were found -// This is needed to prevent security loopholes with ':', '/' and '\' in the assembly name -BOOL AssemblySpec::IsValidAssemblyName() -{ - CONTRACTL - { - THROWS; - GC_TRIGGERS; - } - CONTRACTL_END; - - if (GetName()) - { - SString ssAssemblyName(SString::Utf8, GetName()); - for (SString::Iterator i = ssAssemblyName.Begin(); i[0] != W('\0'); i++) { - switch (i[0]) { - case W(':'): - case W('\\'): - case W('/'): - return FALSE; - - default: - break; - } - } - } - return TRUE; -} - HRESULT AssemblySpec::InitializeSpecInternal(mdToken kAssemblyToken, IMDInternalImport *pImport, DomainAssembly *pStaticParent, @@ -371,7 +340,7 @@ void AssemblySpec::InitializeSpec(StackingAllocator* alloc, ASSEMBLYNAMEREF* pNa CloneFieldsToStackingAllocator(alloc); } -void AssemblySpec::AssemblyNameInit(ASSEMBLYNAMEREF* pAsmName, PEImage* pImageInfo) +void AssemblySpec::AssemblyNameInit(ASSEMBLYNAMEREF* pAsmName) { CONTRACTL { @@ -496,21 +465,8 @@ void AssemblySpec::AssemblyNameInit(ASSEMBLYNAMEREF* pAsmName, PEImage* pImageIn if(GetName()) gc.Name = StringObject::NewString(GetName()); - if (GetCodeBase()) - gc.CodeBase = StringObject::NewString(GetCodeBase()); - BOOL fPublicKey = m_dwFlags & afPublicKey; - ULONG hashAlgId=0; - if (pImageInfo != NULL) - { - if(!pImageInfo->GetMDImport()->IsValidToken(TokenFromRid(1, mdtAssembly))) - { - ThrowHR(COR_E_BADIMAGEFORMAT); - } - IfFailThrow(pImageInfo->GetMDImport()->GetAssemblyProps(TokenFromRid(1, mdtAssembly), NULL, NULL, &hashAlgId, NULL, NULL, NULL)); - } - MethodDescCallSite init(METHOD__ASSEMBLY_NAME__CTOR); ARG_SLOT MethodArgs[] = @@ -523,33 +479,11 @@ void AssemblySpec::AssemblyNameInit(ASSEMBLYNAMEREF* pAsmName, PEImage* pImageIn ObjToArgSlot(gc.PublicKeyOrToken), // public key token ObjToArgSlot(gc.Version), ObjToArgSlot(gc.CultureInfo), - (ARG_SLOT) hashAlgId, - (ARG_SLOT) 1, // AssemblyVersionCompatibility.SameMachine - ObjToArgSlot(gc.CodeBase), (ARG_SLOT) m_dwFlags, }; init.Call(MethodArgs); - // Only set the processor architecture if we're looking at a newer binary that has - // that information in the PE, and we're not looking at a reference assembly. - if(pImageInfo && !pImageInfo->HasV1Metadata() && !pImageInfo->IsReferenceAssembly()) - { - DWORD dwMachine, dwKind; - - pImageInfo->GetPEKindAndMachine(&dwMachine,&dwKind); - - MethodDescCallSite setPA(METHOD__ASSEMBLY_NAME__SET_PROC_ARCH_INDEX); - - ARG_SLOT PAMethodArgs[] = { - ObjToArgSlot(*pAsmName), - (ARG_SLOT)dwMachine, - (ARG_SLOT)dwKind - }; - - setPA.Call(PAMethodArgs); - } - GCPROTECT_END(); } @@ -579,7 +513,7 @@ void AssemblySpec::InitializeAssemblyNameRef(_In_ BINDER_SPACE::AssemblyName* as spec.SetCulture(culture); } - spec.AssemblyNameInit(assemblyNameRef, NULL); + spec.AssemblyNameInit(assemblyNameRef); } @@ -786,9 +720,19 @@ Assembly *AssemblySpec::LoadAssembly(LPCWSTR pFilePath) } CONTRACT_END; - AssemblySpec spec; - spec.SetCodeBase(pFilePath); - RETURN spec.LoadAssembly(FILE_LOADED); + GCX_PREEMP(); + + PEImageHolder pILImage; + + pILImage = PEImage::OpenImage(pFilePath, + MDInternalImport_Default, + Bundle::ProbeAppBundle(pFilePath)); + + // Need to verify that this is a valid CLR assembly. + if (!pILImage->CheckILFormat()) + THROW_BAD_FORMAT(BFA_BAD_IL, pILImage.GetValue()); + + RETURN AssemblyNative::LoadFromPEImage(AppDomain::GetCurrentDomain()->GetDefaultBinder(), pILImage); } HRESULT AssemblySpec::CheckFriendAssemblyName() diff --git a/src/coreclr/vm/assemblyspec.hpp b/src/coreclr/vm/assemblyspec.hpp index 8d2bd8045593d..7d7e66727517c 100644 --- a/src/coreclr/vm/assemblyspec.hpp +++ b/src/coreclr/vm/assemblyspec.hpp @@ -28,7 +28,6 @@ class AssemblySpec : public BaseAssemblySpec { private: AppDomain *m_pAppDomain; - DWORD m_dwHashAlg; DomainAssembly *m_pParentAssembly; // Contains the reference to the fallback load context associated with RefEmitted assembly requesting the load of another assembly (static or dynamic) @@ -37,8 +36,6 @@ class AssemblySpec : public BaseAssemblySpec // Flag to indicate if we should prefer the fallback load context binder for binding or not. bool m_fPreferFallbackBinder; - BOOL IsValidAssemblyName(); - HRESULT InitializeSpecInternal(mdToken kAssemblyRefOrDef, IMDInternalImport *pImport, DomainAssembly *pStaticParent, @@ -105,14 +102,7 @@ class AssemblySpec : public BaseAssemblySpec void InitializeSpec(PEAssembly* pPEAssembly); void InitializeSpec(StackingAllocator* alloc, ASSEMBLYNAMEREF* pName); - void AssemblyNameInit(ASSEMBLYNAMEREF* pName, PEImage* pImageInfo); //[in,out], [in] - - - void SetCodeBase(LPCWSTR szCodeBase) - { - WRAPPER_NO_CONTRACT; - BaseAssemblySpec::SetCodeBase(szCodeBase); - } + void AssemblyNameInit(ASSEMBLYNAMEREF* pName); //[in,out] void SetParentAssembly(DomainAssembly *pAssembly) { @@ -174,8 +164,6 @@ class AssemblySpec : public BaseAssemblySpec // Copy the details of the fallback load context binder SetFallbackBinderForRequestingAssembly(pSource->GetFallbackBinderForRequestingAssembly()); m_fPreferFallbackBinder = pSource->GetPreferFallbackBinder(); - - m_dwHashAlg = pSource->m_dwHashAlg; } HRESULT CheckFriendAssemblyName(); @@ -292,7 +280,7 @@ class AssemblySpecHash GCX_PREEMP(); entry->CopyFrom(pSpec); - entry->CloneFields(AssemblySpec::ALL_OWNED); + entry->CloneFields(); m_map.InsertValue(key, entry); @@ -376,11 +364,11 @@ class AssemblySpecBindingCache InitInternal(pSpec,pPEAssembly,pAssembly); if (pHeap != NULL) { - m_spec.CloneFieldsToLoaderHeap(AssemblySpec::ALL_OWNED,pHeap, pamTracker); + m_spec.CloneFieldsToLoaderHeap(pHeap, pamTracker); } else { - m_spec.CloneFields(m_spec.ALL_OWNED); + m_spec.CloneFields(); } InitException(pEx); diff --git a/src/coreclr/vm/baseassemblyspec.cpp b/src/coreclr/vm/baseassemblyspec.cpp index 10951a8b082f5..386350c1405a9 100644 --- a/src/coreclr/vm/baseassemblyspec.cpp +++ b/src/coreclr/vm/baseassemblyspec.cpp @@ -32,7 +32,7 @@ VOID BaseAssemblySpec::CloneFieldsToStackingAllocator( StackingAllocator* alloc) DWORD hash = Hash(); #endif - if ((~m_ownedFlags & NAME_OWNED) && + if ((~m_ownedFlags & NAME_OWNED) && m_pAssemblyName) { S_UINT32 len = S_UINT32((DWORD) strlen(m_pAssemblyName)) + S_UINT32(1); if(len.IsOverflow()) COMPlusThrowHR(COR_E_OVERFLOW); @@ -48,7 +48,7 @@ VOID BaseAssemblySpec::CloneFieldsToStackingAllocator( StackingAllocator* alloc) m_pbPublicKeyOrToken = temp; } - if ((~m_ownedFlags & LOCALE_OWNED) && + if ((~m_ownedFlags & LOCALE_OWNED) && m_context.szLocale) { S_UINT32 len = S_UINT32((DWORD) strlen(m_context.szLocale)) + S_UINT32(1); if(len.IsOverflow()) COMPlusThrowHR(COR_E_OVERFLOW); @@ -57,15 +57,6 @@ VOID BaseAssemblySpec::CloneFieldsToStackingAllocator( StackingAllocator* alloc) m_context.szLocale = temp; } - if ((~m_ownedFlags & CODEBASE_OWNED) && - m_wszCodeBase) { - S_UINT32 len = S_UINT32((DWORD) wcslen(m_wszCodeBase)) + S_UINT32(1); - if(len.IsOverflow()) COMPlusThrowHR(COR_E_OVERFLOW); - LPWSTR temp = (LPWSTR)alloc->Alloc(len*S_UINT32(sizeof(WCHAR))); - wcscpy_s(temp, len.Value(), m_wszCodeBase); - m_wszCodeBase = temp; - } - _ASSERTE(hash == Hash()); } @@ -83,13 +74,6 @@ BOOL BaseAssemblySpec::IsCoreLib() CONTRACTL_END; if (m_pAssemblyName == NULL) { - LPCWSTR file = GetCodeBase(); - if (file) - { - StackSString path(file); - PEAssembly::UrlToPath(path); - return SystemDomain::System()->IsBaseLibrary(path); - } return FALSE; } @@ -124,13 +108,6 @@ BOOL BaseAssemblySpec::IsCoreLibSatellite() const if (m_pAssemblyName == NULL) { - LPCWSTR file = GetCodeBase(); - if (file) - { - StackSString path(file); - PEAssembly::UrlToPath(path); - return SystemDomain::System()->IsBaseLibrarySatellite(path); - } return FALSE; } @@ -190,14 +167,6 @@ BOOL BaseAssemblySpec::CompareRefToDef(const BaseAssemblySpec *pRef, const BaseA { WRAPPER_NO_CONTRACT; - if(pRef->m_wszCodeBase || pDef->m_wszCodeBase) - { - if(!pRef->m_wszCodeBase || !pDef->m_wszCodeBase) - return FALSE; - - return wcscmp(pRef->m_wszCodeBase,(pDef->m_wszCodeBase)) == 0; - } - // Compare fields // diff --git a/src/coreclr/vm/baseassemblyspec.h b/src/coreclr/vm/baseassemblyspec.h index 871bb47b1e95d..7fd7514d1b247 100644 --- a/src/coreclr/vm/baseassemblyspec.h +++ b/src/coreclr/vm/baseassemblyspec.h @@ -25,7 +25,6 @@ class BaseAssemblySpec PBYTE m_pbPublicKeyOrToken; DWORD m_cbPublicKeyOrToken; DWORD m_dwFlags; // CorAssemblyFlags - LPCWSTR m_wszCodeBase; // URL to the code int m_ownedFlags; AssemblyBinder *m_pBinder; @@ -34,14 +33,11 @@ class BaseAssemblySpec { NAME_OWNED = 0x01, PUBLIC_KEY_OR_TOKEN_OWNED = 0x02, - CODE_BASE_OWNED = 0x04, LOCALE_OWNED = 0x08, - CODEBASE_OWNED = 0x10, // unused = 0x20, // Set if ParseName() returned illegal textual identity. // Cannot process the string any further. BAD_NAME_OWNED = 0x40, - ALL_OWNED = 0xFF, }; BaseAssemblySpec(); @@ -59,8 +55,8 @@ class BaseAssemblySpec // Note that this method does not clone the fields! VOID CopyFrom(const BaseAssemblySpec *pSpec); - VOID CloneFields(int flags=ALL_OWNED); - VOID CloneFieldsToLoaderHeap(int flags, LoaderHeap *pHeap, AllocMemTracker *pamTracker); + VOID CloneFields(); + VOID CloneFieldsToLoaderHeap(LoaderHeap *pHeap, AllocMemTracker *pamTracker); VOID CloneFieldsToStackingAllocator(StackingAllocator* alloc); inline void SetBinder(AssemblyBinder *pBinder) @@ -86,9 +82,6 @@ class BaseAssemblySpec void SetName(LPCSTR szName); void SetName(SString const & ssName); - LPCWSTR GetCodeBase() const; - void SetCodeBase(LPCWSTR szCodeBase); - VOID SetCulture(LPCSTR szCulture); VOID ConvertPublicKeyToToken(); @@ -114,7 +107,6 @@ class BaseAssemblySpec static int CompareStrings(LPCUTF8 string1, LPCUTF8 string2); static BOOL RefMatchesDef(const BaseAssemblySpec* pRef, const BaseAssemblySpec* pDef); - void GetFileOrDisplayName(DWORD flags, SString &result) const; void GetDisplayName(DWORD flags, SString &result) const; protected: // static @@ -123,9 +115,6 @@ class BaseAssemblySpec protected: void InitializeWithAssemblyIdentity(BINDER_SPACE::AssemblyIdentity *identity); void PopulateAssemblyNameData(AssemblyNameData &data) const; - -private: - void GetDisplayNameInternal(DWORD flags, SString &result) const; }; #endif // __BASE_ASSEMBLY_SPEC_H__ diff --git a/src/coreclr/vm/baseassemblyspec.inl b/src/coreclr/vm/baseassemblyspec.inl index 0fc2274acb19c..6b73372c7fc4b 100644 --- a/src/coreclr/vm/baseassemblyspec.inl +++ b/src/coreclr/vm/baseassemblyspec.inl @@ -42,8 +42,6 @@ inline BaseAssemblySpec::~BaseAssemblySpec() delete [] m_pAssemblyName; if (m_ownedFlags & PUBLIC_KEY_OR_TOKEN_OWNED) delete [] m_pbPublicKeyOrToken; - if (m_wszCodeBase && (m_ownedFlags & CODE_BASE_OWNED)) - delete [] m_wszCodeBase; if (m_ownedFlags & LOCALE_OWNED) delete [] m_context.szLocale; } @@ -76,7 +74,7 @@ inline HRESULT BaseAssemblySpec::Init(LPCSTR pAssemblyDisplayName) return ParseName(); } -inline VOID BaseAssemblySpec::CloneFields(int ownedFlags) +inline VOID BaseAssemblySpec::CloneFields() { CONTRACTL { @@ -91,7 +89,7 @@ inline VOID BaseAssemblySpec::CloneFields(int ownedFlags) DWORD hash = Hash(); #endif - if ((~m_ownedFlags & NAME_OWNED) && (ownedFlags & NAME_OWNED) && + if ((~m_ownedFlags & NAME_OWNED) && m_pAssemblyName) { size_t len = strlen(m_pAssemblyName) + 1; LPSTR temp = new char [len]; @@ -101,14 +99,14 @@ inline VOID BaseAssemblySpec::CloneFields(int ownedFlags) } if ((~m_ownedFlags & PUBLIC_KEY_OR_TOKEN_OWNED) && - (ownedFlags & PUBLIC_KEY_OR_TOKEN_OWNED) && m_pbPublicKeyOrToken) { + m_pbPublicKeyOrToken) { BYTE *temp = new BYTE [m_cbPublicKeyOrToken]; memcpy(temp, m_pbPublicKeyOrToken, m_cbPublicKeyOrToken); m_pbPublicKeyOrToken = temp; m_ownedFlags |= PUBLIC_KEY_OR_TOKEN_OWNED; } - if ((~m_ownedFlags & LOCALE_OWNED) && (ownedFlags & LOCALE_OWNED) && + if ((~m_ownedFlags & LOCALE_OWNED) && m_context.szLocale) { size_t len = strlen(m_context.szLocale) + 1; LPSTR temp = new char [len]; @@ -117,19 +115,10 @@ inline VOID BaseAssemblySpec::CloneFields(int ownedFlags) m_ownedFlags |= LOCALE_OWNED; } - if ((~m_ownedFlags & CODEBASE_OWNED) && (ownedFlags & CODEBASE_OWNED) && - m_wszCodeBase) { - size_t len = wcslen(m_wszCodeBase) + 1; - LPWSTR temp = new WCHAR [len]; - wcscpy_s(temp, len, m_wszCodeBase); - m_wszCodeBase = temp; - m_ownedFlags |= CODEBASE_OWNED; - } - _ASSERTE(hash == Hash()); } -inline VOID BaseAssemblySpec::CloneFieldsToLoaderHeap(int flags, LoaderHeap *pHeap, AllocMemTracker *pamTracker) +inline VOID BaseAssemblySpec::CloneFieldsToLoaderHeap(LoaderHeap *pHeap, AllocMemTracker *pamTracker) { CONTRACTL { @@ -145,7 +134,7 @@ inline VOID BaseAssemblySpec::CloneFieldsToLoaderHeap(int flags, LoaderHeap *pHe DWORD hash = Hash(); #endif - if ((~m_ownedFlags & NAME_OWNED) && (flags &NAME_OWNED) && + if ((~m_ownedFlags & NAME_OWNED) && m_pAssemblyName) { size_t len = strlen(m_pAssemblyName) + 1; LPSTR temp = (LPSTR)pamTracker->Track( pHeap->AllocMem(S_SIZE_T (len)) ); @@ -153,14 +142,14 @@ inline VOID BaseAssemblySpec::CloneFieldsToLoaderHeap(int flags, LoaderHeap *pHe m_pAssemblyName = temp; } - if ((~m_ownedFlags & PUBLIC_KEY_OR_TOKEN_OWNED) && (flags &PUBLIC_KEY_OR_TOKEN_OWNED) && + if ((~m_ownedFlags & PUBLIC_KEY_OR_TOKEN_OWNED) && m_pbPublicKeyOrToken && m_cbPublicKeyOrToken > 0) { BYTE *temp = (BYTE *)pamTracker->Track( pHeap->AllocMem(S_SIZE_T (m_cbPublicKeyOrToken)) ); memcpy(temp, m_pbPublicKeyOrToken, m_cbPublicKeyOrToken); m_pbPublicKeyOrToken = temp; } - if ((~m_ownedFlags & LOCALE_OWNED) && (flags &LOCALE_OWNED) && + if ((~m_ownedFlags & LOCALE_OWNED) && m_context.szLocale) { size_t len = strlen(m_context.szLocale) + 1; LPSTR temp = (char *)pamTracker->Track( pHeap->AllocMem(S_SIZE_T (len)) ); @@ -168,14 +157,6 @@ inline VOID BaseAssemblySpec::CloneFieldsToLoaderHeap(int flags, LoaderHeap *pHe m_context.szLocale = temp; } - if ((~m_ownedFlags & CODEBASE_OWNED) && (flags &CODEBASE_OWNED) && - m_wszCodeBase) { - size_t len = wcslen(m_wszCodeBase) + 1; - LPWSTR temp = (LPWSTR)pamTracker->Track( pHeap->AllocMem(S_SIZE_T(len*sizeof(WCHAR))) ); - wcscpy_s(temp, len, m_wszCodeBase); - m_wszCodeBase = temp; - } - _ASSERTE(hash == Hash()); } @@ -199,8 +180,6 @@ inline void BaseAssemblySpec::CopyFrom(const BaseAssemblySpec *pSpec) m_dwFlags = pSpec->m_dwFlags; m_ownedFlags = 0; - m_wszCodeBase=pSpec->m_wszCodeBase; - m_context = pSpec->m_context; if ((pSpec->m_ownedFlags & BAD_NAME_OWNED) != 0) @@ -223,9 +202,6 @@ inline DWORD BaseAssemblySpec::Hash() MODE_ANY; } CONTRACTL_END; - if(m_wszCodeBase) - return HashString(m_wszCodeBase); - // Hash fields. DWORD hash = 0; @@ -270,14 +246,6 @@ inline BOOL BaseAssemblySpec::CompareEx(BaseAssemblySpec *pSpec, DWORD dwCompare { WRAPPER_NO_CONTRACT; - - if(m_wszCodeBase || pSpec->m_wszCodeBase) - { - if(!m_wszCodeBase || !pSpec->m_wszCodeBase) - return FALSE; - return wcscmp(m_wszCodeBase,(pSpec->m_wszCodeBase))==0; - } - // Compare fields if (m_pAssemblyName != pSpec->m_pAssemblyName @@ -453,33 +421,10 @@ inline HRESULT BaseAssemblySpec::Init(mdToken tkAssemblyRef, strcpy_s(assemblyName,len,szAssemblyName); m_pAssemblyName=assemblyName.Extract(); - m_ownedFlags |= CODEBASE_OWNED; SetContext(&sContext); return S_OK; } -inline void BaseAssemblySpec::SetCodeBase(LPCWSTR szCodeBase) -{ - CONTRACTL - { - NOTHROW; - GC_NOTRIGGER; - MODE_ANY; - } - CONTRACTL_END; - - if(m_wszCodeBase && (m_ownedFlags & CODEBASE_OWNED)) - delete m_wszCodeBase; - m_ownedFlags &= ~CODEBASE_OWNED; - m_wszCodeBase=szCodeBase; -} - -inline LPCWSTR BaseAssemblySpec::GetCodeBase() const -{ - LIMITED_METHOD_CONTRACT; - return m_wszCodeBase; -} - inline void BaseAssemblySpec::SetName(LPCSTR szName) { CONTRACTL diff --git a/src/coreclr/vm/clrex.cpp b/src/coreclr/vm/clrex.cpp index 804c25b5e840e..7106161d0d500 100644 --- a/src/coreclr/vm/clrex.cpp +++ b/src/coreclr/vm/clrex.cpp @@ -1728,7 +1728,7 @@ void DECLSPEC_NORETURN EEFileLoadException::Throw(AssemblySpec *pSpec, HRESULT COMPlusThrowOM(); StackSString name; - pSpec->GetFileOrDisplayName(0, name); + pSpec->GetDisplayName(0, name); EX_THROW_WITH_INNER(EEFileLoadException, (name, hr), pInnerException); } diff --git a/src/coreclr/vm/coreassemblyspec.cpp b/src/coreclr/vm/coreassemblyspec.cpp index 2da6e14750d71..00231364042cf 100644 --- a/src/coreclr/vm/coreassemblyspec.cpp +++ b/src/coreclr/vm/coreassemblyspec.cpp @@ -40,7 +40,7 @@ static VOID ThrowLoadError(AssemblySpec * pSpec, HRESULT hr) CONTRACTL_END; StackSString name; - pSpec->GetFileOrDisplayName(0, name); + pSpec->GetDisplayName(0, name); EEFileLoadException::Throw(name, hr); } @@ -64,7 +64,7 @@ HRESULT AssemblySpec::Bind(AppDomain *pAppDomain, BINDER_SPACE::Assembly** ppAs ReleaseHolder pPrivAsm; _ASSERTE(pBinder != NULL); - if (m_wszCodeBase == NULL && IsCoreLibSatellite()) + if (IsCoreLibSatellite()) { StackSString sSystemDirectory(SystemDomain::System()->SystemDirectory()); StackSString tmpString; @@ -83,16 +83,12 @@ HRESULT AssemblySpec::Bind(AppDomain *pAppDomain, BINDER_SPACE::Assembly** ppAs hr = BINDER_SPACE::AssemblyBinderCommon::BindToSystemSatellite(sSystemDirectory, sSimpleName, sCultureName, &pPrivAsm); } - else if (m_wszCodeBase == NULL) + else { AssemblyNameData assemblyNameData = { 0 }; PopulateAssemblyNameData(assemblyNameData); hr = pBinder->BindAssemblyByName(&assemblyNameData, &pPrivAsm); } - else - { - hr = pAppDomain->GetDefaultBinder()->Bind(m_wszCodeBase, &pPrivAsm); - } if (SUCCEEDED(hr)) { @@ -313,42 +309,6 @@ void BaseAssemblySpec::InitializeWithAssemblyIdentity(BINDER_SPACE::AssemblyIden } } -VOID BaseAssemblySpec::GetFileOrDisplayName(DWORD flags, SString &result) const -{ - CONTRACTL - { - INSTANCE_CHECK; - THROWS; - INJECT_FAULT(ThrowOutOfMemory()); - PRECONDITION(CheckValue(result)); - PRECONDITION(result.IsEmpty()); - } - CONTRACTL_END; - - if (m_wszCodeBase) - { - result.Set(m_wszCodeBase); - return; - } - - GetDisplayNameInternal(flags, result); -} - -VOID BaseAssemblySpec::GetDisplayName(DWORD flags, SString &result) const -{ - CONTRACTL - { - INSTANCE_CHECK; - THROWS; - INJECT_FAULT(ThrowOutOfMemory()); - PRECONDITION(CheckValue(result)); - PRECONDITION(result.IsEmpty()); - } - CONTRACTL_END; - - GetDisplayNameInternal(flags, result); -} - namespace { PEKIND GetProcessorArchitectureFromAssemblyFlags(DWORD flags) @@ -372,7 +332,7 @@ namespace } } -VOID BaseAssemblySpec::GetDisplayNameInternal(DWORD flags, SString &result) const +VOID BaseAssemblySpec::GetDisplayName(DWORD flags, SString &result) const { if (flags==0) flags=ASM_DISPLAYF_FULL; diff --git a/src/coreclr/vm/corelib.h b/src/coreclr/vm/corelib.h index 3e272192b5c32..05dbee2e21f01 100644 --- a/src/coreclr/vm/corelib.h +++ b/src/coreclr/vm/corelib.h @@ -113,10 +113,6 @@ DEFINE_FIELD(ARRAY_WITH_OFFSET, M_ARRAY, m_array) DEFINE_FIELD(ARRAY_WITH_OFFSET, M_OFFSET, m_offset) DEFINE_FIELD(ARRAY_WITH_OFFSET, M_COUNT, m_count) -DEFINE_CLASS(ASSEMBLY_HASH_ALGORITHM, Assemblies, AssemblyHashAlgorithm) -DEFINE_CLASS(PORTABLE_EXECUTABLE_KINDS, Reflection, PortableExecutableKinds) -DEFINE_CLASS(IMAGE_FILE_MACHINE, Reflection, ImageFileMachine) - DEFINE_CLASS_U(Reflection, AssemblyName, AssemblyNameBaseObject) DEFINE_FIELD_U(_name, AssemblyNameBaseObject, _name) DEFINE_FIELD_U(_publicKey, AssemblyNameBaseObject, _publicKey) @@ -128,8 +124,7 @@ DEFINE_FIELD_U(_hashAlgorithm, AssemblyNameBaseObject, _hashAlgorith DEFINE_FIELD_U(_versionCompatibility, AssemblyNameBaseObject, _versionCompatibility) DEFINE_FIELD_U(_flags, AssemblyNameBaseObject, _flags) DEFINE_CLASS(ASSEMBLY_NAME, Reflection, AssemblyName) -DEFINE_METHOD(ASSEMBLY_NAME, CTOR, .ctor, IM_Str_ArrB_ArrB_Ver_CI_AHA_AVC_Str_ANF_RetV) -DEFINE_METHOD(ASSEMBLY_NAME, SET_PROC_ARCH_INDEX, SetProcArchIndex, IM_PEK_IFM_RetV) +DEFINE_METHOD(ASSEMBLY_NAME, CTOR, .ctor, IM_Str_ArrB_ArrB_Ver_CI_ANF_RetV) DEFINE_CLASS_U(System, Version, VersionBaseObject) DEFINE_FIELD_U(_Major, VersionBaseObject, m_Major) @@ -141,8 +136,6 @@ DEFINE_METHOD(VERSION, CTOR_Ix2, .ctor, DEFINE_METHOD(VERSION, CTOR_Ix3, .ctor, IM_Int_Int_Int_RetVoid) DEFINE_METHOD(VERSION, CTOR_Ix4, .ctor, IM_Int_Int_Int_Int_RetVoid) -DEFINE_CLASS(ASSEMBLY_VERSION_COMPATIBILITY, Assemblies, AssemblyVersionCompatibility) - DEFINE_CLASS(ASSEMBLY_NAME_FLAGS, Reflection, AssemblyNameFlags) // ASSEMBLYBASE is System.ReflectionAssembly while ASSEMBLY is System.Reflection.RuntimeAssembly diff --git a/src/coreclr/vm/metasig.h b/src/coreclr/vm/metasig.h index 8be89bf3387c0..b7061692a381c 100644 --- a/src/coreclr/vm/metasig.h +++ b/src/coreclr/vm/metasig.h @@ -384,10 +384,8 @@ DEFINE_METASIG(IM(RetInt, _, i)) DEFINE_METASIG_T(IM(RetAssemblyName, _, C(ASSEMBLY_NAME))) DEFINE_METASIG_T(IM(RetAssemblyBase, _, C(ASSEMBLYBASE))) DEFINE_METASIG_T(IM(RetModule, _, C(MODULE))) -DEFINE_METASIG_T(IM(Str_ArrB_ArrB_Ver_CI_AHA_AVC_Str_ANF_RetV, - s a(b) a(b) C(VERSION) C(CULTURE_INFO) g(ASSEMBLY_HASH_ALGORITHM) g(ASSEMBLY_VERSION_COMPATIBILITY) s g(ASSEMBLY_NAME_FLAGS), v)) -DEFINE_METASIG_T(IM(PEK_IFM_RetV, - g(PORTABLE_EXECUTABLE_KINDS) g(IMAGE_FILE_MACHINE), v)) +DEFINE_METASIG_T(IM(Str_ArrB_ArrB_Ver_CI_ANF_RetV, + s a(b) a(b) C(VERSION) C(CULTURE_INFO) g(ASSEMBLY_NAME_FLAGS), v)) DEFINE_METASIG(IM(RetObj, _, j)) DEFINE_METASIG(SM(RetObj, _, j)) DEFINE_METASIG_T(IM(RetIEnumerator, _, C(IENUMERATOR))) diff --git a/src/coreclr/vm/peassembly.inl b/src/coreclr/vm/peassembly.inl index 42102f13a05da..20e0d477ec991 100644 --- a/src/coreclr/vm/peassembly.inl +++ b/src/coreclr/vm/peassembly.inl @@ -751,7 +751,7 @@ inline void PEAssembly::GetDisplayName(SString &result, DWORD flags) #ifndef DACCESS_COMPILE AssemblySpec spec; spec.InitializeSpec(this); - spec.GetFileOrDisplayName(flags, result); + spec.GetDisplayName(flags, result); #else DacNotImpl(); #endif //DACCESS_COMPILE