4

I have read an almost exact same question regarding this issue already (WMI hardware, get RAM info), and here I'm hoping for more information on this topic.

I need to get various hardware information such as RAM serial number, hard drive SN, CPU SN, etc. I am using Visual C++ 2010 and using WMI to query for the information, but it's not giving me what I want. For example, I started trying to get RAM SN, and after querying for it (I used Win32_PhysicalMemory then I get the property "SerialNumber"), I get

SerialNumber
SerNum0
SerNum1

which is obviously not it. I also went to the command line for it (wmic memorychip get serialnumber), but I get the same thing. But I know the serial number is there; when I use a 3rd party program CPU-Z, it retrieves the RAM serial numbers flawlessly.

Am I querying the wrong class? Is there anything I'm missing? I have tried the executable I made on multiple other computers, with mixed results of success and failure--but CPU-Z never fails.

I am developing in Visual Studio C++ 2010 on Windows 7 64 bit computer. Thanks.

Community
  • 1
  • 1
Sophia
  • 155
  • 2
  • 13
  • CPU-Z maybe not use WMI, use assembly or others. – Jerry YY Rain May 27 '14 at 09:08
  • I do realize CPU-Z uses some different method to obtain the hardware info. Someone mentioned that using the CPU-Z's libraries will seal the deal, but the problem is I am very newb, and cannot/will not be able to do that by myself without full documentation and lots of example code... – Sophia May 27 '14 at 09:22
  • These kind of properties need to be supplied by a driver for the motherboard. Very hard to come by these days, the cut-throat competition in that market segment doesn't leave any room for goodies. And nobody actually cares about it. – Hans Passant May 27 '14 at 14:57

1 Answers1

3

The WMI get the data using the WMI providers, unfortunately some manufacturers doesn't expose such data to these providers so you are out luck here. If you want a reliable method to obtain some memory info like serial numbers, manufacturer and so on, you can use the Serial presence detect (SPD) like CPU-Z does. You can get all the documentation related to SPD from the jedec site.

RRUZ
  • 134,889
  • 20
  • 356
  • 483
  • How hard will it be to use SPD? I'm just curious and asking for some reference. As for my own problem, I have instead decided to only grab RAM/HD Capacity and CPU name (3 attributes of which are most likely to actually be THERE in WMI) – Sophia May 28 '14 at 04:50
  • 1
    Access this kind of info require some low level programming skills, so the difficulty depends of your programming background, there are some sdk's to read the SDP info easily or you can access such info through the i2c bus. – RRUZ May 28 '14 at 05:09