Use new little endian marshaller on media images.

This commit is contained in:
2019-02-27 23:57:52 +00:00
parent 45be793491
commit 0fe8e3c11f
54 changed files with 320 additions and 705 deletions

View File

@@ -53,11 +53,7 @@ namespace DiscImageChef.DiscImages
byte[] pHdrB = new byte[Marshal.SizeOf(pHdr)];
stream.Read(pHdrB, 0, Marshal.SizeOf(pHdr));
pHdr = new ParallelsHeader();
IntPtr headerPtr = Marshal.AllocHGlobal(Marshal.SizeOf(pHdr));
Marshal.Copy(pHdrB, 0, headerPtr, Marshal.SizeOf(pHdr));
pHdr = (ParallelsHeader)Marshal.PtrToStructure(headerPtr, typeof(ParallelsHeader));
Marshal.FreeHGlobal(headerPtr);
pHdr = Helpers.Marshal.ByteArrayToStructureLittleEndian<ParallelsHeader>(pHdrB);
DicConsole.DebugWriteLine("Parallels plugin", "pHdr.magic = {0}",
StringHandlers.CToString(pHdr.magic));