3.2.5.9 Receiving an SMB2 CLOSE Response

If the Status field of the SMB2 header of the response indicates an error, then the client MUST return the received status code to the calling application.

The client MUST locate the Open in the Session.OpenTable using the FileId in the SMB2 header of the response.

If Connection.SupportsLeasing is TRUE, the client MUST locate the File in the GlobalFileTable by looking up Open.FileName. The client MUST delete the Open from the File.OpenTable. If all opens in File.OpenTable are deleted, and if there is no entry in GlobalFileTable whose name with its last component removed matches Open.FileName then the entry for this File MUST be deleted from the GlobalFileTable, and the File object MUST be freed.

If Connection.Dialect belongs to the SMB 3.x dialect family and Connection.SupportsDirectoryLeasing is TRUE, and if the File object was freed above, the client MUST scan through the GlobalFileTable and remove all File objects where File.OpenTable is empty and there is no entry in GlobalFileTable whose name with its last component removed matches the name of this File entry (that is, no child objects exist).

The open object MUST be removed from the Session.OpenTable and freed.

If SMB2_CLOSE_FLAG_POSTQUERY_ATTRIB is set in the Flags field of the response, the client MUST return file attributes that are returned in the response and success to the calling application.

If SMB2_CLOSE_FLAG_POSTQUERY_ATTRIB is not set, the client MUST ignore the file attributes and return success to the calling application.

Show: