How to determine if /3GB is active.

F

Fritz

I want to programmatically determine if the /3GB is active in the
boot.ini (and warn my users if not when my app starts). My best plan
so far is to search for /3GB in the boot.ini file. Obviously this has
flaws. They may not have rebooted or have choosen an alternate
configuration.

Ideally I an looking for some .NET or W32 API call that indicates the
switch is in effect. Thanks in advance for any suggestions.

- Fritz
 
J

Jeroen Mostert

Fritz said:
I want to programmatically determine if the /3GB is active in the
boot.ini (and warn my users if not when my app starts). My best plan
so far is to search for /3GB in the boot.ini file. Obviously this has
flaws. They may not have rebooted or have choosen an alternate
configuration.

Ideally I an looking for some .NET or W32 API call that indicates the
switch is in effect. Thanks in advance for any suggestions.
Use WMI to access Win32_OperatingSystem.MaxProcessMemorySize.

Alternatively, P/Invoke to GlobalMemoryStatusEx() and check the
ulTotalVirtual member of the MEMORYSTATUSEX structure.
 
B

Ben Voigt [C++ MVP]

Jeroen said:
Use WMI to access Win32_OperatingSystem.MaxProcessMemorySize.

Alternatively, P/Invoke to GlobalMemoryStatusEx() and check the
ulTotalVirtual member of the MEMORYSTATUSEX structure.

Also note that WOW64 gives the full 4GB of virtual memory address space to
the user process, no need to reserve any for the kernel because it is aware
of 64-bit addresses.
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top