From 9f97e4ff83cb01f683c617c76b99e34d0afb3f27 Mon Sep 17 00:00:00 2001 From: tijoytk Date: Fri, 13 May 2016 11:07:28 -0700 Subject: [PATCH] Renaming the API StringToCoTaskMemUTF8 since we need to be consistent with existing one.Also fixing a merge conflict. Commit migrated from https://github.com/dotnet/coreclr/commit/6c0426b7b5b2529eeb39712f7aca7a652254ba55 --- src/coreclr/src/mscorlib/model.xml | 2 +- .../src/mscorlib/src/System/Runtime/InteropServices/Marshal.cs | 6 +++--- .../tests/src/Interop/MarshalAPI/String/StringMarshalingTest.cs | 2 +- 3 files changed, 5 insertions(+), 5 deletions(-) diff --git a/src/coreclr/src/mscorlib/model.xml b/src/coreclr/src/mscorlib/model.xml index 1dc26fc..225249f 100644 --- a/src/coreclr/src/mscorlib/model.xml +++ b/src/coreclr/src/mscorlib/model.xml @@ -5996,7 +5996,7 @@ - + diff --git a/src/coreclr/src/mscorlib/src/System/Runtime/InteropServices/Marshal.cs b/src/coreclr/src/mscorlib/src/System/Runtime/InteropServices/Marshal.cs index 2423d37..3af866a 100644 --- a/src/coreclr/src/mscorlib/src/System/Runtime/InteropServices/Marshal.cs +++ b/src/coreclr/src/mscorlib/src/System/Runtime/InteropServices/Marshal.cs @@ -199,7 +199,7 @@ namespace System.Runtime.InteropServices { if (byteLen < 0) { - throw new ArgumentException("len"); + throw new ArgumentException("byteLen"); } else if (IntPtr.Zero == ptr) { @@ -1093,7 +1093,7 @@ namespace System.Runtime.InteropServices } if (rtModule == null) - throw new ArgumentNullException(Environment.GetResourceString("Argument_MustBeRuntimeModule")); + throw new ArgumentNullException("m",Environment.GetResourceString("Argument_MustBeRuntimeModule")); return GetHINSTANCE(rtModule.GetNativeHandle()); } @@ -1905,7 +1905,7 @@ namespace System.Runtime.InteropServices } [System.Security.SecurityCritical] // auto-generated_required - unsafe public static IntPtr StringToAllocatedMemoryUTF8(String s) + unsafe public static IntPtr StringToCoTaskMemUTF8(String s) { const int MAX_UTF8_CHAR_SIZE = 3; if (s == null) diff --git a/src/coreclr/tests/src/Interop/MarshalAPI/String/StringMarshalingTest.cs b/src/coreclr/tests/src/Interop/MarshalAPI/String/StringMarshalingTest.cs index 4f5fbf2..714dac8 100644 --- a/src/coreclr/tests/src/Interop/MarshalAPI/String/StringMarshalingTest.cs +++ b/src/coreclr/tests/src/Interop/MarshalAPI/String/StringMarshalingTest.cs @@ -179,7 +179,7 @@ public class StringMarshalingTest if (srcString.Contains("\0")) continue; - IntPtr ptrString = Marshal.StringToAllocatedMemoryUTF8(srcString); + IntPtr ptrString = Marshal.StringToCoTaskMemUTF8(srcString); string retString = Marshal.PtrToStringUTF8(ptrString); if (!srcString.Equals(retString)) -- 2.7.4