IWbemHiPerfProvider::CreateRefresher method (wbemprov.h)

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


[in] pNamespace

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.

[in] lFlags

Reserved. This parameter must be 0 (zero).

[out] ppRefresher

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 list lists the value contained within an HRESULT.


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 2008
Target Platform Windows
Header wbemprov.h (include Wbemidl.h)
Library Wbemuuid.lib
DLL Wmiprvsd.dll

See also

Developing a WMI Provider


Making an Instance Provider into a High-Performance Provider

Performance Counter Provider

Writing an Instance Provider