コード例 #1
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());
            }
        }
コード例 #2
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
            {
                length = marshaler.ReadUInt16();
                interfaceNumber = marshaler.ReadByte();
                alternateSetting = marshaler.ReadByte();
                class_field = marshaler.ReadByte();
                subClass = marshaler.ReadByte();
                protocol = marshaler.ReadByte();
                padding = marshaler.ReadByte();
                interfaceHandle = marshaler.ReadUInt32();
                numberOfPipes = marshaler.ReadUInt32();

                if (numberOfPipes > 0)
                {
                    pipes = new TS_USBD_PIPE_INFORMATION_RESULT[numberOfPipes];

                    for (int i = 0; i < pipes.Length; i++)
                    {
                        pipes[i] = new TS_USBD_PIPE_INFORMATION_RESULT();
                        pipes[i].Decode(marshaler);
                    }
                }
                else
                {
                    pipes = null;
                }
            }
            catch (Exception)
            {
                return false;
            }

            return true;
        }
コード例 #3
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());
     }
 }
コード例 #4
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
     {
         maximumPacketSize = marshaler.ReadUInt16();
         padding = marshaler.ReadUInt16();
         maximumTransferSize = marshaler.ReadUInt32();
         pipeFlags = marshaler.ReadUInt32();
     }
     catch (Exception)
     {
         return false;
     }
     return true;
 }
コード例 #5
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
     {
         size = marshaler.ReadUInt16();
         padding = marshaler.ReadUInt16();
         usbdStatus = marshaler.ReadUInt32();
     }
     catch (Exception)
     {
         return false;
     }
     return true;
 }
        /// <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());
            }
        }
        /// <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());
            }
        }
コード例 #8
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());
            }
        }
コード例 #9
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());
            }
        }
コード例 #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.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());
            }
        }
コード例 #11
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());
            }
        }
コード例 #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.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());
            }
        }
コード例 #13
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());
            }
        }
コード例 #14
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.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());
            }
        }
コード例 #16
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.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());
            }
        }
コード例 #18
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());
            }
        }
        /// <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());
            }
        }
コード例 #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);
                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());
            }
        }
コード例 #21
0
        public override bool Decode(PduMarshaler marshaler)
        {
            try
            {
                fecHeader.snSourceAck = marshaler.ReadUInt32();
                fecHeader.uReceiveWindowSize = marshaler.ReadUInt16();
                fecHeader.uFlags = (RDPUDP_FLAG)marshaler.ReadUInt16();

                if (fecHeader.uFlags.HasFlag(RDPUDP_FLAG.RDPUDP_FLAG_SYN))
                {
                    RDPUDP_SYNDATA_PAYLOAD synData = new RDPUDP_SYNDATA_PAYLOAD();
                    synData.snInitialSequenceNumber = marshaler.ReadUInt32();
                    synData.uUpStreamMtu = marshaler.ReadUInt16();
                    synData.uDownStreamMtu = marshaler.ReadUInt16();
                    // This datagram MUST be zero-padded to increase the size of this datagram to 1232 bytes.

                    if (fecHeader.uFlags.HasFlag(RDPUDP_FLAG.RDPUDP_FLAG_CORRELATION_ID))
                    {
                        RDPUDP_CORRELATION_ID_PAYLOAD correlationId = new RDPUDP_CORRELATION_ID_PAYLOAD();
                        correlationId.uCorrelationId = marshaler.ReadBytes(16);
                        this.CorrelationId = correlationId;
                        correlationId.uReserved = marshaler.ReadBytes(16);
                    }

                    this.padding = marshaler.ReadToEnd();
                    this.SynData = synData;
                    return true;
                }

                if (fecHeader.uFlags.HasFlag(RDPUDP_FLAG.RDPUDP_FLAG_ACK))
                {
                    // ACK.
                    RDPUDP_ACK_VECTOR_HEADER ackVector = new RDPUDP_ACK_VECTOR_HEADER();
                    ackVector.uAckVectorSize = marshaler.ReadUInt16();
                    ackVector.AckVectorElement = new AckVector[ackVector.uAckVectorSize];

                    List<byte> ackVecElementList = new List<byte>(marshaler.ReadBytes(ackVector.AckVectorElement.Length));
                    ackVecElementList.Reverse();

                    for (int i = 0; i < ackVector.AckVectorElement.Length; i++)
                    {
                        byte vecByte = ackVecElementList[i];
                        ackVector.AckVectorElement[i].Length = (byte)(0x3F & vecByte);
                        ackVector.AckVectorElement[i].State = (VECTOR_ELEMENT_STATE)(vecByte >> 6);
                    }

                    this.ackVectorHeader = ackVector;

                    // Padding (variable): A variable-sized array, of length zero or more,
                    // such that this structure ends on a DWORD ([MS-DTYP] section 2.2.9) boundary.
                    int padLen = 4 - (2 + ackVector.AckVectorElement.Length) % 4;
                    if (padLen > 0 && padLen != 4)
                    {
                        this.padding = marshaler.ReadBytes(padLen);
                    }

                    // Ack of Acks.
                    if (fecHeader.uFlags.HasFlag(RDPUDP_FLAG.RDPUDP_FLAG_ACK_OF_ACKS))
                    {
                        RDPUDP_ACK_OF_ACKVECTOR_HEADER aoaHeader = new RDPUDP_ACK_OF_ACKVECTOR_HEADER();
                        aoaHeader.snAckOfAcksSeqNum = marshaler.ReadUInt32();
                        this.ackOfAckVector = aoaHeader;
                    }
                }

                if (fecHeader.uFlags.HasFlag(RDPUDP_FLAG.RDPUDP_FLAG_DATA))
                {
                    if (!fecHeader.uFlags.HasFlag(RDPUDP_FLAG.RDPUDP_FLAG_FEC))
                    {
                        // Source Data.
                        RDPUDP_SOURCE_PAYLOAD_HEADER srcHeader = new RDPUDP_SOURCE_PAYLOAD_HEADER();
                        srcHeader.snCoded = marshaler.ReadUInt32();
                        srcHeader.snSourceStart = marshaler.ReadUInt32();
                        this.sourceHeader = srcHeader;
                    }
                    else
                    {
                        // FEC Data.
                        RDPUDP_FEC_PAYLOAD_HEADER fecDataHeader = new RDPUDP_FEC_PAYLOAD_HEADER();
                        fecDataHeader.snCoded =  marshaler.ReadUInt32();
                        fecDataHeader.snSourceStart = marshaler.ReadUInt32();
                        fecDataHeader.uRange = marshaler.ReadByte();
                        fecDataHeader.uFecIndex = marshaler.ReadByte();
                        fecDataHeader.uPadding = marshaler.ReadUInt16();
                        this.fecPayloadHeader = fecDataHeader;
                    }

                    this.payload = marshaler.ReadToEnd();
                }

                return true;
            }
            catch
            {
                return false;
            }
        }
コード例 #22
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());
     }
 }
コード例 #23
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
     {
         maximumPacketSize = marshaler.ReadUInt16();
         endpointAddress = marshaler.ReadByte();
         interval = marshaler.ReadByte();
         pipeType = marshaler.ReadUInt32();
         pipeHandle = marshaler.ReadUInt32();
         maximumTransferSize = marshaler.ReadUInt32();
         pipeFlags = marshaler.ReadUInt32();
     }
     catch (Exception)
     {
         return false;
     }
     return true;
 }
コード例 #24
0
 public override bool Decode(PduMarshaler marshaler)
 {
     try
     {
         if (!base.Decode(marshaler))
         {
             return false;
         }
         flags = (RDPINPUT_CS_READY_Flag)marshaler.ReadUInt32();
         protocolVersion = (RDPINPUT_CS_READY_ProtocolVersion)marshaler.ReadUInt32();
         maxTouchContacts = marshaler.ReadUInt16();
         return true;
     }
     catch
     {
         return false;
     }
 }
コード例 #25
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
            {
                len = marshaler.ReadUInt16();
                numberOfPipes = marshaler.ReadUInt16();
                interfaceNumber = marshaler.ReadByte();
                alternateSetting = marshaler.ReadByte();
                padding = marshaler.ReadUInt16();
                numberOfPipes = marshaler.ReadUInt32();

                informations = new TS_USBD_PIPE_INFORMATION[numberOfPipes];
                for (int i = 0; i < numberOfPipes; i++)
                {
                    informations[i].Decode(marshaler);
                }
            }
            catch (Exception)
            {
                // TODO: All generic exceptions should be got rid of.
                return false;
            }
            return true;
        }
コード例 #26
0
 public override bool Decode(PduMarshaler marshaler)
 {
     try
     {
         header.eventId = (EventId_Values)marshaler.ReadUInt16();
         header.pduLength = marshaler.ReadUInt32();
         return true;
     }
     catch
     {
         return false;
     }
 }
コード例 #27
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;

                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());
            }
        }
コード例 #29
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());
     }
 }
コード例 #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.surfaceId = marshaler.ReadUInt16();
                pduLen += 2;
                this.reserved = marshaler.ReadUInt16();
                pduLen += 2;
                this.outputOriginX = marshaler.ReadUInt32();
                pduLen += 4;
                this.outputOriginY = marshaler.ReadUInt32();
                pduLen += 4;

                return true;
            }
            catch
            {
                marshaler.Reset();
                throw new PDUDecodeException(this.GetType(), marshaler.ReadToEnd());
            }
        }