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

◆ MarshalToString()

string System.Net.NetworkCredential.MarshalToString ( SecureString sstr)
inlineprivateinherited

Definition at line 126 of file NetworkCredential.cs.

127 {
128 if (sstr == null || sstr.Length == 0)
129 {
130 return string.Empty;
131 }
132 IntPtr intPtr = IntPtr.Zero;
133 string empty = string.Empty;
134 try
135 {
137 return Marshal.PtrToStringUni(intPtr);
138 }
139 finally
140 {
141 if (intPtr != IntPtr.Zero)
142 {
144 }
145 }
146 }
static unsafe void ZeroFreeGlobalAllocUnicode(IntPtr s)
Definition Marshal.cs:1522
static IntPtr SecureStringToGlobalAllocUnicode(SecureString s)
Definition Marshal.cs:1284
static unsafe? string PtrToStringUni(IntPtr ptr)
Definition Marshal.cs:652

References System.Security.SecureString.Length, System.Runtime.InteropServices.Marshal.PtrToStringUni(), System.Runtime.InteropServices.Marshal.SecureStringToGlobalAllocUnicode(), System.IntPtr.Zero, and System.Runtime.InteropServices.Marshal.ZeroFreeGlobalAllocUnicode().