[This is preliminary documentation and subject to change.]
The IWbemServices::CreateInstanceEnum method creates an enumerator that returns the instances of a specified class according to user-specified selection criteria. This method implements a simple query. More complex queries may require the use of IWbemServices::ExecQuery.
Note that it is not an error for the returned enumerator to have zero elements
HRESULT IWbemServices::CreateInstanceEnum(
[in] BSTR bstrClass,
[in] LONG lFlags,
[in] IWbemContext *pCtx,
[out] IEnumWbemClassObject **ppEnum
);
WBEM_E_ACCESS_DENIED | The current user does not have permission to view instances of the specified class. |
WBEM_E_FAILED | Other unspecified errors. |
WBEM_E_INVALID_CLASS | The specified class is 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_TRANSPORT_FAILURE | The communications link between CIMOM and the client has failed. |
WBEM_NO_ERROR | The call succeeded. |
On failure, you can obtain any available information from the COM function GetErrorInfo.
Error Objects, IWbemServices::CreateInstanceEnumAsync