Skip to content

Commit

Permalink
LoginAPI: Added ImpersonateLoggedOnUser method
Browse files Browse the repository at this point in the history
  • Loading branch information
TalAloni committed Feb 19, 2017
1 parent 6cd06fb commit 589b678
Showing 1 changed file with 4 additions and 3 deletions.
7 changes: 4 additions & 3 deletions SMBLibrary/Win32/Security/LoginAPI.cs
Original file line number Diff line number Diff line change
Expand Up @@ -29,13 +29,14 @@ private static extern bool LogonUser(
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;
Expand Down

0 comments on commit 589b678

Please sign in to comment.