18.104.22.168 Processing an RDPGFX_WIRE_TO_SURFACE_PDU_1 message
The structure and fields of the RDPGFX_WIRE_TO_SURFACE_PDU_1 message are specified in section 22.214.171.124. The header field MUST be processed as specified in section 126.96.36.199. The surfaceId field MUST identify a valid offscreen surface in the Offscreen Surface (section 188.8.131.52) 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). Once the data in the bitmapData field has been decoded as specified by the encoding type enumerated in the codecId field, the bitmap MUST be copied to the target surface.
If the encoding type enumerated in the codecId field is not RDPGFX_CODECID_ALPHA (0x000C):
If the target surface is listed in the Surface to Window Mapping (section 184.108.40.206) ADM element, then the alpha channel of the bitmap (if present) MUST be ignored when copying to the target surface, while the red, green, and blue channels MUST all be copied to the target surface without modification.
If the target surface is not listed in the Surface to Window Mapping ADM element, then only the red, green, and blue channels SHOULD be copied to the target surface.
If the encoding type enumerated in the codecId field is RDPGFX_CODECID_ALPHA:
Only the alpha channel of the target surface MUST be updated with the contents of the source bitmap (the red, green, and blue channels of the target surface MUST NOT be changed).