Пример #1
0
 private void WriteEmbeddedPointer <T>(NdrEmbeddedPointer <T> pointer, Action writer)
 {
     if (WriteReferent(pointer))
     {
         _deferred_writes.Add(writer);
     }
 }
 private void WriteEmbeddedPointer <T>(NdrEmbeddedPointer <T> pointer, Action writer)
 {
     WriteReferent(pointer);
     if (pointer != null)
     {
         _deferred_writes.Enqueue(writer);
     }
 }
        public NdrEmbeddedPointer <T> ReadEmbeddedPointer <T>(Func <T> unmarshal_func)
        {
            int referent = ReadReferent();

            if (referent == 0)
            {
                return(null);
            }

            // Really should have referents, but I'm not convinced the MSRPC NDR engine uses them.
            // Perhaps introduce a lazy method to bind it after the fact.
            var deferred_reader = NdrEmbeddedPointer <T> .CreateDeferredReader(unmarshal_func);

            _deferred_reads.Enqueue(deferred_reader.Item2);
            return(deferred_reader.Item1);
        }
Пример #4
0
        public NdrEmbeddedPointer <T> ReadEmbeddedPointer <T>(Func <T> unmarshal_func, bool full_pointer)
        {
            int referent = ReadInt32();

            if (referent == 0)
            {
                return(null);
            }

            if (full_pointer)
            {
                unmarshal_func = () => ReadFullPointer(referent, unmarshal_func);
            }

            var deferred_reader = NdrEmbeddedPointer <T> .CreateDeferredReader(unmarshal_func);

            _deferred_reads.Enqueue(deferred_reader.Item2);
            return(deferred_reader.Item1);
        }
Пример #5
0
 public void WriteEmbeddedPointer <T, U, V>(NdrEmbeddedPointer <T> pointer, Action <T, U, V> writer, U arg, V arg2)
 {
     WriteEmbeddedPointer(pointer, () => writer(pointer, arg, arg2));
 }
Пример #6
0
 public void WriteEmbeddedPointer <T, U>(NdrEmbeddedPointer <T> pointer, Action <T, U> writer, U arg)
 {
     WriteEmbeddedPointer(pointer, () => writer(pointer, arg));
 }
Пример #7
0
 public void WriteEmbeddedPointer <T>(NdrEmbeddedPointer <T> pointer, Action <T> writer)
 {
     WriteEmbeddedPointer(pointer, () => writer(pointer));
 }
        internal static Tuple <NdrEmbeddedPointer <T>, Action> CreateDeferredReader <U, V>(Func <U, V, T> unmarshal_func, U arg, V arg2)
        {
            NdrEmbeddedPointer <T> ret = new NdrEmbeddedPointer <T>(default(T));

            return(Tuple.Create(ret, new Action(() => ret._value = unmarshal_func(arg, arg2))));
        }
 public void WriteEmbeddedStructPointer <T>(NdrEmbeddedPointer <T> pointer) where T : struct, INdrStructure
 {
     WriteEmbeddedPointer(pointer, () => WriteStruct((INdrStructure)pointer));
 }