in LinuxCommunicator/CredentialNativeMethods.cs [84:133]
internal static extern bool LogonUser(
[MarshalAs(UnmanagedType.LPTStr)]
string lpszUsername,
[MarshalAs(UnmanagedType.LPTStr)]
string lpszDomain,
[MarshalAs(UnmanagedType.LPTStr)]
string lpszPassword,
int dwLogonType,
int dwLogonProvider,
out SafeToken phToken
);
[DllImport("Advapi32.dll", CharSet = System.Runtime.InteropServices.CharSet.Auto, SetLastError = true, BestFitMapping = false)]
[return: MarshalAs(UnmanagedType.Bool)]
internal static extern bool LogonUser(
[MarshalAs(UnmanagedType.LPTStr)]
string lpszUsername,
[MarshalAs(UnmanagedType.LPTStr)]
string lpszDomain,
IntPtr lpszPassword,
int dwLogonType,
int dwLogonProvider,
out SafeToken phToken
);
[DllImport("kernel32.dll", SetLastError = true)]
[return: MarshalAs(UnmanagedType.Bool)]
internal static extern bool CloseHandle(IntPtr hObject);
[Flags]
public enum CREDUI_FLAGS
{
INCORRECT_PASSWORD = 0x1,
DO_NOT_PERSIST = 0x2,
REQUEST_ADMINISTRATOR = 0x4,
EXCLUDE_CERTIFICATES = 0x8,
REQUIRE_CERTIFICATE = 0x10,
SHOW_SAVE_CHECK_BOX = 0x40,
ALWAYS_SHOW_UI = 0x80,
REQUIRE_SMARTCARD = 0x100,
PASSWORD_ONLY_OK = 0x200,
VALIDATE_USERNAME = 0x400,
COMPLETE_USERNAME = 0x800,
PERSIST = 0x1000,
SERVER_CREDENTIAL = 0x4000,
EXPECT_CONFIRMATION = 0x20000,
GENERIC_CREDENTIALS = 0x40000,
USERNAME_TARGET_CREDENTIALS = 0x80000,
KEEP_USERNAME = 0x100000,
}