The TS_REFRESH_RECT_PDU structure contains the contents of the Refresh Rect PDU, which is a Share Data Header and two fields.
file:///C:/ts_dev/TestSuites/MS-RDPBCGR/TestSuite/Src/TD/latest_XMLS_16may/RDPBCGR/ _rfc_ms-rdpbcgr2_1_9_2_1.xml
        /// <summary>
        /// Parse TS_REFRESH_RECT_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_REFRESH_RECT_PDU</returns>
        private TS_REFRESH_RECT_PDU ParseTsRefreshRectPdu(byte[] data, ref int currentIndex)
        {
            TS_REFRESH_RECT_PDU pdu = new TS_REFRESH_RECT_PDU();
            pdu.shareDataHeader = ParseTsShareDataHeader(data, ref currentIndex);
            pdu.numberOfAreas = ParseByte(data, ref currentIndex);
            pdu.pad3Octects = GetBytes(data, ref currentIndex, 3);
            pdu.areasToRefresh = new Collection<TS_RECTANGLE16>();
            for (int i = 0; i < pdu.numberOfAreas; ++i)
            {
                pdu.areasToRefresh.Add(ParseInclusiveRect(data, ref currentIndex));
            }

            return pdu;
        }
Esempio n. 2
0
        /// <summary>
        /// Encode refreshRectPduData field.
        /// </summary>
        /// <param name="refreshRectPduData">The data to be encoded.</param>
        /// <returns>The encoded data.</returns>
        private static byte[] EncodeRefreshData(TS_REFRESH_RECT_PDU refreshRectPduData)
        {
            List<byte> refreshRectBuffer = new List<byte>();

            RdpbcgrEncoder.EncodeStructure(refreshRectBuffer, refreshRectPduData.shareDataHeader);
            RdpbcgrEncoder.EncodeStructure(refreshRectBuffer, refreshRectPduData.numberOfAreas);
            RdpbcgrEncoder.EncodeBytes(refreshRectBuffer, refreshRectPduData.pad3Octects);
            if (refreshRectPduData.areasToRefresh != null)
            {
                foreach (TS_RECTANGLE16 reshArea in refreshRectPduData.areasToRefresh)
                {
                    RdpbcgrEncoder.EncodeStructure(refreshRectBuffer, reshArea);
                }
            }

            return refreshRectBuffer.ToArray();
        }