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

@@ -82,10 +82,7 @@ namespace DiscImageChef.Filesystems
byte[] ntfsBpb = imagePlugin.ReadSector(0 + partition.Start);
IntPtr bpbPtr = Marshal.AllocHGlobal(512);
Marshal.Copy(ntfsBpb, 0, bpbPtr, 512);
NtfsBootBlock ntfsBb = (NtfsBootBlock)Marshal.PtrToStructure(bpbPtr, typeof(NtfsBootBlock));
Marshal.FreeHGlobal(bpbPtr);
NtfsBootBlock ntfsBb = Helpers.Marshal.ByteArrayToStructureLittleEndian<NtfsBootBlock>(ntfsBpb);
sb.AppendFormat("{0} bytes per sector", ntfsBb.bps).AppendLine();
sb.AppendFormat("{0} sectors per cluster ({1} bytes)", ntfsBb.spc, ntfsBb.spc * ntfsBb.bps).AppendLine();