Esempio n. 1
0
        static void walChecksumBytes(bool nativeChecksum, WalIndexHeader header, byte[] checksum, byte[] checksumOut)
        {
            int size = Marshal.SizeOf(header);
            var b    = new byte[size];
            var p    = Marshal.AllocHGlobal(size);

            Marshal.StructureToPtr(header, p, true);
            Marshal.Copy(p, b, 0, size);
            Marshal.FreeHGlobal(p);
            walChecksumBytes(nativeChecksum, b, size, checksum, checksumOut);
        }
Esempio n. 2
0
File: Wal.cs Progetto: BclEx/GpuData
 static void walChecksumBytes(bool nativeChecksum, WalIndexHeader header, byte[] checksum, byte[] checksumOut)
 {
     int size = Marshal.SizeOf(header);
     var b = new byte[size];
     var p = Marshal.AllocHGlobal(size);
     Marshal.StructureToPtr(header, p, true);
     Marshal.Copy(p, b, 0, size);
     Marshal.FreeHGlobal(p);
     walChecksumBytes(nativeChecksum, b, size, checksum, checksumOut);
 }