当前位置: 首页>>代码示例>>C#>>正文


C# PduMarshaler.WriteByte方法代码示例

本文整理汇总了C#中Microsoft.Protocols.TestTools.StackSdk.PduMarshaler.WriteByte方法的典型用法代码示例。如果您正苦于以下问题:C# PduMarshaler.WriteByte方法的具体用法?C# PduMarshaler.WriteByte怎么用?C# PduMarshaler.WriteByte使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在Microsoft.Protocols.TestTools.StackSdk.PduMarshaler的用法示例。


在下文中一共展示了PduMarshaler.WriteByte方法的8个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。

示例1: Encode

 /// <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(wTotalLength);
     marshaler.WriteByte(bNumInterfaces);
     marshaler.WriteByte(bConfigurationValue);
     marshaler.WriteByte(iConfiguration);
     marshaler.WriteByte(bmAttributes);
     marshaler.WriteByte(MaxPower);
 }
开发者ID:yazeng,项目名称:WindowsProtocolTestSuites,代码行数:14,代码来源:UsbStructures.cs

示例2: Encode

 /// <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);
 }
开发者ID:yazeng,项目名称:WindowsProtocolTestSuites,代码行数:14,代码来源:RdpevorTypes.cs

示例3: Encode

        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);
                }
            }
        }
开发者ID:yazeng,项目名称:WindowsProtocolTestSuites,代码行数:86,代码来源:Types.cs

示例4: Encode

 /// <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);
 }
开发者ID:yazeng,项目名称:WindowsProtocolTestSuites,代码行数:14,代码来源:RdpeusbTsUrbResultTypes.cs

示例5: Encode

        /// <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);
        }
开发者ID:yazeng,项目名称:WindowsProtocolTestSuites,代码行数:28,代码来源:RdpegfxRFXProgressiveDataBlock.cs

示例6: Encode

        /// <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);
            }
        }
开发者ID:Microsoft,项目名称:WindowsProtocolTestSuites,代码行数:23,代码来源:RdpegfxTypes.cs

示例7: Encode

 /// <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.WriteByte((byte)descriptor);
     if (descriptor == DescriptorTypes.SINGLE)
     {
         if(bulkData != null)
         {
             marshaler.WriteByte(bulkData.header);
             marshaler.WriteBytes(bulkData.data);
         }
     }
     else
     {
         marshaler.WriteUInt16(segmentCount);
         marshaler.WriteUInt32(uncompressedSize);
         if (segmentArray != null && segmentArray.Length > 0)
         {
             foreach (RDP_DATA_SEGMENT dataSeg in segmentArray)
             {
                 marshaler.WriteUInt32(dataSeg.size);
                 if (dataSeg.bulkData != null)
                 {
                     marshaler.WriteByte(bulkData.header);
                     marshaler.WriteBytes(bulkData.data);
                 }
             }
         }
     }
 }
开发者ID:yazeng,项目名称:WindowsProtocolTestSuites,代码行数:33,代码来源:RdpegfxTypes.cs

示例8: Encode

        /// <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.cbGeometryData);
            marshaler.WriteUInt32((uint)this.Version);
            marshaler.WriteUInt64(this.MappingId);
            marshaler.WriteUInt32((uint)this.UpdateType);
            marshaler.WriteUInt32(this.Flags);
            marshaler.WriteUInt64(this.TopLevelId);
            marshaler.WriteUInt32(this.Left);
            marshaler.WriteUInt32(this.Top);
            marshaler.WriteUInt32(this.Right);
            marshaler.WriteUInt32(this.Bottom);
            marshaler.WriteUInt32(this.TopLevelLeft);
            marshaler.WriteUInt32(this.TopLevelTop);
            marshaler.WriteUInt32(this.TopLevelRight);
            marshaler.WriteUInt32(this.TopLevelBottom);
            marshaler.WriteUInt32((uint)this.GeometryType);
            marshaler.WriteUInt32(this.cbGeometryBuffer);

            //Encode RGNDATA
            if (this.cbGeometryBuffer != 0)
            {
                marshaler.WriteUInt32(this.pGeometryBuffer.rdh.dwSize);
                marshaler.WriteUInt32(this.pGeometryBuffer.rdh.iType);
                marshaler.WriteUInt32(this.pGeometryBuffer.rdh.nCount);
                marshaler.WriteUInt32(this.pGeometryBuffer.rdh.nRgnSize);
                EncodeRect(this.pGeometryBuffer.rdh.rcBound, marshaler);

                if (this.pGeometryBuffer.Buffer != null)
                {
                    foreach (RECT rct in this.pGeometryBuffer.Buffer)
                    {
                        EncodeRect(rct, marshaler);
                    }
                }
            }
            marshaler.WriteByte(this.Reserved2);
        }
开发者ID:yazeng,项目名称:WindowsProtocolTestSuites,代码行数:42,代码来源:RdpegtTypes.cs


注:本文中的Microsoft.Protocols.TestTools.StackSdk.PduMarshaler.WriteByte方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。