mirror of
https://github.com/aaru-dps/Aaru.git
synced 2025-12-16 19:24:25 +00:00
* DiscImageChef/Main.cs:
* DiscImageChef/Options.cs: * DiscImageChef/DiscImageChef.csproj: * DiscImageChef/Commands/MediaScan.cs: Added media-scan command. * DiscImageChef.Decoders/SCSI/Inquiry.cs: Fixes decoding for devices that follow old 5-byte SCSI INQUIRY format. * DiscImageChef.Decoders/SCSI/Sense.cs: Fixes printing of sense block missing a newline. * DiscImageChef.Devices/Device/Variables.cs: * DiscImageChef.Devices/Device/Constructor.cs: Added an IsRemovable field. * DiscImageChef.Devices/Device/ScsiCommands.cs: Fixed SCSI READ CAPACITY CDB size. Fixed READ CD-DA MSF method name. Implemented SCSI SEEK (6) and SEEK (10) commands. * DiscImageChef.Devices/Linux/Command.cs: * DiscImageChef.Devices/Windows/Command.cs: Fixed memory leaking on unmanaged heap. * DiscImageChef.Helpers/StringHandlers.cs: Fixed string conversion when input byte array is null. * DiscImageChef/Commands/MediaInfo.cs: Check for inserted medium only on removable media devices.
This commit is contained in:
@@ -53,6 +53,7 @@ namespace DiscImageChef.Devices
|
||||
platformID = Interop.DetectOS.GetRealPlatformID();
|
||||
Timeout = 15;
|
||||
error = false;
|
||||
removable = false;
|
||||
|
||||
switch (platformID)
|
||||
{
|
||||
@@ -115,6 +116,7 @@ namespace DiscImageChef.Devices
|
||||
revision = StringHandlers.SpacePaddedToString(Inquiry.Value.ProductRevisionLevel);
|
||||
model = StringHandlers.SpacePaddedToString(Inquiry.Value.ProductIdentification);
|
||||
manufacturer = StringHandlers.SpacePaddedToString(Inquiry.Value.VendorIdentification);
|
||||
removable = Inquiry.Value.RMB;
|
||||
|
||||
scsiType = (Decoders.SCSI.PeripheralDeviceTypes)Inquiry.Value.PeripheralDeviceType;
|
||||
}
|
||||
@@ -124,7 +126,7 @@ namespace DiscImageChef.Devices
|
||||
if (!sense)
|
||||
{
|
||||
type = DeviceType.ATAPI;
|
||||
Decoders.ATA.Identify.IdentifyDevice? ATAID = Decoders.ATA.Identify.Decode(ataBuf);
|
||||
Identify.IdentifyDevice? ATAID = Identify.Decode(ataBuf);
|
||||
|
||||
if (ATAID.HasValue)
|
||||
serial = ATAID.Value.SerialNumber;
|
||||
@@ -137,7 +139,7 @@ namespace DiscImageChef.Devices
|
||||
if (!sense)
|
||||
{
|
||||
type = DeviceType.ATA;
|
||||
Decoders.ATA.Identify.IdentifyDevice? ATAID = Decoders.ATA.Identify.Decode(ataBuf);
|
||||
Identify.IdentifyDevice? ATAID = Identify.Decode(ataBuf);
|
||||
|
||||
if (ATAID.HasValue)
|
||||
{
|
||||
@@ -155,6 +157,11 @@ namespace DiscImageChef.Devices
|
||||
serial = ATAID.Value.SerialNumber;
|
||||
|
||||
scsiType = Decoders.SCSI.PeripheralDeviceTypes.DirectAccess;
|
||||
|
||||
if ((ushort)ATAID.Value.GeneralConfiguration != 0x848A)
|
||||
{
|
||||
removable |= (ATAID.Value.GeneralConfiguration & Identify.GeneralConfigurationBit.Removable) == Identify.GeneralConfigurationBit.Removable;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user