internal partial class Kernel32
{
[DllImport(Libraries.Kernel32, CharSet = CharSet.Unicode, EntryPoint = "GetCPInfoExW")]
- private extern static unsafe int GetCPInfoExW(uint CodePage, uint dwFlags, CPINFOEXW* lpCPInfoEx);
+ private extern static unsafe Interop.BOOL GetCPInfoExW(uint CodePage, uint dwFlags, CPINFOEXW* lpCPInfoEx);
[StructLayout(LayoutKind.Sequential, CharSet = CharSet.Unicode)]
private unsafe struct CPINFOEXW
internal fixed byte LeadByte[12];
internal char UnicodeDefaultChar;
internal uint CodePage;
- internal fixed byte CodePageName[260];
+ internal fixed char CodePageName[MAX_PATH];
}
internal static unsafe int GetLeadByteRanges(int codePage, byte[] leadByteRanges)
{
int count = 0;
CPINFOEXW cpInfo;
- if (GetCPInfoExW((uint) codePage, 0, &cpInfo) != 0)
+ if (GetCPInfoExW((uint)codePage, 0, &cpInfo) != BOOL.FALSE)
{
// we don't care about the last 2 bytes as those are nulls
for (int i=0; i<10 && leadByteRanges[i] != 0; i+=2)
// Note: GetACP is not available in the Windows Store Profile, but calling
// GetCPInfoEx with the value CP_ACP (0) yields the same result.
CPINFOEXW cpInfo;
- if (GetCPInfoExW(CP_ACP, 0, &cpInfo) != 0)
+ if (GetCPInfoExW(CP_ACP, 0, &cpInfo) != BOOL.FALSE)
{
codePage = (int)cpInfo.CodePage;
return true;
{
internal partial class Kernel32
{
- internal const int MAX_PATH = 260;
-
internal const int CREDUI_MAX_USERNAME_LENGTH = 513;
}
}
<Compile Include="$(CommonPath)\Interop\Windows\Kernel32\Interop.FILE_INFO_BY_HANDLE_CLASS.cs">
<Link>Common\Interop\Windows\Interop.FILE_INFO_BY_HANDLE_CLASS.cs</Link>
</Compile>
- <Compile Include="$(CommonPath)\Interop\Windows\Kernel32\Interop.MaxLengths.cs">
- <Link>Common\Interop\Windows\Interop.MaxLengths.cs</Link>
+ <Compile Include="$(CommonPath)\CoreLib\Interop\Windows\Kernel32\Interop.MAX_PATH.cs">
+ <Link>Common\CoreLib\Interop\Windows\Interop.MAX_PATH.cs</Link>
</Compile>
<Compile Include="$(CommonPath)\CoreLib\Interop\Windows\Kernel32\Interop.FileAttributes.cs">
<Link>Common\Interop\Windows\Interop.FileAttributes.cs</Link>
<Compile Include="$(CommonPath)\Interop\Windows\Kernel32\Interop.GetCPInfoEx.cs">
<Link>Common\Interop\Windows\Interop.GetCPInfoEx.cs</Link>
</Compile>
+ <Compile Include="$(CommonPath)\CoreLib\Interop\Windows\Kernel32\Interop.MAX_PATH.cs">
+ <Link>Common\CoreLib\Interop\Windows\Interop.MAX_PATH.cs</Link>
+ </Compile>
<Compile Include="$(CommonPath)\Interop\Windows\Interop.Libraries.cs">
<Link>Common\Interop\Windows\Interop.Libraries.cs</Link>
</Compile>
<Compile Include="$(CommonPath)\Interop\Windows\Kernel32\Interop.GetCPInfoEx.cs">
<Link>Common\Interop\Windows\Kernel32\Interop.GetCPInfoEx.cs</Link>
</Compile>
+ <Compile Include="$(CommonPath)\CoreLib\Interop\Windows\Kernel32\Interop.MAX_PATH.cs">
+ <Link>Common\CoreLib\Interop\Windows\Interop.MAX_PATH.cs</Link>
+ </Compile>
<Compile Include="Microsoft\Win32\SafeHandles\SafeProcessHandle.Windows.cs" />
<Compile Include="Microsoft\Win32\SafeHandles\SafeThreadHandle.cs" />
<Compile Include="System\Diagnostics\PerformanceCounterLib.cs" />
<Compile Include="$(CommonPath)\Interop\Windows\Kernel32\Interop.GetDiskFreeSpaceEx.cs">
<Link>Common\Interop\Windows\Interop.GetDiskFreeSpaceEx.cs</Link>
</Compile>
- <Compile Include="$(CommonPath)\Interop\Windows\Kernel32\Interop.MaxLengths.cs">
- <Link>Common\Interop\Windows\Interop.MaxLengths.cs</Link>
+ <Compile Include="$(CommonPath)\CoreLib\Interop\Windows\Kernel32\Interop.MAX_PATH.cs">
+ <Link>Common\CoreLib\Interop\Windows\Interop.MAX_PATH.cs</Link>
</Compile>
<Compile Include="$(CommonPath)\Interop\Windows\Kernel32\Interop.SetVolumeLabel.cs">
<Link>Common\Interop\Windows\Interop.SetVolumeLabel.cs</Link>
</Compile>
<Compile Include="$(CommonPath)\CoreLib\Interop\Windows\Kernel32\Interop.SetThreadErrorMode.cs">
- <Link>Common\CoreLibInterop\Windows\Interop.SetThreadErrorMode.cs</Link>
+ <Link>Common\CoreLib\Interop\Windows\Interop.SetThreadErrorMode.cs</Link>
</Compile>
<Compile Include="$(CommonPath)\CoreLib\Interop\Windows\Kernel32\Interop.SecurityOptions.cs">
<Link>Common\Interop\Windows\Interop.SecurityOptions.cs</Link>
<Compile Include="$(CommonPath)\Interop\Windows\Kernel32\Interop.GenericOperations.cs">
<Link>Common\Interop\Windows\Interop.GenericOperations.cs</Link>
</Compile>
- <Compile Include="$(CommonPath)\Interop\Windows\Kernel32\Interop.MaxLengths.cs">
- <Link>Common\Interop\Windows\Interop.MaxLengths.cs</Link>
+ <Compile Include="$(CommonPath)\CoreLib\Interop\Windows\Kernel32\Interop.MAX_PATH.cs">
+ <Link>Common\CoreLib\Interop\Windows\Interop.MAX_PATH.cs</Link>
</Compile>
<Compile Include="$(CommonPath)\Interop\Windows\Kernel32\Interop.WIN32_FIND_DATA.cs">
<Link>Common\Interop\Windows\Interop.WIN32_FIND_DATA.cs</Link>
<Compile Include="$(CommonPath)\Interop\Windows\Interop.Libraries.cs">
<Link>Common\Interop\Windows\Interop.Libraries.cs</Link>
</Compile>
+ <Compile Include="$(CommonPath)\CoreLib\Interop\Windows\Interop.BOOL.cs">
+ <Link>Common\CoreLib\Interop\Windows\Interop.BOOL.cs</Link>
+ </Compile>
<Compile Include="$(CommonPath)\Interop\Windows\Kernel32\Interop.GetCPInfoEx.cs">
<Link>Common\Interop\Windows\Interop.GetCPInfoEx.cs</Link>
</Compile>
+ <Compile Include="$(CommonPath)\CoreLib\Interop\Windows\Kernel32\Interop.MAX_PATH.cs">
+ <Link>Common\CoreLib\Interop\Windows\Interop.MAX_PATH.cs</Link>
+ </Compile>
<Compile Include="$(CommonPath)\CoreLib\Interop\Windows\Kernel32\Interop.WideCharToMultiByte.cs">
<Link>Common\CoreLib\Interop\Windows\Kernel32\Interop.WideCharToMultiByte.cs</Link>
</Compile>