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.
 

Syntax

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

Parameters

[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.

Remarks

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.

Examples

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:
//pNamespace->Release();
//ppRefresher->Release();
//delete[] pMyRefresher;

Requirements

Requirement Value
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

IWbemHiPerfProvider

Making an Instance Provider into a High-Performance Provider

Performance Counter Provider

Writing an Instance Provider