4.2.3 Unregistering for Notifications

The following figure shows an example of a client that cancels a previous registration for a notification.

Client canceling previous registration for notification

Figure 6: Client canceling previous registration for notification

  1. The client requests unregistration by calling the IVdsService::Unadvise method and passing the cookie value that was received during registration.

  2. The server determines that the cookie value matches a registered IVdsAdviseSink interface and invokes the IVdsAdviseSink::Release method to release its reference.

  3. The client returns the new reference count for the IVdsAdviseSink interface.

  4. The server returns an HRESULT of 0x00000000 in response to an IVdsService::Unadvise call from the client to acknowledge that the registration is canceled. The server can reuse the cookie value in the future.