2.1.5.12.8 FileCompressionInformation

msdn link

OutputBuffer is of type FILE_COMPRESSION_INFORMATION as defined in [MS-FSCC] section 2.4.9.<153>

Pseudocode for the operation is as follows:

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

  • The object store MUST initialize all fields in OutputBuffer to zero.

  • 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:

    • The object store MUST set OutputBuffer.CompressedFileSize to the number of bytes actually allocated on the underlying physical storage for storing the compressed data. This value MUST be a multiple of Open.File.Volume.ClusterSize and MUST be less than or equal to Open.Stream.AllocationSize.

    • 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

  • If OutputBuffer.CompressionState is not equal to COMPRESSION_FORMAT_NONE, the object store MUST set:

    • OutputBuffer.CompressedUnitShift to the base-2 logarithm of Open.File.Volume.CompressionUnitSize.

    • OutputBuffer.ChunkShift to the base-2 logarithm of Open.File.Volume.CompressedChunkSize.

    • OutputBuffer.ClusterShift to the base-2 logarithm of Open.File.Volume.ClusterSize.

  • EndIf

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

    • ByteCount set to sizeof(FILE_COMPRESSION_INFORMATION).

    • Status set to STATUS_SUCCESS.