Compartir a través de


2.2.37 SMB2 QUERY_INFO Request

The SMB2 QUERY_INFO Request (section 2.2.37) packet is sent by a client to request information on a file, named pipe, or underlying volume. This request consists of an SMB2 header, as specified in section 2.2.1, followed by this request structure:


0


1


2


3


4


5


6


7


8


9

1
0


1


2


3


4


5


6


7


8


9

2
0


1


2


3


4


5


6


7


8


9

3
0


1

StructureSize

InfoType

FileInfoClass

OutputBufferLength

InputBufferOffset

Reserved

InputBufferLength

AdditionalInformation

Flags

FileId

...

...

...

Buffer (variable)

...

StructureSize (2 bytes): The client MUST set this field to 41, indicating the size of the request structure, not including the header. The client MUST set this field to this value regardless of how long Buffer[] actually is in the request being sent.

InfoType (1 byte): The type of information queried. This field MUST contain one of the following values:

Value

Meaning

SMB2_0_INFO_FILE

0x01

The file information is requested.

SMB2_0_INFO_FILESYSTEM

0x02

The underlying object store information is requested.

SMB2_0_INFO_SECURITY

0x03

The security information is requested.

SMB2_0_INFO_QUOTA

0x04

The underlying object store quota information is requested.

FileInfoClass (1 byte): For file information queries, this field MUST contain one of the following FILE_INFORMATION_CLASS values, as specified in section 3.3.5.20.1 and in [MS-FSCC] section 2.4:

  • FileAccessInformation

  • FileAlignmentInformation

  • FileAllInformation

  • FileAlternateNameInformation

  • FileAttributeTagInformation

  • FileBasicInformation

  • FileCompressionInformation

  • FileEaInformation

  • FileFullEaInformation

  • FileIdInformation

  • FileInternalInformation

  • FileModeInformation

  • FileNetworkOpenInformation

  • FileNormalizedNameInformation

  • FilePipeInformation

  • FilePipeLocalInformation

  • FilePipeRemoteInformation

  • FilePositionInformation

  • FileStandardInformation

  • FileStreamInformation

Or:

  • FileInfoClass_Reserved (0x64): This value MUST be reserved and MUST be ignored on receipt.

    For underlying object store information queries, this field MUST contain one of the following FS_INFORMATION_CLASS values, as specified in section 3.3.5.20.2 and in [MS-FSCC] section 2.5:

    • FileFsAttributeInformation

    • FileFsControlInformation

    • FileFsDeviceInformation

    • FileFsFullSizeInformation

    • FileFsObjectIdInformation

    • FileFsSectorSizeInformation

    • FileFsSizeInformation

    • FileFsVolumeInformation

    For security queries, this field MUST be set to 0. For quota queries, this field SHOULD<78> be set to 0.

OutputBufferLength (4 bytes): The maximum number of bytes of information the server can send in the response.

InputBufferOffset (2 bytes): The offset, in bytes, from the beginning of the SMB2 header to the input buffer. For quota requests, the input buffer MUST contain an SMB2_QUERY_QUOTA_INFO, as specified in section 2.2.37.1. For FileFullEaInformation requests, the input buffer MUST contain the user supplied EA list with zero or more FILE_GET_EA_INFORMATION structures, specified in [MS-FSCC] section 2.4.15.1. For other information queries, this field SHOULD<79> be set to 0.

Reserved (2 bytes): This field MUST NOT be used and MUST be reserved. The client MUST set this field to 0, and the server MUST ignore it on receipt.

InputBufferLength (4 bytes): The length of the input buffer. For quota requests, this MUST be the length of the contained SMB2_QUERY_QUOTA_INFO embedded in the request. For FileFullEaInformation requests, this MUST be set to the length of the user supplied EA list specified in [MS-FSCC] section 2.4.15.1. For other information queries, this field SHOULD be set to 0 and the server MUST ignore it on receipt.

AdditionalInformation (4 bytes): Provides additional information to the server.

If security information is being queried, this value contains a 4-byte bit field of flags indicating what security attributes MUST be returned. For more information about security descriptors, see SECURITY_DESCRIPTOR in [MS-DTYP].

Value

Meaning

OWNER_SECURITY_INFORMATION

0x00000001

The client is querying the owner from the security descriptor of the file or named pipe.

GROUP_SECURITY_INFORMATION

0x00000002

The client is querying the group from the security descriptor of the file or named pipe.

DACL_SECURITY_INFORMATION

0x00000004

The client is querying the discretionary access control list from the security descriptor of the file or named pipe.

SACL_SECURITY_INFORMATION

0x00000008

The client is querying the system access control list from the security descriptor of the file or named pipe.

LABEL_SECURITY_INFORMATION

0x00000010

The client is querying the integrity label from the security descriptor of the file or named pipe.

ATTRIBUTE_SECURITY_INFORMATION

0x00000020

The client is querying the resource attribute from the security descriptor of the file or named pipe.

SCOPE_SECURITY_INFORMATION

0x00000040

The client is querying the central access policy of the resource from the security descriptor of the file or named pipe.

BACKUP_SECURITY_INFORMATION

0x00010000

The client is querying the security descriptor information used for backup operation.

If FileFullEaInformation is being queried and the application has not provided a list of EAs to query, but has provided an index into the object's full extended attribute information array at which to start the query, this field MUST contain a ULONG representation of that index. For all other queries, this field MUST be set to 0 and the server MUST ignore it.

Flags (4 bytes): The flags MUST be set to a combination of zero or more of these bit values for a FileFullEaInformation query.

Value

Meaning

SL_RESTART_SCAN

0x00000001

Restart the scan for EAs from the beginning.

SL_RETURN_SINGLE_ENTRY

0x00000002

Return a single EA entry in the response buffer.

SL_INDEX_SPECIFIED

0x00000004

The caller has specified an EA index.

For all other queries, the client MUST set this field to 0, and the server MUST ignore it on receipt.

FileId (16 bytes): An SMB2_FILEID identifier of the file or named pipe on which to perform the query. Queries for underlying object store or quota information are directed to the volume on which the file resides.

Buffer (variable): A variable-length buffer containing the input buffer for the request, as described by the InputBufferOffset and InputBufferLength fields.<80>

For quota requests, the input Buffer MUST contain an SMB2_QUERY_QUOTA_INFO, as specified in section 2.2.37.1. For a FileFullEaInformation query, the Buffer MUST be in one of the following formats:

  • A zero-length buffer as indicated by an InputBufferLength that is equal to zero.

  • A list of FILE_GET_EA_INFORMATION structures provided by the application, as specified in [MS-FSCC] section 2.4.15.1.