
Code: Select all
EnableExplicit
;GlobalMemoryStatusEx at http://msdn.microsoft.com/en-us/library/aa366589%28VS.85%29.aspx
;GetSystemInfo at http://msdn.microsoft.com/en-us/library/ms724381.aspx
Import "kernel32.lib"
GlobalMemoryStatusEx.l(*lpBuffer)
EndImport
Define meminfo.MEMORYSTATUSEX,si.SYSTEM_INFO,maxvmemsize.q,*minaddress,*maxaddress
meminfo\dwLength=SizeOf(MEMORYSTATUSEX)
If GlobalMemoryStatusEx(meminfo)
maxvmemsize=meminfo\ullTotalVirtual
GetSystemInfo_(si)
*minaddress=si\lpMinimumApplicationAddress
*maxaddress=si\lpMaximumApplicationAddress
Debug "Memory range of this process:"
Debug Str(maxvmemsize)+" Bytes range."
Debug "$"+Hex(*minaddress)+" start address.."
Debug "$"+Hex(*maxaddress)+" end address."
EndIf
If the exe was compiled as Large Address Aware it would probably be closer to 3GB range since I'm running a x64 windows OS.
And if I compile as a x64 program I get:
Memory range of this process:
8796092891136 Bytes range.
$10000 start address..
$7FFFFFEFFFF end address.
Which is close to 8TB minus a little.