System.Security.Principal.WindowsIdentity.WindowsIdentity.WindowsIdentity.SetToken C# (CSharp) Method

SetToken() private method

private SetToken ( IntPtr token ) : void
token IntPtr
return void
		private void SetToken (IntPtr token) 
		{
			if (IsPosix) {

				_token = token;
				// apply defaults
				if (_type == null)
					_type = "POSIX";
				// override user choice in this specific case
				if (_token == IntPtr.Zero)
					_account = WindowsAccountType.System;
			}
			else {
				if ((token == invalidWindows) && (_account != WindowsAccountType.Anonymous))
					throw new ArgumentException ("Invalid token");

				_token = token;
				// apply defaults
				if (_type == null)
					_type = "NTLM";
			}
		}