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

匿名 (未验证) 提交于 2019-12-03 01:48:02

问题:

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?

回答1:

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

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.



标签
易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!