summaryrefslogtreecommitdiff
path: root/src/mscorlib/src/Interop/Windows/Normaliz/Interop.Idna.cs
diff options
context:
space:
mode:
Diffstat (limited to 'src/mscorlib/src/Interop/Windows/Normaliz/Interop.Idna.cs')
-rw-r--r--src/mscorlib/src/Interop/Windows/Normaliz/Interop.Idna.cs38
1 files changed, 38 insertions, 0 deletions
diff --git a/src/mscorlib/src/Interop/Windows/Normaliz/Interop.Idna.cs b/src/mscorlib/src/Interop/Windows/Normaliz/Interop.Idna.cs
new file mode 100644
index 0000000000..cad457d915
--- /dev/null
+++ b/src/mscorlib/src/Interop/Windows/Normaliz/Interop.Idna.cs
@@ -0,0 +1,38 @@
+// Licensed to the .NET Foundation under one or more agreements.
+// The .NET Foundation licenses this file to you under the MIT license.
+// See the LICENSE file in the project root for more information.
+
+using System;
+using System.Runtime.InteropServices;
+
+internal partial class Interop
+{
+ internal partial class Normaliz
+ {
+ //
+ // Idn APIs
+ //
+
+ [DllImport("Normaliz.dll", CharSet = CharSet.Unicode, SetLastError = true)]
+ internal static extern int IdnToAscii(
+ uint dwFlags,
+ IntPtr lpUnicodeCharStr,
+ int cchUnicodeChar,
+ [System.Runtime.InteropServices.OutAttribute()]
+ IntPtr lpASCIICharStr,
+ int cchASCIIChar);
+
+ [DllImport("Normaliz.dll", CharSet = CharSet.Unicode, SetLastError = true)]
+ internal static extern int IdnToUnicode(
+ uint dwFlags,
+ IntPtr lpASCIICharStr,
+ int cchASCIIChar,
+ [System.Runtime.InteropServices.OutAttribute()]
+ IntPtr lpUnicodeCharStr,
+ int cchUnicodeChar);
+
+ internal const int IDN_ALLOW_UNASSIGNED = 0x1;
+ internal const int IDN_USE_STD3_ASCII_RULES = 0x2;
+ internal const int ERROR_INVALID_NAME = 123;
+ }
+}