예제 #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;
 }
예제 #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);
        }