Dela via


2.1.5.21 Server Requests Querying Quota Information

The server provides:

  • Open: An Open of a Quota Stream<198>.

  • OutputBufferSize: The maximum number of bytes to return in OutputBuffer.

  • ReturnSingleEntry: A Boolean that, if TRUE, indicates at most one entry MUST be returned. If FALSE, one or more entries MAY be returned, up to what will fit in OutputBufferSize bytes.

  • SidList: An optional array of one or more FILE_GET_QUOTA_INFORMATION structures as specified in [MS-FSCC] section 2.4.40.1. This identifies the SIDs whose quota information is to be returned.

  • SidListLength: The length, in bytes, of the SidList array. If no SidList array is provided, this MUST be set to zero.

  • StartSid: An optional SID identifying the entry at which to begin scanning quota information. This parameter is ignored if the SidList parameter is specified. If no StartSid SID is provided, this field is empty.

  • RestartScan: A Boolean that, if TRUE, indicates that enumeration is restarted from the beginning of the quota list. If FALSE, enumeration continues from the last position.

On completion, the object store MUST return:

  • Status: An NTSTATUS code that specifies the result.

  • OutputBuffer: An array of one or more FILE_QUOTA_INFORMATION structures as specified in [MS-FSCC] section 2.4.40.

  • ByteCount: The number of bytes stored in OutputBuffer.

Support for this operation is optional. If the object store does not implement this functionality, the operation MUST be failed with STATUS_INVALID_DEVICE_REQUEST.<199>

Pseudocode for the operation is as follows:

  • If SidList is not empty and SidListLength is not a multiple of 4, the operation MUST be failed with STATUS_INVALID_PARAMETER.

  • If SidListLength is not zero but less than sizeof(FILE_GET_QUOTA_INFORMATION), SidList will be zero filled up to sizeof(FILE_GET_QUOTA_INFORMATION).

  • If SidList is not empty:

    • For each entry in SidList, the object store MUST return a FILE_QUOTA_INFORMATION structure as specified in [MS-FSCC] section 2.4.40, where the data returned is from the Open.File.Volume.QuotaInformation entry with the same SID.

    • If SidList includes a SID that does not map to an existing SID in the Open.File.Volume.QuotaInformation list, the object store MUST return a FILE_QUOTA_INFORMATION structure (as specified in [MS-FSCC] section 2.4.40) that is filled with zeros.

    • If ReturnSingleEntry is TRUE, the object store MUST return information only on the first SID in SidList. No other SidList entries other than the first are processed by the object store.

    • RestartScan and StartSid are ignored.

  • Else: // SidList is empty

    • If OutputBufferSize is less than sizeof(FILE_QUOTA_INFORMATION), the operation MUST be failed with STATUS_BUFFER_TOO_SMALL.

    • If StartSid is not empty:

      • If StartSid is not found in Open.File.Volume.QuotaInformation then the operation MUST be failed with STATUS_INVALID_PARAMETER.

      • Set Open.LastQuotaId to the index of the entry in Open.File.Volume.QuotaInformation that matches StartSid.

      • RestartScan is ignored.

    • Else:

      • If RestartScan is TRUE or Open.LastQuotaId is -1:

        • Set Open.LastQuotaId to the index of the first entry in the Open.File.Volume.QuotaInformation list.

      • Else:

        • Set Open.LastQuotaId to the index of the entry after the current value of Open.LastQuotaId of Open.File.Volume.QuotaInformation list.

      • EndIf

    • EndIf

    • The object store MUST return a FILE_QUOTA_INFORMATION structure (as specified in [MS-FSCC] section 2.4.40) that corresponds to the entry in Open.File.Volume.QuotaInformationList that has the index specified by Open.LastQuotaId.

    • If ReturnSingleEntry is TRUE, the object store MUST return information on only a single quota entry.

    • If ReturnSingleEntry is FALSE and Open.LastQuotaId is not at the end of the Open.File.Volume.QuotaInformation list and more FILE_QUOTA_INFORMATION structures will fit in the remaining ByteCount, then more FILE_QUOTA_INFORMATION structures SHOULD be returned until either Open.LastQuotaId is at the end of Open.File.Volume.QuotaInformation list or no more FILE_QUOTA_INFORMATION structures will fit in OutputBuffer.

    • The operation MUST fail with STATUS_NO_MORE_ENTRIES when no entries are returned.

    • Open.LastQuotaId MUST be set to point to the entry in Open.File.Volume.QuotaInformation that represents the last returned FILE_QUOTA_INFORMATION structure in OutputBuffer.

  • EndIf

  • Upon successful completion, the object store MUST return:

    • Status set to STATUS_SUCCESS.

    • ByteCount set to the count, in bytes, of how much data was filled into OutputBuffer.