File Compression (Windows Embedded CE 6.0)


Although Windows Embedded CE automatically allocates 10 KB of RAM for decompression support, the base configuration excludes compression. However, technologies added to the base configuration often add the compression catalog item as a dependency, and an OEM can choose to include compression in an OS design.

If the compression catalog item is part of the OS design, the configuration option COMPRESSION can be set to ON or OFF in Config.bib. By default, COMPRESSION is set to OFF.

If COMPRESSSION is set to ON and the compression catalog item is not added, the files in the ROM file system are unreadable.

Compression in the Run-time Image

By default, Romimage.exe compresses all writable sections of a run-time image to reduce the run-time image size. When the module is loaded from ROM or flash memory, the writable sections are decompressed into RAM. If the COMPRESSION option is set to OFF, compression is turned off for the whole binary image builder (BIB) file. For more information, see Binary Image Builder File.

Determining File or Directory Compression Attributes

On some file systems, each file and directory has a compression attribute. Installable file systems may also use FSCTL_SET_COMPRESSION and FSCTL_GET_COMPRESSION to implement a compression attribute for individual files and directories.

Use the GetFileAttributes or the GetFileAttributesEx function to determine the compression attribute of a file or directory.

If a file's compression attribute is set to FILE_ATTRIBUTE_COMPRESSED, all data in the file is compressed. If the attribute is not set, none of the data in the file is compressed. There is no partially compressed state.

A directory's compression attribute provides a default compression attribute for newly created files and subdirectories. When you call the CreateFile or the CreateDirectory function to create a new file or directory, the new file or directory inherits the compression attribute of its parent directory.

See Also




File System Operations

Other Resources