Jump to content

_WinAPI_GetLastError() donot work


AKing
 Share

Go to solution Solved by AKing,

Recommended Posts

The code is as follows_ WinAPI_ Getlasterror() and   _ WinAPI_ Getlasterrormessage() did not get the extension information returned by dllcall. If msgbox (0,0, @ computername) is removed, it will be normal. Anyone know about it?

My AU3 version:  3.3.14.4,win10 32bit

#Include <array.au3>
#Include <winapi.au3>
$sUserName = "jiayu"
$sPassword = "123.com"
$sDomain = "kings.org"
Local $stToken
MsgBox(0,0,@ComputerName)
_LogonUser("jiayu","kings.org","123.com",$stToken)
Func _LogonUser($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

Link to comment
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
 Share

  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...