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,11 +32,11 @@
|
||||
|
||||
using System;
|
||||
using System.IO;
|
||||
using System.Runtime.InteropServices;
|
||||
using System.Text.RegularExpressions;
|
||||
using DiscImageChef.CommonTypes;
|
||||
using DiscImageChef.CommonTypes.Enums;
|
||||
using DiscImageChef.CommonTypes.Interfaces;
|
||||
using DiscImageChef.Helpers;
|
||||
|
||||
namespace DiscImageChef.DiscImages
|
||||
{
|
||||
@@ -46,13 +46,13 @@ namespace DiscImageChef.DiscImages
|
||||
{
|
||||
Stream stream = imageFilter.GetDataForkStream();
|
||||
|
||||
if(stream.Length < Marshal.SizeOf(typeof(RayHdr))) return false;
|
||||
if(stream.Length < Marshal.SizeOf<RayHdr>()) return false;
|
||||
|
||||
byte[] buffer = new byte[Marshal.SizeOf(typeof(RayHdr))];
|
||||
byte[] buffer = new byte[Marshal.SizeOf<RayHdr>()];
|
||||
stream.Seek(0, SeekOrigin.Begin);
|
||||
stream.Read(buffer, 0, buffer.Length);
|
||||
|
||||
RayHdr header = Helpers.Marshal.ByteArrayToStructureLittleEndian<RayHdr>(buffer);
|
||||
RayHdr header = Marshal.ByteArrayToStructureLittleEndian<RayHdr>(buffer);
|
||||
|
||||
string signature = StringHandlers.CToString(header.signature);
|
||||
|
||||
|
||||
Reference in New Issue
Block a user