mirror of
https://github.com/TalAloni/SMBLibrary.git
synced 2025-04-30 02:37:49 +02:00
LoginAPI: Added ImpersonateLoggedOnUser method
This commit is contained in:
parent
6cd06fb41f
commit
589b6786ff
1 changed files with 4 additions and 3 deletions
|
@ -29,13 +29,14 @@ namespace SMBLibrary.Win32.Security
|
|||
string lpszPassword,
|
||||
int dwLogonType,
|
||||
int dwLogonProvider,
|
||||
out IntPtr phToken
|
||||
);
|
||||
out IntPtr phToken);
|
||||
|
||||
[DllImport("kernel32.dll", SetLastError = true)]
|
||||
[return: MarshalAs(UnmanagedType.Bool)]
|
||||
private static extern bool CloseHandle(IntPtr hObject);
|
||||
|
||||
[DllImport("advapi32.dll", SetLastError = true)]
|
||||
public static extern bool ImpersonateLoggedOnUser(IntPtr hToken);
|
||||
|
||||
public static bool ValidateUserPassword(string userName, string password, LogonType logonType)
|
||||
{
|
||||
IntPtr token;
|
||||
|
|
Loading…
Add table
Reference in a new issue