Microsoft.Protocols.TestTools.StackSdk.RemoteDesktop.Rdpbcgr.Server_Auto_Detect_Request_PDU.ToBytes C# (CSharp) Method

ToBytes() public method

Encode this structure into byte array.
public ToBytes ( ) : byte[]
return byte[]
        public override byte[] ToBytes()
        {
            List<byte> reqDataBuffer = new List<byte>();
            RdpbcgrEncoder.EncodeNetworkDetectionRequest(reqDataBuffer, autoDetectReqData);

            byte[] dataBuffer = reqDataBuffer.ToArray();

            List<byte> totalBuffer = new List<byte>();
            RdpbcgrEncoder.EncodeSlowPathPdu(totalBuffer, commonHeader, dataBuffer, serverSessionContext);

            byte[] encodedBytes = RdpbcgrUtility.ToBytes(totalBuffer);

            // ToDo: Ugly dump message code here
            // ETW Provider Dump Code
            bool isEncrypted = serverSessionContext.RdpEncryptionLevel != EncryptionLevel.ENCRYPTION_LEVEL_NONE && serverSessionContext.RdpEncryptionLevel != EncryptionLevel.ENCRYPTION_LEVEL_LOW;
            RdpbcgrUtility.ETWProviderDump(this.GetType().Name, encodedBytes, isEncrypted, dataBuffer);

            return encodedBytes;
        }