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

@@ -308,7 +308,7 @@ public sealed class MBR : IPartition
{
partitions = [];
ErrorNumber errno = imagePlugin.ReadSector(start, out byte[] sector, out _);
ErrorNumber errno = imagePlugin.ReadSector(start, false, out byte[] sector, out _);
if(errno != ErrorNumber.NoError) return false;
@@ -643,7 +643,7 @@ public sealed class MBR : IPartition
divider = 4;
}
ErrorNumber errno = imagePlugin.ReadSector(sectorOffset, out byte[] sector, out _);
ErrorNumber errno = imagePlugin.ReadSector(sectorOffset, false, out byte[] sector, out _);
if(errno != ErrorNumber.NoError) return false;
@@ -664,7 +664,7 @@ public sealed class MBR : IPartition
if(mbr.magic != MBR_MAGIC) return false; // Not MBR
errno = imagePlugin.ReadSector(1 + sectorOffset, out byte[] hdrBytes, out _);
errno = imagePlugin.ReadSector(1 + sectorOffset, false, out byte[] hdrBytes, out _);
if(errno != ErrorNumber.NoError) return false;
@@ -676,7 +676,7 @@ public sealed class MBR : IPartition
if(imagePlugin.Info.MetadataMediaType == MetadataMediaType.OpticalDisc)
{
errno = imagePlugin.ReadSector(sectorOffset, out hdrBytes, out _);
errno = imagePlugin.ReadSector(sectorOffset, false, out hdrBytes, out _);
if(errno != ErrorNumber.NoError) return false;
@@ -824,7 +824,7 @@ public sealed class MBR : IPartition
while(processingExtended)
{
errno = imagePlugin.ReadSector(lbaStart, out sector, out _);
errno = imagePlugin.ReadSector(lbaStart, false, out sector, out _);
if(errno != ErrorNumber.NoError) break;