Redo Reformat and cleanup.

Rider EAP was having a bug interpreting .editorconfig that didn't generate the code style as we wanted.
This is now done with Rider-stable.
This commit is contained in:
2023-10-04 17:34:40 +01:00
parent bc8bf7a2dc
commit 7363a5d9c5
453 changed files with 7241 additions and 7126 deletions

View File

@@ -79,8 +79,7 @@ public sealed partial class DeviceReport
if(ataId.UnformattedBPS != 0)
mediaTest.UnformattedBPS = ataId.UnformattedBPS;
if(ataId.Cylinders > 0 &&
ataId is { Heads: > 0, SectorsPerTrack: > 0 })
if(ataId.Cylinders > 0 && ataId is { Heads: > 0, SectorsPerTrack: > 0 })
{
mediaTest.CHS = new Chs
{
@@ -92,8 +91,7 @@ public sealed partial class DeviceReport
mediaTest.Blocks = (ulong)(ataId.Cylinders * ataId.Heads * ataId.SectorsPerTrack);
}
if(ataId.CurrentCylinders > 0 &&
ataId is { CurrentHeads: > 0, CurrentSectorsPerTrack: > 0 })
if(ataId.CurrentCylinders > 0 && ataId is { CurrentHeads: > 0, CurrentSectorsPerTrack: > 0 })
{
mediaTest.CurrentCHS = new Chs
{
@@ -121,8 +119,7 @@ public sealed partial class DeviceReport
mediaTest.Blocks = ataId.LBA48Sectors;
}
if(ataId.NominalRotationRate != 0x0000 &&
ataId.NominalRotationRate != 0xFFFF)
if(ataId.NominalRotationRate != 0x0000 && ataId.NominalRotationRate != 0xFFFF)
{
if(ataId.NominalRotationRate == 0x0001)
mediaTest.SolidStateDevice = true;
@@ -136,13 +133,11 @@ public sealed partial class DeviceReport
uint logicalSectorSize;
uint physicalSectorSize;
if((ataId.PhysLogSectorSize & 0x8000) == 0x0000 &&
(ataId.PhysLogSectorSize & 0x4000) == 0x4000)
if((ataId.PhysLogSectorSize & 0x8000) == 0x0000 && (ataId.PhysLogSectorSize & 0x4000) == 0x4000)
{
if((ataId.PhysLogSectorSize & 0x1000) == 0x1000)
{
if(ataId.LogicalSectorWords <= 255 ||
ataId.LogicalAlignment == 0xFFFF)
if(ataId.LogicalSectorWords <= 255 || ataId.LogicalAlignment == 0xFFFF)
logicalSectorSize = 512;
else
logicalSectorSize = ataId.LogicalSectorWords * 2;
@@ -167,13 +162,11 @@ public sealed partial class DeviceReport
{
mediaTest.PhysicalBlockSize = physicalSectorSize;
if((ataId.LogicalAlignment & 0x8000) == 0x0000 &&
(ataId.LogicalAlignment & 0x4000) == 0x4000)
if((ataId.LogicalAlignment & 0x8000) == 0x0000 && (ataId.LogicalAlignment & 0x4000) == 0x4000)
mediaTest.LogicalAlignment = (ushort)(ataId.LogicalAlignment & 0x3FFF);
}
if(ataId.EccBytes != 0x0000 &&
ataId.EccBytes != 0xFFFF)
if(ataId.EccBytes != 0x0000 && ataId.EccBytes != 0xFFFF)
mediaTest.LongBlockSize = logicalSectorSize + ataId.EccBytes;
if(ataId.UnformattedBPS > logicalSectorSize &&
@@ -198,8 +191,8 @@ public sealed partial class DeviceReport
sense = _dev.Read(out readBuf, out errorChs, false, 0, 0, 1, 1, _dev.Timeout, out _);
});
mediaTest.SupportsReadSectors = !sense && (errorChs.Status & 0x01) != 0x01 && errorChs.Error == 0 &&
readBuf.Length > 0;
mediaTest.SupportsReadSectors =
!sense && (errorChs.Status & 0x01) != 0x01 && errorChs.Error == 0 && readBuf.Length > 0;
AaruConsole.DebugWriteLine(ATA_MODULE_NAME, Localization.Core.Sense_0_Status_1_Error_2_Length_3, sense,
errorChs.Status, errorChs.Error, readBuf.Length);
@@ -212,8 +205,8 @@ public sealed partial class DeviceReport
sense = _dev.Read(out readBuf, out errorChs, true, 0, 0, 1, 1, _dev.Timeout, out _);
});
mediaTest.SupportsReadRetry = !sense && (errorChs.Status & 0x01) != 0x01 && errorChs.Error == 0 &&
readBuf.Length > 0;
mediaTest.SupportsReadRetry =
!sense && (errorChs.Status & 0x01) != 0x01 && errorChs.Error == 0 && readBuf.Length > 0;
AaruConsole.DebugWriteLine(ATA_MODULE_NAME, Localization.Core.Sense_0_Status_1_Error_2_Length_3, sense,
errorChs.Status, errorChs.Error, readBuf.Length);
@@ -226,8 +219,8 @@ public sealed partial class DeviceReport
sense = _dev.ReadDma(out readBuf, out errorChs, false, 0, 0, 1, 1, _dev.Timeout, out _);
});
mediaTest.SupportsReadDma = !sense && (errorChs.Status & 0x01) != 0x01 && errorChs.Error == 0 &&
readBuf.Length > 0;
mediaTest.SupportsReadDma =
!sense && (errorChs.Status & 0x01) != 0x01 && errorChs.Error == 0 && readBuf.Length > 0;
AaruConsole.DebugWriteLine(ATA_MODULE_NAME, Localization.Core.Sense_0_Status_1_Error_2_Length_3, sense,
errorChs.Status, errorChs.Error, readBuf.Length);
@@ -240,8 +233,8 @@ public sealed partial class DeviceReport
sense = _dev.ReadDma(out readBuf, out errorChs, true, 0, 0, 1, 1, _dev.Timeout, out _);
});
mediaTest.SupportsReadDmaRetry = !sense && (errorChs.Status & 0x01) != 0x01 && errorChs.Error == 0 &&
readBuf.Length > 0;
mediaTest.SupportsReadDmaRetry =
!sense && (errorChs.Status & 0x01) != 0x01 && errorChs.Error == 0 && readBuf.Length > 0;
AaruConsole.DebugWriteLine(ATA_MODULE_NAME, Localization.Core.Sense_0_Status_1_Error_2_Length_3, sense,
errorChs.Status, errorChs.Error, readBuf.Length);
@@ -257,8 +250,7 @@ public sealed partial class DeviceReport
mediaTest.SupportsSeek = !sense && (errorChs.Status & 0x01) != 0x01 && errorChs.Error == 0;
AaruConsole.DebugWriteLine(ATA_MODULE_NAME, Localization.Core.Sense_0_Status_1_Error_2, sense,
errorChs.Status,
errorChs.Error);
errorChs.Status, errorChs.Error);
Spectre.ProgressSingleSpinner(ctx =>
{
@@ -266,8 +258,8 @@ public sealed partial class DeviceReport
sense = _dev.Read(out readBuf, out errorLba, false, 0, 1, _dev.Timeout, out _);
});
mediaTest.SupportsReadLba = !sense && (errorLba.Status & 0x01) != 0x01 && errorLba.Error == 0 &&
readBuf.Length > 0;
mediaTest.SupportsReadLba =
!sense && (errorLba.Status & 0x01) != 0x01 && errorLba.Error == 0 && readBuf.Length > 0;
AaruConsole.DebugWriteLine(ATA_MODULE_NAME, Localization.Core.Sense_0_Status_1_Error_2_Length_3, sense,
errorChs.Status, errorChs.Error, readBuf.Length);
@@ -280,8 +272,8 @@ public sealed partial class DeviceReport
sense = _dev.Read(out readBuf, out errorLba, true, 0, 1, _dev.Timeout, out _);
});
mediaTest.SupportsReadRetryLba = !sense && (errorLba.Status & 0x01) != 0x01 && errorLba.Error == 0 &&
readBuf.Length > 0;
mediaTest.SupportsReadRetryLba =
!sense && (errorLba.Status & 0x01) != 0x01 && errorLba.Error == 0 && readBuf.Length > 0;
AaruConsole.DebugWriteLine(ATA_MODULE_NAME, Localization.Core.Sense_0_Status_1_Error_2_Length_3, sense,
errorChs.Status, errorChs.Error, readBuf.Length);
@@ -294,8 +286,8 @@ public sealed partial class DeviceReport
sense = _dev.ReadDma(out readBuf, out errorLba, false, 0, 1, _dev.Timeout, out _);
});
mediaTest.SupportsReadDmaLba = !sense && (errorLba.Status & 0x01) != 0x01 && errorLba.Error == 0 &&
readBuf.Length > 0;
mediaTest.SupportsReadDmaLba =
!sense && (errorLba.Status & 0x01) != 0x01 && errorLba.Error == 0 && readBuf.Length > 0;
AaruConsole.DebugWriteLine(ATA_MODULE_NAME, Localization.Core.Sense_0_Status_1_Error_2_Length_3, sense,
errorChs.Status, errorChs.Error, readBuf.Length);
@@ -308,8 +300,8 @@ public sealed partial class DeviceReport
sense = _dev.ReadDma(out readBuf, out errorLba, true, 0, 1, _dev.Timeout, out _);
});
mediaTest.SupportsReadDmaRetryLba = !sense && (errorLba.Status & 0x01) != 0x01 && errorLba.Error == 0 &&
readBuf.Length > 0;
mediaTest.SupportsReadDmaRetryLba =
!sense && (errorLba.Status & 0x01) != 0x01 && errorLba.Error == 0 && readBuf.Length > 0;
AaruConsole.DebugWriteLine(ATA_MODULE_NAME, Localization.Core.Sense_0_Status_1_Error_2_Length_3, sense,
errorChs.Status, errorChs.Error, readBuf.Length);
@@ -325,8 +317,7 @@ public sealed partial class DeviceReport
mediaTest.SupportsSeekLba = !sense && (errorLba.Status & 0x01) != 0x01 && errorLba.Error == 0;
AaruConsole.DebugWriteLine(ATA_MODULE_NAME, Localization.Core.Sense_0_Status_1_Error_2, sense,
errorChs.Status,
errorChs.Error);
errorChs.Status, errorChs.Error);
Spectre.ProgressSingleSpinner(ctx =>
{
@@ -334,8 +325,8 @@ public sealed partial class DeviceReport
sense = _dev.Read(out readBuf, out AtaErrorRegistersLba28 _, 0, 1, _dev.Timeout, out _);
});
mediaTest.SupportsReadLba48 = !sense && (errorLba48.Status & 0x01) != 0x01 && errorLba48.Error == 0 &&
readBuf.Length > 0;
mediaTest.SupportsReadLba48 =
!sense && (errorLba48.Status & 0x01) != 0x01 && errorLba48.Error == 0 && readBuf.Length > 0;
AaruConsole.DebugWriteLine(ATA_MODULE_NAME, Localization.Core.Sense_0_Status_1_Error_2_Length_3, sense,
errorChs.Status, errorChs.Error, readBuf.Length);
@@ -348,8 +339,8 @@ public sealed partial class DeviceReport
sense = _dev.ReadDma(out readBuf, out errorLba48, 0, 1, _dev.Timeout, out _);
});
mediaTest.SupportsReadDmaLba48 = !sense && (errorLba48.Status & 0x01) != 0x01 && errorLba48.Error == 0 &&
readBuf.Length > 0;
mediaTest.SupportsReadDmaLba48 =
!sense && (errorLba48.Status & 0x01) != 0x01 && errorLba48.Error == 0 && readBuf.Length > 0;
AaruConsole.DebugWriteLine(ATA_MODULE_NAME, Localization.Core.Sense_0_Status_1_Error_2_Length_3, sense,
errorChs.Status, errorChs.Error, readBuf.Length);
@@ -367,8 +358,7 @@ public sealed partial class DeviceReport
{
ataId = Identify.Decode(buffer).Value;
if(ataId.EccBytes != 0x0000 &&
ataId.EccBytes != 0xFFFF)
if(ataId.EccBytes != 0x0000 && ataId.EccBytes != 0xFFFF)
mediaTest.LongBlockSize = logicalSectorSize + ataId.EccBytes;
if(ataId.UnformattedBPS > logicalSectorSize &&
@@ -384,8 +374,11 @@ public sealed partial class DeviceReport
_dev.Timeout, out _);
});
mediaTest.SupportsReadLong = !sense && (errorChs.Status & 0x01) != 0x01 && errorChs.Error == 0 &&
readBuf.Length > 0 && BitConverter.ToUInt64(readBuf, 0) != checkCorrectRead;
mediaTest.SupportsReadLong = !sense &&
(errorChs.Status & 0x01) != 0x01 &&
errorChs.Error == 0 &&
readBuf.Length > 0 &&
BitConverter.ToUInt64(readBuf, 0) != checkCorrectRead;
AaruConsole.DebugWriteLine(ATA_MODULE_NAME, Localization.Core.Sense_0_Status_1_Error_2_Length_3, sense,
errorChs.Status, errorChs.Error, readBuf.Length);
@@ -400,9 +393,11 @@ public sealed partial class DeviceReport
_dev.Timeout, out _);
});
mediaTest.SupportsReadLongRetry = !sense && (errorChs.Status & 0x01) != 0x01 && errorChs.Error == 0 &&
readBuf.Length > 0 && BitConverter.ToUInt64(readBuf, 0) !=
checkCorrectRead;
mediaTest.SupportsReadLongRetry = !sense &&
(errorChs.Status & 0x01) != 0x01 &&
errorChs.Error == 0 &&
readBuf.Length > 0 &&
BitConverter.ToUInt64(readBuf, 0) != checkCorrectRead;
AaruConsole.DebugWriteLine(ATA_MODULE_NAME, Localization.Core.Sense_0_Status_1_Error_2_Length_3, sense,
errorChs.Status, errorChs.Error, readBuf.Length);
@@ -417,8 +412,11 @@ public sealed partial class DeviceReport
out _);
});
mediaTest.SupportsReadLongLba = !sense && (errorLba.Status & 0x01) != 0x01 && errorLba.Error == 0 &&
readBuf.Length > 0 && BitConverter.ToUInt64(readBuf, 0) != checkCorrectRead;
mediaTest.SupportsReadLongLba = !sense &&
(errorLba.Status & 0x01) != 0x01 &&
errorLba.Error == 0 &&
readBuf.Length > 0 &&
BitConverter.ToUInt64(readBuf, 0) != checkCorrectRead;
AaruConsole.DebugWriteLine(ATA_MODULE_NAME, Localization.Core.Sense_0_Status_1_Error_2_Length_3, sense,
errorChs.Status, errorChs.Error, readBuf.Length);
@@ -433,9 +431,11 @@ public sealed partial class DeviceReport
out _);
});
mediaTest.SupportsReadLongRetryLba = !sense && (errorLba.Status & 0x01) != 0x01 && errorLba.Error == 0 &&
readBuf.Length > 0 && BitConverter.ToUInt64(readBuf, 0) !=
checkCorrectRead;
mediaTest.SupportsReadLongRetryLba = !sense &&
(errorLba.Status & 0x01) != 0x01 &&
errorLba.Error == 0 &&
readBuf.Length > 0 &&
BitConverter.ToUInt64(readBuf, 0) != checkCorrectRead;
AaruConsole.DebugWriteLine(ATA_MODULE_NAME, Localization.Core.Sense_0_Status_1_Error_2_Length_3, sense,
errorChs.Status, errorChs.Error, readBuf.Length);
@@ -464,8 +464,7 @@ public sealed partial class DeviceReport
if(ataId.UnformattedBPS != 0)
capabilities.UnformattedBPS = ataId.UnformattedBPS;
if(ataId.Cylinders > 0 &&
ataId is { Heads: > 0, SectorsPerTrack: > 0 })
if(ataId.Cylinders > 0 && ataId is { Heads: > 0, SectorsPerTrack: > 0 })
{
capabilities.CHS = new Chs
{
@@ -477,8 +476,7 @@ public sealed partial class DeviceReport
capabilities.Blocks = (ulong)(ataId.Cylinders * ataId.Heads * ataId.SectorsPerTrack);
}
if(ataId.CurrentCylinders > 0 &&
ataId is { CurrentHeads: > 0, CurrentSectorsPerTrack: > 0 })
if(ataId.CurrentCylinders > 0 && ataId is { CurrentHeads: > 0, CurrentSectorsPerTrack: > 0 })
{
capabilities.CurrentCHS = new Chs
{
@@ -502,8 +500,7 @@ public sealed partial class DeviceReport
capabilities.Blocks = ataId.LBA48Sectors;
}
if(ataId.NominalRotationRate != 0x0000 &&
ataId.NominalRotationRate != 0xFFFF)
if(ataId.NominalRotationRate != 0x0000 && ataId.NominalRotationRate != 0xFFFF)
{
if(ataId.NominalRotationRate == 0x0001)
capabilities.SolidStateDevice = true;
@@ -517,13 +514,11 @@ public sealed partial class DeviceReport
uint logicalSectorSize;
uint physicalSectorSize;
if((ataId.PhysLogSectorSize & 0x8000) == 0x0000 &&
(ataId.PhysLogSectorSize & 0x4000) == 0x4000)
if((ataId.PhysLogSectorSize & 0x8000) == 0x0000 && (ataId.PhysLogSectorSize & 0x4000) == 0x4000)
{
if((ataId.PhysLogSectorSize & 0x1000) == 0x1000)
{
if(ataId.LogicalSectorWords <= 255 ||
ataId.LogicalAlignment == 0xFFFF)
if(ataId.LogicalSectorWords <= 255 || ataId.LogicalAlignment == 0xFFFF)
logicalSectorSize = 512;
else
logicalSectorSize = ataId.LogicalSectorWords * 2;
@@ -548,13 +543,11 @@ public sealed partial class DeviceReport
{
capabilities.PhysicalBlockSize = physicalSectorSize;
if((ataId.LogicalAlignment & 0x8000) == 0x0000 &&
(ataId.LogicalAlignment & 0x4000) == 0x4000)
if((ataId.LogicalAlignment & 0x8000) == 0x0000 && (ataId.LogicalAlignment & 0x4000) == 0x4000)
capabilities.LogicalAlignment = (ushort)(ataId.LogicalAlignment & 0x3FFF);
}
if(ataId.EccBytes != 0x0000 &&
ataId.EccBytes != 0xFFFF)
if(ataId.EccBytes != 0x0000 && ataId.EccBytes != 0xFFFF)
capabilities.LongBlockSize = logicalSectorSize + ataId.EccBytes;
if(ataId.UnformattedBPS > logicalSectorSize &&
@@ -579,8 +572,8 @@ public sealed partial class DeviceReport
sense = _dev.Read(out readBuf, out errorChs, false, 0, 0, 1, 1, _dev.Timeout, out _);
});
capabilities.SupportsReadSectors = !sense && (errorChs.Status & 0x01) != 0x01 && errorChs.Error == 0 &&
readBuf.Length > 0;
capabilities.SupportsReadSectors =
!sense && (errorChs.Status & 0x01) != 0x01 && errorChs.Error == 0 && readBuf.Length > 0;
AaruConsole.DebugWriteLine(ATA_MODULE_NAME, Localization.Core.Sense_0_Status_1_Error_2_Length_3, sense,
errorChs.Status, errorChs.Error, readBuf.Length);
@@ -621,8 +614,8 @@ public sealed partial class DeviceReport
sense = _dev.ReadDma(out readBuf, out errorChs, true, 0, 0, 1, 1, _dev.Timeout, out _);
});
capabilities.SupportsReadDmaRetry = !sense && (errorChs.Status & 0x01) != 0x01 && errorChs.Error == 0 &&
readBuf.Length > 0;
capabilities.SupportsReadDmaRetry =
!sense && (errorChs.Status & 0x01) != 0x01 && errorChs.Error == 0 && readBuf.Length > 0;
AaruConsole.DebugWriteLine(ATA_MODULE_NAME, Localization.Core.Sense_0_Status_1_Error_2_Length_3, sense,
errorChs.Status, errorChs.Error, readBuf.Length);
@@ -660,8 +653,8 @@ public sealed partial class DeviceReport
sense = _dev.Read(out readBuf, out errorLba, true, 0, 1, _dev.Timeout, out _);
});
capabilities.SupportsReadRetryLba = !sense && (errorLba.Status & 0x01) != 0x01 && errorLba.Error == 0 &&
readBuf.Length > 0;
capabilities.SupportsReadRetryLba =
!sense && (errorLba.Status & 0x01) != 0x01 && errorLba.Error == 0 && readBuf.Length > 0;
AaruConsole.DebugWriteLine(ATA_MODULE_NAME, Localization.Core.Sense_0_Status_1_Error_2_Length_3, sense,
errorLba.Status, errorLba.Error, readBuf.Length);
@@ -674,8 +667,8 @@ public sealed partial class DeviceReport
sense = _dev.ReadDma(out readBuf, out errorLba, false, 0, 1, _dev.Timeout, out _);
});
capabilities.SupportsReadDmaLba = !sense && (errorLba.Status & 0x01) != 0x01 && errorLba.Error == 0 &&
readBuf.Length > 0;
capabilities.SupportsReadDmaLba =
!sense && (errorLba.Status & 0x01) != 0x01 && errorLba.Error == 0 && readBuf.Length > 0;
AaruConsole.DebugWriteLine(ATA_MODULE_NAME, Localization.Core.Sense_0_Status_1_Error_2_Length_3, sense,
errorLba.Status, errorLba.Error, readBuf.Length);
@@ -713,8 +706,8 @@ public sealed partial class DeviceReport
sense = _dev.Read(out readBuf, out errorLba48, 0, 1, _dev.Timeout, out _);
});
capabilities.SupportsReadLba48 = !sense && (errorLba48.Status & 0x01) != 0x01 && errorLba48.Error == 0 &&
readBuf.Length > 0;
capabilities.SupportsReadLba48 =
!sense && (errorLba48.Status & 0x01) != 0x01 && errorLba48.Error == 0 && readBuf.Length > 0;
AaruConsole.DebugWriteLine(ATA_MODULE_NAME, Localization.Core.Sense_0_Status_1_Error_2_Length_3, sense,
errorLba48.Status, errorLba48.Error, readBuf.Length);
@@ -727,8 +720,8 @@ public sealed partial class DeviceReport
sense = _dev.ReadDma(out readBuf, out errorLba48, 0, 1, _dev.Timeout, out _);
});
capabilities.SupportsReadDmaLba48 = !sense && (errorLba48.Status & 0x01) != 0x01 && errorLba48.Error == 0 &&
readBuf.Length > 0;
capabilities.SupportsReadDmaLba48 =
!sense && (errorLba48.Status & 0x01) != 0x01 && errorLba48.Error == 0 && readBuf.Length > 0;
AaruConsole.DebugWriteLine(ATA_MODULE_NAME, Localization.Core.Sense_0_Status_1_Error_2_Length_3, sense,
errorLba48.Status, errorLba48.Error, readBuf.Length);
@@ -746,8 +739,7 @@ public sealed partial class DeviceReport
{
ataId = Identify.Decode(buffer).Value;
if(ataId.EccBytes != 0x0000 &&
ataId.EccBytes != 0xFFFF)
if(ataId.EccBytes != 0x0000 && ataId.EccBytes != 0xFFFF)
capabilities.LongBlockSize = logicalSectorSize + ataId.EccBytes;
if(ataId.UnformattedBPS > logicalSectorSize &&
@@ -763,8 +755,11 @@ public sealed partial class DeviceReport
_dev.Timeout, out _);
});
capabilities.SupportsReadLong = !sense && (errorChs.Status & 0x01) != 0x01 && errorChs.Error == 0 &&
readBuf.Length > 0 && BitConverter.ToUInt64(readBuf, 0) != checkCorrectRead;
capabilities.SupportsReadLong = !sense &&
(errorChs.Status & 0x01) != 0x01 &&
errorChs.Error == 0 &&
readBuf.Length > 0 &&
BitConverter.ToUInt64(readBuf, 0) != checkCorrectRead;
AaruConsole.DebugWriteLine(ATA_MODULE_NAME, Localization.Core.Sense_0_Status_1_Error_2_Length_3, sense,
errorChs.Status, errorChs.Error, readBuf.Length);
@@ -779,9 +774,11 @@ public sealed partial class DeviceReport
_dev.Timeout, out _);
});
capabilities.SupportsReadLongRetry = !sense && (errorChs.Status & 0x01) != 0x01 && errorChs.Error == 0 &&
readBuf.Length > 0 &&
BitConverter.ToUInt64(readBuf, 0) != checkCorrectRead;
capabilities.SupportsReadLongRetry = !sense &&
(errorChs.Status & 0x01) != 0x01 &&
errorChs.Error == 0 &&
readBuf.Length > 0 &&
BitConverter.ToUInt64(readBuf, 0) != checkCorrectRead;
AaruConsole.DebugWriteLine(ATA_MODULE_NAME, Localization.Core.Sense_0_Status_1_Error_2_Length_3, sense,
errorChs.Status, errorChs.Error, readBuf.Length);
@@ -796,8 +793,11 @@ public sealed partial class DeviceReport
out _);
});
capabilities.SupportsReadLongLba = !sense && (errorLba.Status & 0x01) != 0x01 && errorLba.Error == 0 &&
readBuf.Length > 0 && BitConverter.ToUInt64(readBuf, 0) != checkCorrectRead;
capabilities.SupportsReadLongLba = !sense &&
(errorLba.Status & 0x01) != 0x01 &&
errorLba.Error == 0 &&
readBuf.Length > 0 &&
BitConverter.ToUInt64(readBuf, 0) != checkCorrectRead;
AaruConsole.DebugWriteLine(ATA_MODULE_NAME, Localization.Core.Sense_0_Status_1_Error_2_Length_3, sense,
errorLba.Status, errorLba.Error, readBuf.Length);
@@ -812,9 +812,11 @@ public sealed partial class DeviceReport
out _);
});
capabilities.SupportsReadLongRetryLba = !sense && (errorLba.Status & 0x01) != 0x01 && errorLba.Error == 0 &&
readBuf.Length > 0 && BitConverter.ToUInt64(readBuf, 0) !=
checkCorrectRead;
capabilities.SupportsReadLongRetryLba = !sense &&
(errorLba.Status & 0x01) != 0x01 &&
errorLba.Error == 0 &&
readBuf.Length > 0 &&
BitConverter.ToUInt64(readBuf, 0) != checkCorrectRead;
AaruConsole.DebugWriteLine(ATA_MODULE_NAME, Localization.Core.Sense_0_Status_1_Error_2_Length_3, sense,
errorLba.Status, errorLba.Error, readBuf.Length);

View File

@@ -53,8 +53,7 @@ public sealed partial class DeviceReport
var pressedKey = new ConsoleKeyInfo();
while(pressedKey.Key != ConsoleKey.Y &&
pressedKey.Key != ConsoleKey.N)
while(pressedKey.Key != ConsoleKey.Y && pressedKey.Key != ConsoleKey.N)
{
AaruConsole.Write(Localization.Core.
Have_you_previously_tried_with_a_GD_ROM_disc_and_did_the_computer_hang_or_crash_Q);
@@ -256,8 +255,7 @@ public sealed partial class DeviceReport
return;
}
if(newLeadOutTrack.PMIN >= 0xA0 &&
!tocIsNotBcd)
if(newLeadOutTrack.PMIN >= 0xA0 && !tocIsNotBcd)
newLeadOutTrack.PMIN -= 0x90;
if(newLeadOutTrack.PMIN != leadOutTrack.PMIN ||
@@ -1112,14 +1110,14 @@ public sealed partial class DeviceReport
while(true)
{
report.GdRomSwapDiscCapabilities.Lba100000PqReadable = !_dev.ReadCd(out byte[] lba100000PqBuffer,
out byte[] lba100000PqSenseBuffer,
100000, 2368, cluster,
MmcSectorTypes.AllTypes, false,
false, true,
MmcHeaderCodes.AllHeaders, true,
true, MmcErrorField.None,
MmcSubchannel.Q16, _dev.Timeout,
out _);
out byte[] lba100000PqSenseBuffer,
100000, 2368, cluster,
MmcSectorTypes.AllTypes, false,
false, true,
MmcHeaderCodes.AllHeaders, true,
true, MmcErrorField.None,
MmcSubchannel.Q16, _dev.Timeout,
out _);
report.GdRomSwapDiscCapabilities.Lba100000PqData = lba100000PqBuffer;
report.GdRomSwapDiscCapabilities.Lba100000PqSense = lba100000PqSenseBuffer;
@@ -1176,14 +1174,14 @@ public sealed partial class DeviceReport
while(true)
{
report.GdRomSwapDiscCapabilities.Lba450000PqReadable = !_dev.ReadCd(out byte[] lba450000PqBuffer,
out byte[] lba450000PqSenseBuffer,
450000, 2368, cluster,
MmcSectorTypes.AllTypes, false,
false, true,
MmcHeaderCodes.AllHeaders, true,
true, MmcErrorField.None,
MmcSubchannel.Q16, _dev.Timeout,
out _);
out byte[] lba450000PqSenseBuffer,
450000, 2368, cluster,
MmcSectorTypes.AllTypes, false,
false, true,
MmcHeaderCodes.AllHeaders, true,
true, MmcErrorField.None,
MmcSubchannel.Q16, _dev.Timeout,
out _);
report.GdRomSwapDiscCapabilities.Lba450000PqData = lba450000PqBuffer;
report.GdRomSwapDiscCapabilities.Lba450000PqSense = lba450000PqSenseBuffer;
@@ -1209,14 +1207,14 @@ public sealed partial class DeviceReport
while(true)
{
report.GdRomSwapDiscCapabilities.Lba400000PqReadable = !_dev.ReadCd(out byte[] lba400000PqBuffer,
out byte[] lba400000PqSenseBuffer,
400000, 2368, cluster,
MmcSectorTypes.AllTypes, false,
false, true,
MmcHeaderCodes.AllHeaders, true,
true, MmcErrorField.None,
MmcSubchannel.Q16, _dev.Timeout,
out _);
out byte[] lba400000PqSenseBuffer,
400000, 2368, cluster,
MmcSectorTypes.AllTypes, false,
false, true,
MmcHeaderCodes.AllHeaders, true,
true, MmcErrorField.None,
MmcSubchannel.Q16, _dev.Timeout,
out _);
report.GdRomSwapDiscCapabilities.Lba400000PqData = lba400000PqBuffer;
report.GdRomSwapDiscCapabilities.Lba400000PqSense = lba400000PqSenseBuffer;
@@ -1304,14 +1302,14 @@ public sealed partial class DeviceReport
while(true)
{
report.GdRomSwapDiscCapabilities.Lba100000RwReadable = !_dev.ReadCd(out byte[] lba100000RwBuffer,
out byte[] lba100000RwSenseBuffer,
100000, 2448, cluster,
MmcSectorTypes.AllTypes, false,
false, true,
MmcHeaderCodes.AllHeaders, true,
true, MmcErrorField.None,
MmcSubchannel.Raw, _dev.Timeout,
out _);
out byte[] lba100000RwSenseBuffer,
100000, 2448, cluster,
MmcSectorTypes.AllTypes, false,
false, true,
MmcHeaderCodes.AllHeaders, true,
true, MmcErrorField.None,
MmcSubchannel.Raw, _dev.Timeout,
out _);
report.GdRomSwapDiscCapabilities.Lba100000RwData = lba100000RwBuffer;
report.GdRomSwapDiscCapabilities.Lba100000RwSense = lba100000RwSenseBuffer;
@@ -1368,14 +1366,14 @@ public sealed partial class DeviceReport
while(true)
{
report.GdRomSwapDiscCapabilities.Lba450000RwReadable = !_dev.ReadCd(out byte[] lba450000RwBuffer,
out byte[] lba450000RwSenseBuffer,
450000, 2448, cluster,
MmcSectorTypes.AllTypes, false,
false, true,
MmcHeaderCodes.AllHeaders, true,
true, MmcErrorField.None,
MmcSubchannel.Raw, _dev.Timeout,
out _);
out byte[] lba450000RwSenseBuffer,
450000, 2448, cluster,
MmcSectorTypes.AllTypes, false,
false, true,
MmcHeaderCodes.AllHeaders, true,
true, MmcErrorField.None,
MmcSubchannel.Raw, _dev.Timeout,
out _);
report.GdRomSwapDiscCapabilities.Lba450000RwData = lba450000RwBuffer;
report.GdRomSwapDiscCapabilities.Lba450000RwSense = lba450000RwSenseBuffer;
@@ -1401,14 +1399,14 @@ public sealed partial class DeviceReport
while(true)
{
report.GdRomSwapDiscCapabilities.Lba400000RwReadable = !_dev.ReadCd(out byte[] lba400000RwBuffer,
out byte[] lba400000RwSenseBuffer,
400000, 2448, cluster,
MmcSectorTypes.AllTypes, false,
false, true,
MmcHeaderCodes.AllHeaders, true,
true, MmcErrorField.None,
MmcSubchannel.Raw, _dev.Timeout,
out _);
out byte[] lba400000RwSenseBuffer,
400000, 2448, cluster,
MmcSectorTypes.AllTypes, false,
false, true,
MmcHeaderCodes.AllHeaders, true,
true, MmcErrorField.None,
MmcSubchannel.Raw, _dev.Timeout,
out _);
report.GdRomSwapDiscCapabilities.Lba400000RwData = lba400000RwBuffer;
report.GdRomSwapDiscCapabilities.Lba400000RwSense = lba400000RwSenseBuffer;
@@ -1504,8 +1502,7 @@ public sealed partial class DeviceReport
pressedKey = new ConsoleKeyInfo();
while(pressedKey.Key != ConsoleKey.Y &&
pressedKey.Key != ConsoleKey.N)
while(pressedKey.Key != ConsoleKey.Y && pressedKey.Key != ConsoleKey.N)
{
AaruConsole.Write(Localization.Core.Test_read_whole_high_density_area_proceed_Q);
@@ -1676,11 +1673,9 @@ public sealed partial class DeviceReport
? _dev.ReadCd(out buffer, out senseBuffer, lba, blockSize, cluster, MmcSectorTypes.Cdda, false,
false, false, MmcHeaderCodes.None, true, false, MmcErrorField.None, subchannel,
_dev.Timeout, out _)
: _dev.ReadCd(out buffer, out senseBuffer, lba, blockSize,
cluster, MmcSectorTypes.AllTypes, false, false,
true, MmcHeaderCodes.AllHeaders, true, true,
MmcErrorField.None, subchannel, _dev.Timeout,
out _);
: _dev.ReadCd(out buffer, out senseBuffer, lba, blockSize, cluster, MmcSectorTypes.AllTypes,
false, false, true, MmcHeaderCodes.AllHeaders, true, true, MmcErrorField.None,
subchannel, _dev.Timeout, out _);
if(sense)
{

View File

@@ -602,13 +602,13 @@ public sealed partial class DeviceReport
sense = _dev.ReadCapacity(out buffer, out senseBuffer, _dev.Timeout, out _);
});
if(!sense &&
!_dev.Error)
if(!sense && !_dev.Error)
{
mediaTest.SupportsReadCapacity = true;
mediaTest.Blocks = ((ulong)((buffer[0] << 24) + (buffer[1] << 16) + (buffer[2] << 8) + buffer[3]) &
0xFFFFFFFF) + 1;
0xFFFFFFFF) +
1;
mediaTest.BlockSize = (uint)((buffer[5] << 24) + (buffer[5] << 16) + (buffer[6] << 8) + buffer[7]);
}
@@ -619,8 +619,7 @@ public sealed partial class DeviceReport
sense = _dev.ReadCapacity16(out buffer, out buffer, _dev.Timeout, out _);
});
if(!sense &&
!_dev.Error)
if(!sense && !_dev.Error)
{
mediaTest.SupportsReadCapacity16 = true;
var temp = new byte[8];
@@ -640,8 +639,7 @@ public sealed partial class DeviceReport
0x00, _dev.Timeout, out _);
});
if(!sense &&
!_dev.Error)
if(!sense && !_dev.Error)
{
decMode = Modes.DecodeMode10(buffer, _dev.ScsiType);
@@ -654,8 +652,7 @@ public sealed partial class DeviceReport
sense = _dev.ModeSense(out buffer, out senseBuffer, _dev.Timeout, out _);
});
if(!sense &&
!_dev.Error)
if(!sense && !_dev.Error)
{
decMode ??= Modes.DecodeMode6(buffer, _dev.ScsiType);
@@ -906,8 +903,7 @@ public sealed partial class DeviceReport
break;
}
if(mediaType.StartsWith("BD-R", StringComparison.Ordinal) &&
mediaType != "BD-ROM")
if(mediaType.StartsWith("BD-R", StringComparison.Ordinal) && mediaType != "BD-ROM")
{
Spectre.ProgressSingleSpinner(ctx =>
{
@@ -984,8 +980,7 @@ public sealed partial class DeviceReport
mediaTest.EmbossedPfiData = buffer;
}
if(mediaType.StartsWith("DVD+R", StringComparison.Ordinal) ||
mediaType == "DVD+MRW")
if(mediaType.StartsWith("DVD+R", StringComparison.Ordinal) || mediaType == "DVD+MRW")
{
Spectre.ProgressSingleSpinner(ctx =>
{
@@ -1295,8 +1290,7 @@ public sealed partial class DeviceReport
mediaTest.ReadCdMsfFullData = buffer;
}
if(mediaTest.SupportsReadCdRaw == true ||
mediaType == "Audio CD")
if(mediaTest.SupportsReadCdRaw == true || mediaType == "Audio CD")
{
Spectre.ProgressSingleSpinner(ctx =>
{
@@ -1339,7 +1333,10 @@ public sealed partial class DeviceReport
{
ctx.AddTask(Localization.Core.Trying_to_read_CD_Lead_In).IsIndeterminate();
foreach(int i in new[] { -5000, -4000, -3000, -2000, -1000, -500, -250 })
foreach(int i in new[]
{
-5000, -4000, -3000, -2000, -1000, -500, -250
})
{
if(mediaType == "Audio CD")
{
@@ -1960,14 +1957,12 @@ public sealed partial class DeviceReport
}
}
if(mediaTest.SupportsReadLong == true &&
mediaTest.LongBlockSize == mediaTest.BlockSize)
if(mediaTest.SupportsReadLong == true && mediaTest.LongBlockSize == mediaTest.BlockSize)
{
// DVDs
sense = _dev.ReadLong10(out buffer, out senseBuffer, false, false, 16, 37856, _dev.Timeout, out _);
if(!sense &&
!_dev.Error)
if(!sense && !_dev.Error)
{
mediaTest.ReadLong10Data = buffer;
mediaTest.SupportsReadLong = true;
@@ -2024,8 +2019,7 @@ public sealed partial class DeviceReport
{
ctx.AddTask(Localization.Core.Trying_MediaTek_READ_DRAM_command).IsIndeterminate();
if(mediaType == "Audio CD" &&
mediaTest.SupportsReadCd == true)
if(mediaType == "Audio CD" && mediaTest.SupportsReadCd == true)
{
_dev.ReadCd(out _, out _, 0, 2352, 1, MmcSectorTypes.Cdda, false, false, false, MmcHeaderCodes.None,
true, false, MmcErrorField.None, MmcSubchannel.None, _dev.Timeout, out _);
@@ -2092,8 +2086,7 @@ public sealed partial class DeviceReport
if(!(mediaTest.Blocks > 0))
return;
if(mediaType == "Audio CD" &&
mediaTest.SupportsReadCd == true)
if(mediaType == "Audio CD" && mediaTest.SupportsReadCd == true)
{
_dev.ReadCd(out _, out _, (uint)(mediaTest.Blocks + 1), 2352, 1, MmcSectorTypes.Cdda, false, false,
false, MmcHeaderCodes.None, true, false, MmcErrorField.None, MmcSubchannel.None,
@@ -2207,8 +2200,7 @@ public sealed partial class DeviceReport
FullTOC.TrackDataDescriptor secondSessionFirstTrack =
decodedToc.TrackDescriptors.FirstOrDefault(t => t is { SessionNumber: > 1, POINT: <= 99 });
if(firstSessionLeadOutTrack.SessionNumber == 0 ||
secondSessionFirstTrack.SessionNumber == 0)
if(firstSessionLeadOutTrack.SessionNumber == 0 || secondSessionFirstTrack.SessionNumber == 0)
{
AaruConsole.ErrorWriteLine(Localization.Core.
Could_not_find_second_session_Have_you_inserted_the_correct_type_of_disc);
@@ -2228,12 +2220,14 @@ public sealed partial class DeviceReport
// Skip Lead-Out pre-gap
var firstSessionLeadOutLba = (uint)(firstSessionLeadOutTrack.PMIN * 60 * 75 +
firstSessionLeadOutTrack.PSEC * 75 +
firstSessionLeadOutTrack.PFRAME + 150);
firstSessionLeadOutTrack.PFRAME +
150);
// Skip second session track pre-gap
var secondSessionLeadInLba = (uint)(secondSessionFirstTrack.PMIN * 60 * 75 +
secondSessionFirstTrack.PSEC * 75 +
secondSessionFirstTrack.PFRAME - 300);
secondSessionFirstTrack.PFRAME -
300);
Spectre.ProgressSingleSpinner(ctx =>
{

View File

@@ -174,8 +174,7 @@ public sealed partial class DeviceReport
_dev.Timeout, out _);
});
if(!sense &&
!_dev.Error)
if(!sense && !_dev.Error)
{
decMode = Modes.DecodeMode10(buffer, _dev.ScsiType);
seqTest.ModeSense10Data = buffer;
@@ -187,8 +186,7 @@ public sealed partial class DeviceReport
sense = _dev.ModeSense(out buffer, out _, _dev.Timeout, out _);
});
if(!sense &&
!_dev.Error)
if(!sense && !_dev.Error)
{
decMode ??= Modes.DecodeMode6(buffer, _dev.ScsiType);

View File

@@ -121,7 +121,8 @@ public sealed partial class DeviceReport
Spectre.ProgressSingleSpinner(ctx =>
{
ProgressTask task = ctx.AddTask(Localization.Core.Querying_SCSI_EVPD_pages,
maxValue: evpdPages.Count(page => page != 0x80)).IsIndeterminate();
maxValue: evpdPages.Count(page => page != 0x80)).
IsIndeterminate();
foreach(byte page in evpdPages.Where(page => page != 0x80))
{
@@ -231,10 +232,10 @@ public sealed partial class DeviceReport
IsIndeterminate();
foreach(ScsiModeSensePageControl pageControl in new[]
{
ScsiModeSensePageControl.Default, ScsiModeSensePageControl.Current,
ScsiModeSensePageControl.Changeable
})
{
ScsiModeSensePageControl.Default, ScsiModeSensePageControl.Current,
ScsiModeSensePageControl.Changeable
})
{
var saveBuffer = false;
@@ -256,8 +257,7 @@ public sealed partial class DeviceReport
sense = _dev.ModeSense10(out mode10Buffer, out _, false, false, pageControl, 0x3F, 0x00,
_dev.Timeout, out _);
if(!sense &&
!_dev.Error)
if(!sense && !_dev.Error)
{
v2.SCSI.SupportsModeSense10 = true;
decMode ??= Modes.DecodeMode10(mode10Buffer, devType);
@@ -314,10 +314,10 @@ public sealed partial class DeviceReport
IsIndeterminate();
foreach(ScsiModeSensePageControl pageControl in new[]
{
ScsiModeSensePageControl.Default, ScsiModeSensePageControl.Current,
ScsiModeSensePageControl.Changeable
})
{
ScsiModeSensePageControl.Default, ScsiModeSensePageControl.Current,
ScsiModeSensePageControl.Changeable
})
{
var saveBuffer = false;
@@ -349,8 +349,7 @@ public sealed partial class DeviceReport
sense = _dev.ModeSense6(out mode6Buffer, out _, false, pageControl, 0x00, 0x00,
_dev.Timeout, out _);
if(!sense &&
!_dev.Error)
if(!sense && !_dev.Error)
{
v2.SCSI.SupportsModeSense6 = true;
decMode ??= Modes.DecodeMode6(mode6Buffer, devType);
@@ -453,8 +452,7 @@ public sealed partial class DeviceReport
modePages.Add(modePage);
if(modePage.page == 0x2A &&
modePage.subpage == 0x00)
if(modePage.page == 0x2A && modePage.subpage == 0x00)
cdromMode = page.PageResponse;
}
@@ -477,13 +475,13 @@ public sealed partial class DeviceReport
sense = _dev.ReadCapacity(out buffer, out senseBuffer, _dev.Timeout, out _);
});
if(!sense &&
!_dev.Error)
if(!sense && !_dev.Error)
{
mediaTest.SupportsReadCapacity = true;
mediaTest.Blocks = ((ulong)((buffer[0] << 24) + (buffer[1] << 16) + (buffer[2] << 8) + buffer[3]) &
0xFFFFFFFF) + 1;
0xFFFFFFFF) +
1;
mediaTest.BlockSize = (uint)((buffer[4] << 24) + (buffer[5] << 16) + (buffer[6] << 8) + buffer[7]);
}
@@ -494,8 +492,7 @@ public sealed partial class DeviceReport
sense = _dev.ReadCapacity16(out buffer, out buffer, _dev.Timeout, out _);
});
if(!sense &&
!_dev.Error)
if(!sense && !_dev.Error)
{
mediaTest.SupportsReadCapacity16 = true;
var temp = new byte[8];
@@ -515,8 +512,7 @@ public sealed partial class DeviceReport
0x00, _dev.Timeout, out _);
});
if(!sense &&
!_dev.Error)
if(!sense && !_dev.Error)
{
decMode = Modes.DecodeMode10(buffer, _dev.ScsiType);
mediaTest.ModeSense10Data = buffer;
@@ -528,8 +524,7 @@ public sealed partial class DeviceReport
sense = _dev.ModeSense(out buffer, out senseBuffer, _dev.Timeout, out _);
});
if(!sense &&
!_dev.Error)
if(!sense && !_dev.Error)
{
decMode ??= Modes.DecodeMode6(buffer, _dev.ScsiType);
@@ -660,22 +655,22 @@ public sealed partial class DeviceReport
case 512:
{
foreach(ushort testSize in new ushort[]
{
// Long sector sizes for floppies
514,
{
// Long sector sizes for floppies
514,
// Long sector sizes for SuperDisk
536, 558,
// Long sector sizes for SuperDisk
536, 558,
// Long sector sizes for 512-byte magneto-opticals
600, 610, 630
})
// Long sector sizes for 512-byte magneto-opticals
600, 610, 630
})
{
sense = mediaTest.SupportsReadLong16 == true
? _dev.ReadLong16(out buffer, out senseBuffer, false, 0, testSize, _dev.Timeout,
out _)
: _dev.ReadLong10(out buffer, out senseBuffer, false,
false, 0, testSize, _dev.Timeout, out _);
: _dev.ReadLong10(out buffer, out senseBuffer, false, false, 0, testSize,
_dev.Timeout, out _);
if(sense || _dev.Error)
continue;
@@ -690,19 +685,19 @@ public sealed partial class DeviceReport
case 1024:
{
foreach(ushort testSize in new ushort[]
{
// Long sector sizes for floppies
1026,
{
// Long sector sizes for floppies
1026,
// Long sector sizes for 1024-byte magneto-opticals
1200
})
// Long sector sizes for 1024-byte magneto-opticals
1200
})
{
sense = mediaTest.SupportsReadLong16 == true
? _dev.ReadLong16(out buffer, out senseBuffer, false, 0, testSize, _dev.Timeout,
out _)
: _dev.ReadLong10(out buffer, out senseBuffer, false,
false, 0, testSize, _dev.Timeout, out _);
: _dev.ReadLong10(out buffer, out senseBuffer, false, false, 0, testSize,
_dev.Timeout, out _);
if(sense || _dev.Error)
continue;
@@ -721,8 +716,7 @@ public sealed partial class DeviceReport
: _dev.ReadLong10(out buffer, out senseBuffer, false, false, 0, 2380, _dev.Timeout,
out _);
if(!sense &&
!_dev.Error)
if(!sense && !_dev.Error)
mediaTest.LongBlockSize = 2380;
break;
@@ -734,8 +728,7 @@ public sealed partial class DeviceReport
: _dev.ReadLong10(out buffer, out senseBuffer, false, false, 0, 4760, _dev.Timeout,
out _);
if(!sense &&
!_dev.Error)
if(!sense && !_dev.Error)
mediaTest.LongBlockSize = 4760;
break;
@@ -747,8 +740,7 @@ public sealed partial class DeviceReport
: _dev.ReadLong10(out buffer, out senseBuffer, false, false, 0, 9424, _dev.Timeout,
out _);
if(!sense &&
!_dev.Error)
if(!sense && !_dev.Error)
mediaTest.LongBlockSize = 9424;
break;
@@ -786,13 +778,13 @@ public sealed partial class DeviceReport
sense = _dev.ReadCapacity(out buffer, out senseBuffer, _dev.Timeout, out _);
});
if(!sense &&
!_dev.Error)
if(!sense && !_dev.Error)
{
capabilities.SupportsReadCapacity = true;
capabilities.Blocks = ((ulong)((buffer[0] << 24) + (buffer[1] << 16) + (buffer[2] << 8) + buffer[3]) &
0xFFFFFFFF) + 1;
0xFFFFFFFF) +
1;
capabilities.BlockSize = (uint)((buffer[4] << 24) + (buffer[5] << 16) + (buffer[6] << 8) + buffer[7]);
}
@@ -803,8 +795,7 @@ public sealed partial class DeviceReport
sense = _dev.ReadCapacity16(out buffer, out buffer, _dev.Timeout, out _);
});
if(!sense &&
!_dev.Error)
if(!sense && !_dev.Error)
{
capabilities.SupportsReadCapacity16 = true;
var temp = new byte[8];
@@ -824,8 +815,7 @@ public sealed partial class DeviceReport
0x00, _dev.Timeout, out _);
});
if(!sense &&
!_dev.Error)
if(!sense && !_dev.Error)
{
decMode = Modes.DecodeMode10(buffer, _dev.ScsiType);
capabilities.ModeSense10Data = buffer;
@@ -837,8 +827,7 @@ public sealed partial class DeviceReport
sense = _dev.ModeSense(out buffer, out senseBuffer, _dev.Timeout, out _);
});
if(!sense &&
!_dev.Error)
if(!sense && !_dev.Error)
{
decMode ??= Modes.DecodeMode6(buffer, _dev.ScsiType);
@@ -970,29 +959,30 @@ public sealed partial class DeviceReport
{
ctx.AddTask(capabilities.SupportsReadLong16 == true
? Localization.Core.Trying_SCSI_READ_LONG_16
: Localization.Core.Trying_SCSI_READ_LONG_10).IsIndeterminate();
: Localization.Core.Trying_SCSI_READ_LONG_10).
IsIndeterminate();
switch(capabilities.BlockSize)
{
case 512:
{
foreach(ushort testSize in new ushort[]
{
// Long sector sizes for floppies
514,
{
// Long sector sizes for floppies
514,
// Long sector sizes for SuperDisk
536, 558,
// Long sector sizes for SuperDisk
536, 558,
// Long sector sizes for 512-byte magneto-opticals
600, 610, 630
})
// Long sector sizes for 512-byte magneto-opticals
600, 610, 630
})
{
sense = capabilities.SupportsReadLong16 == true
? _dev.ReadLong16(out buffer, out senseBuffer, false, 0, testSize, _dev.Timeout,
out _)
: _dev.ReadLong10(out buffer, out senseBuffer, false,
false, 0, testSize, _dev.Timeout, out _);
: _dev.ReadLong10(out buffer, out senseBuffer, false, false, 0, testSize,
_dev.Timeout, out _);
if(sense || _dev.Error)
continue;
@@ -1008,19 +998,19 @@ public sealed partial class DeviceReport
case 1024:
{
foreach(ushort testSize in new ushort[]
{
// Long sector sizes for floppies
1026,
{
// Long sector sizes for floppies
1026,
// Long sector sizes for 1024-byte magneto-opticals
1200
})
// Long sector sizes for 1024-byte magneto-opticals
1200
})
{
sense = capabilities.SupportsReadLong16 == true
? _dev.ReadLong16(out buffer, out senseBuffer, false, 0, testSize, _dev.Timeout,
out _)
: _dev.ReadLong10(out buffer, out senseBuffer, false,
false, 0, testSize, _dev.Timeout, out _);
: _dev.ReadLong10(out buffer, out senseBuffer, false, false, 0, testSize,
_dev.Timeout, out _);
if(sense || _dev.Error)
continue;