Ejemplo n.º 1
0
 public static ManagedAllocation Create(object structure)
 {
     var s = new ManagedAllocation();
     s.Size = Marshal.SizeOf(structure);
     s.Pointer = Marshal.AllocHGlobal(s.Size);
     Marshal.StructureToPtr(structure, s.Pointer, false);
     return s;
 }
Ejemplo n.º 2
0
        public static ManagedAllocation Create(object structure)
        {
            var s = new ManagedAllocation();

            s.Size    = Marshal.SizeOf(structure);
            s.Pointer = Marshal.AllocHGlobal(s.Size);
            Marshal.StructureToPtr(structure, s.Pointer, false);
            return(s);
        }