Export (0) Print
Expand All
Expand Minimize

3.2.4.4 Re-establishing a Durable Open

When an application requests an operation on a durable open that existed on a now-disconnected connection, that is, Open.Connection is NULL, and Open.Durable is TRUE, then the client SHOULD attempt to reconnect to this open as specified here.

The client MUST attempt to connect to the target share, as specified in section 3.2.4.2, by obtaining the name of the server and the name of the share to connect to from the Open.FileName. If this attempt fails, the client MUST fail the re-establishment attempt. If this attempt succeeds, the client MUST construct an SMB2 CREATE Request according to the syntax specified in section 2.2.13. The SMB2 header MUST be initialized as follows:

  • The Command field is set to SMB2 CREATE.

  • The MessageId field is set as specified in section 3.2.4.1.3.

  • The SessionId field is set to TreeConnect.Session.SessionId.

  • The TreeId field is set to TreeConnect.TreeConnectId.

The SMB2 CREATE Request MUST be initialized as follows:

  • The SecurityFlags field is set to 0.

  • The RequestedOplockLevel field is set to Open.OplockLevel.

  • The ImpersonationLevel field is set to 0.

  • The client sets the DesiredAccess field to 0.

  • The client sets the FileAttributes field to 0.

  • The client sets the ShareAccess field to 0.

  • The client sets the CreateDisposition field to 0.

  • The client sets the CreateOptions field to 0.

  • The client copies the relative path into Buffer and sets NameLength to the length, in bytes, of the relative path, and NameOffset to the offset, in bytes, to the relative path from the beginning of the SMB2 header.

  • If Connection.Dialect belongs to the SMB 3.x dialect family, the client MUST set the following:

    • The client sets the DesiredAccess field to Open.DesiredAccess.

    • The client sets the FileAttributes field to Open.FileAttributes.

    • The client sets the ShareAccess field to Open.ShareAccess.

    • The client sets the CreateDisposition field to Open.CreateDisposition.

    • The client sets the CreateOptions field to Open.CreateOptions.

  • If Connection.Dialect is "2.100", an SMB2_CREATE_DURABLE_HANDLE_RECONNECTcreate context is constructed according to the syntax specified in section 2.2.13.2.4. The data value is set to Open.FileId, and the create context is appended to the create request.

  • If Connection.Dialect belongs to the SMB 3.x dialect family, an SMB2_CREATE_DURABLE_HANDLE_RECONNECT_V2 create context is constructed according to the syntax specified in section 2.2.13.2.12. The FileId value is set to Open.FileId, CreateGuid is set to Open.CreateGuid, and the create context is appended to the create request. If Open.IsPersistent is TRUE, the client MUST set SMB2_DHANDLE_FLAG_PERSISTENT bit in the Flags field.

  • If Connection.Dialect is not "2.002", and the original open was performed by using a lease as described in section 3.2.4.3.8, as indicated by Open.OplockLevel set to SMB2_OPLOCK_LEVEL_LEASE, it MUST also implement the following:

    • The client MUST re-request the lease as described in section 3.2.4.3.8, and the LeaseState field MUST be set to File.LeaseState of the file being opened.

This request MUST be sent to the server.

 
Show:
© 2015 Microsoft