Exemple #1
0
        public void Marshal(NdrBuffer buffer)
        {
            buffer.WriteInt32LittleEndian(ClaimsArray.Count());
            buffer.WriteDeferredStructArray(ClaimsArray);

            buffer.WriteInt16LittleEndian(ReservedType);
            buffer.WriteInt32LittleEndian(ReservedFieldSize);
            buffer.WriteDeferredConformantArray <byte>(ReservedField);
        }
Exemple #2
0
        public override void WriteBody(NdrBinaryStream stream)
        {
            stream.WriteUnsignedInt(ClaimsArray.Count());
            stream.WriteDeferredArray(ClaimsArray);

            stream.WriteShort(ReservedType);
            stream.WriteUnsignedInt(ReservedFieldSize);
            stream.WriteBytes(ReservedField);
        }
        internal void WriteClaimsArray(ClaimsArray array)
        {
            WriteUnsignedInt((int)array.ClaimSource);

            Queue <Action> deferred = new Queue <Action>();

            WriteDeferredArray(array.ClaimEntries, deferred);

            deferredWrites.Enqueue(() =>
            {
                while (deferred.Count != 0)
                {
                    var action = deferred.Dequeue();
                    action();
                }
            });
        }
Exemple #4
0
        internal void WriteClaimsArray(ClaimsArray array)
        {
            WriteUnsignedInt((int)array.ClaimSource);

            Queue <Action> deferred = new Queue <Action>();

            WriteDeferredArray(array.ClaimEntries, deferred);

            deferredWrites.Enqueue(() =>
            {
                while (deferred.TryDequeue(out Action action))
                {
                    action();
                }
            });
            //WriteDeferredArray(array.ClaimEntries, false, (c, s) => ((ClaimEntry)c).WriteDeferred(s));
        }
Exemple #5
0
        private IEnumerable <ClaimsArray> ReadClaimsArray(NdrBinaryStream stream)
        {
            var count = stream.ReadInt();

            if (count != Count)
            {
                throw new InvalidDataException($"Array count {Count} doesn't match actual count {count}");
            }

            var claims = new List <ClaimsArray>();

            for (var i = 0; i < Count; i++)
            {
                var array = new ClaimsArray();
                array.ReadBody(stream);

                claims.Add(array);
            }

            return(claims);
        }