diff --git a/SMBLibrary/Win32/Security/LoginAPI.cs b/SMBLibrary/Win32/Security/LoginAPI.cs index 096e87b..ad340ce 100644 --- a/SMBLibrary/Win32/Security/LoginAPI.cs +++ b/SMBLibrary/Win32/Security/LoginAPI.cs @@ -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;