/// <summary>
        /// Decode this PDU from the PduMarshaler.
        /// </summary>
        /// <param name="marshaler">This is used to decode the fields of this PDU.</param>
        public override bool Decode(PduMarshaler marshaler)
        {
            try
            {
                this.cbGeometryData   = marshaler.ReadUInt32();
                this.Version          = (RdpegtVersionValues)marshaler.ReadUInt32();
                this.MappingId        = marshaler.ReadUInt64();
                this.UpdateType       = (UpdateTypeValues)marshaler.ReadUInt32();
                this.Flags            = marshaler.ReadUInt32();
                this.TopLevelId       = marshaler.ReadUInt64();
                this.Left             = marshaler.ReadUInt32();
                this.Top              = marshaler.ReadUInt32();
                this.Right            = marshaler.ReadUInt32();
                this.Bottom           = marshaler.ReadUInt32();
                this.TopLevelLeft     = marshaler.ReadUInt32();
                this.TopLevelTop      = marshaler.ReadUInt32();
                this.TopLevelRight    = marshaler.ReadUInt32();
                this.TopLevelBottom   = marshaler.ReadUInt32();
                this.GeometryType     = (GeometryTypeValues)marshaler.ReadUInt32();
                this.cbGeometryBuffer = marshaler.ReadUInt32();

                //Decode RGNDATA
                this.pGeometryBuffer.rdh.dwSize   = marshaler.ReadUInt32();
                this.pGeometryBuffer.rdh.iType    = marshaler.ReadUInt32();
                this.pGeometryBuffer.rdh.nCount   = marshaler.ReadUInt32();
                this.pGeometryBuffer.rdh.nRgnSize = marshaler.ReadUInt32();
                DecodeRect(marshaler, out this.pGeometryBuffer.rdh.rcBound);

                this.pGeometryBuffer.Buffer = new RECT[this.pGeometryBuffer.rdh.nCount];
                for (int i = 0; i < this.pGeometryBuffer.Buffer.Length; i++)
                {
                    DecodeRect(marshaler, out this.pGeometryBuffer.Buffer[i]);
                }

                this.Reserved2 = marshaler.ReadByte();

                return(true);
            }
            catch
            {
                marshaler.Reset();
                throw new PDUDecodeException(this.GetType(), marshaler.ReadToEnd());
            }
        }
        /// <summary>
        /// Decode this PDU from the PduMarshaler.
        /// </summary>
        /// <param name="marshaler">This is used to decode the fields of this PDU.</param>
        public override bool Decode(PduMarshaler marshaler)
        {
            try
            {
                this.cbGeometryData = marshaler.ReadUInt32();
                this.Version = (RdpegtVersionValues)marshaler.ReadUInt32();
                this.MappingId = marshaler.ReadUInt64();
                this.UpdateType = (UpdateTypeValues)marshaler.ReadUInt32();
                this.Flags = marshaler.ReadUInt32();
                this.TopLevelId = marshaler.ReadUInt64();
                this.Left = marshaler.ReadUInt32();
                this.Top = marshaler.ReadUInt32();
                this.Right = marshaler.ReadUInt32();
                this.Bottom = marshaler.ReadUInt32();
                this.TopLevelLeft = marshaler.ReadUInt32();
                this.TopLevelTop = marshaler.ReadUInt32();
                this.TopLevelRight = marshaler.ReadUInt32();
                this.TopLevelBottom = marshaler.ReadUInt32();
                this.GeometryType = (GeometryTypeValues)marshaler.ReadUInt32();
                this.cbGeometryBuffer = marshaler.ReadUInt32();

                //Decode RGNDATA
                this.pGeometryBuffer.rdh.dwSize = marshaler.ReadUInt32();
                this.pGeometryBuffer.rdh.iType = marshaler.ReadUInt32();
                this.pGeometryBuffer.rdh.nCount = marshaler.ReadUInt32();
                this.pGeometryBuffer.rdh.nRgnSize = marshaler.ReadUInt32();
                DecodeRect(marshaler, out this.pGeometryBuffer.rdh.rcBound);

                this.pGeometryBuffer.Buffer = new RECT[this.pGeometryBuffer.rdh.nCount];
                for (int i = 0; i < this.pGeometryBuffer.Buffer.Length; i++)
                {
                    DecodeRect(marshaler, out this.pGeometryBuffer.Buffer[i]);
                }

                this.Reserved2 = marshaler.ReadByte();

                return true;
            }
            catch
            {
                marshaler.Reset();
                throw new PDUDecodeException(this.GetType(), marshaler.ReadToEnd());
            }
        }