Processing an RDPGFX_WIRE_TO_SURFACE_PDU_2 message

The structure and fields of the RDPGFX_WIRE_TO_SURFACE_PDU_2 message are specified in section The header field MUST be processed as specified in section The surfaceId field MUST identify a valid offscreen surface in the Offscreen Surface (section ADM element, and the size of the bitmap data specified in the bitmapDataLength field MUST be consistent with the amount of data read from the "Microsoft::Windows::RDS::Graphics" dynamic virtual channel (section 2.1). If there is no codec context identified by the codecContextId field in the Codec Contexts (section ADM element, the client MUST create a new context, place it into the Codec Contexts ADM element, and begin the process of progressively rendering a bitmap from the data in the bitmapData field, as specified by the encoding type enumerated value in the codecId field, using the context to store intermediate state. The bitmap SHOULD be copied to the target surface using a SRCCOPY ROP3 operation ([MS-RDPEGDI] section once enough data has been decoded to render a discernible image and SHOULD then continue to be updated as subsequent RDPGFX_WIRE_TO_SURFACE_PDU_2 messages are processed. Note that if the type (specified in the blockType field) of the current RFX_PROGRESSIVE_DATABLOCK structure (section of an RFX_PROGRESSIVE_BITMAP_STREAM (section is WBT_TILE_PROGRESSIVE_UPGRADE (0xCCC7), then the codecContextId field in the Codec Contexts (section ADM element MUST be known.