private static IEnumerable <SecurityIdentifier> ParseAttributes(NdrBinaryStream Stream, int count, int pointer) { var attributes = new List <SecurityIdentifier>(); if (pointer == 0) { return(attributes); } int realCount = Stream.ReadInt(); if (realCount != count) { throw new InvalidDataException($"Expected count {count} doesn't match actual count {realCount}"); } for (int i = 0; i < count; i++) { Stream.Align(4); var sid = Stream.ReadRid(); attributes.Add(new SecurityIdentifier(sid, (SidAttributes)Stream.ReadInt())); } return(attributes); }
public override void ReadBody(NdrBinaryStream stream) { stream.Seek(4); // offset for Id Type = (ClaimType)stream.ReadShort(); stream.Align(4); Count = stream.ReadUnsignedInt(); stream.Seek(4); // offset to values }
public virtual void Encode(NdrBinaryStream stream) { if (Header == null) { Header = new RpcHeader(); } Header.WriteCommonHeader(stream); stream.Align(4); WriteBody(stream); stream.WriteDeferred(); }
internal void ReadValue(NdrBinaryStream stream) { Id = stream.ReadString(); stream.Align(4); var count = stream.ReadInt(); if (count != Count) { throw new InvalidDataException($"ValueCount {Count} doesn't match actual count {count} for claim {Id}."); } ReadValues(stream); }
public override void ReadBody(NdrBinaryStream stream) { Count = stream.ReadInt(); stream.Seek(4); ReservedType = stream.ReadShort(); ReservedFieldSize = stream.ReadInt(); ReservedField = stream.Read(ReservedFieldSize); stream.Align(8); ClaimsArray = ReadClaimsArray(stream); }