IWbemServices::CreateClassEnumAsync

[This is preliminary documentation and subject to change.]

The IWbemServices::CreateClassEnumAsync method performs the same function as IWbemServices::CreateClassEnum except that the objects are returned to the specified IWbemObjectSink implementation instead of to an enumerator.

In cases where the call succeeds, CIMOM calls AddRef on the pointer pResponseHandler, and then returns immediately. It then asynchronously calls pResponseHandler – >Notify from another thread with class definitions until the query has been satisfied.

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

Parameters

bstrSuperclass
If not NULL or blank, this parameter specifies a superclass name. Only classes that are subclasses of this class are returned in the enumerator. If NULL or blank, and lFlags is WBEM_FLAG_SHALLOW, only top-level classes, those which have no parent class or superclass, are returned. If NULL or blank and lFlags is WBEM_FLAG_DEEP, all classes within the namespace are returned.
lFlags
WBEM_FLAG_DEEP forces recursive enumeration into all subclasses derived from the specified superclass. The superclass itself is not returned in the enumeration.

WBEM_FLAG_SHALLOW forces the enumeration to include only immediate subclasses of the specified superclass.

Note  If bstrSuperclass is NULL or blank and WBEM_FLAG_DEEP is specified, all classes are returned.

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 using the IWbemObjectSink::Indicate method. When no more objects are available, the IWbemObjectSink::SetStatus method is called by CIMOM. 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 Unspecified error.
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_TRANSPORT_FAILURE A communications failure has occurred between the client process and CIMOM.
WBEM_NO_ERROR The call succeeded.

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

See Also

Asynchronous Methods, IWbemServices::CreateClassEnum, IWbemObjectSink