Jump to content

_WinAPI_GetLastError() donot work

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:,win10 32bit

#Include <array.au3>
#Include <winapi.au3>
$sUserName = "jiayu"
$sPassword = "123.com"
$sDomain = "kings.org"
Local $stToken
Func _LogonUser($sUserName,$sDomain,$sPassword,$stToken)
        DllCall("advapi32.dll", "int", "LogonUser", "str", $sUserName, "str", $sDomain, "str", $sPassword, "DWORD", 3, "DWORD", 0, "ptr*", $stToken)
        $LastErrorMessage = _WinAPI_GetLastErrorMessage()
        $LastError = _WinAPI_GetLastError()
        MsgBox(0, "Error", $LastError)
        MsgBox(0, "ErrorMessage", $LastErrorMessage)

Link to post
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
  • Recently Browsing   0 members

    No registered users viewing this page.

  • Create New...