<div class="content"><p> </p><p>The rpc_ACPurgeQueue method is called by a <span><a href="102555d1-0dbf-4b2e-b78c-e388823d252c#gt_60e0e1fa-66fe-41e1-b5e3-ceab97e53506" data-linktype="relative-path">client</a></span>
to purge an opened <span><a href="102555d1-0dbf-4b2e-b78c-e388823d252c#gt_c1a6400d-703b-4f9a-a74c-40f1487978d9" data-linktype="relative-path">queue</a></span>.</p><dl>
<dd>
<div><pre> HRESULT rpc_ACPurgeQueue(
   [in] RPC_QUEUE_HANDLE hQueue
 );
</pre></div>
</dd></dl><p><b>hQueue: </b> MUST be an <span><a href="1482aa96-e1e2-40e9-8fb8-b35895ca5b4a" data-linktype="relative-path">RPC_QUEUE_HANDLE (section 2.2.1.1.2)</a></span>
obtained from the <i>phQueue</i> parameter of the <span><a href="de086803-3f83-44ec-9bd3-417216c171c8" data-linktype="relative-path">rpc_QMOpenQueueInternal (section 3.1.4.17)</a></span>
method. Prior to this method being invoked, the queue MUST NOT have been
deleted, and the queue handle MUST NOT have been closed.</p><p><b>Return Values: </b> On success, this method MUST return
MQ_OK (0x00000000); otherwise, the <span><a href="102555d1-0dbf-4b2e-b78c-e388823d252c#gt_434b0234-e970-4e8c-bdfa-e16a30d96703" data-linktype="relative-path">server</a></span> 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_58"></a><a aria-label="Product behavior note 58" href="3d105257-668f-4768-83fe-344c8405a5a5#Appendix_A_58" data-linktype="relative-path">&lt;58&gt;</a> and the client MUST treat all
failure HRESULTs identically.</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 <b>Handle</b>
attribute of the <b>LocalQueueContextHandle</b> ADM element instance equals <i>hQueue</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/19d74159-1a11-4486-8e9d-c54cebfe1088" data-linktype="relative-path">Purge
Queue</a></span> (<span><a href="../ms-mqdmpr/5eafe0a6-a22f-436b-a0d9-4cbc25c52b47" data-linktype="relative-path">[MS-MQDMPR]</a></span>
section 3.1.7.1.7) event with the following argument value:</p>
<ul><li><p><span><span> 
</span></span><i>iQueue</i> := <i>iLocatedLocalQueueContextHandle</i>.<b>OpenQueueDescriptorReference.QueueReference</b></p>
</li></ul></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>hQueue</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>Using
the binding handle contained in <i>iLocatedRemoteQueueProxyHandle</i>.<b>RemoteBindingHandle</b>,
invoke the method <span><a href="../ms-mqqp/119644cf-f6ca-4f74-bb4a-c2624ccab22c" data-linktype="relative-path">RemoteQMPurgeQueue</a></span>
of the qm2qm interface defined in <span><a href="../ms-mqqp/c9a334a7-89b4-4e75-902a-bc029e29a072" data-linktype="relative-path">[MS-MQQP]</a></span>
section 3.1.4.7 with the following argument value:</p>
<ul><li><p><span><span> 
</span></span><i>hQueue</i> := <i>iLocatedRemoteQueueProxyHandle</i>.<b>RemoteContext</b></p>
</li></ul></li><li><p><span><span>  </span></span>Return
the return code produced by RemoteQMPurgeQueue.</p>
</li></ul></li></ul></div>