共用方式為


2.1.5.10.26 FSCTL_QUERY_SPARING_INFO

The server provides:

  • Open: An Open of a DataFile.

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

On completion, the object store MUST return:

  • Status: An NTSTATUS code that specifies the result.

  • OutputBuffer: An array of bytes that will return a FILE_QUERY_SPARING_BUFFER structure as defined in [MS-FSCC] section 2.3.60.

  • BytesReturned: The number of bytes returned 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.<119>

Pseudocode for the operation is as follows:

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

  • The object store MUST populate the fields of OutputBuffer as follows:

    • OutputBuffer.SparingUnitBytes set to Open.File.Volume.SparingUnitBytes.

    • OutputBuffer.SoftwareSparing set to Open.File.Volume.SoftwareSparing.

    • OutputBuffer.TotalSpareBlocks set to Open.File.Volume.TotalSpareBlocks.

    • OutputBuffer.FreeSpareBlocks set to Open.File.Volume.FreeSpareBlocks.

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

    • BytesReturned set to sizeof(: FILE_QUERY_SPARING_BUFFER).

    • Status set to STATUS_SUCCESS.