Indicates an Orders Update (see [MS-RDPEGDI] section 2.2.2.2).
Inheritance: RdpbcgrSlowPathUpdatePdu
        /// <summary>
        /// Parse TS_UPDATE_ORDERS
        /// </summary>
        /// <param name="updateData">update data (decompressed if were compressed)</param>
        /// <param name="shareDataHeader">share data header</param>
        /// <returns>TS_UPDATE_ORDERS</returns>
        private TS_UPDATE_ORDERS ParseTsUpdateOrdersPduData(
            byte[] updateData,
            TS_SHAREDATAHEADER shareDataHeader)
        {
            // index of update data
            int index = 0;
            TS_UPDATE_ORDERS pduData = new TS_UPDATE_ORDERS();

            // TS_UPDATE_ORDERS: shareDataHeader
            pduData.shareDataHeader = shareDataHeader;

            // TS_UPDATE_ORDERS: updateType
            pduData.updateType = (updateType_Values)ParseUInt16(updateData, ref index, false);

            // TS_UPDATE_ORDERS: pad2OctetA
            pduData.pad2OctetA = ParseUInt16(updateData, ref index, false);

            // TS_UPDATE_ORDERS: numberOrders
            pduData.numberOrders = ParseUInt16(updateData, ref index, false);

            // TS_UPDATE_ORDERS: pad2OctetsB
            pduData.pad2OctetsB = ParseUInt16(updateData, ref index, false);

            // TS_UPDATE_ORDERS: orderData
            pduData.orderData = GetBytes(updateData, ref index, (updateData.Length - index));

            return pduData;
        }
Ejemplo n.º 2
0
        private byte[] EncodeOrders(TS_UPDATE_ORDERS ordersData)
        {
            List<byte> totalBuffer = new List<byte>();

            RdpbcgrEncoder.EncodeStructure(totalBuffer, ordersData.shareDataHeader);

            List<byte> buffer = new List<byte>();

            RdpbcgrEncoder.EncodeStructure(buffer, (ushort)ordersData.updateType);
            RdpbcgrEncoder.EncodeStructure(buffer, ordersData.pad2OctetA);
            RdpbcgrEncoder.EncodeStructure(buffer, ordersData.numberOrders);
            RdpbcgrEncoder.EncodeStructure(buffer, ordersData.pad2OctetsB);
            RdpbcgrEncoder.EncodeBytes(buffer, ordersData.orderData);

            if (ordersData.shareDataHeader.compressedType != compressedType_Values.None)
            {
                RdpbcgrEncoder.EncodeBytes(
                    totalBuffer, serverSessionContext.Compress(ordersData.shareDataHeader.compressedType, buffer.ToArray()));
            }
            else
            {
                RdpbcgrEncoder.EncodeBytes(totalBuffer, buffer.ToArray());
            }
            return totalBuffer.ToArray();
        }