A question about WMI behavior
Might ask them over here. http://social.msdn.microsoft.com/Forums/en-US/category/windowsdesktopdev Regards, Dave Patrick .... Microsoft Certified Professional Microsoft MVP [Windows] Disclaimer: This posting is provided "AS IS" with no warranties or guarantees , and confers no rights.
November 5th, 2012 10:13pm

Hello, not sure if this is the correct forum to ask the question. If not, please recommend the correct forum to me (the forums are hard like windows to be understood~) I've a C++ program that tries to select instance names of win32_perfrawdata_netframework_netclrmemory, on one Win Server 2008 R2, there's a weird thing: from command line, wmic & wbemtest can return lots of instances (about 15 instances), but my program would just return 1 instance (the one with _Global_ as name). By adding some log into the program, I found the enumeration finished successfully after windows return the first instance (i.e. the _Global_ instance): 11-05 18:44:45 [9852] [TRACE] ScopedInterface: IEnumWbemClassObject=02513D44. 11-05 18:44:46 [9852] [TRACE] ScopedInterface: IWbemClassObject=00000000. ret=1 (0x000001), uReturn=1 (0x000001) Here, I request 2 instances in the IEnumWbemClassObject::Next function, and it return 1 (uReturn) with return value 1 (ret=1). ret=1 means WBEM_S_FALSE, according to MSDN: "Note The Next method returns WBEM_S_FALSE when you have reached the end of the enumeration, even if objects have been returned successfully." So why could this happen? There are obviously many instances, why the API would return the first instance and says "you have reached the end of the enumeration"? Thanks in advance for your help~
Free Windows Admin Tool Kit Click here and download it now
November 5th, 2012 10:23pm

Might ask them over here. http://social.msdn.microsoft.com/Forums/en-US/category/windowsdesktopdev Regards, Dave Patrick .... Microsoft Certified Professional Microsoft MVP [Windows] Disclaimer: This posting is provided "AS IS" with no warranties or guarantees , and confers no rights.
November 5th, 2012 10:29pm

Thank you, I've moved my question there
Free Windows Admin Tool Kit Click here and download it now
November 5th, 2012 10:36pm

You're welcome. Regards, Dave Patrick .... Microsoft Certified Professional Microsoft MVP [Windows] Disclaimer: This posting is provided "AS IS" with no warranties or guarantees , and confers no rights.
November 5th, 2012 10:40pm

This topic is archived. No further replies will be accepted.

Other recent topics Other recent topics