3.3.5.1.1.1.9 Construction of MemBlt

The structure and fields of the MemBlt Primary Drawing Order are specified in section 2.2.2.2.1.1.2.9. The order fields MUST be populated in accordance with this description and the instructions detailed in section 3.3.5.1.1.1.

The source bitmap associated with the MemBlt Order MUST originate from one of three possible locations:

  1. One of the bitmap caches (section 3.1.1.1.1)

  2. The Offscreen Bitmap Cache (section 3.1.1.1.5)

  3. The Bitmap Cache Wait List (section 3.3.1.3)

If the source bitmap associated with the MemBlt Order refers to an item in one of the bitmap caches, the actual bitmap data MUST be sent to the client before this order is dispatched by using a Cache Bitmap Secondary Drawing Order (sections 3.3.5.1.2.1.1, 3.3.5.1.2.1.2, and 3.3.5.1.2.1.7).

If the source bitmap associated with the MemBlt Order refers to an item in the Offscreen Bitmap Cache, the actual entry MUST be created and initialized using the Create Offscreen Bitmap (section 3.3.5.1.3.1.1) and Switch Surface (section 3.3.5.1.3.1.2) Alternate Secondary Drawing Orders; the Create Offscreen Bitmap Order creates the offscreen bitmap while the Switch Surface Order is used to redirect all drawing operations to the offscreen bitmap. The cacheIndex field of the MemBlt Order MUST be set to the index of the Offscreen Bitmap Cache entry, and the bitmap cache ID (specified as part of the cacheId field) MUST be set to TS_BITMAPCACHE_SCREEN_ID (0xFF).

If the source bitmap associated with the MemBlt Order refers to a bitmap in the Bitmap Cache Wait List, the actual bitmap data MUST be sent to the client before this order is dispatched by using a Cache Bitmap (Revision 2) Secondary Drawing Order with the CBR2_DO_NOT_CACHE (0x10) flag set (section 3.3.5.1.2.1.2), or a Cache Bitmap (Revision 3) Secondary Drawing Order with the CBR3_DO_NOT_CACHE (0x10) flag set (section 3.3.5.1.2.1.7). The cacheIndex field of the MemBlt Order MUST be set to BITMAPCACHE_WAITING_LIST_INDEX (32767), and the bitmap cache ID (specified as part of the cacheId field) MUST be set to the ID of the bitmap cache in which the bitmap will be stored when it is cached.

If palettized color is being used, the color table specified in the MemBlt Order MUST be sent to the client before this order is dispatched by using a Cache Color Table Secondary Drawing Order (section 3.3.5.1.2.1.3). This step ensures that the client is able to render the cached bitmap correctly. Support for a Color Table Cache (section 3.1.1.1.3) is implied by support for the MemBlt Order.

The MemBlt Order MUST NOT be sent to the client if support for it was not specified in the Order Capability Set ([MS-RDPBCGR] section 2.2.7.1.3).