Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How to get memory information (RAM type, e.g. DDR,DDR2,DDR3?) with WMI/C++

Tags:

c++

wmi

I have DDR2 RAM on my windows XP SP 2 Machine, but on WMI explorer (win32_physicalMemory) I am getting Memory Type = 0(Unknown) instead of 21(the code for DDR2). NameSpace is CIMV2. Can you please tell me how to get DDR2 Memory Type From WMI?

like image 554
user1959883 Avatar asked Jan 09 '13 01:01

user1959883


People also ask

How do I find my RAM memory type?

To determine memory type (such as DRAM, DDR4, RDRAM, etc.), use these steps: Open Start. Search for Command Prompt, right-click the top result, and select the Run as administrator option. Type the following command to check the memory type and press Enter: wmic memorychip get devicelocator, memorytype.

How do I know if my RAM is DDR DDR2 ddr3?

Voltage of Ram, if you notice this things then its very simple to identify because each DDR Ram has unique volt. ddr1 has 2.5 voltage, ddr2 has 1.8 voltage, ddr3 has 1.5 voltage and ddr4 has 1.2 voltage.

How can a DDR2 and ddr3 DIMM be identified?

DDR2 DIMM: Has a notch slightly closer to the middle and has more pins (240) than DDR memory. DDR3 DIMM: Has a single notch that is more off-centre than the notch for DDR or DDR-2.


1 Answers

One of the most reliable ways to get such info is reading the SMBIOS Tables, you must look for the Memory Device (Type 17) Structure (this structure describes a single memory device installed on the system), and the Memory Type Field.

These are the possible values of this field.

01h Other
02h Unknown
03h DRAM
04h EDRAM
05h VRAM
06h SRAM
07h RAM
08h ROM
09h FLASH
0Ah EEPROM
0Bh FEPROM   
0Ch EPROM
0Dh CDRAM
0Eh 3DRAM
0Fh SDRAM
10h SGRAM
11h RDRAM
12h DDR
13h DDR2
14h DDR2 FB-DIMM
15h-17h Reserved
18h DDR3
19h FBD2
1Ah DDR4
1Bh LPDDR
1Ch LPDDR2
1Dh LPDDR3
1Eh LPDDR4

In order to access the SMBIOS from a C++ application you can use the MSSmBios_RawSMBiosTables WMI Class or the EnumSystemFirmwareTables and GetSystemFirmwareTable functions.

Additionally check these articles to see how parse the infor of the SMBIOS tables.

  • SMBIOS Demystified (C++)
  • Reading the SMBios Tables using Delphi (Delphi)
like image 172
RRUZ Avatar answered Oct 04 '22 22:10

RRUZ