コード例 #1
0
 /// <summary>
 /// Decode this PDU from the PduMarshaler.
 /// </summary>
 /// <param name="marshaler">This is used to encode the fields of this PDU.</param>
 public override bool Decode(PduMarshaler marshaler)
 {
     bool fDecoded = base.Decode(marshaler);
     if (fDecoded)
     {
         return (this.Header.PacketType == PacketTypeValues.TSMM_PACKET_TYPE_CLIENT_NOTIFICATION || this.Header.PacketType == PacketTypeValues.TSMM_PACKET_TYPE_PRESENTATION_RESPONSE);
     }
     else
     {
         marshaler.Reset();
         throw new PDUDecodeException(this.GetType(), marshaler.ReadToEnd());
     }
 }
コード例 #2
0
 /// <summary>
 /// Decode this PDU to the PduMarshaler.
 /// </summary>
 /// <param name="marshaler">This is used to Decode the fields of this PDU.</param>
 /// <returns></returns>
 public override bool Decode(PduMarshaler marshaler)
 {
     try
     {
         base.Decode(marshaler);
         MaxNumMonitors = marshaler.ReadUInt32();
         MaxMonitorAreaFactorA = marshaler.ReadUInt32();
         MaxMonitorAreaFactorB = marshaler.ReadUInt32();
         return true;
     }
     catch
     {
         marshaler.Reset();
         throw new PDUDecodeException(this.GetType(), marshaler.ReadToEnd());
     }
 }
コード例 #3
0
 /// <summary>
 /// Encode this PDU to the PduMarshaler.
 /// </summary>
 /// <param name="marshaler">This is used to encode the fields of this PDU.</param>
 public override bool Decode(PduMarshaler marshaler)
 {
     try
     {
         base.Decode(marshaler);
         this.surfaceId = marshaler.ReadUInt16();
         pduLen += 2;
         this.width = marshaler.ReadUInt16();
         pduLen += 2;
         this.height = marshaler.ReadUInt16();
         pduLen += 2;
         this.pixFormat = (PixelFormat)(marshaler.ReadByte());
         pduLen++;
         return true;
     }
     catch
     {
         marshaler.Reset();
         throw new PDUDecodeException(this.GetType(), marshaler.ReadToEnd());
     }
 }
コード例 #4
0
 /// <summary>
 /// Decode this PDU from the PduMarshaler.
 /// </summary>
 /// <param name="marshaler">This is used to encode the fields of this PDU.</param>
 public override bool Decode(PduMarshaler marshaler)
 {
     try
     {
         this.Header.cbSize = marshaler.ReadUInt32();
         this.Header.PacketType = (PacketTypeValues)marshaler.ReadUInt32();
         this.PresentatioinId = marshaler.ReadByte();
         this.Version = (RdpevorVersionValues)marshaler.ReadByte();
         this.Flags = (TsmmVideoData_FlagsValues)marshaler.ReadByte();
         this.Reserved = marshaler.ReadByte();
         this.HnsTimestamp = marshaler.ReadUInt64();
         this.HnsDuration = marshaler.ReadUInt64();
         this.CurrentPacketIndex = marshaler.ReadUInt16();
         this.PacketsInSample = marshaler.ReadUInt16();
         this.SampleNumber = marshaler.ReadUInt32();
         this.cbSample = marshaler.ReadUInt32();
         this.pSample = marshaler.ReadBytes((int)this.cbSample);
         this.Reserved2 = marshaler.ReadByte();
         return true;
     }
     catch
     {
         marshaler.Reset();
         throw new PDUDecodeException(this.GetType(), marshaler.ReadToEnd());
     }
 }
コード例 #5
0
        /// <summary>
        /// Decode this PDU from the PduMarshaler.
        /// </summary>
        /// <param name="marshaler">This is used to encode the fields of this PDU.</param>
        public override bool Decode(PduMarshaler marshaler)
        {
            try
            {
                base.Decode(marshaler);
                this.surfaceId = marshaler.ReadUInt16();
                pduLen += 2;
                this.fillPixel.R = marshaler.ReadByte();
                this.fillPixel.G = marshaler.ReadByte();
                this.fillPixel.B = marshaler.ReadByte();
                this.fillPixel.XA = marshaler.ReadByte();
                pduLen += 4;
                this.fillRectCount = marshaler.ReadUInt16();
                pduLen += 2;

                for (int i = 0; i < this.fillRectCount; i++)
                {
                    RDPGFX_RECT16 rect;
                    rect.left = marshaler.ReadUInt16();
                    rect.top = marshaler.ReadUInt16();
                    rect.right = marshaler.ReadUInt16();
                    rect.bottom = marshaler.ReadUInt16();

                    fillRectList.Add(rect);
                    pduLen += (uint)Marshal.SizeOf(rect);
                }

                return true;
            }
            catch
            {
                marshaler.Reset();
                throw new PDUDecodeException(this.GetType(), marshaler.ReadToEnd());
            }
        }
        /// <summary>
        /// Decode this PDU from the PduMarshaler.
        /// </summary>
        /// <param name="marshaler">This is used to decode the fields of this PDU.</param>
        public override bool Decode(PduMarshaler marshaler)
        {
            try
            {
                if (!base.Decode(marshaler)) return false;

                this.magic = marshaler.ReadUInt32();
                this.version = marshaler.ReadUInt16();

                this.decodedLen += 6;
                return true;
            }
            catch
            {
                marshaler.Reset();
                throw new PDUDecodeException(this.GetType(), marshaler.ReadToEnd());
            }
        }
コード例 #7
0
 /// <summary>
 /// Decode this PDU from the PduMarshaler.
 /// </summary>
 /// <param name="marshaler">This is used to encode the fields of this PDU.</param>
 public override bool Decode(PduMarshaler marshaler)
 {
     try
     {
         this.Header.cbSize = marshaler.ReadUInt32();
         this.Header.PacketType = (PacketTypeValues)marshaler.ReadUInt32();
         this.PresentatioinId = marshaler.ReadByte();
         this.Version = (RdpevorVersionValues)marshaler.ReadByte();
         this.Command = (CommandValues)marshaler.ReadByte();
         this.FrameRate = marshaler.ReadByte();
         this.AverageBitrateKbps = marshaler.ReadUInt16();
         this.Reserved = marshaler.ReadUInt16();
         this.SourceWidth = marshaler.ReadUInt32();
         this.SourceHeight = marshaler.ReadUInt32();
         this.ScaledWidth = marshaler.ReadUInt32();
         this.ScaledHeight = marshaler.ReadUInt32();
         this.hnsTimestampOffset = marshaler.ReadUInt64();
         this.GeometryMappingId = marshaler.ReadUInt64();
         this.VideoSubtypeId = marshaler.ReadBytes(16);
         this.cbExtra = marshaler.ReadUInt32();
         this.pExtraData = marshaler.ReadBytes((int)this.cbExtra);
         this.Reserved2 = marshaler.ReadByte();
         return true;
     }
     catch
     {
         marshaler.Reset();
         throw new PDUDecodeException(this.GetType(), marshaler.ReadToEnd());
     }
 }
 /// <summary>
 /// Decode this PDU from the PduMarshaler.
 /// </summary>
 /// <param name="marshaler">This is used to decode the fields of this PDU.</param>
 public override bool Decode(PduMarshaler marshaler)
 {
     try
     {
         //if (!base.Decode(marshaler)) return false;
         return true;
     }
     catch
     {
         marshaler.Reset();
         throw new PDUDecodeException(this.GetType(), marshaler.ReadToEnd());
     }
 }
        /// <summary>
        /// Decode this PDU from the PduMarshaler.
        /// </summary>
        /// <param name="marshaler">This is used to decode the fields of this PDU.</param>
        public override bool Decode(PduMarshaler marshaler)
        {
            try
            {
                this.blockType = (RFXProgCodecBlockType) marshaler.ReadUInt16();
                this.blockLen = marshaler.ReadUInt32();

                this.decodedLen = 6;
                return true;
            }
            catch
            {
                marshaler.Reset();
                throw new PDUDecodeException(this.GetType(), marshaler.ReadToEnd());
            }
        }
コード例 #10
0
        /// <summary>
        /// Decode this PDU from the PduMarshaler.
        /// </summary>
        /// <param name="marshaler">This is used to decode the fields of this PDU.</param>
        public override bool Decode(PduMarshaler marshaler)
        {
            try
            {
                base.Decode(marshaler);
                this.surfaceId = marshaler.ReadUInt16();
                pduLen += 2;
                this.codecId = (CodecType)marshaler.ReadUInt16();
                pduLen += 2;
                this.codecContextId = marshaler.ReadUInt32();
                pduLen += 4;
                this.pixelFormat = (PixelFormat)marshaler.ReadByte();
                pduLen++;

                // Bitmap.
                this.bitmapDataLength = marshaler.ReadUInt32();
                pduLen += 4;
                this.bitmapData = marshaler.ReadBytes((int)this.bitmapDataLength);
                pduLen += this.bitmapDataLength;

                return true;
            }
            catch
            {
                marshaler.Reset();
                throw new PDUDecodeException(this.GetType(), marshaler.ReadToEnd());
            }
        }
コード例 #11
0
        public uint pduLen; // RDPEGFX command actual PDU length in bytes after successfully decode

        #endregion Fields

        #region Methods

        /// <summary>
        /// Decode this PDU to the PduMarshaler.
        /// </summary>
        /// <param name="marshaler">This is used to Decode the fields of this PDU.</param>
        public override bool Decode(PduMarshaler marshaler)
        {
            try
            {
                Header.cmdId = (PacketTypeValues)marshaler.ReadUInt16();
                Header.flags = marshaler.ReadUInt16();
                Header.pduLength = marshaler.ReadUInt32();
                pduLen = 8;   // 8 bytes common header.
                return true;
            }
            catch
            {
                marshaler.Reset();
                throw new PDUDecodeException(this.GetType(), marshaler.ReadToEnd());
            }
        }
コード例 #12
0
        /// <summary>
        /// Decode this PDU from the PduMarshaler.
        /// </summary>
        /// <param name="marshaler">This is used to decode the fields of this PDU.</param>
        public override bool Decode(PduMarshaler marshaler)
        {
            try
            {
                base.Decode(marshaler);
                this.surfaceId = marshaler.ReadUInt16();
                pduLen += 2;
                this.codecId = (CodecType)marshaler.ReadUInt16();
                pduLen += 2;
                this.pixelFormat = (PixelFormat)marshaler.ReadByte();
                pduLen ++;

                // Destination rectangle.
                this.destRect.left = marshaler.ReadUInt16();
                this.destRect.top = marshaler.ReadUInt16();
                this.destRect.right = marshaler.ReadUInt16();
                this.destRect.bottom = marshaler.ReadUInt16();
                pduLen += 8;

                // Bitmap.
                this.bitmapDataLength = marshaler.ReadUInt32();
                pduLen += 4;
                this.bitmapData = marshaler.ReadBytes((int)this.bitmapDataLength);
                pduLen += this.bitmapDataLength;

                return true;
            }
            catch
            {
                marshaler.Reset();
                throw new PDUDecodeException(this.GetType(), marshaler.ReadToEnd());
            }
        }
コード例 #13
0
 /// <summary>
 /// Decode this PDU from the PduMarshaler.
 /// </summary>
 /// <param name="marshaler">This is used to encode the fields of this PDU.</param>
 public override bool Decode(PduMarshaler marshaler)
 {
     bool fDecoded = base.Decode(marshaler);
     if (fDecoded)
     {
         return (this.Header.cmdId == PacketTypeValues.RDPGFX_CMDID_FRAMEACKNOWLEDGE ||
                 this.Header.cmdId == PacketTypeValues.RDPGFX_CMDID_CACHEIMPORTOFFER ||
                 this.Header.cmdId == PacketTypeValues.RDPGFX_CMDID_CAPSADVERTISE);
     }
     else
     {
         marshaler.Reset();
         throw new PDUDecodeException(this.GetType(), marshaler.ReadToEnd());
     }
 }
コード例 #14
0
        /// <summary>
        /// Decode this PDU from the PduMarshaler.
        /// </summary>
        /// <param name="marshaler">This is used to decode the fields of this PDU.</param>
        public override bool Decode(PduMarshaler marshaler)
        {
            try
            {
                base.Decode(marshaler);
                this.surfaceIdSrc = marshaler.ReadUInt16();
                pduLen += 2;
                this.surfaceIdDest = marshaler.ReadUInt16();
                pduLen += 2;
                this.rectSrc.left = marshaler.ReadUInt16();
                pduLen += 2;
                this.rectSrc.top = marshaler.ReadUInt16();
                pduLen += 2;
                this.rectSrc.right = marshaler.ReadUInt16();
                pduLen += 2;
                this.rectSrc.bottom = marshaler.ReadUInt16();
                pduLen += 2;
                this.destPtsCount = marshaler.ReadUInt16();
                pduLen += 2;

                for (ushort i = 0; i < this.destPtsCount; i++)
                {
                    RDPGFX_POINT16 destPoint;
                    destPoint.x = marshaler.ReadUInt16();
                    destPoint.y = marshaler.ReadUInt16();
                    destPtsList.Add(destPoint);
                    pduLen += (uint)Marshal.SizeOf(destPoint);
                }

                return true;
            }
            catch
            {
                marshaler.Reset();
                throw new PDUDecodeException(this.GetType(), marshaler.ReadToEnd());
            }
        }
コード例 #15
0
        /// <summary>
        /// Decode this PDU from the PduMarshaler.
        /// </summary>
        /// <param name="marshaler">This is used to decode the fields of this PDU.</param>
        public override bool Decode(PduMarshaler marshaler)
        {
            try
            {
                base.Decode(marshaler);
                this.surfaceId = marshaler.ReadUInt16();
                pduLen += 2;
                this.cacheKey = marshaler.ReadUInt64();
                pduLen += 8;
                this.cacheSlot = marshaler.ReadUInt16();
                pduLen += 2;
                this.rectSrc.left = marshaler.ReadUInt16();
                pduLen += 2;
                this.rectSrc.top = marshaler.ReadUInt16();
                pduLen += 2;
                this.rectSrc.right = marshaler.ReadUInt16();
                pduLen += 2;
                this.rectSrc.bottom = marshaler.ReadUInt16();
                pduLen += 2;

                return true;
            }
            catch
            {
                marshaler.Reset();
                throw new PDUDecodeException(this.GetType(), marshaler.ReadToEnd());
            }
        }
コード例 #16
0
        /// <summary>
        /// Decode this PDU from the PduMarshaler.
        /// </summary>
        /// <param name="marshaler">This is used to encode the fields of this PDU.</param>
        public override bool Decode(PduMarshaler marshaler)
        {
            try
            {
                base.Decode(marshaler);
                this.timeStamp = marshaler.ReadUInt32();
                pduLen += 4;
                this.frameId = marshaler.ReadUInt32();
                pduLen += 4;

                return true;
            }
            catch
            {
                marshaler.Reset();
                throw new PDUDecodeException(this.GetType(), marshaler.ReadToEnd());
            }
        }
        /// <summary>
        /// Decode this PDU from the PduMarshaler.
        /// </summary>
        /// <param name="marshaler">This is used to decode the fields of this PDU.</param>
        public override bool Decode(PduMarshaler marshaler)
        {
            try
            {
                if (!base.Decode(marshaler)) return false;

                this.quantIdxY = marshaler.ReadByte();
                this.quantIdxCb = marshaler.ReadByte();
                this.quantIdxCr = marshaler.ReadByte();
                this.xIdx = marshaler.ReadUInt16();
                this.yIdx = marshaler.ReadUInt16();
                this.flags = marshaler.ReadBool();
                this.decodedLen += 8;

                this.yLen = marshaler.ReadUInt16();
                this.cbLen = marshaler.ReadUInt16();
                this.crLen = marshaler.ReadUInt16();
                this.tailLen = marshaler.ReadUInt16();
                this.decodedLen += 8;

                this.yData = marshaler.ReadBytes((int)this.yLen);
                this.decodedLen += this.yLen;
                this.cbData = marshaler.ReadBytes((int)this.cbLen);
                this.decodedLen += this.cbLen;
                this.crData = marshaler.ReadBytes((int)this.crLen);
                this.decodedLen += this.crLen;
                this.tailData = marshaler.ReadBytes((int)this.tailLen);
                this.decodedLen += this.tailLen;
                return true;
            }
            catch
            {
                marshaler.Reset();
                throw new PDUDecodeException(this.GetType(), marshaler.ReadToEnd());
            }
        }
コード例 #18
0
        /// <summary>
        /// Decode this PDU from the PduMarshaler.
        /// </summary>
        /// <param name="marshaler">This is used to encode the fields of this PDU.</param>
        public override bool Decode(PduMarshaler marshaler)
        {
            bool fDecoded = base.Decode(marshaler);
            if (fDecoded)
            {
                return (this.Header.cmdId == PacketTypeValues.RDPGFX_CMDID_WIRETOSURFACE_1 ||
                        this.Header.cmdId == PacketTypeValues.RDPGFX_CMDID_WIRETOSURFACE_2 ||
                        this.Header.cmdId == PacketTypeValues.RDPGFX_CMDID_DELETEENCODINGCONTEXT ||
                        this.Header.cmdId == PacketTypeValues.RDPGFX_CMDID_SOLIDFILL ||
                        this.Header.cmdId == PacketTypeValues.RDPGFX_CMDID_SURFACETOSURFACE ||

                        this.Header.cmdId == PacketTypeValues.RDPGFX_CMDID_SURFACETOCACHE ||
                        this.Header.cmdId == PacketTypeValues.RDPGFX_CMDID_CACHETOSURFACE ||
                        this.Header.cmdId == PacketTypeValues.RDPGFX_CMDID_EVICTCACHEENTRY ||
                        this.Header.cmdId == PacketTypeValues.RDPGFX_CMDID_CREATESURFACE ||
                        this.Header.cmdId == PacketTypeValues.RDPGFX_CMDID_DELETESURFACE ||

                        this.Header.cmdId == PacketTypeValues.RDPGFX_CMDID_STARTFRAME ||
                        this.Header.cmdId == PacketTypeValues.RDPGFX_CMDID_ENDFRAME ||
                        this.Header.cmdId == PacketTypeValues.RDPGFX_CMDID_RESETGRAPHICS ||
                        this.Header.cmdId == PacketTypeValues.RDPGFX_CMDID_MAPSURFACETOOUTPUT ||
                        this.Header.cmdId == PacketTypeValues.RDPGFX_CMDID_CACHEIMPORTREPLY ||

                        this.Header.cmdId == PacketTypeValues.RDPGFX_CMDID_CAPSCONFIRM
                        );
            }
            else
            {
                marshaler.Reset();
                throw new PDUDecodeException(this.GetType(), marshaler.ReadToEnd());
            }
        }
        /// <summary>
        /// Decode this PDU from the PduMarshaler.
        /// </summary>
        /// <param name="marshaler">This is used to decode the fields of this PDU.</param>
        public override bool Decode(PduMarshaler marshaler)
        {
            try
            {
                if (!base.Decode(marshaler)) return false;

                this.quantIdxY = marshaler.ReadByte();
                this.quantIdxCb = marshaler.ReadByte();
                this.quantIdxCr = marshaler.ReadByte();
                this.xIdx = marshaler.ReadUInt16();
                this.yIdx = marshaler.ReadUInt16();
                this.progressiveQuality = marshaler.ReadByte();
                this.decodedLen += 8;

                this.ySrlLen = marshaler.ReadUInt16();
                this.yRawLen = marshaler.ReadUInt16();
                this.cbSrlLen = marshaler.ReadUInt16();
                this.cbRawLen = marshaler.ReadUInt16();
                this.crSrlLen = marshaler.ReadUInt16();
                this.crRawLen = marshaler.ReadUInt16();
                this.decodedLen += 12;

                this.ySrlData = marshaler.ReadBytes((int)this.ySrlLen);
                this.decodedLen += this.ySrlLen;
                this.yRawData = marshaler.ReadBytes((int)this.yRawLen);
                this.decodedLen += this.yRawLen;
                this.cbSrlData = marshaler.ReadBytes((int)this.cbSrlLen);
                this.decodedLen += this.cbSrlLen;
                this.cbRawData = marshaler.ReadBytes((int)this.cbRawLen);
                this.decodedLen += this.cbRawLen;
                this.crSrlData = marshaler.ReadBytes((int)this.crSrlLen);
                this.decodedLen += this.crSrlLen;
                this.crRawData = marshaler.ReadBytes((int)this.crRawLen);
                this.decodedLen += this.crRawLen;

                return true;
            }
            catch
            {
                marshaler.Reset();
                throw new PDUDecodeException(this.GetType(), marshaler.ReadToEnd());
            }
        }
コード例 #20
0
        /// <summary>
        /// Decode this PDU from the PduMarshaler.
        /// </summary>
        /// <param name="marshaler">This is used to decode the fields of this PDU.</param>
        public override bool Decode(PduMarshaler marshaler)
        {
            try
            {
                base.Decode(marshaler);
                cacheEntriesCount = marshaler.ReadUInt16();
                pduLen += 2;
                cacheEntries = new RDPGFX_CACHE_ENTRY_METADATA[cacheEntriesCount];
                totalCacheSize = 0;

                for (ushort i = 0; i < cacheEntriesCount; i++)
                {
                    cacheEntries[i].cacheKey = marshaler.ReadUInt64();
                    pduLen += 8;
                    cacheEntries[i].bitmapLength = marshaler.ReadUInt32();
                    pduLen += 4;
                    totalCacheSize += cacheEntries[i].bitmapLength;  // Calculate the summary of cache size in the request.
                }

                return true;
            }
            catch
            {
                marshaler.Reset();
                throw new PDUDecodeException(this.GetType(), marshaler.ReadToEnd());
            }
        }
        /// <summary>
        /// Decode this PDU from the PduMarshaler.
        /// </summary>
        /// <param name="marshaler">This is used to decode the fields of this PDU.</param>
        public override bool Decode(PduMarshaler marshaler)
        {
            try
            {
                if (!base.Decode(marshaler)) return false;
                this.ctxId = marshaler.ReadByte();
                this.tileSize = marshaler.ReadUInt16();
                this.flags = marshaler.ReadByte();

                this.decodedLen += 4;
                return true;
            }
            catch
            {
                marshaler.Reset();
                throw new PDUDecodeException(this.GetType(), marshaler.ReadToEnd());
            }
        }
コード例 #22
0
        /// <summary>
        /// Decode this PDU from the PduMarshaler.
        /// </summary>
        /// <param name="marshaler">This is used to decode the fields of this PDU.</param>
        public override bool Decode(PduMarshaler marshaler)
        {
            try
            {
                base.Decode(marshaler);
                this.importedEntriesCount = marshaler.ReadUInt16();
                pduLen += 2;

                for (int i = 0; i < this.importedEntriesCount; i++)
                {
                    ushort slot = marshaler.ReadUInt16();
                    cacheSlotsList.Add(slot);
                    pduLen += 2;
                }
                return true;
            }
            catch
            {
                marshaler.Reset();
                throw new PDUDecodeException(this.GetType(), marshaler.ReadToEnd());
            }
        }
        /// <summary>
        /// Decode this PDU from the PduMarshaler.
        /// </summary>
        /// <param name="marshaler">This is used to decode the fields of this PDU.</param>
        public override bool Decode(PduMarshaler marshaler)
        {
            try
            {
                if (!base.Decode(marshaler)) return false;
                this.tileSize = marshaler.ReadByte();
                this.numRects = marshaler.ReadUInt16();
                this.numQuant = marshaler.ReadByte();
                this.numProgQuant = marshaler.ReadByte();
                this.flags = marshaler.ReadByte();
                this.decodedLen += 6;

                this.numTiles = marshaler.ReadUInt16();
                this.tileDataSize = marshaler.ReadUInt32();
                this.decodedLen += 6;

                this.rects = new TS_RFX_RECT[this.numRects];
                for (int i = 0; i < this.numRects; i++)
                {
                    this.rects[i].x = marshaler.ReadUInt16();
                    this.rects[i].y = marshaler.ReadUInt16();
                    this.rects[i].width = marshaler.ReadUInt16();
                    this.rects[i].height = marshaler.ReadUInt16();

                    this.decodedLen += (uint)Marshal.SizeOf(this.rects[i]);
                }

                this.quantVals = new TS_RFX_CODEC_QUANT[this.numQuant];
                for (int i = 0; i < this.numQuant; i++)
                {
                    this.quantVals[i].LL3_LH3 = marshaler.ReadByte();
                    this.quantVals[i].HL3_HH3 = marshaler.ReadByte();
                    this.quantVals[i].LH2_HL2 = marshaler.ReadByte();
                    this.quantVals[i].HH2_LH1 = marshaler.ReadByte();
                    this.quantVals[i].HL1_HH1 = marshaler.ReadByte();

                    this.decodedLen += 5;
                }

                this.quantProgVals = new RFX_PROGRESSIVE_CODEC_QUANT[this.numProgQuant];

                for (int i = 0; i < this.numProgQuant; i++)
                {
                    int quantProgSize = Marshal.SizeOf(this.quantProgVals[i]);
                    byte[] rawData = marshaler.ReadBytes(quantProgSize);
                    GCHandle handle = GCHandle.Alloc(rawData, GCHandleType.Pinned);
                    try
                    {
                        IntPtr rawDataPtr = handle.AddrOfPinnedObject();
                        this.quantProgVals[i] = (RFX_PROGRESSIVE_CODEC_QUANT)Marshal.PtrToStructure(rawDataPtr, typeof(RFX_PROGRESSIVE_CODEC_QUANT));
                    }
                    finally
                    {
                        handle.Free();
                    }
                    this.decodedLen += (uint)quantProgSize;
                }

                return true;
            }
            catch
            {
                marshaler.Reset();
                throw new PDUDecodeException(this.GetType(), marshaler.ReadToEnd());
            }
        }
コード例 #24
0
        /// <summary>
        /// Decode this PDU from the PduMarshaler.
        /// </summary>
        /// <param name="marshaler">This is used to decode the fields of this PDU.</param>
        public override bool Decode(PduMarshaler marshaler)
        {
            try
            {
                base.Decode(marshaler);
                this.cacheSlot = marshaler.ReadUInt16();
                pduLen += 2;
                this.surfaceId = marshaler.ReadUInt16();
                pduLen += 2;
                this.destPtsCount = marshaler.ReadUInt16();
                pduLen += 2;

                for (int i = 0; i < this.destPtsCount; i++)
                {
                    RDPGFX_POINT16 destPoint;
                    destPoint.x = marshaler.ReadUInt16();
                    destPoint.y = marshaler.ReadUInt16();
                    destPtsList.Add(destPoint);

                    pduLen += 4;
                }

                return true;
            }
            catch
            {
                marshaler.Reset();
                throw new PDUDecodeException(this.GetType(), marshaler.ReadToEnd());
            }
        }
コード例 #25
0
 /// <summary>
 /// Decode this PDU to the PduMarshaler.
 /// </summary>
 /// <param name="marshaler">This is used to Decode the fields of this PDU.</param>
 public override bool Decode(PduMarshaler marshaler)
 {
     try
     {
         Header.cbSize = marshaler.ReadUInt32();
         Header.PacketType = (PacketTypeValues)marshaler.ReadUInt32();
         return true;
     }
     catch
     {
         marshaler.Reset();
         throw new PDUDecodeException(this.GetType(), marshaler.ReadToEnd());
     }
 }
コード例 #26
0
        /// <summary>
        /// Decode this PDU from the PduMarshaler.
        /// </summary>
        /// <param name="marshaler">This is used to decode the fields of this PDU.</param>
        public override bool Decode(PduMarshaler marshaler)
        {
            try
            {
                base.Decode(marshaler);
                this.surfaceId = marshaler.ReadUInt16();
                pduLen += 2;
                this.windowId = marshaler.ReadUInt64();
                pduLen += 8;
                this.mappedWidth = marshaler.ReadUInt32();
                pduLen += 4;
                this.mappedHeight = marshaler.ReadUInt32();
                pduLen += 4;

                return true;
            }
            catch
            {
                marshaler.Reset();
                throw new PDUDecodeException(this.GetType(), marshaler.ReadToEnd());
            }
        }
コード例 #27
0
 /// <summary>
 /// Decode this PDU from the PduMarshaler.
 /// </summary>
 /// <param name="marshaler">This is used to decode the fields of this PDU.</param>
 public override bool Decode(PduMarshaler marshaler)
 {
     try
     {
         this.Header.cbSize = marshaler.ReadUInt32();
         this.Header.PacketType = (PacketTypeValues)marshaler.ReadUInt32();
         this.PresentatioinId = marshaler.ReadByte();
         this.ResponseFlags = marshaler.ReadByte();
         this.ResultFlags = marshaler.ReadUInt16();
         return true;
     }
     catch
     {
         marshaler.Reset();
         throw new PDUDecodeException(this.GetType(), marshaler.ReadToEnd());
     }
 }
コード例 #28
0
        /// <summary>
        /// Decode this PDU from the PduMarshaler.
        /// </summary>
        /// <param name="marshaler">This is used to decode the fields of this PDU.</param>
        public override bool Decode(PduMarshaler marshaler)
        {
            try
            {
                base.Decode(marshaler);
                this.capsSet.version = (CapsVersions) marshaler.ReadUInt32();
                pduLen += 4;
                this.capsSet.capsDataLength = marshaler.ReadUInt32();
                pduLen += 4;

                this.capsSet.capsData = marshaler.ReadBytes((int)this.capsSet.capsDataLength);
                pduLen += this.capsSet.capsDataLength;

                return true;
            }
            catch
            {
                marshaler.Reset();
                throw new PDUDecodeException(this.GetType(), marshaler.ReadToEnd());
            }
        }
コード例 #29
0
        /// <summary>
        /// Decode this PDU from the PduMarshaler.
        /// </summary>
        /// <param name="marshaler">This is used to decode the fields of this PDU.</param>
        public override bool Decode(PduMarshaler marshaler)
        {
            try
            {
                base.Decode(marshaler);
                capsSetCount = marshaler.ReadUInt16();
                pduLen += 2;
                capsSets = new RDPGFX_CAPSET[capsSetCount];

                for (ushort i = 0; i < capsSetCount; i++)
                {
                    CapsVersions version = (CapsVersions)marshaler.ReadUInt32();
                    capsSets[i].version = version;
                    pduLen += 4;
                    capsSets[i].capsDataLength = marshaler.ReadUInt32();
                    pduLen += 4;
                    capsSets[i].capsData = new byte[capsSets[i].capsDataLength];
                    capsSets[i].capsData = marshaler.ReadBytes((int)capsSets[i].capsDataLength);
                    pduLen += capsSets[i].capsDataLength;
                }

                return true;
            }
            catch
            {
                marshaler.Reset();
                throw new PDUDecodeException(this.GetType(), marshaler.ReadToEnd());
            }
        }
コード例 #30
0
        /// <summary>
        /// Decode this PDU from the PduMarshaler.
        /// </summary>
        /// <param name="marshaler">This is used to encode the fields of this PDU.</param>
        public override bool Decode(PduMarshaler marshaler)
        {
            try
            {
                base.Decode(marshaler);
                this.width = marshaler.ReadUInt32();
                pduLen += 4;
                this.height = marshaler.ReadUInt32();
                pduLen += 4;
                this.monitorCount = marshaler.ReadUInt32();
                pduLen += 4;

                for(int i=0; i < this.monitorCount; i++ )
                {
                    TS_MONITOR_DEF monitorDef;
                    monitorDef.left = marshaler.ReadUInt32();
                    monitorDef.top = marshaler.ReadUInt32();
                    monitorDef.right = marshaler.ReadUInt32();
                    monitorDef.bottom = marshaler.ReadUInt32();
                    monitorDef.flags = (Flags_TS_MONITOR_DEF) marshaler.ReadUInt32();

                    monitorDefArray.Add(monitorDef);
                    pduLen += (uint)Marshal.SizeOf(monitorDef);
                }
                if (pduLen < Header.pduLength)
                {
                    this.pad = marshaler.ReadBytes((int)(Header.pduLength - pduLen));
                    pduLen = Header.pduLength;
                }
                return true;
            }
            catch
            {
                marshaler.Reset();
                throw new PDUDecodeException(this.GetType(), marshaler.ReadToEnd());
            }
        }