WMI, Win32_Processor, and Vista/XP-SP3

Markbnj

Elite Member <br>Moderator Emeritus
Moderator
Sep 16, 2005
15,682
13
81
www.markbetz.net
So, I think this qualifies as interesting. A few years back I wrote a widget for Konfabulator, which later became Yahoo Widgets. The widget is a multi-cpu load monitor. The architecture is basically: Widget javascript calls ATL control which uses a WMI refresher class to grab CPU load via the Win32_Processor object. It all worked great, and the widget, called CPUSpy, got some good buzz.

Then came XP-SP3 and Vista, and the widget stopped working. Instead of showing a separate load bar for each CPU it now showed one load bar, regardless. I didn't dig into it for a long while, because I just haven't had the time and don't use Yahoo Widgets anymore. Last night, in response to email pleas from users, I started to debug on Vista. What I found is that now I have just one Win32_Processor instance on my system, whereas before there was one for each physical CPU or core. The object also has two new properties: NumberOfCores, and NumberOfLogicalProcessors.

I haven't been able to find any documentation yet, but I'm guessing they decided there should be one instance of Win32_Processor for each physical CPU, and then one "logical" processor for each core or hyperthreading thingamajig. The problem is there doesn't seem to be a "Win32_LogicalProcessor" object from which to query load numbers for a given core on a multicore die. So I will have to find some other way to get these numbers if I want to make the widget work again. Seems like a pretty significant change to go undocumented too, so I am still hoping to find some official explanation and work around. I didn't see it referenced in the list of fixes for XP SP3.
 

Markbnj

Elite Member <br>Moderator Emeritus
Moderator
Sep 16, 2005
15,682
13
81
www.markbetz.net
Yeah, good find, although it doesn't help much. Guess they are saying what I said in the OP: getting two instances of Win32_Processor for dual core machines in XP prior to SP3 was incorrect behavior. Now the question is: how the heck do you get load numbers for individual cores?
 

Markbnj

Elite Member <br>Moderator Emeritus
Moderator
Sep 16, 2005
15,682
13
81
www.markbetz.net
That looks like it will do the trick, hg403. Thanks a lot for the tip! I remember looking at this class when I first wrote the widget, but for some reason I didn't use it. Will definitely take another look at it.
 
sale-70-410-exam    | Exam-200-125-pdf    | we-sale-70-410-exam    | hot-sale-70-410-exam    | Latest-exam-700-603-Dumps    | Dumps-98-363-exams-date    | Certs-200-125-date    | Dumps-300-075-exams-date    | hot-sale-book-C8010-726-book    | Hot-Sale-200-310-Exam    | Exam-Description-200-310-dumps?    | hot-sale-book-200-125-book    | Latest-Updated-300-209-Exam    | Dumps-210-260-exams-date    | Download-200-125-Exam-PDF    | Exam-Description-300-101-dumps    | Certs-300-101-date    | Hot-Sale-300-075-Exam    | Latest-exam-200-125-Dumps    | Exam-Description-200-125-dumps    | Latest-Updated-300-075-Exam    | hot-sale-book-210-260-book    | Dumps-200-901-exams-date    | Certs-200-901-date    | Latest-exam-1Z0-062-Dumps    | Hot-Sale-1Z0-062-Exam    | Certs-CSSLP-date    | 100%-Pass-70-383-Exams    | Latest-JN0-360-real-exam-questions    | 100%-Pass-4A0-100-Real-Exam-Questions    | Dumps-300-135-exams-date    | Passed-200-105-Tech-Exams    | Latest-Updated-200-310-Exam    | Download-300-070-Exam-PDF    | Hot-Sale-JN0-360-Exam    | 100%-Pass-JN0-360-Exams    | 100%-Pass-JN0-360-Real-Exam-Questions    | Dumps-JN0-360-exams-date    | Exam-Description-1Z0-876-dumps    | Latest-exam-1Z0-876-Dumps    | Dumps-HPE0-Y53-exams-date    | 2017-Latest-HPE0-Y53-Exam    | 100%-Pass-HPE0-Y53-Real-Exam-Questions    | Pass-4A0-100-Exam    | Latest-4A0-100-Questions    | Dumps-98-365-exams-date    | 2017-Latest-98-365-Exam    | 100%-Pass-VCS-254-Exams    | 2017-Latest-VCS-273-Exam    | Dumps-200-355-exams-date    | 2017-Latest-300-320-Exam    | Pass-300-101-Exam    | 100%-Pass-300-115-Exams    |
http://www.portvapes.co.uk/    | http://www.portvapes.co.uk/    |