IWbemConfigureRefresher::AddEnum method

The IWbemConfigureRefresher::AddEnum method adds an enumerator to the requested refresher.


  [in]  IWbemServices   *pNamespace,
  [in]  LPCWSTR         wszClassName,
  [in]  long            lFlags,
  [in]  IWbemContext    *pCtx,
  [out] IWbemHiPerfEnum **ppEnum,
  [out] long            *plId


pNamespace [in]

An IWbemServices pointer back into Windows Management, which can service any request made by the provider. If the method must call back into Windows Management during its execution, the provider should call AddRef with the pNamespace pointer.

wszClassName [in]

Constant, null-terminated string of 16-bit Unicode characters containing the name of the class that is enumerated.

lFlags [in]

Bitmask of flags that modify the behavior of this method. If this parameter is set to WBEM_FLAG_USE_AMENDED_QUALIFIERS, the returned instances contain localized qualifiers if they are available.

pCtx [in]

Typically NULL; otherwise, this is a pointer to an IWbemContext object that is required by one or more dynamic class providers. The values in the context object must be specified in the specific provider documentation. For more information about this parameter, see Making Calls to WMI.

ppEnum [out]

Pointer that holds the reference to a IWbemHiPerfEnum object, which will contain the enumeration. The client must call Release on this pointer when it is no longer required.

plId [out]

Pointer to an integer returned by the provider that uniquely identifies the refreshable enumeration.

Return value

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


The specified parameter is not valid.


The specified class was not valid.


The current user does not have permission to perform this operation.


The requested instance is not supplied by a high-performance provider.


The refresher is busy with another operation.


The operation was successful.


The supplied class must specify a valid class, which is provided by the High-Performance Provider. All instances of the returned enumerator can be queried after calls. On each call to refresh, the number of instances in the enumerator can vary. Only instances of the specified class name are returned; subclasses of the specified class will not be enumerated because detailed enumeration is not supported. The returned enumerator must not be touched by the client while a Refresh operation is in process. The returned identifier can be used by the Remove function to remove the object. Note that it is not necessary for the user to explicitly remove added enumerators. However, the client must call Release on the returned enumerator when it is no longer required.


Minimum supported client

Windows Vista

Minimum supported server

Windows Server 2008


Wbemcli.h (include Wbemidl.h)



See also