Hi,
I wanted to use _GetLogonTime() by guinness (https://www.autoitscript.com/forum/topic/19370-autoit-wrappers/?do=findComment&comment=942069).
#include <Date.au3>
#include <Array.au3>
ConsoleWrite(_GetLogonTime() & @LF)
Func _GetLogonTime($sUserName = @UserName, $sComputerName = @ComputerName) ; Idea by trancexx: http://www.autoitscript.com/forum/topic/113611-if-isadmin-not-detected-as-admin/
Local $aRet = DllCall("netapi32.dll", "long", "NetUserGetInfo", "wstr", $sComputerName, "wstr", $sUserName, "dword", 11, "ptr*", 0)
_ArrayDisplay($aRet)
If @error Or $aRet[0] Then Return SetError(1, 0, False)
Local $sHours = DllStructGetData(DllStructCreate("ptr;ptr;ptr;ptr;dword;dword;dword;ptr;ptr;dword;dword;dword;dword;ptr;dword;ptr;dword;dword;byte;dword", $aRet[4]), 18)
DllCall("netapi32.dll", "long", "NetApiBufferFree", "ptr", $aRet[4])
Return _DateAdd("h", "-" & $sHours, _NowCalc())
EndFunc ;==>_GetLogonTime
It always returns false.
I displayed $aRet:
[0]|2221
[1]|mycomputer
[2]|myuser
[3]|11
[4]|0x0000000000000000
$aRet[4] shouldn't be 0x0000000000000000 right? Any help?
Regards, Conrad