Fix DllImport of IdnToAscii & IdnToUnicode (dotnet/coreclr#8666)
authorJohn Chen <jochen@microsoft.com>
Mon, 19 Dec 2016 19:17:25 +0000 (11:17 -0800)
committerTarek Mahmoud Sayed <tarekms@microsoft.com>
Mon, 19 Dec 2016 19:17:25 +0000 (11:17 -0800)
Fix an issue found in OneCoreUAP testing. According to MSDN,
the official exporting DLL for IdnToAccii and IdnToUnicode
is normaliz.dll, not kernel32.dll. While most Windows SKUs
export these functions from both normaliz.dll and kernel32.dll,
recent tests revealed that some Windows SKUs export them from
normaliz.dll only.

Commit migrated from https://github.com/dotnet/coreclr/commit/dec5a1ff4088780bf0b8226002a5a51d7d6c4d3a

src/coreclr/src/mscorlib/src/System/Globalization/IdnMapping.cs

index b161851..bf75f5b 100644 (file)
@@ -1158,7 +1158,7 @@ namespace System.Globalization
 
 
         [SuppressUnmanagedCodeSecurityAttribute()]
-        [DllImport("kernel32.dll", CharSet=CharSet.Unicode, SetLastError=true)]
+        [DllImport("normaliz.dll", CharSet=CharSet.Unicode, SetLastError=true)]
         private static extern int IdnToAscii(
                                         uint    dwFlags, 
                                         [InAttribute()]
@@ -1171,7 +1171,7 @@ namespace System.Globalization
                                         int     cchASCIIChar);
 
         [SuppressUnmanagedCodeSecurityAttribute()]
-        [DllImport("kernel32.dll", CharSet=CharSet.Unicode, SetLastError=true)]
+        [DllImport("normaliz.dll", CharSet=CharSet.Unicode, SetLastError=true)]
         private static extern int IdnToUnicode(
                                         uint    dwFlags, 
                                         [InAttribute()]