3.16.4.5.4 Unadvise (Opnum 6)
The Unadvise method is received by the server in an RPC_REQUEST packet. In response, the server MUST deregister a client's callback object to cease receiving event notifications.
-
HRESULT Unadvise( [in] DWORD dwCookie );
dwCookie: A DWORD value that uniquely identifies the interface pointer for the callback that is to be deregistered. This corresponds to the value of the "cookie" that was returned in the call to IConnectionPoint::Advise.
Return Values: The method MUST return S_OK (0x00000000) on success or an implementation-specific error HRESULT on failure.<95>
When processing this call, the server MUST follow these guidelines:
If the dwCookie input parameter value does NOT exist as a key in the ConnectionCollection collection:
Return CONNECT_E_NOCONNECTION (0x80040200), and take no further action.
Call the IUnknown::Release method (refer to section 3.1) on the interface pointer that is retrieved from the ConnectionCollection instance variable where the key value matches the dwCookie input parameter.
Remove the item from the ConnectionCollection instance variable where the key value matches the dwCookie input parameter.