mirror of
https://github.com/aaru-dps/Aaru.git
synced 2025-12-16 19:24:25 +00:00
Fix detection of flash drives that report themselves as CD drives when they're not.
This commit is contained in:
@@ -308,7 +308,8 @@ namespace Aaru.Core.Devices.Dumping
|
||||
|
||||
if(dskType == MediaType.Unknown)
|
||||
dskType = MediaTypeFromDevice.GetFromScsi((byte)_dev.ScsiType, _dev.Manufacturer, _dev.Model,
|
||||
scsiMediumTypeTape, scsiDensityCodeTape, blocks, blockSize);
|
||||
scsiMediumTypeTape, scsiDensityCodeTape, blocks, blockSize,
|
||||
_dev.IsUsb);
|
||||
|
||||
if(dskType == MediaType.Unknown)
|
||||
dskType = MediaType.UnknownTape;
|
||||
@@ -1037,23 +1038,23 @@ namespace Aaru.Core.Devices.Dumping
|
||||
mhddLog.Close();
|
||||
|
||||
ibgLog.Close(_dev, blocks, blockSize, (end - start).TotalSeconds, currentSpeed * 1024,
|
||||
(blockSize * (double)(blocks + 1)) / 1024 / (totalDuration / 1000), _devicePath);
|
||||
blockSize * (double)(blocks + 1) / 1024 / (totalDuration / 1000), _devicePath);
|
||||
|
||||
UpdateStatus?.Invoke($"Dump finished in {(end - start).TotalSeconds} seconds.");
|
||||
|
||||
UpdateStatus?.
|
||||
Invoke($"Average dump speed {((double)blockSize * (double)(blocks + 1)) / 1024 / (totalDuration / 1000):F3} KiB/sec.");
|
||||
Invoke($"Average dump speed {(double)blockSize * (double)(blocks + 1) / 1024 / (totalDuration / 1000):F3} KiB/sec.");
|
||||
|
||||
UpdateStatus?.
|
||||
Invoke($"Average write speed {((double)blockSize * (double)(blocks + 1)) / 1024 / imageWriteDuration:F3} KiB/sec.");
|
||||
Invoke($"Average write speed {(double)blockSize * (double)(blocks + 1) / 1024 / imageWriteDuration:F3} KiB/sec.");
|
||||
|
||||
_dumpLog.WriteLine("Dump finished in {0} seconds.", (end - start).TotalSeconds);
|
||||
|
||||
_dumpLog.WriteLine("Average dump speed {0:F3} KiB/sec.",
|
||||
((double)blockSize * (double)(blocks + 1)) / 1024 / (totalDuration / 1000));
|
||||
(double)blockSize * (double)(blocks + 1) / 1024 / (totalDuration / 1000));
|
||||
|
||||
_dumpLog.WriteLine("Average write speed {0:F3} KiB/sec.",
|
||||
((double)blockSize * (double)(blocks + 1)) / 1024 / imageWriteDuration);
|
||||
(double)blockSize * (double)(blocks + 1) / 1024 / imageWriteDuration);
|
||||
|
||||
#region Error handling
|
||||
if(_resume.BadBlocks.Count > 0 &&
|
||||
@@ -1284,12 +1285,12 @@ namespace Aaru.Core.Devices.Dumping
|
||||
UpdateStatus?.Invoke($"Sidecar created in {(end - chkStart).TotalSeconds} seconds.");
|
||||
|
||||
UpdateStatus?.
|
||||
Invoke($"Average checksum speed {((double)blockSize * (double)(blocks + 1)) / 1024 / (totalChkDuration / 1000):F3} KiB/sec.");
|
||||
Invoke($"Average checksum speed {(double)blockSize * (double)(blocks + 1) / 1024 / (totalChkDuration / 1000):F3} KiB/sec.");
|
||||
|
||||
_dumpLog.WriteLine("Sidecar created in {0} seconds.", (end - chkStart).TotalSeconds);
|
||||
|
||||
_dumpLog.WriteLine("Average checksum speed {0:F3} KiB/sec.",
|
||||
((double)blockSize * (double)(blocks + 1)) / 1024 / (totalChkDuration / 1000));
|
||||
(double)blockSize * (double)(blocks + 1) / 1024 / (totalChkDuration / 1000));
|
||||
|
||||
if(_preSidecar != null)
|
||||
{
|
||||
@@ -1361,7 +1362,7 @@ namespace Aaru.Core.Devices.Dumping
|
||||
Invoke($"Took a total of {(end - start).TotalSeconds:F3} seconds ({totalDuration / 1000:F3} processing commands, {totalChkDuration / 1000:F3} checksumming, {imageWriteDuration:F3} writing, {(closeEnd - closeStart).TotalSeconds:F3} closing).");
|
||||
|
||||
UpdateStatus?.
|
||||
Invoke($"Average speed: {((double)blockSize * (double)(blocks + 1)) / 1048576 / (totalDuration / 1000):F3} MiB/sec.");
|
||||
Invoke($"Average speed: {(double)blockSize * (double)(blocks + 1) / 1048576 / (totalDuration / 1000):F3} MiB/sec.");
|
||||
|
||||
if(maxSpeed > 0)
|
||||
UpdateStatus?.Invoke($"Fastest speed burst: {maxSpeed:F3} MiB/sec.");
|
||||
|
||||
@@ -180,7 +180,8 @@ namespace Aaru.Core.Devices.Dumping
|
||||
|
||||
if(dskType == MediaType.Unknown)
|
||||
dskType = MediaTypeFromDevice.GetFromScsi((byte)_dev.ScsiType, _dev.Manufacturer, _dev.Model,
|
||||
scsiMediumType, scsiDensityCode, blocks + 1, blockSize);
|
||||
scsiMediumType, scsiDensityCode, blocks + 1, blockSize,
|
||||
_dev.IsUsb);
|
||||
|
||||
if(_dev.ScsiType == PeripheralDeviceTypes.MultiMediaDevice)
|
||||
MMC.DetectDiscType(ref dskType, 1, null, _dev, out _, out _, 0);
|
||||
|
||||
@@ -283,7 +283,8 @@ namespace Aaru.Core.Media.Info
|
||||
break;
|
||||
}
|
||||
|
||||
if(dev.ScsiType == PeripheralDeviceTypes.MultiMediaDevice)
|
||||
if(dev.ScsiType == PeripheralDeviceTypes.MultiMediaDevice &&
|
||||
!(dev.IsUsb && (scsiMediumType == 0x40 || scsiMediumType == 0x41 || scsiMediumType == 0x42)))
|
||||
{
|
||||
sense = dev.GetConfiguration(out cmdBuf, out senseBuf, 0, MmcGetConfigurationRt.Current, dev.Timeout,
|
||||
out _);
|
||||
@@ -1397,7 +1398,8 @@ namespace Aaru.Core.Media.Info
|
||||
|
||||
case MediaType.Unknown:
|
||||
MediaType = MediaTypeFromDevice.GetFromScsi((byte)dev.ScsiType, dev.Manufacturer, dev.Model,
|
||||
scsiMediumType, scsiDensityCode, Blocks, BlockSize);
|
||||
scsiMediumType, scsiDensityCode, Blocks, BlockSize,
|
||||
dev.IsUsb);
|
||||
|
||||
break;
|
||||
}
|
||||
@@ -1407,7 +1409,8 @@ namespace Aaru.Core.Media.Info
|
||||
containsFloppyPage)
|
||||
MediaType = MediaType.FlashDrive;
|
||||
|
||||
if(DeviceInfo.ScsiType != PeripheralDeviceTypes.MultiMediaDevice)
|
||||
if(DeviceInfo.ScsiType != PeripheralDeviceTypes.MultiMediaDevice ||
|
||||
(dev.IsUsb && (scsiMediumType == 0x40 || scsiMediumType == 0x41 || scsiMediumType == 0x42)))
|
||||
return;
|
||||
|
||||
sense = dev.ReadDiscInformation(out cmdBuf, out senseBuf, MmcDiscInformationDataTypes.DiscInformation,
|
||||
|
||||
@@ -990,7 +990,9 @@ namespace Aaru.DiscImages
|
||||
_imageInfo.MediaType = MediaTypeFromDevice.GetFromScsi((byte)devType, _imageInfo.DriveManufacturer,
|
||||
_imageInfo.DriveModel, mediumType,
|
||||
densityCode, _imageInfo.Sectors,
|
||||
_imageInfo.SectorSize);
|
||||
_imageInfo.SectorSize,
|
||||
_mediaTags.ContainsKey(MediaTagType.
|
||||
USB_Descriptors));
|
||||
}
|
||||
|
||||
if(_imageInfo.MediaType == MediaType.Unknown)
|
||||
|
||||
Reference in New Issue
Block a user