3.2.4.20.8 Application Requests Resiliency on an Open File

The application provides the following:

  • A handle to the Open identifying the file to on which to request resiliency.

  • The time-out for which the server MUST hold the handle open on behalf of the client after a network disconnection, in milliseconds.

If the handle is invalid, or if no Open referenced by the handle is found, the client MUST return an implementation-specific error code. If the handle is valid and Open is found, the client MUST proceed as follows.

For the specified Open, the client MUST select a connection as specified in section 3.2.4.1.7. If no connection is returned, the client MUST fail the request.

Otherwise, the client MUST perform the following:

If Open.Connection.Dialect is equal to "2.0.2", the client MUST fail the application request with STATUS_NOT_SUPPORTED. Otherwise, set Open.ResilientTimeout to the application supplied time-out.

The client initializes an SMB2 IOCTL Request following the syntax specified in section 2.2.31. The SMB2 header MUST be initialized as follows:

  • The Command field is set to SMB2 IOCTL.

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

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

  • The TreeId field is set to Open.TreeConnect.TreeConnectId.

The SMB2 IOCTL Request MUST be initialized as follows:

  • The CtlCode field MUST be set to FSCTL_LMR_REQUEST_RESILIENCY.

  • The FileId field MUST be set to Open.FileId.

  • The Buffer field is set to a NETWORK_RESILIENCY_REQUEST Request, as specified in section 2.2.31.3.

    • The Timeout field MUST be set to the application-provided time-out (in milliseconds).

  • The InputOffset field MUST be set to the offset to the Buffer, in bytes, from the beginning of the SMB2 header.

  • The InputCount field MUST be set to the size, in bytes, of the Buffer field.

  • The OutputOffset field SHOULD<173> be set to zero.

  • The OutputCount field MUST be set to 0.

  • The MaxInputResponse field MUST be set to 0.

  • The MaxOutputResponse field MUST be set to 0.

  •  SMB2_0_IOCTL_IS_FSCTL in the Flags field MUST be set to TRUE.

The request MUST be sent to the server, and the response from the server MUST be handled as described in section 3.2.5.14.9.

The status of the response MUST be returned to the application.