<div class="content"><p align="right"><a href="https://msdn.microsoft.com/en-us/library/6698ab67-aa8d-47f9-99ca-a1196f9f2f6d" data-linktype="external">msdn link</a></p><p>(Protocol Version 3) The ApiCloseBatchPort method instructs
the <a href="694e5e7a-5833-4f3d-b47e-323ee1d452c2#gt_434b0234-e970-4e8c-bdfa-e16a30d96703" data-linktype="relative-path">server</a> to free any
context information that is created in a previous <a href="8f8778db-0dbe-473b-b786-30d4c2c54978" data-linktype="relative-path">ApiCreateBatchPort</a> method.</p><p>The server SHOULD accept an ApiCloseBatchPort request if its
<a href="694e5e7a-5833-4f3d-b47e-323ee1d452c2#gt_a93e2fea-3006-4a06-b48f-fdb36d9abac9" data-linktype="relative-path">protocol server state</a> is
read-only, and the server MUST accept the request for processing if it is in
the read/write state, as specified in section <a href="756547e7-ca64-4b7c-9f1b-2b1fbc6153d3" data-linktype="relative-path">3.1.1</a>.</p><p>The server SHOULD accept an ApiCloseBatchPort request if the
client&#39;s access level is at least &#34;Read&#34; (section <a href="a249a463-3d3b-4058-abf6-3024d81806a0" data-linktype="relative-path">3.1.4</a>).</p><dl>
<dd>
<div><pre> error_status_t ApiCloseBatchPort(
   [in, out] HBATCH_PORT_RPC * phBatchPort
 );
</pre></div>
</dd></dl><p><b>phBatchPort: </b>A pointer to an <a href="e273a61a-e2e6-4901-a3fa-2d3a21ca42f5" data-linktype="relative-path">HBATCH_PORT_RPC</a> context
handle that was obtained in a previous ApiCreateBatchPort method call. Upon
success, the server MUST set to NULL (0x00000000) the context handle pointed to
by this parameter.</p><p><b>Return Values: </b>The method MUST return the
following error codes for the specified conditions.</p><dl>
<dd>
<table><thead>
  <tr>
   <th>
   <p>Return value/code</p>
   </th>
   <th>
   <p>Description</p>
   </th>
  </tr>
 </thead><tbody><tr>
  <td>
  <p>0x00000000</p>
  <p>ERROR_SUCCESS</p>
  </td>
  <td>
  <p>Success.</p>
  </td>
 </tr><tr>
  <td>
  <p>0x00000006</p>
  <p>ERROR_INVALID_HANDLE</p>
  </td>
  <td>
  <p>The data that is pointed to by the <i>phBatchPort</i>
  parameter does not represent a valid HBATCH_PORT_RPC context handle.</p>
  </td>
 </tr></tbody></table>
</dd></dl><p>For any other condition, this method MUST return a value
that is not one of the values listed in the preceding table. The <a href="694e5e7a-5833-4f3d-b47e-323ee1d452c2#gt_60e0e1fa-66fe-41e1-b5e3-ceab97e53506" data-linktype="relative-path">client</a> MUST behave in one
consistent, identical manner for all values that are not listed in the
preceding table.</p></div>