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


C# PduMarshaler.ReadBytes方法代码示例

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


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

示例1: Decode

 /// <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);
         RequestId = marshaler.ReadUInt32();
         CbTsUrbResult = marshaler.ReadUInt32();
         TsUrbResult = marshaler.ReadBytes((int)CbTsUrbResult);
         HResult = marshaler.ReadUInt32();
         OutputBufferSize = marshaler.ReadUInt32();
         OutputBuffer = marshaler.ReadBytes((int)OutputBufferSize);
     }
     catch (Exception)
     {
         return false;
     }
     return true;
 }
开发者ID:yazeng,项目名称:WindowsProtocolTestSuites,代码行数:22,代码来源:RdpeusbTypes.cs

示例2: Decode

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

示例3: Decode

 /// <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);
         configurationDescriptorIsValid = marshaler.ReadByte();
         padding = marshaler.ReadBytes(PADDING_SIZE);
         numInterfaces = marshaler.ReadUInt32();
         for (int i = 0; i < intefaces.Length; i++)
         {
             intefaces[i].Decode(marshaler);
         }
         descriptor = marshaler.ReadToEnd();
     }
     catch (Exception)
     {
         return false;
     }
     return true;
 }
开发者ID:yazeng,项目名称:WindowsProtocolTestSuites,代码行数:24,代码来源:RdpeusbTsUrbTypes.cs

示例4: Decode

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

示例5: Decode

 public override bool Decode(PduMarshaler marshaler)
 {
     try
     {
         this.SubHeaderLength = marshaler.ReadByte();
         this.SubHeaderType = (RDP_TUNNEL_SUBHEADER_TYPE_Values)marshaler.ReadByte();
         if (this.SubHeaderLength > 2)
         {
             this.SubHeaderData = marshaler.ReadBytes(this.SubHeaderLength - 2);
         }
         return true;
     }
     catch
     {
         return false;
     }
 }
开发者ID:yazeng,项目名称:WindowsProtocolTestSuites,代码行数:17,代码来源:Types.cs

示例6: Decode

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

示例7: Decode

        /// <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.descriptor = (DescriptorTypes)marshaler.ReadByte();

                if (this.descriptor == DescriptorTypes.SINGLE)
                {
                    this.bulkData = new RDP8_BULK_ENCODED_DATA();
                    this.bulkData.header = marshaler.ReadByte();
                    this.bulkData.data = marshaler.ReadToEnd();
                }
                else
                {
                    this.segmentCount = marshaler.ReadUInt16();
                    this.uncompressedSize = marshaler.ReadUInt32();
                    if (this.segmentCount > 0)
                    {
                        this.segmentArray = new RDP_DATA_SEGMENT[this.segmentCount];
                        for (int i = 0; i < this.segmentCount; i++)
                        {
                            this.segmentArray[i].size = marshaler.ReadUInt32();
                            if (this.segmentArray[i].size > 0)
                            {
                                this.segmentArray[i].bulkData = new RDP8_BULK_ENCODED_DATA();
                                this.segmentArray[i].bulkData.header = marshaler.ReadByte();
                                this.segmentArray[i].bulkData.data = marshaler.ReadBytes((int)this.segmentArray[i].size - 1);
                            }
                        }
                    }
                }

                return true;
            }
            catch
            {
                marshaler.Reset();
                throw new PDUDecodeException(this.GetType(), marshaler.ReadToEnd());
            }
        }
开发者ID:yazeng,项目名称:WindowsProtocolTestSuites,代码行数:44,代码来源:RdpegfxTypes.cs


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