3.2.4.23 Application Requests Terminating an Authenticated Context

The application provides a handle to the Session. If the handle is invalid, or if no Session referenced by the handle is found, the client MUST return an implementation-specific error code locally to the calling application. If the handle is valid and a Session is found, the client MUST close all tree connects in the Session.TreeConnectTable, as specified in section 3.2.4.22.

The client initializes an SMB2 LOGOFF Request, following the syntax specified in section 2.2.7. The SMB2 header MUST be initialized as follows:

  • The Command field is set to SMB2 LOGOFF.

  • The MessageId field is set as specified in section 3.2.4.1.3.

  • The SessionId field is set to Session.SessionId.

The SMB2 LOGOFF Request MUST be initialized to the default values, as specified in 2.2.7.

The request MUST be sent to the server.