IWbemServices::CreateClassEnum

[This is preliminary documentation and subject to change.]

The IWbemServices::CreateClassEnum method returns an enumerator for all classes satisfying the selection criteria.

The caller must then use the returned enumerator to retrieve the class definitions, calling IEnumWbemClassObject::Next to obtain each class or blocks of classes. It finishes by calling IEnumWbemClassObject::Release.

Note that it is not an error for the returned enumerator to have zero elements.

HRESULT IWbemServices::CreateClassEnum(
  [in] BSTR bstrSuperclass,
  [in] LONG lFlags,
  [in] IWbemContext *pCtx,
  [out] IEnumWbemClassObject **ppEnum
);
 

Parameters

bstrSuperclass
If not NULL or blank, specifies a superclass name. Only classes that are subclasses of this class are returned in the enumerator. If it is NULL or blank, and lFlags is WBEM_FLAG_SHALLOW, only the top-level classes, that is, classes that 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.
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.
ppEnum
Receives the pointer to the enumerator. The returned object has a positive reference count. The caller must call Release on the pointer when it is no longer required.

Return Values

WBEM_E_ACCESS_DENIED The current user does not have permission to view one or more of the classes that the call can return.
WBEM_E_FAILED Other unspecified errors.
WBEM_E_INVALID_CLASS The specified class did not exist.
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 occurred between CIMOM and the client.
WBEM_NO_ERROR The call succeeded.

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

See Also

Error Objects, IWbemServices::CreateClassEnumAsync, IEnumWbemClassObject