如何使用WMI/C ++获取内存信息(RAM类型,例如DDR,DDR2,DDR3?) [英] How to get memory information (RAM type, e.g. DDR,DDR2,DDR3?) with WMI/C++

查看:75
本文介绍了如何使用WMI/C ++获取内存信息(RAM类型,例如DDR,DDR2,DDR3?)的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我的Windows XP SP 2机器上有DDR2 RAM,但是在WMI Explorer(win32_physicalMemory)上,我得到的Memory Type = 0(未知),而不是21(DDR2的代码).NameSpace是CIMV2.您能告诉我如何从WMI获取DDR2内存类型吗?

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?

推荐答案

获取此类信息的最可靠方法之一是阅读 SMBIOS 表,必须查找

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

为了从C ++应用程序访问SMBIOS,可以使用 MSSmBios_RawSMBiosTables WMI类或 GetSystemFirmwareTable 函数.

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

请另外查看这些文章,以了解如何解析SMBIOS表的信息.

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

  • SMBIOS Demystified (C++)
  • Reading the SMBios Tables using Delphi (Delphi)

这篇关于如何使用WMI/C ++获取内存信息(RAM类型,例如DDR,DDR2,DDR3?)的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆