Welcome to mirror list, hosted at ThFree Co, Russian Federation.

github.com/mono/corert.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorFaizur Rahman <shrah@microsoft.com>2017-04-25 21:43:58 +0300
committerFaizur Rahman <shrah@microsoft.com>2017-04-25 21:43:58 +0300
commit15e3e38fd80919aa759d31588ec0d40e409005ad (patch)
tree7cfd71538247f14fbef43a690a844190a2968be4 /src/System.Private.CoreLib/shared
parent4d4daf9d92d518af7638a022e493423f5aaf2031 (diff)
Move ANSI string marshalling helper functions to CoreLib
The ANSI helper methods are moved from McgMarshal in S.P.Interop to PInvokeMarshal in S.P.CoreLib so that they can be reused from CoreRT. I have also moved MarshalDirectiveException to CoreRT. [tfs-changeset: 1655965]
Diffstat (limited to 'src/System.Private.CoreLib/shared')
-rw-r--r--src/System.Private.CoreLib/shared/Interop/Windows/Kernel32/Interop.GetCPInfo.cs24
-rw-r--r--src/System.Private.CoreLib/shared/System.Private.CoreLib.Shared.projitems1
2 files changed, 25 insertions, 0 deletions
diff --git a/src/System.Private.CoreLib/shared/Interop/Windows/Kernel32/Interop.GetCPInfo.cs b/src/System.Private.CoreLib/shared/Interop/Windows/Kernel32/Interop.GetCPInfo.cs
new file mode 100644
index 000000000..166511942
--- /dev/null
+++ b/src/System.Private.CoreLib/shared/Interop/Windows/Kernel32/Interop.GetCPInfo.cs
@@ -0,0 +1,24 @@
+// 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.IO;
+using System.Text;
+using System.Runtime.InteropServices;
+
+internal partial class Interop
+{
+ internal partial class Kernel32
+ {
+ internal unsafe struct CPINFO
+ {
+ internal int MaxCharSize;
+
+ internal fixed byte DefaultChar[2 /* MAX_DEFAULTCHAR */];
+ internal fixed byte LeadByte[12 /* MAX_LEADBYTES */];
+ }
+
+ [DllImport(Libraries.Kernel32)]
+ internal static extern unsafe int GetCPInfo(uint codePage, CPINFO* lpCpInfo);
+ }
+}
diff --git a/src/System.Private.CoreLib/shared/System.Private.CoreLib.Shared.projitems b/src/System.Private.CoreLib/shared/System.Private.CoreLib.Shared.projitems
index 6d4c2a025..154a61f14 100644
--- a/src/System.Private.CoreLib/shared/System.Private.CoreLib.Shared.projitems
+++ b/src/System.Private.CoreLib/shared/System.Private.CoreLib.Shared.projitems
@@ -459,6 +459,7 @@
<Compile Include="$(MSBuildThisFileDirectory)Interop\Windows\Kernel32\Interop.FileTypes.cs"/>
<Compile Include="$(MSBuildThisFileDirectory)Interop\Windows\Kernel32\Interop.FlushFileBuffers.cs"/>
<Compile Include="$(MSBuildThisFileDirectory)Interop\Windows\Kernel32\Interop.FormatMessage.cs"/>
+ <Compile Include="$(MSBuildThisFileDirectory)Interop\Windows\Kernel32\Interop.GetCPInfo.cs" />
<Compile Include="$(MSBuildThisFileDirectory)Interop\Windows\Kernel32\Interop.GetFileInformationByHandleEx.cs" />
<Compile Include="$(MSBuildThisFileDirectory)Interop\Windows\Kernel32\Interop.GetFileType_SafeHandle.cs"/>
<Compile Include="$(MSBuildThisFileDirectory)Interop\Windows\Kernel32\Interop.GetFullPathNameW.cs"/>