'==============================================================================
' Test #4: System Information - PID, uptime, constants
'==============================================================================
#COMPILE EXE
#DIM ALL

DECLARE FUNCTION GetTickCount LIB "kernel32.dll" ALIAS "GetTickCount" () AS LONG
DECLARE FUNCTION GetCurrentProcessId LIB "kernel32.dll" ALIAS "GetCurrentProcessId" () AS LONG
DECLARE SUB Sleep LIB "kernel32.dll" ALIAS "Sleep" (BYVAL dwMilliseconds AS LONG)

%GENERIC_READ = &H80000000
%GENERIC_WRITE = &H40000000
%OPEN_EXISTING = 3
%FILE_ATTRIBUTE_NORMAL = 128

FUNCTION PBMAIN() AS LONG
    CALL Sleep(1)

    PRINT "Uptime ms:", GetTickCount()
    PRINT "PID:", GetCurrentProcessId()
    PRINT "GENERIC_READ:", %GENERIC_READ
    PRINT "GENERIC_WRITE:", %GENERIC_WRITE

    FUNCTION = 0
END FUNCTION
