mirror of
https://github.com/aaru-dps/Aaru.git
synced 2025-12-16 19:24:25 +00:00
Use new little endian marshaller on filesystems.
This commit is contained in:
@@ -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;
|
||||
|
||||
|
||||
Reference in New Issue
Block a user