3.1.4.9.4 LsarClose (Opnum 0)

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.

 NTSTATUS LsarClose(
   [in, out] LSAPR_HANDLE* ObjectHandle
 );

ObjectHandle: The context handle to be freed. On response, it MUST be set to 0.

Return Values: The following is a summary of the return values that an implementation MUST return, as specified by the message processing that follows.

Return value/code

Description

0x00000000

STATUS_SUCCESS

The request was successfully completed.

0xC0000008

STATUS_INVALID_HANDLE

ObjectHandle is not a valid handle.

Processing:

A handle of any type can be closed by calling LsarClose. Successful calls to LsarDeleteObject, which deletes an object to which the caller has an open handle, will also close the handle.

If ObjectHandle is invalid, the server MUST return STATUS_INVALID_HANDLE.

The server MUST free any resources associated with the LsaContextHandle element (section 3.1.1.7) that is represented by ObjectHandle, as specified in section 3.1.6.1, LSAPR_HANDLE_rundown.

The fact that a handle is closed is communicated to the RPC transport by returning a NULL value in the handle parameter, as specified in [C706] section 5.1.6.

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.