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

◆ ConvertToManaged()

static unsafe string System.StubHelpers.BSTRMarshaler.ConvertToManaged ( IntPtr bstr)
inlinestaticpackage

Definition at line 38 of file BSTRMarshaler.cs.

39 {
40 if (IntPtr.Zero == bstr)
41 {
42 return null;
43 }
44 uint num = Marshal.SysStringByteLen(bstr);
45 StubHelpers.CheckStringLength(num);
46 string text = ((num != 1) ? new string((char*)(void*)bstr, 0, (int)(num / 2)) : string.FastAllocateString(0));
47 if ((num & 1) == 1)
48 {
49 text.SetTrailByte(((byte*)(void*)bstr)[num - 1]);
50 }
51 return text;
52 }
static unsafe uint SysStringByteLen(IntPtr s)
Definition Marshal.cs:1551

References System.StubHelpers.StubHelpers.CheckStringLength(), System.Runtime.InteropServices.Marshal.SysStringByteLen(), System.text, and System.IntPtr.Zero.