3.2.4.20.7 Application Requests Content Information for a File

An application can request Content Information from the server that contains a set of hashes that can be used by the application to retrieve the contents of a specific file using the branch cache, as specified in [MS-PCCRC]. This request is not supported for the SMB 2.0.2 dialect. To retrieve the Content Information, the application provides the following:

  • The HashType, as specified in section 2.2.31.2.

  • The HashVersion, as specified in section 2.2.31.2.

  • The HashRetrievalType, as specified in section 2.2.31.2.

  • A handle to the Open identifying the remote file with which the Content Information is associated.

  • The maximum number of bytes to get from the associated Content Information data structure.

  • The offset into the Content Information data structure, if the structure is being retrieved across multiple requests, in bytes.

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 available, the client MUST fail this FSCTL operation.

Otherwise, the client MUST perform the following:

If Open.Connection.Dialect is "2.0.2", fail the application request with STATUS_NOT_SUPPORTED. Otherwise, format a 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 is set to FSCTL_SRV_READ_HASH.

  • The FileId field is set to Open.FileId.

  • The Buffer field is set to an SRV_READ_HASH Request, as specified in section 2.2.31.2.

    • The client initializes an SRV_READ_HASH request structure following the syntax specified in section 2.2.31.2 using the application-provided hash type, hash version, hash retrieval type, length, and offset, in bytes.

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

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

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

  • The OutputCount field is set to 0.

  • The MaxInputResponse field is set to 0.

  • The MaxOutputResponse field is set to the maximum number of bytes that the application expects to retrieve.

  • The SMB2_0_IOCTL_IS_FSCTL in the Flags field is 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.7.

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