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

CalculateFpUpdatePduLength() private method

Calculate the overall length of Server Fast-Path Update PDU (based on field values of "length1" and "length2")
private CalculateFpUpdatePduLength ( byte length1, byte length2 ) : UInt16
length1 byte value of length1 field
length2 byte value of length2 field
return System.UInt16
        private UInt16 CalculateFpUpdatePduLength(byte length1, byte length2)
        {
            if ((ConstValue.MOST_SIGNIFICANT_BIT_FILTER & length1) == length1)
            {
                // when length1's most significant bit is not set
                // only length1 is considered
                return (UInt16)length1;
            }
            else
            {
                // when length1's most significant bit is set
                // length1 and length2 are concatenated
                byte[] buffer = new byte[2];
                buffer[0] = length2;
                buffer[1] = (byte)(ConstValue.MOST_SIGNIFICANT_BIT_FILTER & length1);
                UInt16 length = BitConverter.ToUInt16(buffer, 0);
                return length;
            }
        }
RdpbcgrServerDecoder