mirror of
https://github.com/aaru-dps/Aaru.git
synced 2025-12-16 19:24:25 +00:00
Use new little endian marshaller on media images.
This commit is contained in:
@@ -30,7 +30,6 @@
|
||||
// Copyright © 2011-2019 Natalia Portillo
|
||||
// ****************************************************************************/
|
||||
|
||||
using System;
|
||||
using System.IO;
|
||||
using System.Linq;
|
||||
using System.Runtime.InteropServices;
|
||||
@@ -50,10 +49,7 @@ namespace DiscImageChef.DiscImages
|
||||
byte[] hdr = new byte[Marshal.SizeOf(Header)];
|
||||
stream.Read(hdr, 0, Marshal.SizeOf(Header));
|
||||
|
||||
IntPtr hdrPtr = Marshal.AllocHGlobal(Marshal.SizeOf(Header));
|
||||
Marshal.Copy(hdr, 0, hdrPtr, Marshal.SizeOf(Header));
|
||||
Header = (ScpHeader)Marshal.PtrToStructure(hdrPtr, typeof(ScpHeader));
|
||||
Marshal.FreeHGlobal(hdrPtr);
|
||||
Header = Helpers.Marshal.ByteArrayToStructureLittleEndian<ScpHeader>(hdr);
|
||||
|
||||
return scpSignature.SequenceEqual(Header.signature);
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user