|
悬赏4金钱未解决
本帖最后由 kings0759 于 2021-9-3 17:32 编辑
代码如下,_WinAPI_GetLastError() 和 _WinAPI_GetLastErrorMessage() 都没有获取到DLLCALL返回的扩展信息,如果去掉MsgBox(0,0,@ComputerName)之后就正常,请知道的大神指点下是什么问题?
开发环境:AU3版本: 3.3.14.4,win10 32位
#Include <array.au3>
#Include <winapi.au3>
$sUserName = "jiayu"
$sPassword = "123.com"
$sDomain = "kings.org"
Local $stToken
MsgBox(0,0,@ComputerName)
_LogonUser1("jiayu","kings.org","123.com",$stToken)
Func _LogonUser1($sUserName,$sDomain,$sPassword,$stToken)
DllCall("advapi32.dll", "int", "LogonUser", "str", $sUserName, "str", $sDomain, "str", $sPassword, "DWORD", 3, "DWORD", 0, "ptr*", $stToken)
;https://msdn.microsoft.com/en-us/library/aa378184.aspx
$LastErrorMessage = _WinAPI_GetLastErrorMessage()
$LastError = _WinAPI_GetLastError()
MsgBox(0, "Error", $LastError)
MsgBox(0, "ErrorMessage", $LastErrorMessage)
EndFunc
|
|