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

◆ WindowsIdentity() [5/9]

System.Security.Principal.WindowsIdentity.WindowsIdentity ( WindowsIdentity identity)
inlineprotected

Definition at line 322 of file WindowsIdentity.cs.

323 : base(identity, null, GetAuthType(identity), null, null)
324 {
325 bool success = false;
326 try
327 {
328 if (!identity._safeTokenHandle.IsInvalid && identity._safeTokenHandle != SafeAccessTokenHandle.InvalidHandle && identity._safeTokenHandle.DangerousGetHandle() != IntPtr.Zero)
329 {
330 identity._safeTokenHandle.DangerousAddRef(ref success);
331 if (!identity._safeTokenHandle.IsInvalid && identity._safeTokenHandle.DangerousGetHandle() != IntPtr.Zero)
332 {
333 CreateFromToken(identity._safeTokenHandle.DangerousGetHandle());
334 }
335 _authType = identity._authType;
336 _isAuthenticated = identity._isAuthenticated;
337 }
338 }
339 finally
340 {
341 if (success)
342 {
343 identity._safeTokenHandle.DangerousRelease();
344 }
345 }
346 }
static string GetAuthType(WindowsIdentity identity)

References System.Security.Principal.WindowsIdentity._authType, System.Security.Principal.WindowsIdentity._isAuthenticated, System.Security.Principal.WindowsIdentity._safeTokenHandle, System.Security.Principal.WindowsIdentity.CreateFromToken(), System.Runtime.InteropServices.SafeHandle.DangerousAddRef(), System.Runtime.InteropServices.SafeHandle.DangerousGetHandle(), System.Runtime.InteropServices.SafeHandle.DangerousRelease(), Microsoft.Win32.SafeHandles.SafeAccessTokenHandle.InvalidHandle, Microsoft.Win32.SafeHandles.SafeAccessTokenHandle.IsInvalid, and System.IntPtr.Zero.