Receiving an SMB2 TREE_DISCONNECT Request

When the server receives a request with an SMB2 header having a Command value equal to SMB2 TREE_DISCONNECT, message handling proceeds as follows:

Session Verification:

The server MUST locate the session, as specified in section

Tree Connect Verification:

The server MUST locate the tree connection, as specified in section

For any Open in Session.OpenTable, if Open.TreeConnect matches the tree connect being disconnected, the server MUST close the Open as specified in section

The server MUST provide the tuple <TreeConnect.Share.ServerName, TreeConnect.Share.Name> and TreeConnect.TreeGlobalId as input parameters and deregister TreeConnect by invoking the event specified in [MS-SRVS] section TreeConnect.Share.CurrentUses MUST be decreased by 1. The tree connect MUST then be removed from Session.TreeConnectTable and freed. The server MUST initialize an SMB2 TREE_DISCONNECT Response following the syntax specified in section 2.2.12, and send it to the client.

The status code returned by this operation MUST be one of those defined in [MS-ERREF]. Common status codes returned by this operation include: