private byte[] GetBodyBytes()
        {
            var tempBuffer = new WspBuffer();

            tempBuffer.Add(_iClientVersion);

            tempBuffer.Add(_fClientIsRemote);

            var bufferForBlob1 = new WspBuffer();

            bufferForBlob1.Add(cPropSets);

            PropertySet1.ToBytes(bufferForBlob1);

            PropertySet2.ToBytes(bufferForBlob1);

            _cbBlob1 = (uint)bufferForBlob1.WriteOffset;

            tempBuffer.Add(_cbBlob1);

            var bufferForBlob2 = new WspBuffer();

            bufferForBlob2.Add(cExtPropSet, 8);

            foreach (var propertySet in aPropertySets)
            {
                propertySet.ToBytes(bufferForBlob2);
            }

            _cbBlob2 = (uint)bufferForBlob2.WriteOffset;

            tempBuffer.Add(_cbBlob2, 8);

            tempBuffer.AddRange(new byte[12]);

            tempBuffer.AddUnicodeString(MachineName);

            tempBuffer.AddUnicodeString(UserName);

            tempBuffer.AlignWrite(8);

            tempBuffer.AddRange(bufferForBlob1.GetBytes());

            tempBuffer.AlignWrite(8);

            tempBuffer.AddRange(bufferForBlob2.GetBytes());

            return(tempBuffer.GetBytes());
        }
        public byte[] GetBodyBytes()
        {
            var buffer = new WspBuffer();

            buffer.Add(_hCursor);

            buffer.Add(_cbRow);

            var tempBuffer = new WspBuffer();

            tempBuffer.Add(cColumns);

            foreach (var column in aColumns)
            {
                tempBuffer.AlignWrite(4);

                column.ToBytes(tempBuffer);
            }

            var bytesAfterDummy = tempBuffer.GetBytes();

            _cbBindingDesc = (uint)bytesAfterDummy.Length;

            buffer.Add(_cbBindingDesc);

            buffer.Add(_dummy);

            buffer.AddRange(bytesAfterDummy);

            return(buffer.GetBytes());
        }
Ejemplo n.º 3
0
        public byte[] GetBodyBytes()
        {
            var buffer = new WspBuffer();

            buffer.Add(_wid);

            buffer.Add(_cbSoFar);

            var tempBuffer = new WspBuffer();

            PropSpec.ToBytes(tempBuffer);

            var propSpecBytes = tempBuffer.GetBytes();

            _cbPropSpec = (uint)propSpecBytes.Length;

            buffer.Add(_cbPropSpec);

            buffer.Add(_cbChunk);

            buffer.AddRange(propSpecBytes);

            buffer.AlignWrite(4);

            return(buffer.GetBytes());
        }
        public byte[] GetBodyBytes()
        {
            var buffer = new WspBuffer();

            buffer.Add(_hCursor);

            buffer.Add(_cRowsToTransfer);

            buffer.Add(_cbRowWidth);

            var tempBuffer = new WspBuffer();

            tempBuffer.Add(eType);

            tempBuffer.Add(_chapt);

            switch (SeekDescription)
            {
            case CRowSeekNext seek:
                seek.ToBytes(tempBuffer);
                break;

            case CRowSeekAt seek:
                seek.ToBytes(tempBuffer);
                break;

            case CRowSeekAtRatio seek:
                seek.ToBytes(tempBuffer);
                break;

            case CRowSeekByBookmark seek:
                seek.ToBytes(tempBuffer);
                break;

            default:
                break;
            }

            var bytesFromEType = tempBuffer.GetBytes();

            _cbSeek = (uint)bytesFromEType.Length;

            buffer.Add(_cbSeek);

            buffer.Add(_cbReserved);

            buffer.Add(_cbReadBuffer);

            buffer.Add(_ulClientBase);

            buffer.Add(_fBwdFetch);

            buffer.AddRange(bytesFromEType);

            return(buffer.GetBytes());
        }
        public void ToBytes(WspBuffer buffer)
        {
            var bodyBytes = GetBodyBytes();

            var checksum = Helper.CalculateChecksum(WspMessageHeader_msg_Values.CPMSetBindingsIn, bodyBytes);

            var header = Header;

            header._ulChecksum = checksum;

            Header = header;

            Header.ToBytes(buffer);

            buffer.AddRange(bodyBytes);
        }
        public void ToBytes(WspBuffer buffer)
        {
            buffer.Add(cbSize);

            buffer.AddRange(blobData);
        }
        public void ToBytes(WspBuffer buffer)
        {
            buffer.Add(ccLen);

            buffer.AddRange(bytes);
        }
        public byte[] GetBodyBytes()
        {
            var buffer = new WspBuffer();

            var tempBuffer = new WspBuffer();

            tempBuffer.Add(Size);

            int tempOffset = tempBuffer.WriteOffset;

            byte CColumnSetPresent;

            if (ColumnSet.HasValue)
            {
                CColumnSetPresent = 0x01;

                tempBuffer.Add(CColumnSetPresent);

                tempBuffer.AlignWrite(4);

                ColumnSet.Value.ToBytes(tempBuffer);
            }
            else
            {
                CColumnSetPresent = 0x00;

                tempBuffer.Add(CColumnSetPresent);
            }

            byte CRestrictionPresent;

            if (RestrictionArray.HasValue)
            {
                CRestrictionPresent = 0x01;

                tempBuffer.Add(CRestrictionPresent);

                RestrictionArray.Value.ToBytes(tempBuffer);
            }
            else
            {
                CRestrictionPresent = 0x00;

                tempBuffer.Add(CRestrictionPresent);
            }

            byte CSortSetPresent;

            if (SortSet.HasValue)
            {
                CSortSetPresent = 0x01;

                tempBuffer.Add(CSortSetPresent);

                tempBuffer.AlignWrite(4);

                SortSet.Value.ToBytes(tempBuffer);
            }
            else
            {
                CSortSetPresent = 0x00;

                tempBuffer.Add(CSortSetPresent);
            }

            byte CCategorizationSetPresent;

            if (CCategorizationSet.HasValue)
            {
                CCategorizationSetPresent = 0x01;

                tempBuffer.Add(CCategorizationSetPresent);

                tempBuffer.AlignWrite(4);

                CCategorizationSet.Value.ToBytes(tempBuffer);
            }
            else
            {
                CCategorizationSetPresent = 0x00;

                tempBuffer.Add(CCategorizationSetPresent);
            }

            tempBuffer.AlignWrite(4);

            RowSetProperties.ToBytes(tempBuffer);

            PidMapper.ToBytes(tempBuffer);

            GroupArray.ToBytes(tempBuffer);

            tempBuffer.Add(Lcid);

            Size = (uint)tempBuffer.WriteOffset;

            buffer.Add(Size);

            var bytesAfterSize = tempBuffer.GetBytes().Skip(tempOffset).ToArray();

            buffer.AddRange(bytesAfterSize);

            return(buffer.GetBytes());
        }