IWbemRefresher::Refresh method (wbemcli.h)

The IWbemRefresher::Refresh method updates all refreshable objects, enumerators, and nested refreshers. The WMI Refresher calls this function in response to a client request to Refresh.


HRESULT Refresh(
  [in] long lFlags


[in] lFlags

Bitmask of flags that modify the behavior of this method.

If WBEM_FLAG_REFRESH_AUTO_RECONNECT is specified and if the connection is broken, the refresher attempts to reconnect to the provider automatically. This is the default behavior for this method.

If you do not want the refresher to attempt to reconnect to the provider, specify WBEM_FLAG_REFRESH_NO_AUTO_RECONNECT.

Return value

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


When refreshing enumerators and objects, providers should take as little time as possible. Using the IWbemObjectAccess methods and caching property handles for reuse can dramatically improve performance. When updating enumerators, a provider can either remove and re-instantiate all objects, or simply remove and add the changed instances. It is up to you to choose the best approach. In either case, caching instances can improve performance.

The provider should only access the objects and enumerators in a refresher in response to a call to IWbemRefresher::Refresh. It would, however, be perfectly valid to have a background thread polling for data with which to fill these objects, to prepare for when Refresh is called.


The following code example describes how to implement Refresh.

HRESULT CMyHiPerfProviderRefresher::Refresh(
/* [in] */long lFlags
  // Run through all the objects and update their
  // data.

  // Now run through the enumerators.
  // Empty the enumerator and refill it.

  return WBEM_S_NO_ERROR;


Requirement Value
Minimum supported client Windows Vista
Minimum supported server Windows Server 2008
Target Platform Windows
Header wbemcli.h (include Wbemidl.h)
Library Wbemuuid.lib

See also

Developing a WMI Provider



Making an Instance Provider into a High-Performance Provider

Performance Counter Provider

Writing an Instance Provider