Refactor IOpticalMediaImage.ReadSector(s) to return error status instead of buffer.

This commit is contained in:
2021-09-21 01:38:54 +01:00
parent 34df6087ce
commit b7fa638410
19 changed files with 281 additions and 274 deletions

View File

@@ -118,7 +118,14 @@ namespace Aaru.Core
UpdateProgress2Event?.Invoke($"Entropying sector {i + 1} of track {currentTrack.Sequence}",
(long)(i + 1), (long)currentTrack.EndSector);
byte[] sector = opticalMediaImage.ReadSector(i, currentTrack.Sequence);
ErrorNumber errno = opticalMediaImage.ReadSector(i, currentTrack.Sequence, out byte[] sector);
if(errno != ErrorNumber.NoError)
{
AaruConsole.ErrorWriteLine($"Error {errno} while reading sector {i}, continuing...");
continue;
}
if(duplicatedSectors)
{