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

◆ SafeUnicodeStringHandle() [4/4]

unsafe Microsoft.Win32.SafeHandles.SafeUnicodeStringHandle.SafeUnicodeStringHandle ( ReadOnlySpan< char > s)
inline

Definition at line 16 of file SafeUnicodeStringHandle.cs.

17 : base(IntPtr.Zero, ownsHandle: true)
18 {
19 checked
20 {
21 if (s != default(ReadOnlySpan<char>))
22 {
23 int num = s.Length + 1;
24 int cb = num * 2;
27 s.CopyTo(destination);
28 destination[s.Length] = '\0';
29 }
30 }
31 }
static IntPtr AllocHGlobal(int cb)
Definition Marshal.cs:625
static readonly IntPtr Zero
Definition IntPtr.cs:18
unsafe void * ToPointer()
Definition IntPtr.cs:210

References System.Runtime.InteropServices.Marshal.AllocHGlobal(), System.destination, System.Runtime.InteropServices.SafeHandle.handle, System.s, and System.IntPtr.ToPointer().