IWbemServices::CreateInstanceEnumAsync

[This is preliminary documentation and subject to change.]

The IWbemServices::CreateInstanceEnumAsync method performs the same task as IWbemServices::CreateInstanceEnum except that the call returns immediately, and the instances are asynchronously provided to the specified response handler.

HRESULT IWbemServices::CreateInstanceEnumAsync(
  [in] BSTR bstrClass, 
  [in] LONG lFlags, 
  [in] IWbemContext *pCtx, 
  [in] CALLBACK *pResponseHandler 
);
 

Parameters

bstrClass
A valid BSTR containing the name of the class for which instances are desired. This parameter cannot be NULL.
lFlags
When set to zero, WBEM_FLAG_DEEP forces recursive enumeration into all subclasses derived from the specified class. Instances of Class as well as those of its derived classes are returned. WBEM_FLAG_SHALLOW forces the enumeration to include only instances of the specified class.
pCtx
Typically NULL. Otherwise, this is a pointer to an IWbemContext object required by the dynamic class provider that is producing the class instances. The values in the context object must be specified in the documentation for the provider in question.
pResponseHandler
Points to the caller's implementation of IWbemObjectSink. This handler receives the objects as they become available. For a detailed explanation of this parameter, see Asynchronous Methods. CIMOM only calls AddRef on the pointer in cases where WBEM_NO_ERROR is returned. In cases where an error code is returned, the reference count is the same as on entry.

Return Values

WBEM_E_FAILED Other unspecified errors.
WBEM_E_INVALID_CLASS The specified class was invalid.
WBEM_E_INVALID_PARAMETER An invalid parameter was specified, or the namespace could not be parsed.
WBEM_E_OUT_OF_MEMORY There was not enough memory to complete the operation.
WBEM_E_RPC_FAILURE The RPC link between the client and CIMOM has failed.
WBEM_NO_ERROR The call succeeded.

On failure, you can obtain additional information from the COM function GetErrorInfo.

See Also

Asynchronous Methods, IWbemServices::CreateInstanceEnum