Partager via


FSCTL_GET_COMPRESSION (Windows Embedded CE 6.0)

1/6/2010

This I/O control 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 obtain 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 that indicates the current compression state of the file or directory. The following table shows possible values.

    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, the DeviceIoControl function 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 that contains 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 decompress a file using this control code.

You can obtain 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

Header fsioctl.h
Windows Embedded CE Windows CE 5.0 and later

See Also

Reference

FS I/O Controls
CreateFile
FSCTL_SET_COMPRESSION
GetFileAttributes

Other Resources

DeviceIoControl
GetLastError