IWbemEventProviderQuerySink::CancelQuery method

Call the IWbemEventProviderQuerySink::CancelQuery method whenever a logical event consumer cancels a relevant event query filter with Windows Management. The CancelQuery method determines how an event provider responds to a relevant canceled event query filter. Whenever WMI retrieves a cancellation notice for an event query filter from a consumer, WMI calls CancelQuery to echo the cancellation to the responsible event provider. The event provider can examine the identifier of the query to determine which query is being canceled. The provider then modifies which events are being sent out based on the cancellation.

Syntax


HRESULT CancelQuery(
  [inunsigned long dwId
);

Parameters

dwId [in]

Identifier of the query which was canceled. This identifier was originally delivered to the provider by the NewQuery method of this interface.

Return value

This method returns an HRESULT indicating the status of the method call. The following list lists the value contained withinan HRESULT.

WBEM_S_NO_ERROR

The provider should return this result.

Remarks

Whenever a consumer registers a new event query filter, Windows Management calls the IWbemEventProviderQuerySink::NewQuery method with the query identifier. Later, when that query is unregistered, this method is called indicating which query is no longer outstanding.

Providers use this method to help optimize the generation of events internally.

Requirements

Minimum supported client

Windows Vista

Minimum supported server

Windows Server 2008

Header

Wbemprov.h (include Wbemidl.h)

Library

Wbemuuid.lib

DLL

Wbemsvc.dll

See also

IWbemEventProviderQuerySink
IWbemEventProviderQuerySink::NewQuery

 

 

Show: