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

@@ -52,11 +52,7 @@ namespace DiscImageChef.Filesystems.AppleDOS
int spt = imagePlugin.Info.Sectors == 455 ? 13 : 16;
byte[] vtocB = imagePlugin.ReadSector((ulong)(17 * spt));
vtoc = new Vtoc();
IntPtr vtocPtr = Marshal.AllocHGlobal(256);
Marshal.Copy(vtocB, 0, vtocPtr, 256);
vtoc = (Vtoc)Marshal.PtrToStructure(vtocPtr, typeof(Vtoc));
Marshal.FreeHGlobal(vtocPtr);
vtoc = Helpers.Marshal.ByteArrayToStructureLittleEndian<Vtoc>(vtocB);
return vtoc.catalogSector < spt && vtoc.maxTrackSectorPairsPerSector <= 122 &&
vtoc.sectorsPerTrack == spt && vtoc.bytesPerSector == 256;
@@ -73,11 +69,7 @@ namespace DiscImageChef.Filesystems.AppleDOS
spt = imagePlugin.Info.Sectors == 455 ? 13 : 16;
byte[] vtocB = imagePlugin.ReadSector((ulong)(17 * spt));
vtoc = new Vtoc();
IntPtr vtocPtr = Marshal.AllocHGlobal(256);
Marshal.Copy(vtocB, 0, vtocPtr, 256);
vtoc = (Vtoc)Marshal.PtrToStructure(vtocPtr, typeof(Vtoc));
Marshal.FreeHGlobal(vtocPtr);
vtoc = Helpers.Marshal.ByteArrayToStructureLittleEndian<Vtoc>(vtocB);
sb.AppendLine("Apple DOS File System");
sb.AppendLine();