Use new little endian marshaller on filesystems.

This commit is contained in:
2019-03-01 00:28:55 +00:00
parent f95633046e
commit 0ec558da55
45 changed files with 154 additions and 531 deletions

View File

@@ -72,10 +72,7 @@ namespace DiscImageChef.Filesystems
byte[] sector = imagePlugin.ReadSectors(partition.Start + sbAddr, sbSize);
if(sector.Length < Marshal.SizeOf(reiserSb)) return false;
IntPtr sbPtr = Marshal.AllocHGlobal(Marshal.SizeOf(reiserSb));
Marshal.Copy(sector, 0, sbPtr, Marshal.SizeOf(reiserSb));
reiserSb = (Reiser4_Superblock)Marshal.PtrToStructure(sbPtr, typeof(Reiser4_Superblock));
Marshal.FreeHGlobal(sbPtr);
reiserSb = Helpers.Marshal.ByteArrayToStructureLittleEndian<Reiser4_Superblock>(sector);
return reiser4_magic.SequenceEqual(reiserSb.magic);
}
@@ -98,10 +95,7 @@ namespace DiscImageChef.Filesystems
byte[] sector = imagePlugin.ReadSectors(partition.Start + sbAddr, sbSize);
if(sector.Length < Marshal.SizeOf(reiserSb)) return;
IntPtr sbPtr = Marshal.AllocHGlobal(Marshal.SizeOf(reiserSb));
Marshal.Copy(sector, 0, sbPtr, Marshal.SizeOf(reiserSb));
reiserSb = (Reiser4_Superblock)Marshal.PtrToStructure(sbPtr, typeof(Reiser4_Superblock));
Marshal.FreeHGlobal(sbPtr);
reiserSb = Helpers.Marshal.ByteArrayToStructureLittleEndian<Reiser4_Superblock>(sector);
if(!reiser4_magic.SequenceEqual(reiserSb.magic)) return;