Add support for negative sectors to read and write sector calls in images.

This commit is contained in:
2025-10-23 03:07:43 +01:00
parent 0c19fe1b11
commit 69738f5f1a
289 changed files with 2676 additions and 1352 deletions

View File

@@ -55,7 +55,7 @@ public sealed partial class XFS
if((Marshal.SizeOf<Superblock>() + 0x400) % imagePlugin.Info.SectorSize != 0) sbSize++;
ErrorNumber errno = imagePlugin.ReadSectors(partition.Start, sbSize, out byte[] sector, out _);
ErrorNumber errno = imagePlugin.ReadSectors(partition.Start, false, sbSize, out byte[] sector, out _);
if(errno != ErrorNumber.NoError) return false;
@@ -95,7 +95,7 @@ public sealed partial class XFS
if(Marshal.SizeOf<Superblock>() % imagePlugin.Info.SectorSize != 0) sbSize++;
ErrorNumber errno =
imagePlugin.ReadSectors(partition.Start + location, sbSize, out byte[] sector, out _);
imagePlugin.ReadSectors(partition.Start + location, false, sbSize, out byte[] sector, out _);
if(errno != ErrorNumber.NoError) continue;
@@ -135,7 +135,7 @@ public sealed partial class XFS
if((Marshal.SizeOf<Superblock>() + 0x400) % imagePlugin.Info.SectorSize != 0) sbSize++;
ErrorNumber errno = imagePlugin.ReadSectors(partition.Start, sbSize, out byte[] sector, out _);
ErrorNumber errno = imagePlugin.ReadSectors(partition.Start, false, sbSize, out byte[] sector, out _);
if(errno != ErrorNumber.NoError || sector.Length < Marshal.SizeOf<Superblock>()) return;
@@ -172,7 +172,7 @@ public sealed partial class XFS
if(Marshal.SizeOf<Superblock>() % imagePlugin.Info.SectorSize != 0) sbSize++;
ErrorNumber errno =
imagePlugin.ReadSectors(partition.Start + location, sbSize, out byte[] sector, out _);
imagePlugin.ReadSectors(partition.Start + location, false, sbSize, out byte[] sector, out _);
if(errno != ErrorNumber.NoError || sector.Length < Marshal.SizeOf<Superblock>()) return;