Microsoft.Protocols.TestTools.StackSdk.RemoteDesktop.Rdpbcgr.RdpbcgrDecoder.ParseTsDemandActivePdu C# (CSharp) Method

ParseTsDemandActivePdu() private method

Parse TS_DEMAND_ACTIVE_PDU (parser index is updated according to parsed length)
private ParseTsDemandActivePdu ( byte data, int &currentIndex ) : TS_DEMAND_ACTIVE_PDU
data byte data to be parsed
currentIndex int current parser index
return TS_DEMAND_ACTIVE_PDU
        private TS_DEMAND_ACTIVE_PDU ParseTsDemandActivePdu(byte[] data, ref int currentIndex)
        {
            TS_DEMAND_ACTIVE_PDU pdu = new TS_DEMAND_ACTIVE_PDU();

            // TS_DEMAND_ACTIVE_PDU: shareControlHeader
            pdu.shareControlHeader = ParseTsShareControlHeader(data, ref currentIndex);

            // TS_DEMAND_ACTIVE_PDU: shareId
            pdu.shareId = ParseUInt32(data, ref currentIndex, false);

            // TS_DEMAND_ACTIVE_PDU: lengthSourceDescriptor
            pdu.lengthSourceDescriptor = ParseUInt16(data, ref currentIndex, false);

            // TS_DEMAND_ACTIVE_PDU: lengthCombinedCapabilities
            pdu.lengthCombinedCapabilities = ParseUInt16(data, ref currentIndex, false);

            // TS_DEMAND_ACTIVE_PDU: sourceDescriptor
            pdu.sourceDescriptor = GetBytes(data, ref currentIndex,
                ConstValue.TS_DEMAND_ACTIVE_PDU_SOURCE_DESCRIPTOR_LENGTH);

            // TS_DEMAND_ACTIVE_PDU: numberCapabilities
            pdu.numberCapabilities = ParseUInt16(data, ref currentIndex, false);

            // TS_DEMAND_ACTIVE_PDU: pad2Octets
            pdu.pad2Octets = ParseUInt16(data, ref currentIndex, false);

            // TS_DEMAND_ACTIVE_PDU: capabilitySets
            pdu.capabilitySets = new Collection<ITsCapsSet>();
            for (int i = 0; i < pdu.numberCapabilities; i++)
            {
                pdu.capabilitySets.Add(ParseTsCapsSet(data, ref currentIndex));
            }

            // TS_DEMAND_ACTIVE_PDU: sessionId
            pdu.sessionId = ParseUInt32(data, ref currentIndex, false);

            return pdu;
        }
RdpbcgrDecoder