public unsafe static bool StructureEqual(this object structure, object other) { long asize = Extractor.GetSize(structure); long bsize = Extractor.GetSize(structure); if (asize < bsize) { return(false); } byte *a = (byte *)structure.GetStructurePointer(), b = (byte *)other.GetStructurePointer(); bool equal = Extractor.BlockEqual(a, 0, b, 0, asize); Marshal.FreeHGlobal(new IntPtr(a)); Marshal.FreeHGlobal(new IntPtr(b)); return(equal); }
public unsafe static long GetSize(this object structure) { return(Extractor.GetSize(structure)); }