126.96.36.199 Application Requests Querying Quota Information
The application provides:
A handle to the Open identifying a directory.
A Boolean indicating whether the enumeration is being restarted.
A Boolean indicating whether only a single entry is to be returned.
The maximum output buffer it will accept.
It also optionally can provide a list of the SIDs whose quota information is to be queried, in the form of a SidList of FILE_GET_QUOTA_INFORMATION structures linked via the NextOffset field.
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 188.8.131.52. 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.
The Command field is set to SMB2 QUERY_INFO.
The MessageId field is set as specified in section 184.108.40.206.3.
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_QUOTA.
The FileInfoClass field is set to 0.
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 AdditionalInformation is set to 0.
The FileId field is set to Open.FileId.
An SMB2_QUERY_QUOTA_INFO structure is constructed and copied into the SidBuffer field of the SMB2 QUERY_INFO structure, and initialized as follows:
If only a single entry is to be returned, the client sets ReturnSingle to TRUE. Otherwise, it is set to FALSE.
If the application requires to restart the scan, the client sets RestartScan to TRUE. Otherwise, it is set to FALSE.
SidListLength, StartSidOffset, and StartSidLength are set based on the parameters received from the application as follows:
If the application provides a SidList, via one or more FILE_GET_QUOTA_INFORMATION structures linked by NextEntryOffset, they MUST be copied to the beginning of the SidBuffer, SidListLength MUST be set to their length in bytes, StartSidLength SHOULD be set to 0, and StartSidOffset SHOULD be set to 0.<126>
If a SidList is not provided by the application, then SidListLength MUST be set to 0, StartSidLength SHOULD be set to 0, and StartSidOffset SHOULD be set to 0.
The InputBufferOffset field is set to the offset, in bytes, from the beginning of the SMB2 header to the SMB2_QUERY_QUOTA_INFO structure.
The InputBufferLength field is set to the size, in bytes, of the SMB2_QUERY_QUOTA_INFO structure, including any trailing buffer for the SidList.
The request MUST be sent to the server.