[This is preliminary documentation and subject to change.]
The IWbemServices::ExecNotificationQuery method executes a query to receive events. The call returns immediately, and the user can poll the returned enumerator for events as they arrive. Releasing the returned enumerator cancels the query.
HRESULT IWbemServices::ExecNotificationQuery(
[in] BSTR bstrQueryLanguage,
[in] BSTR bstrQuery,
[in] LONG lFlags,
[in] IWbemContext *pCtx,
[out] IEnumWbemClassObject **ppEnum
);
WBEM_E_ACCESS_DENIED | The current user is not authorized to view the result set. |
WBEM_E_FAILED | Other unspecified errors. |
WBEM_E_INVALID_PARAMETER | An invalid parameter was specified, or the namespace could not be parsed. |
WBEM_E_INVALID_QUERY | The query was not syntactically valid. |
WBEM_E_INVALID_QUERY_LANGUAGE | The requested query language is not supported. |
WBEM_E_OUT_OF_MEMORY | There was not enough memory to complete the operation. |
WBEM_E_TRANSPORT_FAILURE | The communications link between the client and CIMOM has failed. |
WBEM_NO_ERROR | The call succeeded. |
On failure, you can obtain any available information from the COM function GetErrorInfo.
Error Objects, IWbemServices::ExecNotificationQueryAsync, Queries