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

DecodeMonitorLayoutPDU() public method

Decode Monitor Layout PDU
public DecodeMonitorLayoutPDU ( 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 DecodeMonitorLayoutPDU(
            byte[] data,
            byte[] decryptedUserData,
            SecurityHeaderType type)
        {
            TS_MONITOR_LAYOUT_PDU pdu = new TS_MONITOR_LAYOUT_PDU();

            // data index
            int dataIndex = 0;

            // TS_MONITOR_LAYOUT_PDU: commonHeader
            pdu.commonHeader = ParseMcsCommonHeader(data, ref dataIndex, type);

            // user data index
            int userDataIndex = 0;

            // TS_MONITOR_LAYOUT_PDU: shareDataHeader
            pdu.shareDataHeader = ParseTsShareDataHeader(decryptedUserData, ref userDataIndex);

            // TS_MONITOR_LAYOUT_PDU: monitorCount
            pdu.monitorCount = ParseUInt32(decryptedUserData, ref userDataIndex, false);

            // TS_MONITOR_LAYOUT_PDU: monitorDefArray
            pdu.monitorDefArray = new TS_MONITOR_DEF[pdu.monitorCount];
            for (int i = 0; i < pdu.monitorDefArray.Length; i++)
            {
                pdu.monitorDefArray[i] = ParseTsMonitorDef(decryptedUserData, ref userDataIndex);
            }

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