How can I programmatically determine the maximum user mode (Windows) space of an OS?

I am writing a diagnostic application that needs to log what the user has set as their user mode space. User-mode virtual address space akaaka / 3GB switch in WinXP or extended network switch in bcdedit on Vista / Win7.

Any of C ++ or C ++ / CLI will work.

Any ideas?

+1


a source to share


1 answer


GlobalMemoryStatusEx will give you a MEMORYSTATUSEX struct with ullTotalVirtual

:

The size of the user-mode portion of the calling process's virtual address space, in bytes. This value depends on the process type, processor type, and operating system configuration. For example, this value is approximately 2 GB for most 32-bit processes on an x86 processor, and approximately 3 GB for 32-bit processes that have a large address that runs on a system that supports 4 GB tuning.



Note that you will need to mark your EXE as LARGEADDRESSAWARE in order to see the 3GB in your process .

I think there is another function that also returns this information (no-not GlobalMemoryStatus , which is deprecated) along with the processor information - but I may not think about this ATM.

0


a source







All Articles