FSCTL_GET_COMPRESSION (Windows CE 5.0)
This IOCTL retrieves the current compression state of a file or directory on a volume whose file system supports per-stream compression.
Parameters
- hDevice
[in] Handle to the file, alternate stream, or directory whose state of compression is to be retrieved. To retrieve a handle, call the CreateFile function. - dwIoControlCode
[in] Set to FSCTL_GET_COMPRESSION. - lpInBuf
Not used. Set to NULL. - nInBufSize
Not used. Set to zero. - lpOutBuf
[out] Pointer to a buffer that receives a USHORT value indicating the current compression state of the file or directory. The following table shows the possible values for lpOutBuf.Value Description COMPRESSION_FORMAT_NONE The file or directory is not compressed. COMPRESSION_FORMAT_LZNT1 The file or directory is compressed, using the LZNT1 compression format. - nOutBufSize
[in] Size of the output buffer, in bytes. The buffer must be large enough to contain one USHORT value. - lpBytesReturned
[out] Pointer to a variable that receives the size of the data stored in the output buffer, in bytes. - lpOverlapped
Not used.
Return Values
If the operation succeeds, DeviceIoControl returns a nonzero value.
If the operation fails, DeviceIoControl returns zero. For extended error information, call GetLastError.
Remarks
If the file system of the volume containing the specified file or directory does not support per-file or per-directory compression, the operation fails.
You can set the compression state of a file or directory by using the FSCTL_SET_COMPRESSION control code. You can also compress or uncompress a file using this control code.
You can retrieve the compression attribute of a file or directory by calling the GetFileAttributes function. The compression attribute indicates whether a file or directory is compressed. The compression state indicates whether a file or directory is compressed, and if it is, the format of the compressed data.
Requirements
OS Versions: Windows CE 5.0 and later.
Header: Fsioctl.h
See Also
FSD IOCTLs | CreateFile | DeviceIoControl | GetLastError | FSCTL_SET_COMPRESSION | GetFileAttributes
Send Feedback on this topic to the authors