18.104.22.168 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:
Tree Connect Verification:
The server MUST locate the tree connection, as specified in section 22.214.171.124.11.
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 126.96.36.199.
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 188.8.131.52. 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: