示例#1
0
        /// <summary>
        /// Server MCS Connect Response PDU with GCC Conference Create Response
        /// Part 1.1
        /// </summary>
        private static void parseDomainParams(RdpPacket data)
        {
            int  num  = BER.berParseHeader(data, BER.BER_Header.TAG_DOMAIN_PARAMS);
            long num2 = data.Position + num;

            if (num2 > data.Length)
            {
                throw new RDFatalException("Bad domain param received");
            }

            data.Position += num;
        }
示例#2
0
        /// <summary>
        /// Server MCS Connect Response PDU with GCC Conference Create Response
        /// Part 1
        /// </summary>
        private static void receiveConnectResponse()
        {
            string[] strArray = new string[]
            {
                "Successful",
                "Domain Merging",
                "Domain not Hierarchical",
                "No Such Channel",
                "No Such Domain",
                "No Such User",
                "Not Admitted",
                "Other User ID",
                "Parameters Unacceptable",
                "Token Not Available",
                "Token Not Possessed",
                "Too Many Channels",
                "Too Many Tokens",
                "Too Many Users",
                "Unspecified Failure",
                "User Rejected"
            };

            RdpPacket data = ISO.Receive();

            data.ReadByte();
            int num = data.ReadByte();

            if (num != 240)
            {
                throw new RDFatalException("Bad connection response packet type " + num.ToString());
            }

            data.ReadByte();
            int index = 0;

            index = BER.berParseHeader(data, BER.BER_Header.CONNECT_RESPONSE);
            index = BER.berParseHeader(data, BER.BER_Header.BER_TAG_RESULT);
            index = data.ReadByte();

            if (index != 0)
            {
                throw new RDFatalException("MCS failed " + strArray[index].ToString());
            }

            index = BER.berParseHeader(data, BER.BER_Header.BER_TAG_INTEGER);
            index = data.ReadByte();
            parseDomainParams(data);
            index = BER.berParseHeader(data, BER.BER_Header.BER_TAG_OCTET_STRING);
            processMcsData(data);
        }