Re: WMI Performace counters.
Re: WMI Performace counters.
Thanks Arjay but I have no problem with handling IWbemClassObject and related to enumerate, retrieve data and do all that nice stuff you can do with WMI.
My problem is with performance counter classes.
The only way I know of it to do it by refresher (IWbemRefresher) and add perf counters using IWbemConfigureRefresher, getting IWbemHiPerfEnum to get all objects.
This returns an array of IWbemObjectAccess that is used for getting class’ data after calling Refresh.
Now is the brick wall. IWbemObjectAccess has only limited number of methods to get the IWbemClassObject data and they are poorly documented.
For example getting a name of an object returns invalid handle.
I wonder if there is any way to find IWbemClassObject associated with IWbemObjectAccess and use more intuitive way to retrieve data.
Re: WMI Performace counters.
I resolved it. It was so obvious I cannot believe I overlooked it.
IWbemObjectAccess is derived from IWbemClassObject! I can always get IWbemClassObject by calling QueryInterface on IWbemObjectAccess, passing IID_IWbemClassObject.
It works like a charm.
Re: WMI Performace counters.