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

◆ DoAnsiConversion()

static unsafe byte[] System.StubHelpers.AnsiCharMarshaler.DoAnsiConversion ( string str,
bool fBestFit,
bool fThrowOnUnmappableChar,
out int cbLength )
inlinestaticpackage

Definition at line 8 of file AnsiCharMarshaler.cs.

9 {
10 byte[] array = new byte[checked((str.Length + 1) * Marshal.SystemMaxDBCSCharSize)];
11 fixed (byte* buffer = &array[0])
12 {
13 cbLength = Marshal.StringToAnsiString(str, buffer, array.Length, fBestFit, fThrowOnUnmappableChar);
14 }
15 return array;
16 }
static unsafe int StringToAnsiString(string s, byte *buffer, int bufferLength, bool bestFit=false, bool throwOnUnmappableChar=false)
Definition Marshal.cs:1608
static readonly int SystemMaxDBCSCharSize
Definition Marshal.cs:19

References System.array, System.buffer, System.str, System.Runtime.InteropServices.Marshal.StringToAnsiString(), and System.Runtime.InteropServices.Marshal.SystemMaxDBCSCharSize.

Referenced by System.StubHelpers.AnsiBSTRMarshaler.ConvertToNative(), System.StubHelpers.CSTRMarshaler.ConvertToNative(), and System.StubHelpers.VBByValStrMarshaler.ConvertToNative().