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

@@ -52,10 +52,7 @@ namespace DiscImageChef.DiscImages
byte[] hdrB = new byte[Marshal.SizeOf(typeof(RsIdeHeader))];
stream.Read(hdrB, 0, hdrB.Length);
IntPtr hdrPtr = Marshal.AllocHGlobal(Marshal.SizeOf(typeof(RsIdeHeader)));
Marshal.Copy(hdrB, 0, hdrPtr, Marshal.SizeOf(typeof(RsIdeHeader)));
RsIdeHeader hdr = (RsIdeHeader)Marshal.PtrToStructure(hdrPtr, typeof(RsIdeHeader));
Marshal.FreeHGlobal(hdrPtr);
RsIdeHeader hdr = Helpers.Marshal.ByteArrayToStructureLittleEndian<RsIdeHeader>(hdrB);
if(!hdr.magic.SequenceEqual(signature)) return false;