From 5bc77788ece229aac83b0605b6652f1e56db3d5c Mon Sep 17 00:00:00 2001 From: Natalia Portillo Date: Sun, 19 Sep 2021 21:16:40 +0100 Subject: [PATCH] Refactor IMediaImage.ReadSector(s) to return error status instead of buffer. --- Enums/ErrorNumber.cs | 3 ++- Interfaces/IMediaImage.cs | 6 ++++-- 2 files changed, 6 insertions(+), 3 deletions(-) diff --git a/Enums/ErrorNumber.cs b/Enums/ErrorNumber.cs index fa0dfebd6..12e9ef704 100644 --- a/Enums/ErrorNumber.cs +++ b/Enums/ErrorNumber.cs @@ -170,6 +170,7 @@ namespace Aaru.CommonTypes.Enums /// Cannot open device CannotOpenDevice = 27, /// Cannot remove the existing database - CannotRemoveDatabase = -28 + CannotRemoveDatabase = 28, + SectorNotFound=29 } } \ No newline at end of file diff --git a/Interfaces/IMediaImage.cs b/Interfaces/IMediaImage.cs index d05a3ba89..22b986d90 100644 --- a/Interfaces/IMediaImage.cs +++ b/Interfaces/IMediaImage.cs @@ -83,7 +83,8 @@ namespace Aaru.CommonTypes.Interfaces /// Reads a sector's user data. /// The sector's user data. /// Sector address (LBA). - byte[] ReadSector(ulong sectorAddress); + /// + ErrorNumber ReadSector(ulong sectorAddress, out byte[] buffer); /// Reads a sector's tag. /// The sector's tag. @@ -95,7 +96,8 @@ namespace Aaru.CommonTypes.Interfaces /// The sectors user data. /// Starting sector address (LBA). /// How many sectors to read. - byte[] ReadSectors(ulong sectorAddress, uint length); + /// + ErrorNumber ReadSectors(ulong sectorAddress, uint length, out byte[] buffer); /// Reads tag from several sectors. /// The sectors tag.