Update ReadSector and ReadSectors methods to include sector status output

This commit is contained in:
2025-10-22 14:28:58 +01:00
parent 1003088cc3
commit 0ac2a48fb6
238 changed files with 5881 additions and 5196 deletions

View File

@@ -401,7 +401,7 @@ public sealed partial class Sidecar
if(sectors - doneSectors >= sectorsToRead)
{
errno = image.ReadSectors(doneSectors, sectorsToRead, out sector);
errno = image.ReadSectors(doneSectors, sectorsToRead, out sector, out _);
if(errno != ErrorNumber.NoError)
{
@@ -416,7 +416,7 @@ public sealed partial class Sidecar
}
else
{
errno = image.ReadSectors(doneSectors, (uint)(sectors - doneSectors), out sector);
errno = image.ReadSectors(doneSectors, (uint)(sectors - doneSectors), out sector, out _);
if(errno != ErrorNumber.NoError)
{
@@ -502,7 +502,8 @@ public sealed partial class Sidecar
{
errno = image.ReadSectors(tapePartition.FirstBlock + doneSectors,
sectorsToRead,
out sector);
out sector,
out _);
if(errno != ErrorNumber.NoError)
{
@@ -522,7 +523,8 @@ public sealed partial class Sidecar
{
errno = image.ReadSectors(tapePartition.FirstBlock + doneSectors,
(uint)(sectors - doneSectors),
out sector);
out sector,
out _);
if(errno != ErrorNumber.NoError)
{
@@ -602,7 +604,10 @@ public sealed partial class Sidecar
if(sectors - doneSectors >= sectorsToRead)
{
errno = image.ReadSectors(tapeFile.FirstBlock + doneSectors, sectorsToRead, out sector);
errno = image.ReadSectors(tapeFile.FirstBlock + doneSectors,
sectorsToRead,
out sector,
out _);
if(errno != ErrorNumber.NoError)
{
@@ -625,7 +630,8 @@ public sealed partial class Sidecar
{
errno = image.ReadSectors(tapeFile.FirstBlock + doneSectors,
(uint)(sectors - doneSectors),
out sector);
out sector,
out _);
if(errno != ErrorNumber.NoError)
{
@@ -1023,7 +1029,7 @@ public sealed partial class Sidecar
if(scpImage.ScpTracks.TryGetValue(t, out SuperCardPro.TrackHeader scpTrack))
{
byte[] trackContents =
var trackContents =
new byte[scpTrack.Entries.Last().dataOffset +
scpTrack.Entries.Last().trackLength -
scpImage.Header.offsets[t] +
@@ -1065,7 +1071,7 @@ public sealed partial class Sidecar
string basename = Path.Combine(Path.GetDirectoryName(imagePath), Path.GetFileNameWithoutExtension(imagePath));
bool kfDir = false;
var kfDir = false;
if(_aborted) return;
@@ -1138,7 +1144,7 @@ public sealed partial class Sidecar
}
Stream kfStream = kvp.Value.GetDataForkStream();
byte[] trackContents = new byte[kfStream.Length];
var trackContents = new byte[kfStream.Length];
kfStream.Position = 0;
kfStream.EnsureRead(trackContents, 0, trackContents.Length);
kfBlockTrackType.Size = (ulong)trackContents.Length;
@@ -1229,7 +1235,7 @@ public sealed partial class Sidecar
dfiImage.TrackLengths.TryGetValue(t, out long length))
{
dfiBlockTrackType.Image.Offset = (ulong)offset;
byte[] trackContents = new byte[length];
var trackContents = new byte[length];
dfiStream.Position = offset;
dfiStream.EnsureRead(trackContents, 0, trackContents.Length);
dfiBlockTrackType.Size = (ulong)trackContents.Length;

View File

@@ -358,7 +358,11 @@ public sealed partial class Sidecar
if(sectors - doneSectors >= sectorsToRead)
{
errno = image.ReadSectorsLong(doneSectors, sectorsToRead, xmlTrk.Sequence.Number, out sector);
errno = image.ReadSectorsLong(doneSectors,
sectorsToRead,
xmlTrk.Sequence.Number,
out sector,
out _);
UpdateProgress2(Localization.Core.Hashing_sector_0_of_1,
(long)doneSectors,
@@ -379,7 +383,8 @@ public sealed partial class Sidecar
errno = image.ReadSectorsLong(doneSectors,
(uint)(sectors - doneSectors),
xmlTrk.Sequence.Number,
out sector);
out sector,
out _);
UpdateProgress2(Localization.Core.Hashing_sector_0_of_1,
(long)doneSectors,