Export (0) Print
Expand All

IWbemHiPerfProvider::CreateRefresher method

The IWbemHiPerfProvider::CreateRefresher method creates a refresher. The returned refresher will be used in subsequent calls to IWbemHiPerfProvider::CreateRefreshableEnum, IWbemHiPerfProvider::CreateRefreshableObject, and IWbemHiPerfProvider::StopRefreshing.

Note  If a provider does not implement this method, it must return WBEM_E_PROVIDER_NOT_CAPABLE. A provider must implement this method to support refresher operations.


HRESULT CreateRefresher(
  [in]   IWbemServices  *pNamespace,
  [in]   long           lFlags,
  [out]  IWbemRefresher **ppRefresher


pNamespace [in]

An IWbemServices pointer back into Windows Management, which can service any request made by the provider. The provider should call AddRef on this pointer if it is going to call back into Windows Management during its execution.

lFlags [in]

Reserved. This parameter must be 0 (zero).

ppRefresher [out]

Pointer to hold the reference to the provider's implementation of the IWbemRefresher interface.

Return value

This method returns an HRESULT indicating the status of the method call. The following table lists the value contained within an HRESULT.

Return codeDescription

The method was successful.


The provider cannot retrieve specific instances regardless of whether it recognizes the paths.

Return this error code in all cases unless you need a specific return code.


The provider failed internally, even though the operation was valid.


The refresher is busy.



The provider must supply its own implementation of the IWbemRefresher interface. It is valid for WMI to request multiple refreshers, each of which will be used for its own refresh operations.

When you release a refresher, the provider should clean up any refreshable objects or enumerators that were added to the refresher.


The following code example describes how to implement CreateRefresher.

HRESULT CHiPerfProvider::CreateRefresher(
  /* [in] */IWbemServices *pNamespace,
  /* [in] */ long lFlags,
  /* [out] */ IWbemRefresher** ppRefresher
    // Allocate a new refresher
    //For Example:
    // CMyRefresher* pMyRefresher = new CMyRefresher();

    // Return the refresher to the ppRefresher
    // [out] parameter
    /*return pMyRefresher->QueryInterface(
     IID_IWbemRefresher, (void**) ppRefresher );*/

// Free memory resources.
// For Example:
//delete[] pMyRefresher;


Minimum supported client

Windows Vista

Minimum supported server

Windows Server 2003


Wbemprov.h (include Wbemidl.h)





See also

Developing a WMI Provider
Writing an Instance Provider
Making an Instance Provider into a High-Performance Provider
Performance Counter Provider



© 2015 Microsoft