2.1.5.10.9 FSCTL_GET_COMPRESSION

The server provides:

  • Open: An Open of a DataStream or DirectoryStream.

  • 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 USHORT value representing the compression state of the stream, as specified in [MS-FSCC] section 2.3.18.

  • 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.<102>

Pseudocode for the operation is as follows:

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

  • If Open.Stream.StreamType is DirectoryStream:

    • If Open.File.FileAttributes.FILE_ATTRIBUTE_COMPRESSED is TRUE:

      • The object store MUST set OutputBuffer.CompressionState to COMPRESSION_FORMAT_LZNT1.

    • Else:

      • The object store MUST set OutputBuffer.CompressionState to COMPRESSION_FORMAT_NONE.

    • EndIf

  • Else:

    • If Open.Stream.IsCompressed is TRUE:

      • The object store MUST set OutputBuffer.CompressionState to COMPRESSION_FORMAT_LZNT1.

    • Else:

      • The object store MUST set OutputBuffer.CompressionState to COMPRESSION_FORMAT_NONE.

    • EndIf

  • EndIf

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

    • BytesReturned set to sizeof(USHORT) (2 bytes).

    • Status set to STATUS_SUCCESS.