3.1.8.2.3 Decompressing Data

Decompression with RDP6.1-BC is based on the principles specified in [MS-RDPBCGR] section 3.1.8.3 with the compressed stream being decoded using the scheme described in section 2.2.2.4.1 under the control of the level-1 and level-2 compression flags. For a general description of how compression chaining works during decompression, refer to section 3.1.8.1.3.

Compression Flag

Meaning

L1_PACKET_AT_FRONT

0x04

The level-1 history buffer MUST be reinitialized (by filling it with zeros). This flag indicates that the data to be decompressed will not fit into the local level-1 history buffer at the current offset.

L1_NO_COMPRESSION

0x02

No compression was performed. The input data consists of raw literals that MUST be appended to the local level-1 history buffer.

L1_COMPRESSED

0x01

Compression with the level-1 compressor was performed. The input data MUST contain at least one match. The uncompressed data MUST be appended to the level-1 history buffer.

L1_INNER_COMPRESSION

0x10

Indicates that additional level-2 compression (using RDP 5.0 bulk compression) has been performed on the level-1 compressor output. If the L1_INNER_COMPRESSION flag is set, the data following the Level2ComprFlags field in the RDP 6.1 Compressed Data structure (see sections 2.2.2.4.1 and 2.2.2.5.1) MUST first be passed to the chained level-2 RDP 5.0 bulk decompressor. The level-2 decompression MUST be controlled by the contents of the Level2ComprFlags field. After this decompression phase the output MUST then be processed by the RDP6.1-BC decompressor using the Level1ComprFlags field to control the decompression.

The following flowchart describes how the RDP6.1-BC decompression algorithm operates.

The RDP 6.1 bulk decompression algorithm

Figure 13: The RDP 6.1 bulk decompression algorithm