2.1.5.12.3 FileFsSizeInformation

OutputBuffer is of type FILE_FS_SIZE_INFORMATION as described in [MS-FSCC] section 2.5.8.

This routine uses the following local variables:

  • 64-bit unsigned integer: RemainingQuota

  • FILE_QUOTA_INFORMATION element: QuotaEntry

Pseudocode for the operation is as follows:

  • If OutputBufferSize is smaller than sizeof(FILE_FS_SIZE_INFORMATION), the operation MUST be failed with STATUS_INFO_LENGTH_MISMATCH.

  • OutputBuffer MUST be constructed as follows:

    • OutputBuffer.TotalAllocationUnits set to Open.File.Volume.TotalSpace / Open.File.Volume.ClusterSize.

    • OutputBuffer.AvailableAllocationUnits set to (Open.File.Volume.FreeSpace - Open.File.Volume.ReservedSpace) / Open.File.Volume.ClusterSize.

    • OutputBuffer.SectorsPerAllocationUnit set to Open.File.Volume.ClusterSize / Open.File.Volume.LogicalBytesPerSector.

    • OutputBuffer.BytesPerSector set to Open.File.Volume.LogicalBytesPerSector.

  • If Open.File.Volume.QuotaInformation contains an entry QuotaEntry that matches the SID of the current Open, the object store MUST modify the returned information based on QuotaEntry as follows:

    • If QuotaEntry.QuotaLimit < Open.File.Volume.TotalSpace:

      • OutputBuffer.TotalAllocationUnits MUST be set to QuotaEntry.QuotaLimit / Open.File.Volume.ClusterSize.

    • EndIf

    • If QuotaEntry.QuotaLimit <= QuotaEntry.QuotaUsed:

      • RemainingQuota MUST be set to 0.

    • Else

      • RemainingQuota MUST be set to QuotaEntry.QuotaLimit - QuotaEntry.QuotaUsed.

    • EndIf

    • If RemainingQuota < (Open.File.Volume.FreeSpace - Open.File.Volume.ReservedSpace):

      • OutputBuffer.AvailableAllocationUnits MUST be set to RemainingQuota / Open.File.Volume.ClusterSize.

    • EndIf

  • EndIf

  • Upon successful completion of the operation, the object store MUST return:

    • ByteCount MUST be set to sizeof(FILE_FS_SIZE_INFORMATION).

    • Status set to STATUS_SUCCESS.