22.214.171.124 Server Application Requests Closing a Session
The calling application provides GlobalSessionId of the session to be closed. The server MUST look up Session from the GlobalSessionTable where Session.SessionGlobalId is equal to GlobalSessionId, and remove it from the table. If there is no matching session, the call MUST return.
The server MUST deregister the session by invoking the event specified in [MS-SRVS] section 126.96.36.199, providing GlobalSessionId as the input parameter. ServerStatistics.sts0_sopens MUST be decreased by 1.
The server MUST close every Open in Session.OpenTable as specified in 188.8.131.52.
The server MUST disconnect every TreeConnect in Session.TreeConnectTable and deregister TreeConnect by invoking the event specified in [MS-SRVS] section 184.108.40.206, providing the tuple <TreeConnect.Share.ServerName, TreeConnect.Share.Name> and TreeConnect.TreeGlobalId as the input parameters. For each deregistered TreeConnect, TreeConnect.Share.CurrentUses MUST be decreased by 1.
The session MUST be torn down and freed.