public void Write(NDRWriter writer) { string valueToWrite = string.Empty; if (Value != null) { valueToWrite = Value; } if (m_writeNullTerminationCharacter) { valueToWrite += '\0'; } uint maxCount = (uint)valueToWrite.Length; writer.WriteUInt32(maxCount); // the offset from the first index of the string to the first index of the actual subset being passed uint index = 0; writer.WriteUInt32(index); uint actualCount = (uint)valueToWrite.Length; writer.WriteUInt32(actualCount); foreach (char value in valueToWrite) { writer.WriteUInt16(value); } }
public void Write(NDRWriter writer) { int length = 0; if (Value != null) { length = Value.Length; } // maxCount includes the null terminator uint maxCount = (uint)(length + 1); writer.WriteUInt32(maxCount); // the offset from the first index of the string to the first index of the actual subset being passed uint index = 0; writer.WriteUInt32(index); // actualCount includes the null terminator uint actualCount = (uint)(length + 1); writer.WriteUInt32(actualCount); for (int position = 0; position < length; position++) { writer.WriteUInt16((ushort)Value[position]); } writer.WriteUInt16(0); // null terminator }
public void Write(NDRWriter writer) { byte[] data = new byte[sid.Length]; int offset = 0; sid.WriteBytes(data, ref offset); writer.WriteUInt32((uint)sid.SubAuthority.Count); writer.WriteBytes(data); }
public void Write(NDRWriter writer) { writer.BeginStructure(); uint maxCount = (uint)this.Count; writer.WriteUInt32(maxCount); for (int index = 0; index < this.Count; index++) { this[index].Write(writer); } writer.EndStructure(); }