3.3.4.17 Server Application Requests Closing an Open

The calling application provides GlobalFileId as input parameter. The server MUST look up Open in GlobalOpenTable where Open.FileGlobalId is equal to GlobalFileId, and, if the Open is found, the server MUST perform the following:

  • Remove the Open from the GlobalOpenTable.

  • If Open.Connection is not NULL, cancel all requests in Open.Connection.RequestList for which Request.Open matches the Open, as specified in section 3.3.5.16.

  • If Open.IsSharedVHDX is TRUE, close the underlying Open.LocalOpen as specified in [MS-RSVD] section 3.2.5.2.

  • Close the underlying Open.LocalOpen.

  • If Open.Session is not NULL, remove the Open from Open.Session.OpenTable.

  • If Open.TreeConnect is not NULL, decrease Open.TreeConnect.OpenCount by 1.

  • If Open.Connection.Dialect is not "2.0.2", the server supports leasing, and Open.Lease is not NULL:

    • The server MUST identify a LeaseTable by enumerating each entry in GlobalLeaseTableList to find the one whose LeaseTable.LeaseList contains Open.Lease.

    • The server MUST then remove the Open from Open.Lease.LeaseOpens. If this Open is the last open in Open.Lease.LeaseOpens, the server MUST set Open.Lease.Held to FALSE.

    • If Open.Lease.Held is FALSE:

      • If Open.Lease.Breaking is TRUE, the server MUST complete the lease break to the underlying object store with NONE as the new lease state. <247>

      • The server MUST remove the Open.Lease from the LeaseTable.LeaseList and free the Open.Lease.

    • If LeaseTable.LeaseList is now empty, the server MAY remove the LeaseTable from the GlobalLeaseTableList and free the LeaseTable.

  • Provide Open.FileGlobalId as the input parameter and deregister the Open by invoking the event specified in [MS-SRVS] section 3.1.6.5.

  • The Open object is then freed.

  • Return STATUS_SUCCESS to the calling application.

If no Open is found, the call MUST return an implementation-dependent error.