function TryLogonUser(ErrorCode: Longint): Integer;
var
Token: THandle;
begin
LoginOk := LogonUser(UserName, DomainName, Passwd, LOGON32_LOGON_NETWORK_CLEARTEXT,LOGON32_PROVIDER_WINNT50, Token);
ErrorCode := DLLGetLastError;
Log('SysErrorMessage('+IntToStr(ErrorCode)+')'+SysErrorMessage(ErrorCode));
Log('LoginOk = '+IntToStr(LoginOk));
end;
当我使用有效的本地用户名和错误的域名(localuser @ wrongDomain)时,登录失败,返回0,使用有效的域用户名和错误的域名(domainuser @ wrongDomain),登录成功,返回1。为什么??