From: Rahul Kumar Date: Wed, 29 Mar 2017 17:26:35 +0000 (-0700) Subject: Fix duplicate fcall entries for GetAssemblyName (dotnet/coreclr#10546) X-Git-Tag: submit/tizen/20210909.063632~11030^2~7512 X-Git-Url: http://review.tizen.org/git/?a=commitdiff_plain;h=0a3318fffa848ab4d33dd3d7916ea09f27be0681;p=platform%2Fupstream%2Fdotnet%2Fruntime.git Fix duplicate fcall entries for GetAssemblyName (dotnet/coreclr#10546) Commit migrated from https://github.com/dotnet/coreclr/commit/ec9de1aa41d80ec3be8d5a7adb1eea791abacc9a --- diff --git a/src/coreclr/src/mscorlib/src/System/Runtime/Loader/AssemblyLoadContext.cs b/src/coreclr/src/mscorlib/src/System/Runtime/Loader/AssemblyLoadContext.cs index 0da4773..de8137f 100644 --- a/src/coreclr/src/mscorlib/src/System/Runtime/Loader/AssemblyLoadContext.cs +++ b/src/coreclr/src/mscorlib/src/System/Runtime/Loader/AssemblyLoadContext.cs @@ -348,11 +348,6 @@ namespace System.Runtime.Loader } } - // This call opens and closes the file, but does not add the - // assembly to the domain. - [MethodImplAttribute(MethodImplOptions.InternalCall)] - static internal extern AssemblyName nGetFileInformation(String s); - // Helper to return AssemblyName corresponding to the path of an IL assembly public static AssemblyName GetAssemblyName(string assemblyPath) { @@ -361,10 +356,9 @@ namespace System.Runtime.Loader throw new ArgumentNullException(nameof(assemblyPath)); } - string fullPath = Path.GetFullPath(assemblyPath); - return nGetFileInformation(fullPath); + return AssemblyName.GetAssemblyName(assemblyPath); } - + [DllImport(JitHelpers.QCall, CharSet = CharSet.Unicode)] [SuppressUnmanagedCodeSecurity] private static extern IntPtr GetLoadContextForAssembly(RuntimeAssembly assembly); diff --git a/src/coreclr/src/vm/ecalllist.h b/src/coreclr/src/vm/ecalllist.h index a34d538..ad73135 100644 --- a/src/coreclr/src/vm/ecalllist.h +++ b/src/coreclr/src/vm/ecalllist.h @@ -623,7 +623,6 @@ FCFuncStart(gAssemblyLoadContextFuncs) QCFuncElement("InternalLoadUnmanagedDllFromPath", AssemblyNative::InternalLoadUnmanagedDllFromPath) QCFuncElement("CanUseAppPathAssemblyLoadContextInCurrentDomain", AssemblyNative::CanUseAppPathAssemblyLoadContextInCurrentDomain) QCFuncElement("LoadFromStream", AssemblyNative::LoadFromStream) - FCFuncElement("nGetFileInformation", AssemblyNameNative::GetFileInformation) QCFuncElement("GetLoadContextForAssembly", AssemblyNative::GetLoadContextForAssembly) #if defined(FEATURE_MULTICOREJIT) QCFuncElement("InternalSetProfileRoot", MultiCoreJITNative::InternalSetProfileRoot)