<div class="content"><p>The Unadvise method is received by the server in an
RPC_REQUEST packet. In response, the server MUST deregister a client&#39;s callback
object to cease receiving event notifications.</p><dl>
<dd>
<div><pre> HRESULT Unadvise(
   [in] DWORD dwCookie
 );
</pre></div>
</dd></dl><p><b>dwCookie: </b>A <a href="../ms-dtyp/262627d8-3418-4627-9218-4ffe110850b2" data-linktype="relative-path">DWORD</a>
value that uniquely identifies the interface pointer for the callback that is
to be deregistered. This corresponds to the value of the &#34;cookie&#34;
that was returned in the call to <a href="c157b1a0-ac9a-43f1-85e8-7cf9b34d6d73" data-linktype="relative-path">IConnectionPoint::Advise</a>.</p><p><b>Return Values: </b>The method MUST return S_OK
(0x00000000) on success or an implementation-specific error <a href="../ms-dtyp/a9046ed2-bfb2-4d56-a719-2824afce59ac" data-linktype="relative-path">HRESULT</a>
on failure.<a id="Appendix_A_Target_95"></a><a aria-label="Product behavior note 95" href="71c359c3-e9ec-4fe6-a101-aab1eabecdcf#Appendix_A_95" data-linktype="relative-path">&lt;95&gt;</a></p><p>When processing this call, the <a href="3b7be3f7-651c-4f9c-930b-a9a7c4355ad8#gt_434b0234-e970-4e8c-bdfa-e16a30d96703" data-linktype="relative-path">server</a> MUST follow these
guidelines:</p><ul><li><p><span><span> 
</span></span>If the <i>dwCookie</i> input parameter value does NOT exist as a
key in the <i>ConnectionCollection</i> collection:</p>
<ul><li><p><span><span>  </span></span>Return
CONNECT_E_NOCONNECTION (0x80040200), and take no further action.</p>
</li></ul></li><li><p><span><span> 
</span></span>Call the IUnknown::Release method (refer to section <a href="6b1800d7-4e98-48be-997e-57f09ce52d41" data-linktype="relative-path">3.1</a>) on the interface
pointer that is retrieved from the <i>ConnectionCollection</i> instance
variable where the key value matches the <i>dwCookie</i> input parameter.</p>
</li><li><p><span><span> 
</span></span>Remove the item from the <i>ConnectionCollection</i> instance
variable where the key value matches the <i>dwCookie</i> input parameter.</p>
</li></ul></div>