Microsoft.Protocols.TestTools.StackSdk.RemoteDesktop.Rdpbcgr.SlowPathOutputPdu.EncodePtr C# (CSharp) Method

EncodePtr() private method

private EncodePtr ( TS_POINTER_PDU ptrData ) : byte[]
ptrData TS_POINTER_PDU
return byte[]
        private byte[] EncodePtr(TS_POINTER_PDU ptrData)
        {
            List<byte> totalBuffer = new List<byte>();

            RdpbcgrEncoder.EncodeStructure(totalBuffer, ptrData.shareDataHeader);

            List<byte> buffer = new List<byte>();
            RdpbcgrEncoder.EncodeStructure(buffer, (ushort)ptrData.messageType);
            RdpbcgrEncoder.EncodeStructure(buffer, ptrData.pad2Octets);
            if (ptrData.pointerAttributeData.GetType() == typeof(byte[]))
            {
                RdpbcgrEncoder.EncodeBytes(buffer, (byte[])ptrData.pointerAttributeData);
            }
            else
            {
                RdpbcgrEncoder.EncodeStructure(buffer, ptrData.pointerAttributeData);
            }

            if (ptrData.shareDataHeader.compressedType != compressedType_Values.None)
            {
                RdpbcgrEncoder.EncodeBytes(
                    totalBuffer, serverSessionContext.Compress(ptrData.shareDataHeader.compressedType, buffer.ToArray()));
            }
            else
            {
                RdpbcgrEncoder.EncodeBytes(totalBuffer, buffer.ToArray());
            }
            return totalBuffer.ToArray();
        }