Wait for device to exist ASC 28h status. This should be trapped by the

OS but it's being so in some corner cases.
This commit is contained in:
2017-09-11 18:34:01 +01:00
parent f2d12773c6
commit 2c647dfc5c
3 changed files with 59 additions and 0 deletions

View File

@@ -805,6 +805,23 @@ namespace DiscImageChef.Core.Devices.Report.SCSI
mediaTest.MediaIsRecognized &= !sense;
}
// These should be trapped by the OS but seems in some cases they're not
else if(decSense.Value.ASC == 0x28)
{
int leftRetries = 20;
while(leftRetries > 0)
{
DicConsole.Write("\rWaiting for drive to become ready");
System.Threading.Thread.Sleep(2000);
sense = dev.ScsiTestUnitReady(out senseBuffer, timeout, out duration);
if(!sense)
break;
leftRetries--;
}
mediaTest.MediaIsRecognized &= !sense;
}
else
mediaTest.MediaIsRecognized = false;
}