3.3.5.1.2.1.2 Construction of Cache Bitmap (Revision 2)
The structure and fields of the Cache Bitmap (Revision 2) Secondary Drawing Order are specified in section 2.2.2.2.1.2.3. The order fields MUST be populated in accordance with this description.
The bitmaps that are cached by the Cache Bitmap (Revision 2) Secondary Drawing Order can be consumed by future MemBlt (see section 3.3.5.1.1.1.9) and Mem3Blt (see section 3.3.5.1.1.1.11) Primary Drawing Orders.
The bitmap data MUST NOT include a Compressed Data Header structure (see [MS-RDPBCGR] section 2.2.9.1.1.3.1.2.3) if the exclusion of this header was specified in the General Capability Set (see [MS-RDPBCGR] section 2.2.7.1.1).
The cache ID and cache index to use are selected by the server based on the management policies that are implemented (for example, an LRU policy might be in effect).
If a 64-bit key identifying the bitmap MUST be generated for the bitmap (dictated by the capabilities for the bitmap cache specified in the Revision 2 Bitmap Cache Capability Set as defined in [MS-RDPBCGR] section 2.2.7.1.4.2), the server MUST create a unique 64-bit identifier and include it in the Key1 and Key2 fields of the Cache Bitmap (Revision 2) Order.
If it is the first time the server is instructing the client to cache the bitmap, and a Bitmap Cache Wait List (see section 3.3.1.3) is present, the server MUST force the bitmap into the Wait List and set the CBR2_DO_NOT_CACHE (0x10) flag in the Cache Bitmap (Revision 2) Secondary Drawing Order. The cacheId field MUST be set to the ID of the bitmap cache in which the bitmap will be stored if it is encountered again, and the cacheIndex field MUST be set to BITMAPCACHE_WAITING_LIST (32767). If the bitmap is encountered again, it MUST be removed from the Wait List and sent to the client without the CBR2_DO_NOT_CACHE flag.
The Cache Bitmap (Revision 2) Order MUST NOT be sent to the client if support for bitmap caching was not specified using the Revision 2 Bitmap Cache Capability Set (see [MS-RDPBCGR] section 2.2.7.1.4.2). Furthermore, if client-side support for the MemBlt (see section 3.3.5.1.1.1.9) and Mem3Blt (see section 3.3.5.1.1.1.10) Primary Drawing Orders (specified using the Order Capability Set specified in [MS-RDPBCGR] section 2.2.7.1.3) does not exist, the Cache Bitmap (Revision 2) Order SHOULD NOT be sent to the client.