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

ParseCapsTypeVirtualChannel() private method

Parse TS_VIRTUALCHANNEL_CAPABILITYSET
private ParseCapsTypeVirtualChannel ( byte data ) : TS_VIRTUALCHANNEL_CAPABILITYSET
data byte data to be parsed
return TS_VIRTUALCHANNEL_CAPABILITYSET
        private TS_VIRTUALCHANNEL_CAPABILITYSET ParseCapsTypeVirtualChannel(byte[] data)
        {
            TS_VIRTUALCHANNEL_CAPABILITYSET set = RdpbcgrUtility.ToStruct<TS_VIRTUALCHANNEL_CAPABILITYSET>(data);

            // VCChunkSize is optional
            // (RdpbcgrUtility.ToStruct() will provide it with an invalid value when it's absent)
            if (data.Length + Marshal.SizeOf(set.VCChunkSize) == Marshal.SizeOf(set))
            {
                // VCChunckSize is absent, correct its value to default 0
                set.VCChunkSize = 0;
            }
            else
            {
                // Check if data length is consistent with the decoded struct length
                VerifyDataLength(data.Length, Marshal.SizeOf(set), ConstValue.ERROR_MESSAGE_DATA_LENGTH_INCONSISTENT);
            }
            return set;
        }
RdpbcgrServerDecoder