Microsoft.Protocols.TestTools.StackSdk.RemoteDesktop.Rdpbcgr.RdpbcgrServerDecoder.SwitchDecodeMcsPDU C# (CSharp) Method

SwitchDecodeMcsPDU() private method

Switch Decode MCS PDU
private SwitchDecodeMcsPDU ( RdpbcgrServerSessionContext serverSessionContext, byte data ) : StackPacket
serverSessionContext RdpbcgrServerSessionContext the server session context
data byte data to be parsed
return StackPacket
        private StackPacket SwitchDecodeMcsPDU(RdpbcgrServerSessionContext serverSessionContext, byte[] data)
        {
            // Check data length
            if (ConstValue.MCS_CONNECT_INITIAL_PDU_INDICATOR_INDEX >= data.Length)
            {
                throw new FormatException(ConstValue.ERROR_MESSAGE_DATA_INDEX_OUT_OF_RANGE);
            }

            // Decode by MCS PDU Type
            StackPacket pdu = null;
            byte mcsPduType = data[ConstValue.MCS_CONNECT_INITIAL_PDU_INDICATOR_INDEX];
            if (ConstValue.MCS_CONNECT_INITIAL_PDU_INDICATOR_VALUE == mcsPduType)
            {
                // Decode MCS Connect Response PDU
                pdu = DecodeMcsConnectInitialPDU(data);
            }
            else
            {
                // Decode MCS Domain PDU
                pdu = SwitchDecodeMcsDomainPDU(serverSessionContext, data);
            }
            return pdu;
        }
RdpbcgrServerDecoder