Application Requests Querying File System Attributes

The application provides:

  • A handle to the Open identifying a file that resides in the file system whose attributes are being queried.

  • The maximum output buffer it will accept.

  • The InformationClass of the file system attributes being queried, as specified in [MS-FSCC] section 2.5.

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.

If Open.Connection is NULL, and Open.Durable is TRUE, the client SHOULD attempt to reconnect to this open, as specified in section If the reconnect succeeds, the query MUST be retried. If it fails, the error code MUST be returned to the application.

If Open.Connection is NULL, and Open.Durable is FALSE, the client MUST fail the query operation.

If Open.Connection is not NULL, the client initializes an SMB2 QUERY_INFO Request following the syntax specified in section 2.2.37. The SMB2 header MUST be initialized as follows:

  • The Command field is set to SMB2 QUERY_INFO.

  • The MessageId field is set as specified in section

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

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

The SMB2 QUERY_INFO Request MUST be initialized as follows:

  • The InfoType field is set to SMB2_0_INFO_FILESYSTEM.

  • The FileInfoClass field is set to the InformationLevel that is received from the application.

  • The OutputBufferLength field is set to the maximum output buffer that the calling application will accept. An OutputBufferLength exceeding Connection.MaxTransactSize will be rejected by the server.

  • The InputBufferOffset field SHOULD<125> be set to 0.

  • The InputBufferLength field is set to 0.

  • The AdditionalInformation is set to 0.

  • The FileId field is set to Open.FileId.

The request MUST be sent to the server.