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

@@ -60,10 +60,7 @@ namespace DiscImageChef.Filesystems
byte[] bk0 = imagePlugin.ReadSector(0 + partition.Start);
GCHandle handle = GCHandle.Alloc(bk0, GCHandleType.Pinned);
MicroDosBlock0 block0 =
(MicroDosBlock0)Marshal.PtrToStructure(handle.AddrOfPinnedObject(), typeof(MicroDosBlock0));
handle.Free();
MicroDosBlock0 block0 = Helpers.Marshal.ByteArrayToStructureLittleEndian<MicroDosBlock0>(bk0);
return block0.label == MAGIC && block0.mklabel == MAGIC2;
}
@@ -78,10 +75,7 @@ namespace DiscImageChef.Filesystems
byte[] bk0 = imagePlugin.ReadSector(0 + partition.Start);
GCHandle handle = GCHandle.Alloc(bk0, GCHandleType.Pinned);
MicroDosBlock0 block0 =
(MicroDosBlock0)Marshal.PtrToStructure(handle.AddrOfPinnedObject(), typeof(MicroDosBlock0));
handle.Free();
MicroDosBlock0 block0 = Helpers.Marshal.ByteArrayToStructureLittleEndian<MicroDosBlock0>(bk0);
sb.AppendLine("MicroDOS filesystem");
sb.AppendFormat("Volume has {0} blocks ({1} bytes)", block0.blocks, block0.blocks * 512).AppendLine();