<div class="content" name="RpcCloseListener" uuid="95be2185-9921-48b0-b722-848ae3075b9d"><p>The RpcCloseListener method closes the <span><a href="c41d3367-04c9-4c93-babf-9b5de834eb29#gt_5044babb-08e3-4bb9-bc12-fe8f542b05ee" data-linktype="relative-path">handle</a></span>
for a <span><a href="c41d3367-04c9-4c93-babf-9b5de834eb29#gt_ffff3f01-8c21-44d3-bbda-0062a1fbda4b" data-linktype="relative-path">Terminal Services</a></span> <span><a href="c41d3367-04c9-4c93-babf-9b5de834eb29#gt_1e5aa0c2-4617-4d7a-969e-a7091c415c8d" data-linktype="relative-path">listener</a></span>
running on a <span><a href="c41d3367-04c9-4c93-babf-9b5de834eb29#gt_b416f72e-cf04-4d80-bf93-f5753f3b0998" data-linktype="relative-path">terminal server</a></span>.
This MUST be called after <span><a href="126bc7fa-9e64-4b7b-a78c-1a08895fb60a" data-linktype="relative-path">RpcOpenListener</a></span>.
The call to this method MUST be serialized if there are multiple threads
running otherwise the behavior of this function is unknown. No special
permissions are required to call this method.</p><dl>
<dd>
<div><pre> HRESULT RpcCloseListener(
   [in, out] HLISTENER* phListener
 );
</pre></div>
</dd></dl><p><b>phListener: </b>Pointer to a handle to the
listener as returned by RpcOpenListener. The handle is of type <span><a href="c50c3e48-7a1d-4fb6-8934-1663a90cadff" data-linktype="relative-path">HLISTENER</a></span>.
The handle is set to NULL when the call returns.</p><p><b>Return Values: </b> The method MUST return S_OK
(0x00000000) on success; otherwise, it MUST return an implementation-specific
negative value.<a id="Appendix_A_Target_159"></a><a aria-label="Product behavior note 159" href="7ce7f717-461b-4f18-9829-6690168c7707#Appendix_A_159" data-linktype="relative-path">&lt;159&gt;</a></p><dl>
<dd>
<table><thead>
  <tr>
   <th>
   <p>Return value/code</p>
   </th>
   <th>
   <p>Description</p>
   </th>
  </tr>
 </thead><tbody><tr>
  <td>0x00000000 S_OK</td>
  <td>Successful completion.</td>
 </tr></tbody></table>
</dd></dl><p> </p></div>