Terraria v1.4.4.9
Terraria source code documentation
Loading...
Searching...
No Matches

◆ GetAnsiStringByteCount()

static unsafe int System.Runtime.InteropServices.Marshal.GetAnsiStringByteCount ( ReadOnlySpan< char > chars)
inlinestaticpackage

Definition at line 1625 of file Marshal.cs.

1626 {
1627 int num;
1628 if (chars.Length == 0)
1629 {
1630 num = 0;
1631 }
1632 else
1633 {
1634 fixed (char* lpWideCharStr = chars)
1635 {
1636 num = Interop.Kernel32.WideCharToMultiByte(0u, 1024u, lpWideCharStr, chars.Length, null, 0, IntPtr.Zero, IntPtr.Zero);
1637 if (num <= 0)
1638 {
1639 throw new ArgumentException();
1640 }
1641 }
1642 }
1643 return checked(num + 1);
1644 }
static unsafe int WideCharToMultiByte(uint CodePage, uint dwFlags, char *lpWideCharStr, int cchWideChar, byte *lpMultiByteStr, int cbMultiByte, IntPtr lpDefaultChar, IntPtr lpUsedDefaultChar)

References System.chars, Interop.Kernel32.WideCharToMultiByte(), and System.IntPtr.Zero.

Referenced by System.Security.SecureString.MarshalToString().