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 void ToBytes(WspBuffer buffer) { buffer.Add(type); buffer.AlignWrite(4); buffer.Add(ccAlias); if (ccAlias != 0) { buffer.AddUnicodeString(Alias, false); } buffer.Add(idColumn); switch (type) { case CAggregSpec_type_Values.DBAGGTTYPE_FIRST: case CAggregSpec_type_Values.DBAGGTTYPE_BYFREQ: case CAggregSpec_type_Values.DBAGGTTYPE_REPRESENTATIVEOF: buffer.Add(ulMaxNumToReturn); break; } switch (type) { case CAggregSpec_type_Values.DBAGGTTYPE_REPRESENTATIVEOF: buffer.Add(idRepresentative); break; } }
public void ToBytes(WspBuffer buffer) { buffer.Add(cLen); if (cLen != 0) { buffer.AddUnicodeString(_string); } }
public VT_BSTR(string val) { var buffer = new WspBuffer(); buffer.AddUnicodeString(val); cbSize = (uint)buffer.WriteOffset; blobData = buffer.GetBytes(); }
public void ToBytes(WspBuffer buffer) { _Property.ToBytes(buffer); buffer.Add(Cc, 4); buffer.AddUnicodeString(_pwcsPhrase, false); buffer.Add(Lcid, 4); }
public void ToBytes(WspBuffer buffer) { buffer.Add(CcLowerPath); buffer.AddUnicodeString(_lowerPath, false); buffer.Add(_length, 4); buffer.Add(_fRecursive); buffer.Add(_fVirtual); }
public void ToBytes(WspBuffer buffer) { buffer.Add(_guidPropSet, 8); buffer.Add(ulKind); buffer.Add(PrSpec); if (ulKind == CFullPropSpec_ulKind_Values.PRSPEC_LPWSTR) { buffer.AddUnicodeString(Property_name); } }
public void ToBytes(WspBuffer buffer) { buffer.Add(eKind); buffer.Add(GUID, 8); buffer.Add(ulId); if (eKind == CDbColId_eKind_Values.DBKIND_GUID_NAME) { buffer.AddUnicodeString(vString); } }
public void ToBytes(WspBuffer buffer) { buffer.Add(ulType); prVal.ToBytes(buffer); buffer.Add(labelPresent); if (labelPresent == 0x01) { buffer.Add(ccLabel, 4); buffer.AddUnicodeString(Label, false); } }
public void ToBytes(WspBuffer buffer) { if (string.IsNullOrEmpty(_string)) { cLen = 0; buffer.Add(cLen); } else { cLen = (uint)(_string.Length + 1); buffer.Add(cLen); buffer.AddUnicodeString(_string); } }