Application Requests Closing a Share Connection

The application provides a handle to the TreeConnect. If the handle is invalid, or if no TreeConnect 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 TreeConnect is found, the client MUST enumerate all open files on TreeConnect.Session.Connection.OpenTable and close those Opens where Open.TreeConnect matches the TreeConnect by issuing an SMB2 CLOSE as specified in section

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

  • The Command field is set to SMB2 TREE_DISCONNECT.

  • The MessageId field is set as specified in section

  • The SessionId field is set to TreeConnect.Session.SessionId.

  • The TreeId field is set to TreeConnect.TreeConnectId.

The SMB2 TREE_DISCONNECT Request MUST be initialized to the default values, as specified in 2.2.11.

The request MUST be sent to the server.