public static LsaAuthHandle Connect(string name) { NtStatus status; AnsiString nameStr; IntPtr handle; LsaOperationalMode mode; nameStr = new AnsiString(name); try { if ((status = Win32.LsaRegisterLogonProcess( ref nameStr, out handle, out mode )) >= NtStatus.Error) Win32.Throw(status); } finally { nameStr.Dispose(); } return new LsaAuthHandle(handle, true); }
public static LsaAuthHandle Connect(string name) { NtStatus status; AnsiString nameStr; IntPtr handle; LsaOperationalMode mode; nameStr = new AnsiString(name); try { if ((status = Win32.LsaRegisterLogonProcess( ref nameStr, out handle, out mode )) >= NtStatus.Error) { Win32.Throw(status); } } finally { nameStr.Dispose(); } return(new LsaAuthHandle(handle, true)); }
public int LookupAuthenticationPackage(string packageName) { NtStatus status; AnsiString packageNameStr; int authenticationPackage; packageNameStr = new AnsiString(packageName); try { if ((status = Win32.LsaLookupAuthenticationPackage( this, ref packageNameStr, out authenticationPackage )) >= NtStatus.Error) { Win32.Throw(status); } } finally { packageNameStr.Dispose(); } return(authenticationPackage); }
public TokenHandle LogonUser( string originName, SecurityLogonType logonType, IAuthenticationPackage package, TokenSource source, out object profileData, out Luid logonId, out NtStatus subStatus ) { NtStatus status; AnsiString originNameStr; IntPtr profileBuffer; int profileBufferLength; IntPtr token; QuotaLimits quotas; originNameStr = new AnsiString(originName); try { using (var logonData = package.GetAuthData()) { if ((status = Win32.LsaLogonUser( this, ref originNameStr, logonType, this.LookupAuthenticationPackage(package.PackageName), logonData, logonData.Size, IntPtr.Zero, ref source, out profileBuffer, out profileBufferLength, out logonId, out token, out quotas, out subStatus )) >= NtStatus.Error) { Win32.Throw(status); } using (var profileBufferAlloc = new LsaMemoryAlloc(profileBuffer, true)) profileData = package.GetProfileData(new MemoryRegion(profileBuffer, 0, profileBufferLength)); return(new TokenHandle(token, true)); } } finally { originNameStr.Dispose(); } }
public int LookupAuthenticationPackage(string packageName) { int authenticationPackage; AnsiString packageNameStr = new AnsiString(packageName); try { Win32.LsaLookupAuthenticationPackage( this, ref packageNameStr, out authenticationPackage ).ThrowIf(); } finally { packageNameStr.Dispose(); } return(authenticationPackage); }
public static LsaAuthHandle Connect(string name) { IntPtr handle; LsaOperationalMode mode; AnsiString nameStr = new AnsiString(name); try { Win32.LsaRegisterLogonProcess( ref nameStr, out handle, out mode ).ThrowIf(); } finally { nameStr.Dispose(); } return new LsaAuthHandle(handle, true); }
public static LsaAuthHandle Connect(string name) { IntPtr handle; LsaOperationalMode mode; AnsiString nameStr = new AnsiString(name); try { Win32.LsaRegisterLogonProcess( ref nameStr, out handle, out mode ).ThrowIf(); } finally { nameStr.Dispose(); } return(new LsaAuthHandle(handle, true)); }
public TokenHandle LogonUser( string originName, SecurityLogonType logonType, IAuthenticationPackage package, TokenSource source, out object profileData, out Luid logonId, out NtStatus subStatus ) { IntPtr profileBuffer; int profileBufferLength; IntPtr token; QuotaLimits quotas; AnsiString originNameStr = new AnsiString(originName); try { using (MemoryRegion logonData = package.GetAuthData()) { Win32.LsaLogonUser( this, ref originNameStr, logonType, this.LookupAuthenticationPackage(package.PackageName), logonData, logonData.Size, IntPtr.Zero, ref source, out profileBuffer, out profileBufferLength, out logonId, out token, out quotas, out subStatus ).ThrowIf(); using (new LsaMemoryAlloc(profileBuffer, true)) { profileData = package.GetProfileData(new MemoryRegion(profileBuffer, 0, profileBufferLength)); } return new TokenHandle(token, true); } } finally { originNameStr.Dispose(); } }
public int LookupAuthenticationPackage(string packageName) { int authenticationPackage; AnsiString packageNameStr = new AnsiString(packageName); try { Win32.LsaLookupAuthenticationPackage( this, ref packageNameStr, out authenticationPackage ).ThrowIf(); } finally { packageNameStr.Dispose(); } return authenticationPackage; }
public int LookupAuthenticationPackage(string packageName) { NtStatus status; AnsiString packageNameStr; int authenticationPackage; packageNameStr = new AnsiString(packageName); try { if ((status = Win32.LsaLookupAuthenticationPackage( this, ref packageNameStr, out authenticationPackage )) >= NtStatus.Error) Win32.Throw(status); } finally { packageNameStr.Dispose(); } return authenticationPackage; }