mirror of
https://github.com/aaru-dps/Aaru.git
synced 2025-12-16 19:24:25 +00:00
[AaruFormat] More V1 behavior with not dumped sectors.
This commit is contained in:
@@ -77,6 +77,14 @@ public sealed partial class AaruFormat
|
||||
|
||||
Status res = aaruf_read_sector(_context, sectorAddress, negative, buffer, ref length, out _);
|
||||
|
||||
// Sector not dumped
|
||||
if(res == Status.SectorNotDumped && length > 0)
|
||||
{
|
||||
buffer = new byte[length];
|
||||
|
||||
return ErrorNumber.NoError;
|
||||
}
|
||||
|
||||
if(res != Status.BufferTooSmall) return StatusToErrorNumber(res);
|
||||
|
||||
buffer = new byte[length];
|
||||
@@ -102,6 +110,14 @@ public sealed partial class AaruFormat
|
||||
|
||||
Status res = aaruf_read_track_sector(_context, buffer, sectorAddress, ref length, (byte)track, out _);
|
||||
|
||||
// Sector not dumped
|
||||
if(res == Status.SectorNotDumped && length > 0)
|
||||
{
|
||||
buffer = new byte[length];
|
||||
|
||||
return ErrorNumber.NoError;
|
||||
}
|
||||
|
||||
if(res != Status.BufferTooSmall) return StatusToErrorNumber(res);
|
||||
|
||||
buffer = new byte[length];
|
||||
@@ -133,6 +149,14 @@ public sealed partial class AaruFormat
|
||||
|
||||
Status res = aaruf_read_sector_long(_context, sectorAddress, negative, buffer, ref length, out _);
|
||||
|
||||
// Sector not dumped
|
||||
if(res == Status.SectorNotDumped && length > 0)
|
||||
{
|
||||
buffer = new byte[length];
|
||||
|
||||
return ErrorNumber.NoError;
|
||||
}
|
||||
|
||||
if(res != Status.BufferTooSmall) return StatusToErrorNumber(res);
|
||||
|
||||
buffer = new byte[length];
|
||||
|
||||
Reference in New Issue
Block a user