3.2.4.25 Application Requests an SMB Session Logoff

The application MUST provide the Client.Session of the SMB session to be closed.

The client MUST traverse the Client.Connection.TreeConnectTable, and for each entry in which Client.TreeConnect.Session matches the application-provided Client.Session, the TreeConnect MUST be closed, as specified in section 3.2.4.24.

The client MUST construct an SMB_COM_LOGOFF_ANDX Request (section 2.2.4.54.1). The request MUST be sent to the server as specified in section 3.2.4.1. The user represented by the Client.Session.SessionUID value, presented in the SMB Header (section 2.2.3.1), is logged off as follows:

  • The server cancels any outstanding command requests for this UID.

  • The server releases all locks and closes all files opened by this UID; the associated FIDs are invalidated.

  • The server closes all searches currently held open by this UID; the associated SIDs are invalidated.

  • The server disconnects all tree connects created by this UID; the associated TIDs are invalidated.

  • The server invalidates the UID.