3.1.4.1.6 RemoveS (Opnum 12)

The RemoveS method is called by the client to remove an event class or subscription.

 [id(6), helpstring("method RemoveS")] HRESULT RemoveS(
   [in] BSTR progID,
   [in] BSTR queryCriteria
 );

progID: A string that uniquely identifies the type of collection. The value MUST be one of the following.

Value

Meaning

"EventSystem.EventClassCollection"

The store for event classes (as specified in section 3.1.1.1).

"EventSystem.EventSubscriptionCollection"

The store for subscriptions (as specified in section 3.1.1.2).

queryCriteria: The actual query string. The syntax for this string MUST conform to section 2.2.1.

Return Values: An HRESULT specifying success or failure. All success codes MUST be treated the same, and all failure codes other than EVENT_E_QUERYSYNTAX, EVENT_E_QUERYFIELD, and EVENT_E_NOT_ALL_REMOVED MUST be treated the same.

Return value/code

Description

0x80040203

EVENT_E_QUERYSYNTAX

A syntax error occurred while trying to evaluate a query string.

0x80040204

EVENT_E_QUERYFIELD

An invalid field name was used in a query string.

0x8004020B

EVENT_E_NOT_ALL_REMOVED

Not all of the requested objects could be removed.

When this method is called, the server MUST use the progID parameter value to determine the store against which the query needs to be executed, and validate the query. If the specified collection is not valid or the specified query is not valid, the server MUST fail the call, returning a failure HRESULT to the client.

If they are valid, the server MUST use the queryCriteria value to determine the event classes or subscriptions that need to be removed. If none of the entries in the internal store matched the queryCriteria, the server MUST fail the call.

Otherwise, the server will validate the entries in the query according to the following verification cases:

  • Protocol version is 1; CatalogMode is TRUE

    If the query includes anything other than subscriptions with the SubscriberInterface property set (transient subscriptions), the server MAY fail the call, returning a failure HRESULT to the client. If the server does not fail the call, the server behavior is undefined.

  • Protocol version is 1; CatalogMode is FALSE

    No additional verification.

  • Protocol version is 2; CatalogMode is TRUE

    If the query includes anything other than subscriptions with the PartitionID property not equal to GUID_NULL and with the SubscriberInterface property set (transient subscriptions), the server MAY fail the call, returning a failure HRESULT to the client. If the server does not fail the call, the server behavior is undefined.

  • Protocol version is 2; CatalogMode is FALSE

    If the query includes anything other than event classes and subscriptions with the PartitionID property equal to GUID_NULL, the server SHOULD fail the call, returning a failure HRESULT to the client.

If the verification succeeds, the server MUST attempt to remove the event classes or subscriptions from its internal collection and fail the call if it cannot.