<div class="content"><p> </p><p>A <span><a href="102555d1-0dbf-4b2e-b78c-e388823d252c#gt_60e0e1fa-66fe-41e1-b5e3-ceab97e53506" data-linktype="relative-path">client</a></span> calls the
rpc_ACCloseHandle method to close context handles acquired from <span><a href="de086803-3f83-44ec-9bd3-417216c171c8" data-linktype="relative-path">rpc_QMOpenQueueInternal (section 3.1.4.17)</a></span>.</p><dl>
<dd>
<div><pre> HRESULT rpc_ACCloseHandle(
   [in, out] RPC_QUEUE_HANDLE* phQueue
 );
</pre></div>
</dd></dl><p><b>phQueue: </b> MUST be a context handle acquired
from the <i>phQueue</i> out-parameter of the rpc_QMOpenQueueInternal method. On
success, the <span><a href="102555d1-0dbf-4b2e-b78c-e388823d252c#gt_434b0234-e970-4e8c-bdfa-e16a30d96703" data-linktype="relative-path">server</a></span> MUST set this
parameter to NULL.</p><p><b>Return Values: </b> On success, this method MUST return
MQ_OK (0x00000000); otherwise, the server MUST return a failure <span><a href="../ms-dtyp/a9046ed2-bfb2-4d56-a719-2824afce59ac" data-linktype="relative-path">HRESULT</a></span>,<a id="Appendix_A_Target_52"></a><a aria-label="Product behavior note 52" href="3d105257-668f-4768-83fe-344c8405a5a5#Appendix_A_52" data-linktype="relative-path">&lt;52&gt;</a> and the client MUST treat all
failure HRESULTs identically. Additionally, if a failure HRESULT is returned,
the client MUST disregard all out-parameter values.</p><p>Exceptions Thrown: No exceptions are thrown beyond those
thrown by the underlying <span><a href="102555d1-0dbf-4b2e-b78c-e388823d252c#gt_8a7f6700-8311-45bc-af10-82e10accd331" data-linktype="relative-path">RPC</a></span> protocol, as
specified in <span><a href="../ms-rpce/290c38b1-92fe-4229-91e6-4fc376610c15" data-linktype="relative-path">[MS-RPCE]</a></span>.</p><p>This method is invoked at the dynamically assigned <span><a href="102555d1-0dbf-4b2e-b78c-e388823d252c#gt_b91c1e27-e8e0-499b-8c65-738006af72ee" data-linktype="relative-path">endpoint</a></span>
returned by the <span><a href="a8c96155-a7e6-41cb-95c7-6ab7e4f8214d" data-linktype="relative-path">R_QMGetRTQMServerPort (section 3.1.4.24)</a></span>
method when IP_HANDSHAKE (0x00000000) or IPX_HANDSHAKE (0x00000002) is the
interface specified by the <i>fIP</i> parameter.</p><p>When processing this call, the server MUST:</p><ul><li><p><span><span> 
</span></span>Locate a <span><a href="910315e4-d43e-4c99-b086-555cc271563f" data-linktype="relative-path">LocalQueueContextHandle (section 3.1.1.3)</a></span>
ADM element instance in the server&#39;s <i>iLocalQueueContextHandleTable</i>
(section <span><a href="6d5edb49-62b1-46de-a235-f2cc97df6a31" data-linktype="relative-path">3.1.1.2</a></span>) where the
value of the <b>Handle</b> attribute of the <b>LocalQueueContextHandle</b> ADM
element instance equals <i>phQueue</i>.</p>
</li><li><p><span><span> 
</span></span>If such a <b>LocalQueueContextHandle</b> ADM element instance
exists:</p>
<ul><li><p><span><span>  </span></span>Declare
<i>iLocatedLocalQueueContextHandle</i> and set it to a reference to the located
<b>LocalQueueContextHandle</b> ADM element instance.</p>
</li><li><p><span><span>  </span></span>Generate
a <span><a href="../ms-mqdmpr/c4ccefa4-d914-47b3-8e39-ad49e66a9d9b" data-linktype="relative-path">Close
Queue</a></span> (<span><a href="../ms-mqdmpr/5eafe0a6-a22f-436b-a0d9-4cbc25c52b47" data-linktype="relative-path">[MS-MQDMPR]</a></span>
section <span><a href="../ms-mqdmpr/2a9858ca-518a-4abe-9f06-168931173895" data-linktype="relative-path">3.1.7.1.2</a></span>)
event with the following argument value:</p>
<ul><li><p><span><span> 
</span></span><i>iQueueDesc</i> := <i>iLocatedLocalQueueContextHandle</i>.<b>OpenQueueDescriptorReference</b></p>
</li></ul></li><li><p><span><span>  </span></span>Delete
<i>iLocatedLocalQueueContextHandle</i> from the server&#39;s <i>iLocalQueueContextHandleTable</i>.</p>
</li><li><p><span><span>  </span></span>Set
<i>phQueue</i> to NULL.</p>
</li><li><p><span><span>  </span></span>Take
no further action and return MQ_OK (0x00000000).</p>
</li></ul></li><li><p><span><span> 
</span></span>Else:</p>
<ul><li><p><span><span>  </span></span>Locate
a <span><a href="01412cba-2803-4644-be30-76cdb8560cec" data-linktype="relative-path">RemoteQueueProxyHandle (section 3.1.1.5)</a></span>
ADM element instance in the server&#39;s <i>iRemoteQueueProxyHandleTable</i>
(section <span><a href="50eab75b-1cc0-4023-bb19-a20975e50883" data-linktype="relative-path">3.1.1.4</a></span>) where the
value of the <b>Handle</b> attribute of the <b>RemoteQueueProxyHandle</b> ADM
element instance equals <i>phQueue</i>.</p>
</li><li><p><span><span>  </span></span>If
no such <b>RemoteQueueProxyHandle</b> ADM element instance exists, take no
further action and return a failure <b>HRESULT</b>.</p>
</li><li><p><span><span>  </span></span>Declare
<i>iLocatedRemoteQueueProxyHandle</i> and set it to a reference to the located <b>RemoteQueueProxyHandle</b>
ADM element instance.</p>
</li><li><p><span><span>  </span></span>Invoke
the <span><a href="../ms-mqqp/f8b37cf7-cdf4-4e3a-8497-cf2c65074db5" data-linktype="relative-path">RemoteQMCloseQueue</a></span>
method of the qm2qm RPC interface as specified in <span><a href="../ms-mqqp/c9a334a7-89b4-4e75-902a-bc029e29a072" data-linktype="relative-path">[MS-MQQP]</a></span>
section 3.1.4.4 using the binding handle in <i>iLocatedRemoteQueueProxyHandle</i>.<b>RemoteBindingHandle</b>
and the following parameter value:</p>
<ul><li><p><span><span> 
</span></span><i>pphContext</i> := <i>iLocatedRemoteQueueProxyHandle</i>.<b>RemoteHandle</b></p>
</li></ul></li><li><p><span><span>  </span></span>Upon
completion of the RemoteQMCloseQueue method, successful or not, dispose of the <i>iLocatedRemoteQueueProxyHandle</i>.<b>RemoteBindingHandle</b>
as appropriate.</p>
<ul><li><p><span><span> 
</span></span>Note: This method SHOULD<a id="Appendix_A_Target_53"></a><a aria-label="Product behavior note 53" href="3d105257-668f-4768-83fe-344c8405a5a5#Appendix_A_53" data-linktype="relative-path">&lt;53&gt;</a> start a
parallel process to perform the above operations and return S_OK without
waiting for the process to complete. Since S_OK is returned to the client
without regard for the activities in the parallel process, failures that occur
in the parallel process will not be conveyed to the client, which will delay
reclamation of resources in the [MS-MQQP] server.</p>
</li></ul></li><li><p><span><span>  </span></span>Delete
<i>iLocatedRemoteQueueProxyHandle</i> from <i>iRemoteQueueProxyHandleTable</i>.</p>
</li><li><p><span><span>  </span></span>Set
<i>phQueue</i> to NULL.</p>
</li><li><p><span><span>  </span></span>Return
MQ_OK (0x00000000).</p>
</li></ul></li></ul></div>