mirror of
https://github.com/aaru-dps/Aaru.git
synced 2025-12-16 19:24:25 +00:00
REFACTOR: Possible 'System.InvalidOperationException'.
This commit is contained in:
@@ -83,7 +83,9 @@ namespace DiscImageChef.Core.Devices.Dumping
|
||||
sense = dev.AtaIdentify(out byte[] cmdBuf, out AtaErrorRegistersCHS errorChs);
|
||||
if(!sense && Identify.Decode(cmdBuf).HasValue)
|
||||
{
|
||||
Identify.IdentifyDevice ataId = Identify.Decode(cmdBuf).Value;
|
||||
Identify.IdentifyDevice? ataIdNullable = Identify.Decode(cmdBuf);
|
||||
if(ataIdNullable != null) {
|
||||
Identify.IdentifyDevice ataId = ataIdNullable.Value;
|
||||
|
||||
CICMMetadataType sidecar =
|
||||
new CICMMetadataType {BlockMedia = new[] {new BlockMediaType()}};
|
||||
@@ -609,6 +611,7 @@ namespace DiscImageChef.Core.Devices.Dumping
|
||||
xmlSer.Serialize(xmlFs, sidecar);
|
||||
xmlFs.Close();
|
||||
}
|
||||
}
|
||||
|
||||
Statistics.AddMedia(CommonTypes.MediaType.GENERIC_HDD, true);
|
||||
}
|
||||
|
||||
@@ -67,7 +67,8 @@ namespace DiscImageChef.Core.Devices
|
||||
switch(dev.Type)
|
||||
{
|
||||
case DeviceType.ATA:
|
||||
if(Identify.Decode(identification).HasValue) ataId = Identify.Decode(identification).Value;
|
||||
Identify.IdentifyDevice? ataIdNullable = Identify.Decode(identification);
|
||||
if(ataIdNullable.HasValue) ataId = ataIdNullable.Value;
|
||||
break;
|
||||
case DeviceType.NVMe: throw new NotImplementedException("NVMe devices not yet supported.");
|
||||
}
|
||||
|
||||
@@ -63,7 +63,9 @@ namespace DiscImageChef.Core.Devices.Report
|
||||
|
||||
if(!Identify.Decode(buffer).HasValue) return;
|
||||
|
||||
Identify.IdentifyDevice ataId = Identify.Decode(buffer).Value;
|
||||
Identify.IdentifyDevice? ataIdNullable = Identify.Decode(buffer);
|
||||
if(ataIdNullable != null) {
|
||||
Identify.IdentifyDevice ataId = ataIdNullable.Value;
|
||||
|
||||
if((ushort)ataId.GeneralConfiguration == 0x848A)
|
||||
{
|
||||
@@ -1229,3 +1231,4 @@ namespace DiscImageChef.Core.Devices.Report
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -54,7 +54,9 @@ namespace DiscImageChef.Core.Devices.Report
|
||||
|
||||
if(!Identify.Decode(buffer).HasValue) return;
|
||||
|
||||
Identify.IdentifyDevice atapiId = Identify.Decode(buffer).Value;
|
||||
Identify.IdentifyDevice? atapiIdNullable = Identify.Decode(buffer);
|
||||
if(atapiIdNullable != null) {
|
||||
Identify.IdentifyDevice atapiId = atapiIdNullable.Value;
|
||||
|
||||
report.ATAPI = new ataType();
|
||||
|
||||
@@ -453,6 +455,7 @@ namespace DiscImageChef.Core.Devices.Report
|
||||
report.ATAPI.WRVSectorCountMode2 = atapiId.WRVSectorCountMode2;
|
||||
report.ATAPI.WRVSectorCountMode2Specified = true;
|
||||
}
|
||||
}
|
||||
if(debug) report.ATAPI.Identify = buffer;
|
||||
}
|
||||
}
|
||||
|
||||
@@ -58,8 +58,6 @@ namespace DiscImageChef.Core.Devices.Scanning
|
||||
sense = dev.AtaIdentify(out cmdBuf, out errorChs);
|
||||
if(!sense && Identify.Decode(cmdBuf).HasValue)
|
||||
{
|
||||
Identify.IdentifyDevice ataId = Identify.Decode(cmdBuf).Value;
|
||||
|
||||
// Initializate reader
|
||||
Reader ataReader = new Reader(dev, timeout, cmdBuf);
|
||||
// Fill reader blocks
|
||||
|
||||
Reference in New Issue
Block a user