<div class="content" name="LsarClose" uuid="99dd2d7a-b0fc-4c6d-837a-2b4d342383ae"><p>The LsarClose method frees the resources held by a context
handle that was opened earlier. After response, the context handle will no
longer be usable, and any subsequent uses of this handle will fail.</p><dl>
<dd>
<div><pre> NTSTATUS LsarClose(
   [in, out] LSAPR_HANDLE* ObjectHandle
 );
</pre></div>
</dd></dl><p><b>ObjectHandle: </b>The context handle to be freed.
On response, it MUST be set to 0.</p><p><b>Return Values: </b>The following is a summary of
the return values that an implementation MUST return, as specified by the
message processing that follows.</p><dl>
<dd>
<table><thead>
  <tr>
   <th>
   <p>Return value/code</p>
   </th>
   <th>
   <p>Description</p>
   </th>
  </tr>
 </thead><tbody><tr>
  <td>0x00000000 STATUS_SUCCESS</td>
  <td>The request was successfully completed.</td>
 </tr><tr>
  <td>0xC0000008 STATUS_INVALID_HANDLE</td>
  <td>ObjectHandle is not a valid handle.</td>
 </tr></tbody></table>
</dd></dl><p>Processing:</p><p>A handle of any type can be closed by calling LsarClose.
Successful calls to <span><a href="8d0aa2dc-22b6-4bc3-b5d2-79b4b0ad7bce" data-linktype="relative-path">LsarDeleteObject</a></span>,
which deletes an object to which the caller has an open handle, will also close
the handle.</p><p>If <i>ObjectHandle</i> is invalid, the server MUST return
STATUS_INVALID_HANDLE.</p><p>The server MUST free any resources associated with the
LsaContextHandle element (section <span><a href="1011130b-0413-460d-81ed-d1821d141639" data-linktype="relative-path">3.1.1.7</a></span>) that is
represented by <i>ObjectHandle</i>, as specified in section <span><a href="2184a151-ce74-4e1e-8ba7-25384f51dbf8" data-linktype="relative-path">3.1.6.1</a></span>,
LSAPR_HANDLE_rundown.</p><p>The fact that a handle is closed is communicated to the <span><a href="31ca2a31-0be4-4773-bcef-05ad6cd3ccfb#gt_c2eeb200-3cd0-4916-966e-d7d6bff1737a" data-linktype="relative-path">RPC
transport</a></span> by returning a NULL value in the handle parameter, as
specified in <span><a href="https://go.microsoft.com/fwlink/?LinkId=89824" data-linktype="external">[C706]</a></span> section
5.1.6.</p><p>Closing one handle MUST NOT affect any other handle on the
server; that is, handles obtained using a policy handle MUST continue to be
valid after that policy handle is closed.</p></div>