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

DecodeLicenseErrorPDU() public method

[TD Reference 3.2.5.3.12] Decode License Error PDU - Valid Client
public DecodeLicenseErrorPDU ( byte data, byte decryptedUserData, SecurityHeaderType type ) : StackPacket
data byte data to be parsed
decryptedUserData byte decrypted user data to be parsed
type SecurityHeaderType security header type
return StackPacket
        public StackPacket DecodeLicenseErrorPDU(
            byte[] data,
            byte[] decryptedUserData,
            SecurityHeaderType type)
        {
            Server_License_Error_Pdu_Valid_Client pdu = new Server_License_Error_Pdu_Valid_Client();

            // data index
            int currentIndex = 0;

            // LicenseErrorPDU: commonHeader
            pdu.commonHeader = ParseMcsCommonHeader(data, ref currentIndex, type);

            // user data index
            int userDataIndex = 0;

            // LicenseErrorPDU: preamble
            pdu.preamble = ParseLicensePreamble(decryptedUserData, ref userDataIndex);

            if (pdu.preamble.bMsgType == bMsgType_Values.ERROR_ALERT)
            {
                // LicenseErrorPDU: validClientMessage
                pdu.validClientMessage = ParseLicenseErrorMessage(decryptedUserData, ref userDataIndex);

                // has received ERROR_ALERT packet, change client context status
                clientContext.IsWaitingLicenseErrorPdu = false;
            }
            else
            {
                // RDPELE Type PDU
                RdpelePdu elePdu = new RdpelePdu(clientContext);
                elePdu.commonHeader = pdu.commonHeader;
                elePdu.rdpeleData = decryptedUserData;
                return elePdu;
            }

            // Check if data length exceeded expectation
            VerifyDataLength(decryptedUserData.Length, userDataIndex, ConstValue.ERROR_MESSAGE_DATA_LENGTH_EXCEEDED);
            return pdu;
        }
RdpbcgrDecoder