mirror of
https://github.com/aaru-dps/Aaru.git
synced 2025-12-16 19:24:25 +00:00
Override Marshal.SizeOf in Helpers and use it instead of System's.
This commit is contained in:
@@ -32,10 +32,10 @@
|
||||
|
||||
using System.IO;
|
||||
using System.Linq;
|
||||
using System.Runtime.InteropServices;
|
||||
using System.Text;
|
||||
using DiscImageChef.CommonTypes.Interfaces;
|
||||
using DiscImageChef.Console;
|
||||
using DiscImageChef.Helpers;
|
||||
|
||||
namespace DiscImageChef.DiscImages
|
||||
{
|
||||
@@ -48,14 +48,12 @@ namespace DiscImageChef.DiscImages
|
||||
// Even if comment is supposedly ASCII, I'm pretty sure most emulators allow Shift-JIS to be used :p
|
||||
Encoding shiftjis = Encoding.GetEncoding("shift_jis");
|
||||
|
||||
v98Hdr = new Virtual98Header();
|
||||
if(stream.Length < Marshal.SizeOf<Virtual98Header>()) return false;
|
||||
|
||||
if(stream.Length < Marshal.SizeOf(v98Hdr)) return false;
|
||||
|
||||
byte[] hdrB = new byte[Marshal.SizeOf(v98Hdr)];
|
||||
byte[] hdrB = new byte[Marshal.SizeOf<Virtual98Header>()];
|
||||
stream.Read(hdrB, 0, hdrB.Length);
|
||||
|
||||
v98Hdr = Helpers.Marshal.ByteArrayToStructureLittleEndian<Virtual98Header>(hdrB);
|
||||
v98Hdr = Marshal.ByteArrayToStructureLittleEndian<Virtual98Header>(hdrB);
|
||||
|
||||
if(!v98Hdr.signature.SequenceEqual(signature)) return false;
|
||||
|
||||
|
||||
Reference in New Issue
Block a user