Fix duplicate fcall entries for GetAssemblyName (dotnet/coreclr#10546)
authorRahul Kumar <rahku@microsoft.com>
Wed, 29 Mar 2017 17:26:35 +0000 (10:26 -0700)
committerJan Kotas <jkotas@microsoft.com>
Wed, 29 Mar 2017 17:26:35 +0000 (10:26 -0700)
Commit migrated from https://github.com/dotnet/coreclr/commit/ec9de1aa41d80ec3be8d5a7adb1eea791abacc9a

src/coreclr/src/mscorlib/src/System/Runtime/Loader/AssemblyLoadContext.cs
src/coreclr/src/vm/ecalllist.h

index 0da4773..de8137f 100644 (file)
@@ -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);
index a34d538..ad73135 100644 (file)
@@ -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)