nasiroudin
nasiroudin

Reputation: 337

Retrieve number of memory slots using C

How to retrieve number of memory slots my computer have using C-language not through WMI? When i tried retrieving number of memory slots using WMI though command prompt,

C:>wmic
wmic:root\cli> path Win32_PhysicalMemoryArray get MemoryDevices

(http://msdn.microsoft.com/en-us/library/aa394348%28v=vs.85%29.aspx)

But it does not give me correct number of memory slots. I have only 2 memory slots but it give me 4.

and what is the difference between memory array, Memory slots and memory sockets? Because in the msdn(Link provided above) it state that MemoryDevices is the "Number of physical slots or sockets available in this memory array".

Upvotes: 0

Views: 1771

Answers (1)

rkosegi
rkosegi

Reputation: 14658

Using WMI:

wmic:root\cli>memorychip get *
BankLabel  Capacity    Caption          CreationClassName     DataWidth  Description      DeviceLocator   FormFactor  HotSwappable  InstallDate  InterleaveDataDepth  InterleavePosition  Manufacturer  MemoryType  Model  Name             OtherIdentifyingInfo  PartNumber        PositionInRow  PoweredOn  Removable  Replaceable  SerialNumber  SKU  Speed  Status  Tag                TotalWidth  TypeDetail  Version
BANK 0     4294967296  Physical Memory  Win32_PhysicalMemory  64         Physical Memory  ChannelA-DIMM0  12                                     0                    0                   Samsung       0                  Physical Memory                        M47132156CH0-CH9  1                                                 CAC74CFC           1333           Physical Memory 0  64          128

wmic:root\cli>

Follow this link to use it in your C/C++ application with native win32 API calls.

Also this link helps you.

Upvotes: 1

Related Questions