Google Groups no longer supports new Usenet posts or subscriptions. Historical content remains viewable.
Dismiss

How to fetch memory slot and usage info from WMI?

231 views
Skip to first unread message

Mark Findlay

unread,
May 15, 2006, 1:24:22 PM5/15/06
to
Our Win32 app has successfully detected memory slots and associated memory
on machines in the past by using SMBios calls. But we recently moved to
using WMI calls so can no longer use the SMBios binaries.

We're using WMI calls but are having problems on newer Dell machines (Dell
GX280 with Windows 2003 sp1
for example).

The machine has 4 memory slots, with 2 containing memory chips, but our
results are showing all slots containing memory.

To fetch the slot configuration we first query: select * from
win32_memorydevices.
Then for each row returned, we fetch the ASSOCIATORS of the row where the
class is Win32_physicalmemory:

CString strQuery = "ASSOCIATORS OF {Win32_MemoryDevice.DeviceID=\"";
strQuery += sMemoryDeviceID;
strQuery += "\"} WHERE ResultClass =
Win32_PhysicalMemory";

There must be a problem in our queries. Is these the proper queries to
execute to determine the number of slots, and then whether or not each slot
has memory in it and how much?

Thanks experts!

Gary Chang[MSFT]

unread,
May 16, 2006, 2:41:43 AM5/16/06
to
Hi Mark,

Thank you posting!

>There must be a problem in our queries.

I am not very clear how about your WMI query string--strQuery finally. But
I test the following query in wbemtest utility, it works well:

ASSOCIATORS OF {Win32_MemoryDevice.DeviceID="Memory Device 0"} WHERE
ResultClass = Win32_PhysicalMemory

Wish it helps!

Best regards,

Gary Chang
Microsoft Online Community Support
==================================================
When responding to posts, please "Reply to Group" via your newsreader so
that others may learn and benefit from your issue.
==================================================
This posting is provided "AS IS" with no warranties, and confers no rights.

Mark Findlay

unread,
May 18, 2006, 2:49:44 PM5/18/06
to
Thanks Gary,

That is the query we are using as well. And it successfully returns the
sockets that have memory in them. However, our client has a Dell GX280 with
Windows 2003 sp1 and it is only reporting 2 slots when in fact the machine
has 4 slots. 2 slots are DDR and 2 slots are DDR2. Is it possible that WMI
is filtering the access/visibility to the 2 slots that are not in use since
you can't have both slot types active at the same time? When we perform
old-style SMBios 16bit DOS interrupts to query memory slots, we get all 4
reported.

Any advise / direction would be appreciated.

Note: below is a note from Dell in their docs on the memory configuration:
Dual-channel DDR2 memory modules should be installed in pairs of matched
memory size, speed, and technology. If the DDR2 memory modules are not
installed in matched pairs, the computer will continue to operate, but with
a slight reduction in performance. See the label in the upper-right corner
of the module to determine the module's capacity.


Thanks
Mark

""Gary Chang[MSFT]"" <v-ga...@online.microsoft.com> wrote in message
news:PyRdYPLe...@TK2MSFTNGXA01.phx.gbl...

James Crosswell

unread,
May 18, 2006, 3:22:31 PM5/18/06
to
Mark Findlay wrote:
> Thanks Gary,
>
> That is the query we are using as well. And it successfully returns the
> sockets that have memory in them. However, our client has a Dell GX280
> with Windows 2003 sp1 and it is only reporting 2 slots when in fact the
> machine has 4 slots. 2 slots are DDR and 2 slots are DDR2. Is it
> possible that WMI is filtering the access/visibility to the 2 slots that
> are not in use since you can't have both slot types active at the same
> time? When we perform old-style SMBios 16bit DOS interrupts to query
> memory slots, we get all 4 reported.
>
> Any advise / direction would be appreciated.
>
> Note: below is a note from Dell in their docs on the memory configuration:
> Dual-channel DDR2 memory modules should be installed in pairs of matched
> memory size, speed, and technology. If the DDR2 memory modules are not
> installed in matched pairs, the computer will continue to operate, but
> with a slight reduction in performance. See the label in the upper-right
> corner of the module to determine the module's capacity.

Might be that WMI is picking up banks and not slots (so the Dell docs
are describing 4 slots split into 2 banks - you need simms in two slots
to make a bank).

Best Regards,

James Crosswell
Microforge.net LLC
http://www.microforge.net

Gary Chang[MSFT]

unread,
May 19, 2006, 2:27:46 AM5/19/06
to
Hi Mark,

I agree with James' opinion. Your code is correct, and the result on the
Dell GX280 machine seems also as expected, WMI service just collect data
from the system's corresponding provider, the Dell GX280 machine may have a
different memory device controller from yours.

Thanks.

Mark Findlay

unread,
May 20, 2006, 11:08:54 PM5/20/06
to

> Might be that WMI is picking up banks and not slots (so the Dell docs
> are describing 4 slots split into 2 banks - you need simms in two slots
> to make a bank).
>
Thanks James,
If that is the case, is there a query that will identify slots?

Thanks,
Mark

James Crosswell

unread,
May 21, 2006, 8:53:11 AM5/21/06
to

How many records is the Win32_MemoryDevice class itself returning on
these machines? 4 by any chance???

Mark Findlay

unread,
May 24, 2006, 3:22:36 AM5/24/06
to
Unfortunately the Win32_MemoryDevice query only returns the 2 slots that
actually contain memory.


"James Crosswell" <ja...@microforge.net> wrote in message
news:%23qg0KWN...@TK2MSFTNGP05.phx.gbl...

Yan-Hong Huang[MSFT]

unread,
May 24, 2006, 6:10:05 AM5/24/06
to
Hello Mark,

After reviewing the problem carefully, I think the issue is very machine
specially. We tested it on our side on some Dell machines and got the right
information. But we have no Dell GX280 here and so can't do the same test
for you.

I am not sure whether that is the expected behavior from that Dell machine.
Could you pleaes contact Dell dev support to check the status? If they
confirm that that is a WMI issue, you may contact our customer support
service by using your MSDN free support incident. If it is confirmed as our
product issue, the service request should be free.

Thanks very much for your understanding.

Sincerely,
Yanhong Huang

0 new messages