The TS_BITMAPCACHE_PERSISTENT_LIST_PDU structure contains a list of cached bitmap keys saved from Cache Bitmap (Revision 2) Orders (see [MS-RDPEGDI] section 2.2.2.3.1.2.3) which were sent in previous sessions. By including a key in the Persistent Key List PDU Data the client indicates to the server that it has a local copy of the bitmap associated with the key, which implies that the server does not need to retransmit the bitmap to the client (for more details about the Persistent Bitmap Cache, see [MS-RDPEGDI] section 3.1.1.1.1). The bitmap keys can be sent in more than one Persistent Key List PDU, with each PDU being marked using flags in the bBitMask field.
file:///C:/ts_dev/TestSuites/MS-RDPBCGR/TestSuite/Src/TD/latest_XMLS_16may/RDPBCGR/ _rfc_ms-rdpbcgr2_1_1_17_1.xml
        /// <summary>
        /// Parse TS_BITMAPCACHE_PERSISTENT_LIST_PDU
        /// (parser index is updated according to parsed length)
        /// </summary>
        /// <param name="data">data to be parsed</param>
        /// <param name="currentIndex">current parser index</param>
        /// <returns>TS_BITMAPCACHE_PERSISTENT_LIST_PDU</returns>
        private TS_BITMAPCACHE_PERSISTENT_LIST_PDU ParseTsPersistentListPdu(byte[] data, ref int currentIndex)
        {
            TS_BITMAPCACHE_PERSISTENT_LIST_PDU pdu = new TS_BITMAPCACHE_PERSISTENT_LIST_PDU();

            // TS_CONTROL_PDU: shareDataHeader
            pdu.shareDataHeader = ParseTsShareDataHeader(data, ref currentIndex);

            pdu.numEntriesCache0 = ParseUInt16(data, ref currentIndex, false);
            pdu.numEntriesCache1 = ParseUInt16(data, ref currentIndex, false);
            pdu.numEntriesCache2 = ParseUInt16(data, ref currentIndex, false);
            pdu.numEntriesCache3 = ParseUInt16(data, ref currentIndex, false);
            pdu.numEntriesCache4 = ParseUInt16(data, ref currentIndex, false);
            pdu.totalEntriesCache0 = ParseUInt16(data, ref currentIndex, false);
            pdu.totalEntriesCache1 = ParseUInt16(data, ref currentIndex, false);
            pdu.totalEntriesCache2 = ParseUInt16(data, ref currentIndex, false);
            pdu.totalEntriesCache3 = ParseUInt16(data, ref currentIndex, false);
            pdu.totalEntriesCache4 = ParseUInt16(data, ref currentIndex, false);
            pdu.bBitMask = (bBitMask_Values)ParseByte(data, ref currentIndex);
            pdu.Pad2 = ParseByte(data, ref currentIndex);
            pdu.Pad3 = ParseUInt16(data, ref currentIndex, false);
            pdu.entries = new List<TS_BITMAPCACHE_PERSISTENT_LIST_ENTRY>();
            while (currentIndex < data.Length)
            {
                pdu.entries.Add(ParseEntry(data, ref currentIndex));
            }

            return pdu;
        }
Exemplo n.º 2
0
        /// <summary>
        /// Encode controlPduData field.
        /// </summary>
        /// <param name="persistentKeyListPduData">The data to be encoded.</param>
        /// <returns>The encoded data.</returns>
        private static byte[] EncodePersistentKeyListData(TS_BITMAPCACHE_PERSISTENT_LIST_PDU persistentKeyListPduData)
        {
            List<byte> dataBuffer = new List<byte>();

            if (persistentKeyListPduData != null)
            {
                RdpbcgrEncoder.EncodeStructure(dataBuffer, persistentKeyListPduData.shareDataHeader);
                RdpbcgrEncoder.EncodeStructure(dataBuffer, persistentKeyListPduData.numEntriesCache0);
                RdpbcgrEncoder.EncodeStructure(dataBuffer, persistentKeyListPduData.numEntriesCache1);
                RdpbcgrEncoder.EncodeStructure(dataBuffer, persistentKeyListPduData.numEntriesCache2);
                RdpbcgrEncoder.EncodeStructure(dataBuffer, persistentKeyListPduData.numEntriesCache3);
                RdpbcgrEncoder.EncodeStructure(dataBuffer, persistentKeyListPduData.numEntriesCache4);
                RdpbcgrEncoder.EncodeStructure(dataBuffer, persistentKeyListPduData.totalEntriesCache0);
                RdpbcgrEncoder.EncodeStructure(dataBuffer, persistentKeyListPduData.totalEntriesCache1);
                RdpbcgrEncoder.EncodeStructure(dataBuffer, persistentKeyListPduData.totalEntriesCache2);
                RdpbcgrEncoder.EncodeStructure(dataBuffer, persistentKeyListPduData.totalEntriesCache3);
                RdpbcgrEncoder.EncodeStructure(dataBuffer, persistentKeyListPduData.totalEntriesCache4);
                RdpbcgrEncoder.EncodeStructure(dataBuffer, (byte)persistentKeyListPduData.bBitMask);
                RdpbcgrEncoder.EncodeStructure(dataBuffer, persistentKeyListPduData.Pad2);
                RdpbcgrEncoder.EncodeStructure(dataBuffer, persistentKeyListPduData.Pad3);
                foreach (TS_BITMAPCACHE_PERSISTENT_LIST_ENTRY entry in persistentKeyListPduData.entries)
                {
                    RdpbcgrEncoder.EncodeStructure(dataBuffer, entry);
                }
            }

            return dataBuffer.ToArray();
        }