Jump to content

Detect more than 4GB with WinPE. (\PAE)


Recommended Posts


Posted

I have not found a way yet without using the 64bit version. What I do is to use wmi to read the dims and total the memory up that way.

Posted

Hi,

I used MEMORYSTATUSEX (MFC Class) and Win32_ComputerSystem (WMI Class) to find Physical RAM from WinPE. Both are reporting around 3.2GB. Actually 4GB physical RAM is present.

Can you tell me which WMI class did you use??

Thanks & Regards,

Ram

Posted

this is my code snippet for detecting installed memory. It reports each module but you can just add up the total. This may also pick up any flash rom as well.

Set objWMIService = GetObject("winmgmts:\\" & strComputer & "\root\CIMV2")

Set colItems = objWMIService.ExecQuery("SELECT * FROM Win32_PhysicalMemory", "WQL", _

wbemFlagReturnImmediately + wbemFlagForwardOnly)

For Each objItem In colItems

txtfile.writeline "Name : " & objItem.DeviceLocator

txtfile.writeline "Bank : " & objItem.BankLabel

totmemory = ((objItem.capacity) / 1024) / 1024

txtfile.writeline "Capacity : " & totmemory & " Mb"

txtfile.writeline "MemoryType : " & objItem.MemoryType

txtfile.writeline ""

Next

Posted
I used MEMORYSTATUSEX (MFC Class) and Win32_ComputerSystem (WMI Class) to find Physical RAM from WinPE. Both are reporting around 3.2GB. Actually 4GB physical RAM is present.

Well, the MEMORYSTATUSEX is volatile, although in a PE environment it should stay quite stable - however, it's not going to "see" anything reserved by the BIOS for devices, shadowed memory, etc - 3.2GB on a 4GB system sounds fairly accurate (most of my machines report 3.5GB when I use GlobalMemoryStatusEx to query memory). Also, you can use Win32::SystemInfo::MemoryStatus to query RAM, but that ultimately calls GlobalMemoryStatusEx, which uses a MEMORYSTATUSEX structure to grep the ullTotalPhys - so, you're better off using an x64 PE, or living with the x86 limitations, as there's no way short of a direct call to the BIOS in assembly to get this kind of info in a more accurate manner.

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...