Partilhar via


2.4.9 FileCompressionInformation

This information class is used to query compression information for a file.

A FILE_COMPRESSION_INFORMATION data element, defined as follows, is returned by the server.


0


1


2


3


4


5


6


7


8


9

1
0


1


2


3


4


5


6


7


8


9

2
0


1


2


3


4


5


6


7


8


9

3
0


1

CompressedFileSize

...

CompressionFormat

CompressionUnitShift

ChunkShift

ClusterShift

Reserved

CompressedFileSize (8 bytes):  A 64-bit signed integer that contains the size, in bytes, of the compressed file. This value MUST be greater than or equal to 0.

CompressionFormat (2 bytes):  A 16-bit unsigned integer that contains the compression format. The actual compression operation associated with each of these compression format values is implementation-dependent. An implementation can link any local compression algorithm with the values described in the following table because the compressed data does not travel across the wire in the context of FSCTL, FileInformation class, or FileSystemInformation class requests or replies.<107>

Value

Meaning

COMPRESSION_FORMAT_NONE

0x0000

The file or directory is not compressed.

COMPRESSION_FORMAT_LZNT1

0x0002

The file or directory is compressed by using the LZNT1 compression algorithm.

All other values

Reserved for future use.

CompressionUnitShift (1 byte):  An 8-bit unsigned integer that contains the compression unit shift, which is the number of bits by which to left-shift a 1 bit to arrive at the compression unit size. The compression unit size is the number of bytes in a compression unit, that is, the number of bytes to be compressed. This value is implementation-defined.<108>

ChunkShift (1 byte):  An 8-bit unsigned integer that contains the compression chunk size shift, which is the number of bits by which to left-shift a 1 bit to arrive at the compression chunk size. The chunk size is the number of bytes that the operating system's implementation of the Lempel-Ziv compression algorithm tries to compress at one time. This value is implementation-defined.<109>

ClusterShift (1 byte):  An 8-bit unsigned integer that contains the cluster size shift, which is the number of bits by which to left-shift a 1 bit to arrive at the cluster size. The cluster size specifies the amount of space that is saved by compression to successfully compress a compression unit. If a cluster size amount of space is not saved by compression, the data in that compression unit is stored uncompressed. Each successfully compressed compression unit MUST occupy at least one cluster less than the uncompressed compression unit. This value is implementation-defined.<110>

Reserved (3 bytes):  A 24-bit reserved value. This field SHOULD be set to 0, and MUST be ignored.

This operation returns a status code as specified in section 2.2. Upon success, the status code returned by the function that processes this file information class is STATUS_SUCCESS. The most common error codes are listed in the following table.

Error code

Meaning

STATUS_INFO_LENGTH_MISMATCH

0xC0000004

The specified information record length does not match the length that is required for the specified information class.

STATUS_BUFFER_OVERFLOW

0x80000005

The data was too large to fit into the specified buffer. No data is returned.