コード例 #1
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 void Encode(PduMarshaler marshaler)
 {
     base.Encode(marshaler);
     marshaler.WriteUInt16(this.surfaceId);
     marshaler.WriteUInt64(this.cacheKey);
     marshaler.WriteUInt16(this.cacheSlot);
     marshaler.WriteUInt16(this.rectSrc.left);
     marshaler.WriteUInt16(this.rectSrc.top);
     marshaler.WriteUInt16(this.rectSrc.right);
     marshaler.WriteUInt16(this.rectSrc.bottom);
 }
コード例 #2
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 void Encode(PduMarshaler marshaler)
 {
     marshaler.WriteUInt32(this.Header.cbSize);
     marshaler.WriteUInt32((uint)this.Header.PacketType);
     marshaler.WriteByte(this.PresentatioinId);
     marshaler.WriteByte((byte)this.NotificationType);
     marshaler.WriteUInt16(this.Reserved);
     marshaler.WriteUInt32(this.cbData);
     marshaler.WriteBytes(this.pData);
 }
コード例 #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 void Encode(PduMarshaler marshaler)
 {
     marshaler.WriteUInt32(this.Header.cbSize);
     marshaler.WriteUInt32((uint)this.Header.PacketType);
     marshaler.WriteByte(this.PresentatioinId);
     marshaler.WriteByte(this.ResponseFlags);
     marshaler.WriteUInt16(this.ResultFlags);
 }
コード例 #4
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 void Encode(PduMarshaler marshaler)
 {
     marshaler.WriteUInt16(maximumPacketSize);
     marshaler.WriteUInt16(padding);
     marshaler.WriteUInt32(maximumTransferSize);
     marshaler.WriteUInt32(pipeFlags);
 }
コード例 #5
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 void Encode(PduMarshaler marshaler)
 {
     marshaler.WriteUInt16(size);
     marshaler.WriteUInt16(padding);
     marshaler.WriteUInt32(usbdStatus);
 }
        /// <summary>
        /// Encode this PDU to the PduMarshaler.
        /// </summary>
        /// <param name="marshaler">This is used to encode the fields of this PDU.</param>
        public override void Encode(PduMarshaler marshaler)
        {
            base.Encode(marshaler);

            marshaler.WriteByte(this.tileSize);
            marshaler.WriteUInt16(this.numRects);
            marshaler.WriteByte(this.numQuant);
            marshaler.WriteByte(this.numProgQuant);
            marshaler.WriteByte(this.flags);
            marshaler.WriteUInt16(this.numTiles);
            marshaler.WriteUInt32(this.tileDataSize);

            // Encode rects, in normal case, it can't be NULL
            if (rects != null)
            {
                for (int i = 0; i < rects.Count(); i++)
                {
                    byte[] arr = Convert2Bytes(rects[i]);
                    marshaler.WriteBytes(arr);
                }
            }

            // Encode quantVals, in normal case, it can't be NULL
            if (quantVals != null)
            {
                for (int i = 0; i < quantVals.Count(); i++)
                {
                    byte[] arr = Convert2Bytes(quantVals[i]);
                    marshaler.WriteBytes(arr);
                }
            }

            if (quantProgVals != null)   // progressive encoding enabled
            {
                for (int i = 0; i < quantProgVals.Count(); i++)
                {
                    byte[] arr;
                    marshaler.WriteByte(quantProgVals[i].quality);

                    arr = Convert2Bytes(quantProgVals[i].yQuantValues);
                    marshaler.WriteBytes(arr);

                    arr = Convert2Bytes(quantProgVals[i].cbQuantValues);
                    marshaler.WriteBytes(arr);

                    arr = Convert2Bytes(quantProgVals[i].crQuantValues);
                    marshaler.WriteBytes(arr);
                }
            }
        }
コード例 #7
0
        public override void Encode(PduMarshaler marshaler)
        {
            marshaler.WriteUInt32(fecHeader.snSourceAck);
            marshaler.WriteUInt16(fecHeader.uReceiveWindowSize);
            marshaler.WriteUInt16((ushort)fecHeader.uFlags);

            if (SynData.HasValue)
            {
                marshaler.WriteUInt32(SynData.Value.snInitialSequenceNumber);
                marshaler.WriteUInt16(SynData.Value.uUpStreamMtu);
                marshaler.WriteUInt16(SynData.Value.uDownStreamMtu);
                // This datagram MUST be zero-padded to increase the size of this datagram to 1232 bytes.
                int length = 16;
                if (CorrelationId.HasValue)
                {
                    marshaler.WriteBytes(CorrelationId.Value.uCorrelationId);
                    length += 16;
                    marshaler.WriteBytes(CorrelationId.Value.uReserved);
                    length += 16;
                }

                byte[] padBytes = new byte[1232 - length];
                marshaler.WriteBytes(padBytes);
                return;
            }

            if (ackVectorHeader.HasValue)
            {
                // ACK
                marshaler.WriteUInt16(ackVectorHeader.Value.uAckVectorSize);
                if (ackVectorHeader.Value.AckVectorElement != null)
                {
                    List<byte> ackVecElementList = new List<byte>();
                    foreach (AckVector vec in ackVectorHeader.Value.AckVectorElement)
                    {
                        byte vecByte = 0;
                        vecByte |= vec.Length;
                        byte state = (byte)vec.State;
                        vecByte |= (byte)(state << 6);
                        ackVecElementList.Add(vecByte);
                    }
                    ackVecElementList.Reverse();
                    marshaler.WriteBytes(ackVecElementList.ToArray());
                }

                // 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 + ackVectorHeader.Value.uAckVectorSize) % 4;

                if (padLen > 0 && padLen != 4)
                {
                    byte[] padding = new byte[padLen];
                    marshaler.WriteBytes(padding);
                }

                // Ack of Acks.
                if (ackOfAckVector.HasValue)
                {
                    marshaler.WriteUInt32(ackOfAckVector.Value.snAckOfAcksSeqNum);
                }
            }

            if (sourceHeader.HasValue || fecPayloadHeader.HasValue)
            {
                if (sourceHeader.HasValue)
                {
                    // Source Data.
                    marshaler.WriteUInt32(sourceHeader.Value.snCoded);
                    marshaler.WriteUInt32(sourceHeader.Value.snSourceStart);
                }
                else
                {
                    // FEC Data.
                    marshaler.WriteUInt32(fecPayloadHeader.Value.snCoded);
                    marshaler.WriteUInt32(fecPayloadHeader.Value.snSourceStart);
                    marshaler.WriteByte(fecPayloadHeader.Value.uRange);
                    marshaler.WriteByte(fecPayloadHeader.Value.uFecIndex);
                    marshaler.WriteUInt16(fecPayloadHeader.Value.uPadding);
                }

                if (payload != null)
                {
                    marshaler.WriteBytes(payload);
                }
            }
        }
コード例 #8
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 void Encode(PduMarshaler marshaler)
        {
            base.Encode(marshaler);
            marshaler.WriteUInt16(this.importedEntriesCount);

            foreach (ushort slot in cacheSlotsList)
            {
                marshaler.WriteUInt16(slot);
            }
        }
コード例 #9
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 void Encode(PduMarshaler marshaler)
        {
            base.Encode(marshaler);
            marshaler.WriteUInt16(this.cacheSlot);
            marshaler.WriteUInt16(this.surfaceId);
            marshaler.WriteUInt16(this.destPtsCount);

            foreach (RDPGFX_POINT16 destPoint in destPtsList)
            {
                marshaler.WriteUInt16(destPoint.x);
                marshaler.WriteUInt16(destPoint.y);
            }
        }
コード例 #10
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 void Encode(PduMarshaler marshaler)
 {
     marshaler.WriteUInt16((ushort)Header.cmdId);
     marshaler.WriteUInt16(Header.flags);
     marshaler.WriteUInt32(Header.pduLength);
 }
コード例 #11
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 void Encode(PduMarshaler marshaler)
 {
     base.Encode(marshaler);
     marshaler.WriteUInt16(this.cacheEntriesCount);
     for (ushort i = 0; i < cacheEntriesCount; i++)
     {
         marshaler.WriteUInt64(cacheEntries[i].cacheKey);
         marshaler.WriteUInt64(cacheEntries[i].bitmapLength);
     }
 }
コード例 #12
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 void Encode(PduMarshaler marshaler)
        {
            base.Encode(marshaler);
            marshaler.WriteUInt16(this.surfaceId);
            marshaler.WriteUInt16((ushort)this.codecId);
            marshaler.WriteUInt32(this.codecContextId);
            marshaler.WriteByte((byte)this.pixelFormat);

            // Bitmap.
            marshaler.WriteUInt32(this.bitmapDataLength);
            marshaler.WriteBytes(this.bitmapData);
        }
コード例 #13
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 void Encode(PduMarshaler marshaler)
        {
            base.Encode(marshaler);
            marshaler.WriteUInt16(this.surfaceId);
            marshaler.WriteUInt16((ushort)this.codecId);
            marshaler.WriteByte((byte)this.pixelFormat);

            // Destination rectangle.
            marshaler.WriteUInt16(this.destRect.left);
            marshaler.WriteUInt16(this.destRect.top);
            marshaler.WriteUInt16(this.destRect.right);
            marshaler.WriteUInt16(this.destRect.bottom);

            // Bitmap.
            marshaler.WriteUInt32(this.bitmapDataLength);
            marshaler.WriteBytes(this.bitmapData);
        }
コード例 #14
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 void Encode(PduMarshaler marshaler)
        {
            base.Encode(marshaler);
            marshaler.WriteUInt16(this.surfaceIdSrc);
            marshaler.WriteUInt16(this.surfaceIdDest);
            marshaler.WriteUInt16(this.rectSrc.left);
            marshaler.WriteUInt16(this.rectSrc.top);
            marshaler.WriteUInt16(this.rectSrc.right);
            marshaler.WriteUInt16(this.rectSrc.bottom);
            marshaler.WriteUInt16(this.destPtsCount);

            foreach (RDPGFX_POINT16 destPoint in destPtsList)
            {
                marshaler.WriteUInt16(destPoint.x);
                marshaler.WriteUInt16(destPoint.y);
            }
        }
 /// <summary>
 /// Encode this PDU to the PduMarshaler.
 /// </summary>
 /// <param name="marshaler">This is used to encode the fields of this PDU.</param>
 public override void Encode(PduMarshaler marshaler)
 {
     marshaler.WriteUInt16((ushort)blockType);
     marshaler.WriteUInt32(blockLen);
 }
コード例 #16
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 void Encode(PduMarshaler marshaler)
        {
            base.Encode(marshaler);
            marshaler.WriteUInt16(this.capsSetCount);

            for (int i = 0; i < this.capsSetCount; i++ )
            {
                marshaler.WriteUInt32((uint)capsSets[i].version);
                marshaler.WriteUInt32(capsSets[i].capsDataLength);
                marshaler.WriteBytes(capsSets[i].capsData);
            }
        }
 /// <summary>
 /// Encode this PDU to the PduMarshaler.
 /// </summary>
 /// <param name="marshaler">This is used to encode the fields of this PDU.</param>
 public override void Encode(PduMarshaler marshaler)
 {
     base.Encode(marshaler);
     marshaler.WriteUInt32(this.frameIndex);
     marshaler.WriteUInt16(this.regionCount);
 }
コード例 #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 void Encode(PduMarshaler marshaler)
 {
     base.Encode(marshaler);
     marshaler.WriteUInt16(this.surfaceId);
     marshaler.WriteUInt16(this.width);
     marshaler.WriteUInt16(this.height);
     marshaler.WriteByte((byte)this.pixFormat);
 }
 /// <summary>
 /// Encode this PDU to the PduMarshaler.
 /// </summary>
 /// <param name="marshaler">This is used to encode the fields of this PDU.</param>
 public override void Encode(PduMarshaler marshaler)
 {
     base.Encode(marshaler);
     marshaler.WriteUInt32(this.magic);
     marshaler.WriteUInt16(this.version);
 }
コード例 #20
0
 public override void Encode(PduMarshaler marshaler)
 {
     base.Encode(marshaler);
     marshaler.WriteUInt32((uint)flags);
     marshaler.WriteUInt32((uint)protocolVersion);
     marshaler.WriteUInt16(maxTouchContacts);
 }
コード例 #21
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 void Encode(PduMarshaler marshaler)
        {
            marshaler.WriteUInt16(length);
            marshaler.WriteByte(interfaceNumber);
            marshaler.WriteByte(alternateSetting);
            marshaler.WriteByte(class_field);
            marshaler.WriteByte(subClass);
            marshaler.WriteByte(protocol);
            marshaler.WriteByte(padding);
            marshaler.WriteUInt32(interfaceHandle);
            marshaler.WriteUInt32(numberOfPipes);

            if (null != pipes)
            {
                for (int i = 0; i < pipes.Length; i++)
                {
                    pipes[i].Encode(marshaler);
                }
            }
        }
コード例 #22
0
 public override void Encode(PduMarshaler marshaler)
 {
     marshaler.WriteUInt16((ushort)header.eventId);
     marshaler.WriteUInt32(header.pduLength);
 }
コード例 #23
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 void Encode(PduMarshaler marshaler)
 {
     marshaler.WriteUInt16(maximumPacketSize);
     marshaler.WriteByte(endpointAddress);
     marshaler.WriteByte(interval);
     marshaler.WriteUInt32(pipeType);
     marshaler.WriteUInt32(pipeHandle);
     marshaler.WriteUInt32(maximumTransferSize);
     marshaler.WriteUInt32(pipeFlags);
 }
        /// <summary>
        /// Encode this PDU to the PduMarshaler.
        /// </summary>
        /// <param name="marshaler">This is used to encode the fields of this PDU.</param>
        public override void Encode(PduMarshaler marshaler)
        {
            base.Encode(marshaler);
            marshaler.WriteByte(this.quantIdxY);
            marshaler.WriteByte(this.quantIdxCb);
            marshaler.WriteByte(this.quantIdxCr);
            marshaler.WriteUInt16(this.xIdx);
            marshaler.WriteUInt16(this.yIdx);
            marshaler.WriteBool(this.flags);

            marshaler.WriteUInt16(this.yLen);
            marshaler.WriteUInt16(this.cbLen);
            marshaler.WriteUInt16(this.crLen);
            marshaler.WriteUInt16(this.tailLen);

            if (this.yData != null)
                marshaler.WriteBytes(this.yData);
            if (this.cbData != null)
                marshaler.WriteBytes(this.cbData);
            if (this.crData != null)
                marshaler.WriteBytes(this.crData);
            if (this.tailData != null)
                marshaler.WriteBytes(this.tailData);
        }
コード例 #25
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 void Encode(PduMarshaler marshaler)
        {
            marshaler.WriteUInt16(len);
            marshaler.WriteUInt16(numberOfPipesExpected);
            marshaler.WriteByte(interfaceNumber);
            marshaler.WriteByte(alternateSetting);
            marshaler.WriteUInt16(padding);
            marshaler.WriteUInt32(numberOfPipes);

            for (int i = 0; i < informations.Length; i++)
            {
                informations[i].Encode(marshaler);
            }
        }
        /// <summary>
        /// Encode this PDU to the PduMarshaler.
        /// </summary>
        /// <param name="marshaler">This is used to encode the fields of this PDU.</param>
        public override void Encode(PduMarshaler marshaler)
        {
            base.Encode(marshaler);
            marshaler.WriteByte(this.quantIdxY);
            marshaler.WriteByte(this.quantIdxCb);
            marshaler.WriteByte(this.quantIdxCr);
            marshaler.WriteUInt16(this.xIdx);
            marshaler.WriteUInt16(this.yIdx);
            marshaler.WriteByte(this.progressiveQuality);

            marshaler.WriteUInt16(this.ySrlLen);
            marshaler.WriteUInt16(this.yRawLen);
            marshaler.WriteUInt16(this.cbSrlLen);
            marshaler.WriteUInt16(this.cbRawLen);
            marshaler.WriteUInt16(this.crSrlLen);
            marshaler.WriteUInt16(this.crRawLen);

            if (this.ySrlData != null)
                marshaler.WriteBytes(this.ySrlData);
            if (this.yRawData != null)
                marshaler.WriteBytes(this.yRawData);
            if (this.cbSrlData != null)
                marshaler.WriteBytes(this.cbSrlData);
            if (this.cbRawData != null)
                marshaler.WriteBytes(this.cbRawData);
            if (this.crSrlData != null)
                marshaler.WriteBytes(this.crSrlData);
            if (this.crRawData != null)
                marshaler.WriteBytes(this.crRawData);
        }
コード例 #27
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 void Encode(PduMarshaler marshaler)
 {
     marshaler.WriteUInt32(this.Header.cbSize);
     marshaler.WriteUInt32((uint)this.Header.PacketType);
     marshaler.WriteByte(this.PresentatioinId);
     marshaler.WriteByte((byte)this.Version);
     marshaler.WriteByte((byte)this.Command);
     marshaler.WriteByte(this.FrameRate);
     marshaler.WriteUInt16(this.AverageBitrateKbps);
     marshaler.WriteUInt16(this.Reserved);
     marshaler.WriteUInt32(this.SourceWidth);
     marshaler.WriteUInt32(this.SourceHeight);
     marshaler.WriteUInt32(this.ScaledWidth);
     marshaler.WriteUInt32(this.ScaledHeight);
     marshaler.WriteUInt64(this.hnsTimestampOffset);
     marshaler.WriteUInt64(this.GeometryMappingId);
     marshaler.WriteBytes(this.VideoSubtypeId, 0, 16);
     marshaler.WriteUInt32(this.cbExtra);
     if (this.pExtraData != null)
     {
         marshaler.WriteBytes(this.pExtraData);
     }
     marshaler.WriteByte(this.Reserved2);
 }
 /// <summary>
 /// Encode this PDU to the PduMarshaler.
 /// </summary>
 /// <param name="marshaler">This is used to encode the fields of this PDU.</param>
 public override void Encode(PduMarshaler marshaler)
 {
     base.Encode(marshaler);
     marshaler.WriteByte(this.ctxId);
     marshaler.WriteUInt16(this.tileSize);
     marshaler.WriteByte(this.flags);
 }
コード例 #29
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 void Encode(PduMarshaler marshaler)
 {
     marshaler.WriteUInt32(this.Header.cbSize);
     marshaler.WriteUInt32((uint)this.Header.PacketType);
     marshaler.WriteByte(this.PresentatioinId);
     marshaler.WriteByte((byte)this.Version);
     marshaler.WriteByte((byte)this.Flags);
     marshaler.WriteByte(this.Reserved);
     marshaler.WriteUInt64(this.HnsTimestamp);
     marshaler.WriteUInt64(this.HnsDuration);
     marshaler.WriteUInt16(this.CurrentPacketIndex);
     marshaler.WriteUInt16(this.PacketsInSample);
     marshaler.WriteUInt32(this.SampleNumber);
     marshaler.WriteUInt32(this.cbSample);
     if (this.pSample != null)
     {
         marshaler.WriteBytes(this.pSample);
     }
     marshaler.WriteByte(this.Reserved2);
 }
コード例 #30
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 void Encode(PduMarshaler marshaler)
        {
            base.Encode(marshaler);

            marshaler.WriteUInt16(this.surfaceId);
            marshaler.WriteByte(this.fillPixel.B);
            marshaler.WriteByte(this.fillPixel.G);
            marshaler.WriteByte(this.fillPixel.R);
            marshaler.WriteByte(this.fillPixel.XA);
            marshaler.WriteUInt16(this.fillRectCount);

            foreach (RDPGFX_RECT16 rect in fillRectList)
            {
                marshaler.WriteUInt16(rect.left);
                marshaler.WriteUInt16(rect.top);
                marshaler.WriteUInt16(rect.right);
                marshaler.WriteUInt16(rect.bottom);
            }
        }