3.3.5.2 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 2.2.2.2. The header field MUST be processed as specified in section 3.1.5.1. The surfaceId field MUST identify a valid offscreen surface in the Offscreen Surface (section 3.3.1.6) 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 3.3.1.1) 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 2.2.2.2.1.1.1.7) 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 2.2.4.2.1) of an RFX_PROGRESSIVE_BITMAP_STREAM (section 2.2.4.2) is WBT_TILE_PROGRESSIVE_UPGRADE (0xCCC7), then the codecContextId field in the Codec Contexts (section 3.3.1.1) ADM element MUST be known.