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

@@ -232,10 +232,7 @@ namespace DiscImageChef.Filesystems
if(littleEndian)
{
GCHandle handle = GCHandle.Alloc(minixSbSector, GCHandleType.Pinned);
mnxSb = (Minix3SuperBlock)Marshal.PtrToStructure(handle.AddrOfPinnedObject(),
typeof(Minix3SuperBlock));
handle.Free();
mnxSb = Helpers.Marshal.ByteArrayToStructureLittleEndian<Minix3SuperBlock>(minixSbSector);
}
else mnxSb = Helpers.Marshal.ByteArrayToStructureBigEndian<Minix3SuperBlock>(minixSbSector);
@@ -269,11 +266,7 @@ namespace DiscImageChef.Filesystems
if(littleEndian)
{
GCHandle handle = GCHandle.Alloc(minixSbSector, GCHandleType.Pinned);
mnxSb = (MinixSuperBlock)Marshal.PtrToStructure(handle.AddrOfPinnedObject(),
typeof(MinixSuperBlock));
handle.Free();
}
mnxSb = Helpers.Marshal.ByteArrayToStructureLittleEndian<MinixSuperBlock>(minixSbSector); }
else mnxSb = Helpers.Marshal.ByteArrayToStructureBigEndian<MinixSuperBlock>(minixSbSector);
sb.AppendLine(minixVersion);