mirror of
https://github.com/aaru-dps/Aaru.Server.git
synced 2025-12-16 19:24:27 +00:00
REFACTOR: Final cleanup of DiscImageChef.Devices.
This commit is contained in:
@@ -53,7 +53,10 @@ namespace DiscImageChef.Devices
|
||||
/// <param name="timeout">Timeout in seconds</param>
|
||||
/// <param name="direction">SCSI command transfer direction</param>
|
||||
/// <param name="duration">Time it took to execute the command in milliseconds</param>
|
||||
/// <param name="sense"><c>True</c> if SCSI error returned non-OK status and <paramref name="senseBuffer"/> contains SCSI sense</param>
|
||||
/// <param name="sense">
|
||||
/// <c>True</c> if SCSI error returned non-OK status and <paramref name="senseBuffer" /> contains SCSI
|
||||
/// sense
|
||||
/// </param>
|
||||
/// <exception cref="InvalidOperationException">If the specified platform is not supported</exception>
|
||||
internal static int SendScsiCommand(object fd, byte[] cdb, ref byte[] buffer, out byte[] senseBuffer,
|
||||
uint timeout, ScsiDirection direction, out double duration, out bool sense)
|
||||
@@ -76,7 +79,10 @@ namespace DiscImageChef.Devices
|
||||
/// <param name="timeout">Timeout in seconds</param>
|
||||
/// <param name="direction">SCSI command transfer direction</param>
|
||||
/// <param name="duration">Time it took to execute the command in milliseconds</param>
|
||||
/// <param name="sense"><c>True</c> if SCSI error returned non-OK status and <paramref name="senseBuffer"/> contains SCSI sense</param>
|
||||
/// <param name="sense">
|
||||
/// <c>True</c> if SCSI error returned non-OK status and <paramref name="senseBuffer" /> contains SCSI
|
||||
/// sense
|
||||
/// </param>
|
||||
/// <exception cref="InvalidOperationException">If the specified platform is not supported</exception>
|
||||
internal static int SendScsiCommand(PlatformID ptId, object fd, byte[] cdb, ref byte[] buffer,
|
||||
out byte[] senseBuffer, uint timeout, ScsiDirection direction,
|
||||
@@ -175,9 +181,10 @@ namespace DiscImageChef.Devices
|
||||
/// <param name="transferRegister">What register contains the transfer length</param>
|
||||
/// <param name="transferBlocks">Set to <c>true</c> if the transfer length is in block, otherwise it is in bytes</param>
|
||||
/// <exception cref="InvalidOperationException">If the specified platform is not supported</exception>
|
||||
internal static int SendAtaCommand(object fd, AtaRegistersChs registers, out AtaErrorRegistersChs errorRegisters,
|
||||
AtaProtocol protocol, AtaTransferRegister transferRegister, ref byte[] buffer,
|
||||
uint timeout, bool transferBlocks, out double duration, out bool sense)
|
||||
internal static int SendAtaCommand(object fd, AtaRegistersChs registers,
|
||||
out AtaErrorRegistersChs errorRegisters, AtaProtocol protocol,
|
||||
AtaTransferRegister transferRegister, ref byte[] buffer, uint timeout,
|
||||
bool transferBlocks, out double duration, out bool sense)
|
||||
{
|
||||
PlatformID ptId = DetectOS.GetRealPlatformID();
|
||||
|
||||
@@ -212,8 +219,8 @@ namespace DiscImageChef.Devices
|
||||
{
|
||||
if(Environment.OSVersion.Version.Major == 5 && Environment.OSVersion.Version.Minor == 1 &&
|
||||
(Environment.OSVersion.ServicePack == "Service Pack 1" ||
|
||||
Environment.OSVersion.ServicePack == "") || Environment.OSVersion.Version.Major == 5 &&
|
||||
Environment.OSVersion.Version.Minor == 0)
|
||||
Environment.OSVersion.ServicePack == "") ||
|
||||
Environment.OSVersion.Version.Major == 5 && Environment.OSVersion.Version.Minor == 0)
|
||||
return Windows.Command.SendIdeCommand((SafeFileHandle)fd, registers, out errorRegisters,
|
||||
protocol, ref buffer, timeout, out duration, out sense);
|
||||
// Windows NT 4 or earlier, requires special ATA pass thru SCSI. But DiscImageChef cannot run there (or can it?)
|
||||
@@ -291,8 +298,8 @@ namespace DiscImageChef.Devices
|
||||
{
|
||||
if(Environment.OSVersion.Version.Major == 5 && Environment.OSVersion.Version.Minor == 1 &&
|
||||
(Environment.OSVersion.ServicePack == "Service Pack 1" ||
|
||||
Environment.OSVersion.ServicePack == "") || Environment.OSVersion.Version.Major == 5 &&
|
||||
Environment.OSVersion.Version.Minor == 0)
|
||||
Environment.OSVersion.ServicePack == "") ||
|
||||
Environment.OSVersion.Version.Major == 5 && Environment.OSVersion.Version.Minor == 0)
|
||||
return Windows.Command.SendIdeCommand((SafeFileHandle)fd, registers, out errorRegisters,
|
||||
protocol, ref buffer, timeout, out duration, out sense);
|
||||
// Windows NT 4 or earlier, requires special ATA pass thru SCSI. But DiscImageChef cannot run there (or can it?)
|
||||
@@ -405,9 +412,10 @@ namespace DiscImageChef.Devices
|
||||
/// <param name="response">Response registers</param>
|
||||
/// <param name="blockSize">Size of block in bytes</param>
|
||||
/// <exception cref="InvalidOperationException">If the specified platform is not supported</exception>
|
||||
internal static int SendMmcCommand(object fd, MmcCommands command, bool write, bool isApplication, MmcFlags flags,
|
||||
uint argument, uint blockSize, uint blocks, ref byte[] buffer,
|
||||
out uint[] response, out double duration, out bool sense, uint timeout = 0)
|
||||
internal static int SendMmcCommand(object fd, MmcCommands command, bool write, bool isApplication,
|
||||
MmcFlags flags, uint argument, uint blockSize, uint blocks,
|
||||
ref byte[] buffer, out uint[] response, out double duration, out bool sense,
|
||||
uint timeout = 0)
|
||||
{
|
||||
PlatformID ptId = DetectOS.GetRealPlatformID();
|
||||
|
||||
@@ -435,9 +443,9 @@ namespace DiscImageChef.Devices
|
||||
/// <param name="blockSize">Size of block in bytes</param>
|
||||
/// <exception cref="InvalidOperationException">If the specified platform is not supported</exception>
|
||||
internal static int SendMmcCommand(PlatformID ptId, object fd, MmcCommands command, bool write,
|
||||
bool isApplication, MmcFlags flags, uint argument, uint blockSize, uint blocks,
|
||||
ref byte[] buffer, out uint[] response, out double duration, out bool sense,
|
||||
uint timeout = 0)
|
||||
bool isApplication, MmcFlags flags, uint argument, uint blockSize,
|
||||
uint blocks, ref byte[] buffer, out uint[] response, out double duration,
|
||||
out bool sense, uint timeout = 0)
|
||||
{
|
||||
switch(ptId)
|
||||
{
|
||||
|
||||
@@ -43,7 +43,6 @@ namespace DiscImageChef.Devices
|
||||
buffer = new byte[512];
|
||||
AtaRegistersLba28 registers = new AtaRegistersLba28 {Command = (byte)AtaCommands.ReadBuffer};
|
||||
|
||||
|
||||
LastError = SendAtaCommand(registers, out statusRegisters, AtaProtocol.PioIn,
|
||||
AtaTransferRegister.NoTransfer, ref buffer, timeout, false, out duration,
|
||||
out bool sense);
|
||||
@@ -60,7 +59,6 @@ namespace DiscImageChef.Devices
|
||||
buffer = new byte[512];
|
||||
AtaRegistersLba28 registers = new AtaRegistersLba28 {Command = (byte)AtaCommands.ReadBufferDma};
|
||||
|
||||
|
||||
LastError = SendAtaCommand(registers, out statusRegisters, AtaProtocol.Dma, AtaTransferRegister.NoTransfer,
|
||||
ref buffer, timeout, false, out duration, out bool sense);
|
||||
Error = LastError != 0;
|
||||
|
||||
@@ -45,7 +45,6 @@ namespace DiscImageChef.Devices
|
||||
AtaRegistersLba48 registers =
|
||||
new AtaRegistersLba48 {Command = (byte)AtaCommands.NativeMaxAddress, Feature = 0x0000};
|
||||
|
||||
|
||||
LastError = SendAtaCommand(registers, out statusRegisters, AtaProtocol.NonData,
|
||||
AtaTransferRegister.NoTransfer, ref buffer, timeout, false, out duration,
|
||||
out bool sense);
|
||||
|
||||
@@ -40,7 +40,7 @@ namespace DiscImageChef.Devices
|
||||
/// <summary>
|
||||
/// Sends the ATA IDENTIFY DEVICE command to the device, using default device timeout
|
||||
/// </summary>
|
||||
/// <returns><c>true</c> if the command failed and <paramref name="statusRegisters"/> contains the error registers.</returns>
|
||||
/// <returns><c>true</c> if the command failed and <paramref name="statusRegisters" /> contains the error registers.</returns>
|
||||
/// <param name="buffer">Buffer.</param>
|
||||
/// <param name="statusRegisters">Status registers.</param>
|
||||
public bool AtaIdentify(out byte[] buffer, out AtaErrorRegistersChs statusRegisters)
|
||||
@@ -51,7 +51,7 @@ namespace DiscImageChef.Devices
|
||||
/// <summary>
|
||||
/// Sends the ATA IDENTIFY DEVICE command to the device, using default device timeout
|
||||
/// </summary>
|
||||
/// <returns><c>true</c> if the command failed and <paramref name="statusRegisters"/> contains the error registers.</returns>
|
||||
/// <returns><c>true</c> if the command failed and <paramref name="statusRegisters" /> contains the error registers.</returns>
|
||||
/// <param name="buffer">Buffer.</param>
|
||||
/// <param name="statusRegisters">Status registers.</param>
|
||||
/// <param name="duration">Duration.</param>
|
||||
@@ -63,7 +63,7 @@ namespace DiscImageChef.Devices
|
||||
/// <summary>
|
||||
/// Sends the ATA IDENTIFY DEVICE command to the device
|
||||
/// </summary>
|
||||
/// <returns><c>true</c> if the command failed and <paramref name="statusRegisters"/> contains the error registers.</returns>
|
||||
/// <returns><c>true</c> if the command failed and <paramref name="statusRegisters" /> contains the error registers.</returns>
|
||||
/// <param name="buffer">Buffer.</param>
|
||||
/// <param name="statusRegisters">Status registers.</param>
|
||||
/// <param name="timeout">Timeout.</param>
|
||||
@@ -75,7 +75,7 @@ namespace DiscImageChef.Devices
|
||||
/// <summary>
|
||||
/// Sends the ATA IDENTIFY DEVICE command to the device
|
||||
/// </summary>
|
||||
/// <returns><c>true</c> if the command failed and <paramref name="statusRegisters"/> contains the error registers.</returns>
|
||||
/// <returns><c>true</c> if the command failed and <paramref name="statusRegisters" /> contains the error registers.</returns>
|
||||
/// <param name="buffer">Buffer.</param>
|
||||
/// <param name="statusRegisters">Status registers.</param>
|
||||
/// <param name="timeout">Timeout.</param>
|
||||
@@ -86,7 +86,6 @@ namespace DiscImageChef.Devices
|
||||
buffer = new byte[512];
|
||||
AtaRegistersChs registers = new AtaRegistersChs {Command = (byte)AtaCommands.IdentifyDevice};
|
||||
|
||||
|
||||
LastError = SendAtaCommand(registers, out statusRegisters, AtaProtocol.PioIn,
|
||||
AtaTransferRegister.NoTransfer, ref buffer, timeout, false, out duration,
|
||||
out bool sense);
|
||||
@@ -117,7 +116,6 @@ namespace DiscImageChef.Devices
|
||||
Command = retry ? (byte)AtaCommands.ReadDmaRetry : (byte)AtaCommands.ReadDma
|
||||
};
|
||||
|
||||
|
||||
LastError = SendAtaCommand(registers, out statusRegisters, AtaProtocol.Dma, AtaTransferRegister.SectorCount,
|
||||
ref buffer, timeout, true, out duration, out bool sense);
|
||||
Error = LastError != 0;
|
||||
@@ -141,7 +139,6 @@ namespace DiscImageChef.Devices
|
||||
Sector = sector
|
||||
};
|
||||
|
||||
|
||||
LastError = SendAtaCommand(registers, out statusRegisters, AtaProtocol.PioIn,
|
||||
AtaTransferRegister.SectorCount, ref buffer, timeout, true, out duration,
|
||||
out bool sense);
|
||||
@@ -172,7 +169,6 @@ namespace DiscImageChef.Devices
|
||||
Sector = sector
|
||||
};
|
||||
|
||||
|
||||
LastError = SendAtaCommand(registers, out statusRegisters, AtaProtocol.PioIn,
|
||||
AtaTransferRegister.SectorCount, ref buffer, timeout, true, out duration,
|
||||
out bool sense);
|
||||
@@ -204,7 +200,6 @@ namespace DiscImageChef.Devices
|
||||
Sector = sector
|
||||
};
|
||||
|
||||
|
||||
LastError = SendAtaCommand(registers, out statusRegisters, AtaProtocol.PioIn,
|
||||
AtaTransferRegister.SectorCount, ref buffer, timeout, true, out duration,
|
||||
out bool sense);
|
||||
@@ -228,7 +223,6 @@ namespace DiscImageChef.Devices
|
||||
Sector = sector
|
||||
};
|
||||
|
||||
|
||||
LastError = SendAtaCommand(registers, out statusRegisters, AtaProtocol.NonData,
|
||||
AtaTransferRegister.NoTransfer, ref buffer, timeout, true, out duration,
|
||||
out bool sense);
|
||||
|
||||
@@ -40,7 +40,7 @@ namespace DiscImageChef.Devices
|
||||
/// <summary>
|
||||
/// Sends the ATA IDENTIFY PACKET DEVICE command to the device, using default device timeout
|
||||
/// </summary>
|
||||
/// <returns><c>true</c> if the command failed and <paramref name="statusRegisters"/> contains the error registers.</returns>
|
||||
/// <returns><c>true</c> if the command failed and <paramref name="statusRegisters" /> contains the error registers.</returns>
|
||||
/// <param name="buffer">Buffer.</param>
|
||||
/// <param name="statusRegisters">Status registers.</param>
|
||||
public bool AtapiIdentify(out byte[] buffer, out AtaErrorRegistersChs statusRegisters)
|
||||
@@ -51,7 +51,7 @@ namespace DiscImageChef.Devices
|
||||
/// <summary>
|
||||
/// Sends the ATA IDENTIFY PACKET DEVICE command to the device, using default device timeout
|
||||
/// </summary>
|
||||
/// <returns><c>true</c> if the command failed and <paramref name="statusRegisters"/> contains the error registers.</returns>
|
||||
/// <returns><c>true</c> if the command failed and <paramref name="statusRegisters" /> contains the error registers.</returns>
|
||||
/// <param name="buffer">Buffer.</param>
|
||||
/// <param name="statusRegisters">Status registers.</param>
|
||||
/// <param name="duration">Duration.</param>
|
||||
@@ -63,7 +63,7 @@ namespace DiscImageChef.Devices
|
||||
/// <summary>
|
||||
/// Sends the ATA IDENTIFY PACKET DEVICE command to the device
|
||||
/// </summary>
|
||||
/// <returns><c>true</c> if the command failed and <paramref name="statusRegisters"/> contains the error registers.</returns>
|
||||
/// <returns><c>true</c> if the command failed and <paramref name="statusRegisters" /> contains the error registers.</returns>
|
||||
/// <param name="buffer">Buffer.</param>
|
||||
/// <param name="statusRegisters">Status registers.</param>
|
||||
/// <param name="timeout">Timeout.</param>
|
||||
@@ -75,7 +75,7 @@ namespace DiscImageChef.Devices
|
||||
/// <summary>
|
||||
/// Sends the ATA IDENTIFY PACKET DEVICE command to the device
|
||||
/// </summary>
|
||||
/// <returns><c>true</c> if the command failed and <paramref name="statusRegisters"/> contains the error registers.</returns>
|
||||
/// <returns><c>true</c> if the command failed and <paramref name="statusRegisters" /> contains the error registers.</returns>
|
||||
/// <param name="buffer">Buffer.</param>
|
||||
/// <param name="statusRegisters">Status registers.</param>
|
||||
/// <param name="timeout">Timeout.</param>
|
||||
@@ -86,7 +86,6 @@ namespace DiscImageChef.Devices
|
||||
buffer = new byte[512];
|
||||
AtaRegistersChs registers = new AtaRegistersChs {Command = (byte)AtaCommands.IdentifyPacketDevice};
|
||||
|
||||
|
||||
LastError = SendAtaCommand(registers, out statusRegisters, AtaProtocol.PioIn,
|
||||
AtaTransferRegister.NoTransfer, ref buffer, timeout, false, out duration,
|
||||
out bool sense);
|
||||
|
||||
@@ -75,7 +75,6 @@ namespace DiscImageChef.Devices
|
||||
DeviceHead = (byte)(head & 0x0F)
|
||||
};
|
||||
|
||||
|
||||
LastError = SendAtaCommand(registers, out statusRegisters, AtaProtocol.PioIn,
|
||||
AtaTransferRegister.NoTransfer, ref buffer, timeout, false, out duration,
|
||||
out bool sense);
|
||||
@@ -92,7 +91,6 @@ namespace DiscImageChef.Devices
|
||||
byte[] buffer = new byte[0];
|
||||
AtaRegistersLba28 registers = new AtaRegistersLba28 {Command = (byte)AtaCommands.RequestSense};
|
||||
|
||||
|
||||
LastError = SendAtaCommand(registers, out statusRegisters, AtaProtocol.PioIn,
|
||||
AtaTransferRegister.NoTransfer, ref buffer, timeout, false, out duration,
|
||||
out bool sense);
|
||||
|
||||
@@ -56,7 +56,6 @@ namespace DiscImageChef.Devices
|
||||
AtaRegistersChs registers =
|
||||
new AtaRegistersChs {Command = (byte)AtaCommands.CheckMediaCardType, Feature = feature};
|
||||
|
||||
|
||||
LastError = SendAtaCommand(registers, out statusRegisters, AtaProtocol.NonData,
|
||||
AtaTransferRegister.NoTransfer, ref buffer, timeout, false, out duration,
|
||||
out bool sense);
|
||||
|
||||
@@ -48,7 +48,6 @@ namespace DiscImageChef.Devices
|
||||
LbaMid = 0x4F
|
||||
};
|
||||
|
||||
|
||||
LastError = SendAtaCommand(registers, out statusRegisters, AtaProtocol.NonData,
|
||||
AtaTransferRegister.NoTransfer, ref buffer, timeout, false, out duration,
|
||||
out bool sense);
|
||||
@@ -72,7 +71,6 @@ namespace DiscImageChef.Devices
|
||||
SectorCount = 0xF1
|
||||
};
|
||||
|
||||
|
||||
LastError = SendAtaCommand(registers, out statusRegisters, AtaProtocol.NonData,
|
||||
AtaTransferRegister.NoTransfer, ref buffer, timeout, false, out duration,
|
||||
out bool sense);
|
||||
@@ -95,7 +93,6 @@ namespace DiscImageChef.Devices
|
||||
LbaMid = 0x4F
|
||||
};
|
||||
|
||||
|
||||
LastError = SendAtaCommand(registers, out statusRegisters, AtaProtocol.NonData,
|
||||
AtaTransferRegister.NoTransfer, ref buffer, timeout, false, out duration,
|
||||
out bool sense);
|
||||
@@ -117,7 +114,6 @@ namespace DiscImageChef.Devices
|
||||
LbaMid = 0x4F
|
||||
};
|
||||
|
||||
|
||||
LastError = SendAtaCommand(registers, out statusRegisters, AtaProtocol.NonData,
|
||||
AtaTransferRegister.NoTransfer, ref buffer, timeout, false, out duration,
|
||||
out bool sense);
|
||||
@@ -141,7 +137,6 @@ namespace DiscImageChef.Devices
|
||||
LbaLow = subcommand
|
||||
};
|
||||
|
||||
|
||||
LastError = SendAtaCommand(registers, out statusRegisters, AtaProtocol.NonData,
|
||||
AtaTransferRegister.NoTransfer, ref buffer, timeout, false, out duration,
|
||||
out bool sense);
|
||||
@@ -164,7 +159,6 @@ namespace DiscImageChef.Devices
|
||||
LbaMid = 0x4F
|
||||
};
|
||||
|
||||
|
||||
LastError = SendAtaCommand(registers, out statusRegisters, AtaProtocol.PioIn,
|
||||
AtaTransferRegister.NoTransfer, ref buffer, timeout, false, out duration,
|
||||
out bool sense);
|
||||
@@ -188,7 +182,6 @@ namespace DiscImageChef.Devices
|
||||
LbaLow = logAddress
|
||||
};
|
||||
|
||||
|
||||
LastError = SendAtaCommand(registers, out statusRegisters, AtaProtocol.PioIn,
|
||||
AtaTransferRegister.NoTransfer, ref buffer, timeout, false, out duration,
|
||||
out bool sense);
|
||||
@@ -210,7 +203,6 @@ namespace DiscImageChef.Devices
|
||||
LbaMid = 0x4F
|
||||
};
|
||||
|
||||
|
||||
LastError = SendAtaCommand(registers, out statusRegisters, AtaProtocol.NonData,
|
||||
AtaTransferRegister.NoTransfer, ref buffer, timeout, false, out duration,
|
||||
out bool sense);
|
||||
|
||||
@@ -49,7 +49,10 @@ namespace DiscImageChef.Devices
|
||||
/// <param name="timeout">Timeout in seconds</param>
|
||||
/// <param name="direction">SCSI command transfer direction</param>
|
||||
/// <param name="duration">Time it took to execute the command in milliseconds</param>
|
||||
/// <param name="sense"><c>True</c> if SCSI command returned non-OK status and <paramref name="senseBuffer"/> contains SCSI sense</param>
|
||||
/// <param name="sense">
|
||||
/// <c>True</c> if SCSI command returned non-OK status and <paramref name="senseBuffer" /> contains
|
||||
/// SCSI sense
|
||||
/// </param>
|
||||
public int SendScsiCommand(byte[] cdb, ref byte[] buffer, out byte[] senseBuffer, uint timeout,
|
||||
ScsiDirection direction, out double duration, out bool sense)
|
||||
{
|
||||
@@ -67,15 +70,19 @@ namespace DiscImageChef.Devices
|
||||
/// <param name="transferRegister">Indicates which register indicates the transfer length</param>
|
||||
/// <param name="buffer">Buffer for ATA/ATAPI command response</param>
|
||||
/// <param name="timeout">Timeout in seconds</param>
|
||||
/// <param name="transferBlocks">If set to <c>true</c>, transfer is indicated in blocks, otherwise, it is indicated in bytes.</param>
|
||||
/// <param name="transferBlocks">
|
||||
/// If set to <c>true</c>, transfer is indicated in blocks, otherwise, it is indicated in
|
||||
/// bytes.
|
||||
/// </param>
|
||||
/// <param name="duration">Time it took to execute the command in milliseconds</param>
|
||||
/// <param name="sense"><c>True</c> if ATA/ATAPI command returned non-OK status</param>
|
||||
public int SendAtaCommand(AtaRegistersChs registers, out AtaErrorRegistersChs errorRegisters,
|
||||
AtaProtocol protocol, AtaTransferRegister transferRegister, ref byte[] buffer,
|
||||
uint timeout, bool transferBlocks, out double duration, out bool sense)
|
||||
{
|
||||
return Command.SendAtaCommand(PlatformId, FileHandle, registers, out errorRegisters, protocol, transferRegister,
|
||||
ref buffer, timeout, transferBlocks, out duration, out sense);
|
||||
return Command.SendAtaCommand(PlatformId, FileHandle, registers, out errorRegisters, protocol,
|
||||
transferRegister, ref buffer, timeout, transferBlocks, out duration,
|
||||
out sense);
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
@@ -88,15 +95,19 @@ namespace DiscImageChef.Devices
|
||||
/// <param name="transferRegister">Indicates which register indicates the transfer length</param>
|
||||
/// <param name="buffer">Buffer for ATA/ATAPI command response</param>
|
||||
/// <param name="timeout">Timeout in seconds</param>
|
||||
/// <param name="transferBlocks">If set to <c>true</c>, transfer is indicated in blocks, otherwise, it is indicated in bytes.</param>
|
||||
/// <param name="transferBlocks">
|
||||
/// If set to <c>true</c>, transfer is indicated in blocks, otherwise, it is indicated in
|
||||
/// bytes.
|
||||
/// </param>
|
||||
/// <param name="duration">Time it took to execute the command in milliseconds</param>
|
||||
/// <param name="sense"><c>True</c> if ATA/ATAPI command returned non-OK status</param>
|
||||
public int SendAtaCommand(AtaRegistersLba28 registers, out AtaErrorRegistersLba28 errorRegisters,
|
||||
AtaProtocol protocol, AtaTransferRegister transferRegister, ref byte[] buffer,
|
||||
uint timeout, bool transferBlocks, out double duration, out bool sense)
|
||||
{
|
||||
return Command.SendAtaCommand(PlatformId, FileHandle, registers, out errorRegisters, protocol, transferRegister,
|
||||
ref buffer, timeout, transferBlocks, out duration, out sense);
|
||||
return Command.SendAtaCommand(PlatformId, FileHandle, registers, out errorRegisters, protocol,
|
||||
transferRegister, ref buffer, timeout, transferBlocks, out duration,
|
||||
out sense);
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
@@ -109,15 +120,19 @@ namespace DiscImageChef.Devices
|
||||
/// <param name="transferRegister">Indicates which register indicates the transfer length</param>
|
||||
/// <param name="buffer">Buffer for ATA/ATAPI command response</param>
|
||||
/// <param name="timeout">Timeout in seconds</param>
|
||||
/// <param name="transferBlocks">If set to <c>true</c>, transfer is indicated in blocks, otherwise, it is indicated in bytes.</param>
|
||||
/// <param name="transferBlocks">
|
||||
/// If set to <c>true</c>, transfer is indicated in blocks, otherwise, it is indicated in
|
||||
/// bytes.
|
||||
/// </param>
|
||||
/// <param name="duration">Time it took to execute the command in milliseconds</param>
|
||||
/// <param name="sense"><c>True</c> if ATA/ATAPI command returned non-OK status</param>
|
||||
public int SendAtaCommand(AtaRegistersLba48 registers, out AtaErrorRegistersLba48 errorRegisters,
|
||||
AtaProtocol protocol, AtaTransferRegister transferRegister, ref byte[] buffer,
|
||||
uint timeout, bool transferBlocks, out double duration, out bool sense)
|
||||
{
|
||||
return Command.SendAtaCommand(PlatformId, FileHandle, registers, out errorRegisters, protocol, transferRegister,
|
||||
ref buffer, timeout, transferBlocks, out duration, out sense);
|
||||
return Command.SendAtaCommand(PlatformId, FileHandle, registers, out errorRegisters, protocol,
|
||||
transferRegister, ref buffer, timeout, transferBlocks, out duration,
|
||||
out sense);
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
@@ -140,7 +155,8 @@ namespace DiscImageChef.Devices
|
||||
uint blockSize, uint blocks, ref byte[] buffer, out uint[] response,
|
||||
out double duration, out bool sense, uint timeout = 0)
|
||||
{
|
||||
switch(command) {
|
||||
switch(command)
|
||||
{
|
||||
case MmcCommands.SendCid when cachedCid != null:
|
||||
{
|
||||
DateTime start = DateTime.Now;
|
||||
@@ -176,10 +192,11 @@ namespace DiscImageChef.Devices
|
||||
}
|
||||
}
|
||||
|
||||
if((command != (MmcCommands)SecureDigitalCommands.SendOperatingCondition &&
|
||||
command != MmcCommands.SendOpCond) || cachedOcr == null)
|
||||
return Command.SendMmcCommand(PlatformId, FileHandle, command, write, isApplication, flags, argument, blockSize,
|
||||
blocks, ref buffer, out response, out duration, out sense, timeout);
|
||||
if(command != (MmcCommands)SecureDigitalCommands.SendOperatingCondition &&
|
||||
command != MmcCommands.SendOpCond || cachedOcr == null)
|
||||
return Command.SendMmcCommand(PlatformId, FileHandle, command, write, isApplication, flags, argument,
|
||||
blockSize, blocks, ref buffer, out response, out duration, out sense,
|
||||
timeout);
|
||||
|
||||
{
|
||||
DateTime start = DateTime.Now;
|
||||
|
||||
@@ -71,11 +71,9 @@ namespace DiscImageChef.Devices
|
||||
{
|
||||
case PlatformID.Win32NT:
|
||||
{
|
||||
FileHandle = Extern.CreateFile(devicePath,
|
||||
FileAccess.GenericRead | FileAccess.GenericWrite,
|
||||
FileShare.Read | FileShare.Write, IntPtr.Zero,
|
||||
FileMode.OpenExisting, FileAttributes.Normal,
|
||||
IntPtr.Zero);
|
||||
FileHandle = Extern.CreateFile(devicePath, FileAccess.GenericRead | FileAccess.GenericWrite,
|
||||
FileShare.Read | FileShare.Write, IntPtr.Zero, FileMode.OpenExisting,
|
||||
FileAttributes.Normal, IntPtr.Zero);
|
||||
|
||||
if(((SafeFileHandle)FileHandle).IsInvalid)
|
||||
{
|
||||
@@ -107,8 +105,7 @@ namespace DiscImageChef.Devices
|
||||
LastError = Marshal.GetLastWin32Error();
|
||||
}
|
||||
|
||||
CamDevice camDevice =
|
||||
(CamDevice)Marshal.PtrToStructure((IntPtr)FileHandle, typeof(CamDevice));
|
||||
CamDevice camDevice = (CamDevice)Marshal.PtrToStructure((IntPtr)FileHandle, typeof(CamDevice));
|
||||
|
||||
if(StringHandlers.CToString(camDevice.SimName) == "ata")
|
||||
throw new
|
||||
@@ -116,8 +113,7 @@ namespace DiscImageChef.Devices
|
||||
|
||||
break;
|
||||
}
|
||||
default:
|
||||
throw new InvalidOperationException($"Platform {PlatformId} not yet supported.");
|
||||
default: throw new InvalidOperationException($"Platform {PlatformId} not yet supported.");
|
||||
}
|
||||
|
||||
if(Error) throw new SystemException($"Error {LastError} opening device.");
|
||||
@@ -133,7 +129,8 @@ namespace DiscImageChef.Devices
|
||||
bool scsiSense = true;
|
||||
|
||||
// Windows is answering SCSI INQUIRY for all device types so it needs to be detected first
|
||||
switch(PlatformId) {
|
||||
switch(PlatformId)
|
||||
{
|
||||
case PlatformID.Win32NT:
|
||||
StoragePropertyQuery query = new StoragePropertyQuery();
|
||||
query.PropertyId = StoragePropertyId.Device;
|
||||
@@ -147,11 +144,9 @@ namespace DiscImageChef.Devices
|
||||
int error = 0;
|
||||
|
||||
bool hasError = !Extern.DeviceIoControlStorageQuery((SafeFileHandle)FileHandle,
|
||||
WindowsIoctl
|
||||
.IoctlStorageQueryProperty,
|
||||
WindowsIoctl.IoctlStorageQueryProperty,
|
||||
ref query, (uint)Marshal.SizeOf(query),
|
||||
descriptorPtr, 1000, ref returned,
|
||||
IntPtr.Zero);
|
||||
descriptorPtr, 1000, ref returned, IntPtr.Zero);
|
||||
|
||||
if(hasError) error = Marshal.GetLastWin32Error();
|
||||
|
||||
@@ -212,9 +207,11 @@ namespace DiscImageChef.Devices
|
||||
break;
|
||||
}
|
||||
|
||||
switch(Type) {
|
||||
switch(Type)
|
||||
{
|
||||
case DeviceType.SCSI:
|
||||
case DeviceType.ATAPI: scsiSense = ScsiInquiry(out inqBuf, out _);
|
||||
case DeviceType.ATAPI:
|
||||
scsiSense = ScsiInquiry(out inqBuf, out _);
|
||||
break;
|
||||
case DeviceType.ATA:
|
||||
bool atapiSense = AtapiIdentify(out ataBuf, out _);
|
||||
@@ -239,10 +236,11 @@ namespace DiscImageChef.Devices
|
||||
{
|
||||
byte[] sdBuffer = new byte[16];
|
||||
|
||||
LastError = Windows.Command.SendMmcCommand((SafeFileHandle)FileHandle, MmcCommands.SendCsd, false, false,
|
||||
LastError = Windows.Command.SendMmcCommand((SafeFileHandle)FileHandle, MmcCommands.SendCsd,
|
||||
false, false,
|
||||
MmcFlags.ResponseSpiR2 | MmcFlags.ResponseR2 |
|
||||
MmcFlags.CommandAc, 0, 16, 1, ref sdBuffer,
|
||||
out _, out _, out bool sense);
|
||||
MmcFlags.CommandAc, 0, 16, 1, ref sdBuffer, out _,
|
||||
out _, out bool sense);
|
||||
|
||||
if(!sense)
|
||||
{
|
||||
@@ -252,7 +250,8 @@ namespace DiscImageChef.Devices
|
||||
|
||||
sdBuffer = new byte[16];
|
||||
|
||||
LastError = Windows.Command.SendMmcCommand((SafeFileHandle)FileHandle, MmcCommands.SendCid, false, false,
|
||||
LastError = Windows.Command.SendMmcCommand((SafeFileHandle)FileHandle, MmcCommands.SendCid,
|
||||
false, false,
|
||||
MmcFlags.ResponseSpiR2 | MmcFlags.ResponseR2 |
|
||||
MmcFlags.CommandAc, 0, 16, 1, ref sdBuffer, out _,
|
||||
out _, out sense);
|
||||
@@ -266,10 +265,11 @@ namespace DiscImageChef.Devices
|
||||
sdBuffer = new byte[8];
|
||||
|
||||
LastError = Windows.Command.SendMmcCommand((SafeFileHandle)FileHandle,
|
||||
(MmcCommands)SecureDigitalCommands.SendScr, false, true,
|
||||
(MmcCommands)SecureDigitalCommands.SendScr, false,
|
||||
true,
|
||||
MmcFlags.ResponseSpiR1 | MmcFlags.ResponseR1 |
|
||||
MmcFlags.CommandAdtc, 0, 8, 1, ref sdBuffer,
|
||||
out _, out _, out sense);
|
||||
MmcFlags.CommandAdtc, 0, 8, 1, ref sdBuffer, out _,
|
||||
out _, out sense);
|
||||
|
||||
if(!sense)
|
||||
{
|
||||
@@ -298,8 +298,8 @@ namespace DiscImageChef.Devices
|
||||
{
|
||||
sdBuffer = new byte[4];
|
||||
|
||||
LastError = Windows.Command.SendMmcCommand((SafeFileHandle)FileHandle, MmcCommands.SendOpCond, false,
|
||||
true,
|
||||
LastError = Windows.Command.SendMmcCommand((SafeFileHandle)FileHandle,
|
||||
MmcCommands.SendOpCond, false, true,
|
||||
MmcFlags.ResponseSpiR3 | MmcFlags.ResponseR3 |
|
||||
MmcFlags.CommandBcr, 0, 4, 1, ref sdBuffer,
|
||||
out _, out _, out sense);
|
||||
@@ -343,7 +343,8 @@ namespace DiscImageChef.Devices
|
||||
}
|
||||
}
|
||||
break;
|
||||
default: scsiSense = ScsiInquiry(out inqBuf, out _);
|
||||
default:
|
||||
scsiSense = ScsiInquiry(out inqBuf, out _);
|
||||
break;
|
||||
}
|
||||
|
||||
@@ -375,7 +376,8 @@ namespace DiscImageChef.Devices
|
||||
#endregion SecureDigital / MultiMediaCard
|
||||
|
||||
#region USB
|
||||
switch(PlatformId) {
|
||||
switch(PlatformId)
|
||||
{
|
||||
case PlatformID.Linux:
|
||||
if(devicePath.StartsWith("/dev/sd", StringComparison.Ordinal) ||
|
||||
devicePath.StartsWith("/dev/sr", StringComparison.Ordinal) ||
|
||||
@@ -405,14 +407,14 @@ namespace DiscImageChef.Devices
|
||||
|
||||
StreamReader usbSr = new StreamReader(resolvedLink + "/idProduct");
|
||||
string usbTemp = usbSr.ReadToEnd();
|
||||
ushort.TryParse(usbTemp, NumberStyles.HexNumber,
|
||||
CultureInfo.InvariantCulture, out usbProduct);
|
||||
ushort.TryParse(usbTemp, NumberStyles.HexNumber, CultureInfo.InvariantCulture,
|
||||
out usbProduct);
|
||||
usbSr.Close();
|
||||
|
||||
usbSr = new StreamReader(resolvedLink + "/idVendor");
|
||||
usbTemp = usbSr.ReadToEnd();
|
||||
ushort.TryParse(usbTemp, NumberStyles.HexNumber,
|
||||
CultureInfo.InvariantCulture, out usbVendor);
|
||||
ushort.TryParse(usbTemp, NumberStyles.HexNumber, CultureInfo.InvariantCulture,
|
||||
out usbVendor);
|
||||
usbSr.Close();
|
||||
|
||||
if(File.Exists(resolvedLink + "/manufacturer"))
|
||||
@@ -448,10 +450,7 @@ namespace DiscImageChef.Devices
|
||||
|
||||
// I have to search for USB disks, floppies and CD-ROMs as separate device types
|
||||
foreach(string devGuid in new[]
|
||||
{
|
||||
Usb.GuidDevinterfaceFloppy, Usb.GuidDevinterfaceCdrom,
|
||||
Usb.GuidDevinterfaceDisk
|
||||
})
|
||||
{Usb.GuidDevinterfaceFloppy, Usb.GuidDevinterfaceCdrom, Usb.GuidDevinterfaceDisk})
|
||||
{
|
||||
usbDevice = Usb.FindDrivePath(devicePath, devGuid);
|
||||
if(usbDevice != null) break;
|
||||
@@ -468,7 +467,8 @@ namespace DiscImageChef.Devices
|
||||
usbDevice.SerialNumber; // This is incorrect filled by Windows with SCSI/ATA serial number
|
||||
}
|
||||
break;
|
||||
default: IsUsb = false;
|
||||
default:
|
||||
IsUsb = false;
|
||||
break;
|
||||
}
|
||||
#endregion USB
|
||||
@@ -489,27 +489,25 @@ namespace DiscImageChef.Devices
|
||||
while(resolvedLink.Contains("firewire"))
|
||||
{
|
||||
resolvedLink = Path.GetDirectoryName(resolvedLink);
|
||||
if(!File.Exists(resolvedLink + "/model") ||
|
||||
!File.Exists(resolvedLink + "/vendor") ||
|
||||
if(!File.Exists(resolvedLink + "/model") || !File.Exists(resolvedLink + "/vendor") ||
|
||||
!File.Exists(resolvedLink + "/guid")) continue;
|
||||
|
||||
StreamReader fwSr = new StreamReader(resolvedLink + "/model");
|
||||
string fwTemp = fwSr.ReadToEnd();
|
||||
uint.TryParse(fwTemp, NumberStyles.HexNumber,
|
||||
CultureInfo.InvariantCulture, out firewireModel);
|
||||
uint.TryParse(fwTemp, NumberStyles.HexNumber, CultureInfo.InvariantCulture,
|
||||
out firewireModel);
|
||||
fwSr.Close();
|
||||
|
||||
fwSr = new StreamReader(resolvedLink + "/vendor");
|
||||
fwTemp = fwSr.ReadToEnd();
|
||||
uint.TryParse(fwTemp, NumberStyles.HexNumber,
|
||||
CultureInfo.InvariantCulture,
|
||||
uint.TryParse(fwTemp, NumberStyles.HexNumber, CultureInfo.InvariantCulture,
|
||||
out firewireVendor);
|
||||
fwSr.Close();
|
||||
|
||||
fwSr = new StreamReader(resolvedLink + "/guid");
|
||||
fwTemp = fwSr.ReadToEnd();
|
||||
ulong.TryParse(fwTemp, NumberStyles.HexNumber,
|
||||
CultureInfo.InvariantCulture, out firewireGuid);
|
||||
ulong.TryParse(fwTemp, NumberStyles.HexNumber, CultureInfo.InvariantCulture,
|
||||
out firewireGuid);
|
||||
fwSr.Close();
|
||||
|
||||
if(File.Exists(resolvedLink + "/model_name"))
|
||||
@@ -554,20 +552,17 @@ namespace DiscImageChef.Devices
|
||||
resolvedLink = Path.GetDirectoryName(resolvedLink);
|
||||
if(!Directory.Exists(resolvedLink + "/pcmcia_socket")) continue;
|
||||
|
||||
string[] subdirs =
|
||||
Directory.GetDirectories(resolvedLink + "/pcmcia_socket",
|
||||
string[] subdirs = Directory.GetDirectories(resolvedLink + "/pcmcia_socket",
|
||||
"pcmcia_socket*",
|
||||
SearchOption.TopDirectoryOnly);
|
||||
|
||||
if(subdirs.Length <= 0) continue;
|
||||
|
||||
string possibleDir =
|
||||
Path.Combine(resolvedLink, "pcmcia_socket", subdirs[0]);
|
||||
if(!File.Exists(possibleDir + "/card_type") ||
|
||||
!File.Exists(possibleDir + "/cis")) continue;
|
||||
string possibleDir = Path.Combine(resolvedLink, "pcmcia_socket", subdirs[0]);
|
||||
if(!File.Exists(possibleDir + "/card_type") || !File.Exists(possibleDir + "/cis"))
|
||||
continue;
|
||||
|
||||
FileStream cisFs = new FileStream(possibleDir + "/cis",
|
||||
System.IO.FileMode.Open,
|
||||
FileStream cisFs = new FileStream(possibleDir + "/cis", System.IO.FileMode.Open,
|
||||
System.IO.FileAccess.Read);
|
||||
byte[] cisBuf = new byte[65536];
|
||||
int cisCount = cisFs.Read(cisBuf, 0, 65536);
|
||||
|
||||
@@ -41,7 +41,7 @@ namespace DiscImageChef.Devices
|
||||
{
|
||||
/// <summary>
|
||||
/// Releases unmanaged resources and performs other cleanup operations before the
|
||||
/// <see cref="Device"/> is reclaimed by garbage collection.
|
||||
/// <see cref="Device" /> is reclaimed by garbage collection.
|
||||
/// </summary>
|
||||
~Device()
|
||||
{
|
||||
|
||||
@@ -97,8 +97,8 @@ namespace DiscImageChef.Devices
|
||||
byte[] buffer = new byte[0];
|
||||
|
||||
LastError = SendMmcCommand(MmcCommands.SetBlocklen, false, false,
|
||||
MmcFlags.ResponseSpiR1 | MmcFlags.ResponseR1 | MmcFlags.CommandAc, length, 0,
|
||||
0, ref buffer, out response, out duration, out bool sense, timeout);
|
||||
MmcFlags.ResponseSpiR1 | MmcFlags.ResponseR1 | MmcFlags.CommandAc, length, 0, 0,
|
||||
ref buffer, out response, out duration, out bool sense, timeout);
|
||||
Error = LastError != 0;
|
||||
|
||||
DicConsole.DebugWriteLine("MMC Device", "SET_BLOCKLEN took {0} ms.", duration);
|
||||
@@ -118,8 +118,8 @@ namespace DiscImageChef.Devices
|
||||
|
||||
LastError = SendMmcCommand(command, false, false,
|
||||
MmcFlags.ResponseSpiR1 | MmcFlags.ResponseR1 | MmcFlags.CommandAdtc, address,
|
||||
blockSize, transferLength, ref buffer, out response, out duration, out bool sense,
|
||||
timeout);
|
||||
blockSize, transferLength, ref buffer, out response, out duration,
|
||||
out bool sense, timeout);
|
||||
Error = LastError != 0;
|
||||
|
||||
if(transferLength > 1)
|
||||
|
||||
@@ -62,11 +62,9 @@ namespace DiscImageChef.Devices
|
||||
|
||||
if(mode != FujitsuDisplayModes.Half)
|
||||
if(!ArrayHelpers.ArrayIsNullOrWhiteSpace(firstHalfBytes) &&
|
||||
!ArrayHelpers.ArrayIsNullOrWhiteSpace(secondHalfBytes))
|
||||
displayLen = true;
|
||||
!ArrayHelpers.ArrayIsNullOrWhiteSpace(secondHalfBytes)) displayLen = true;
|
||||
else if(!ArrayHelpers.ArrayIsNullOrWhiteSpace(firstHalfBytes) &&
|
||||
ArrayHelpers.ArrayIsNullOrWhiteSpace(secondHalfBytes))
|
||||
halfMsg = true;
|
||||
ArrayHelpers.ArrayIsNullOrWhiteSpace(secondHalfBytes)) halfMsg = true;
|
||||
|
||||
buffer[0] = (byte)((byte)mode << 5);
|
||||
if(displayLen) buffer[0] += 0x10;
|
||||
|
||||
@@ -39,7 +39,7 @@ namespace DiscImageChef.Devices
|
||||
/// <summary>
|
||||
/// Reads a "raw" sector from DVD on HL-DT-ST drives.
|
||||
/// </summary>
|
||||
/// <returns><c>true</c> if the command failed and <paramref name="senseBuffer"/> contains the sense buffer.</returns>
|
||||
/// <returns><c>true</c> if the command failed and <paramref name="senseBuffer" /> contains the sense buffer.</returns>
|
||||
/// <param name="buffer">Buffer where the HL-DT-ST READ DVD (RAW) response will be stored</param>
|
||||
/// <param name="senseBuffer">Sense buffer.</param>
|
||||
/// <param name="timeout">Timeout in seconds.</param>
|
||||
|
||||
@@ -39,7 +39,7 @@ namespace DiscImageChef.Devices
|
||||
/// <summary>
|
||||
/// Sends the HP READ LONG vendor command
|
||||
/// </summary>
|
||||
/// <returns><c>true</c> if the command failed and <paramref name="senseBuffer"/> contains the sense buffer.</returns>
|
||||
/// <returns><c>true</c> if the command failed and <paramref name="senseBuffer" /> contains the sense buffer.</returns>
|
||||
/// <param name="buffer">Buffer where the SCSI READ LONG response will be stored</param>
|
||||
/// <param name="senseBuffer">Sense buffer.</param>
|
||||
/// <param name="relAddr">If set to <c>true</c> address contain two's complement offset from last read address.</param>
|
||||
@@ -58,7 +58,7 @@ namespace DiscImageChef.Devices
|
||||
/// <summary>
|
||||
/// Sends the HP READ LONG vendor command
|
||||
/// </summary>
|
||||
/// <returns><c>true</c> if the command failed and <paramref name="senseBuffer"/> contains the sense buffer.</returns>
|
||||
/// <returns><c>true</c> if the command failed and <paramref name="senseBuffer" /> contains the sense buffer.</returns>
|
||||
/// <param name="buffer">Buffer where the SCSI READ LONG response will be stored</param>
|
||||
/// <param name="senseBuffer">Sense buffer.</param>
|
||||
/// <param name="relAddr">If set to <c>true</c> address contain two's complement offset from last read address.</param>
|
||||
@@ -66,7 +66,10 @@ namespace DiscImageChef.Devices
|
||||
/// <param name="transferLen">How many blocks/bytes to read.</param>
|
||||
/// <param name="blockBytes">How many bytes per block.</param>
|
||||
/// <param name="pba">If set to <c>true</c> address contain physical block address.</param>
|
||||
/// <param name="sectorCount">If set to <c>true</c> <paramref name="transferLen"/> is a count of secors to read. Otherwise it will be ignored</param>
|
||||
/// <param name="sectorCount">
|
||||
/// If set to <c>true</c> <paramref name="transferLen" /> is a count of secors to read. Otherwise
|
||||
/// it will be ignored
|
||||
/// </param>
|
||||
/// <param name="timeout">Timeout in seconds.</param>
|
||||
/// <param name="duration">Duration in milliseconds it took for the device to execute the command.</param>
|
||||
public bool HpReadLong(out byte[] buffer, out byte[] senseBuffer, bool relAddr, uint address,
|
||||
|
||||
@@ -40,7 +40,7 @@ namespace DiscImageChef.Devices
|
||||
/// <summary>
|
||||
/// Sets the drive to the xtreme unlocked state
|
||||
/// </summary>
|
||||
/// <returns><c>true</c> if the command failed and <paramref name="senseBuffer"/> contains the sense buffer.</returns>
|
||||
/// <returns><c>true</c> if the command failed and <paramref name="senseBuffer" /> contains the sense buffer.</returns>
|
||||
/// <param name="senseBuffer">Sense buffer.</param>
|
||||
/// <param name="timeout">Timeout.</param>
|
||||
/// <param name="duration">Duration.</param>
|
||||
@@ -67,7 +67,7 @@ namespace DiscImageChef.Devices
|
||||
/// <summary>
|
||||
/// Sets the drive to the locked state.
|
||||
/// </summary>
|
||||
/// <returns><c>true</c> if the command failed and <paramref name="senseBuffer"/> contains the sense buffer.</returns>
|
||||
/// <returns><c>true</c> if the command failed and <paramref name="senseBuffer" /> contains the sense buffer.</returns>
|
||||
/// <param name="senseBuffer">Sense buffer.</param>
|
||||
/// <param name="timeout">Timeout.</param>
|
||||
/// <param name="duration">Duration.</param>
|
||||
@@ -79,7 +79,7 @@ namespace DiscImageChef.Devices
|
||||
/// <summary>
|
||||
/// Sets the drive to the xtreme unlocked state
|
||||
/// </summary>
|
||||
/// <returns><c>true</c> if the command failed and <paramref name="senseBuffer"/> contains the sense buffer.</returns>
|
||||
/// <returns><c>true</c> if the command failed and <paramref name="senseBuffer" /> contains the sense buffer.</returns>
|
||||
/// <param name="senseBuffer">Sense buffer.</param>
|
||||
/// <param name="timeout">Timeout.</param>
|
||||
/// <param name="duration">Duration.</param>
|
||||
@@ -91,7 +91,7 @@ namespace DiscImageChef.Devices
|
||||
/// <summary>
|
||||
/// Sets the drive to the wxripper unlocked state
|
||||
/// </summary>
|
||||
/// <returns><c>true</c> if the command failed and <paramref name="senseBuffer"/> contains the sense buffer.</returns>
|
||||
/// <returns><c>true</c> if the command failed and <paramref name="senseBuffer" /> contains the sense buffer.</returns>
|
||||
/// <param name="senseBuffer">Sense buffer.</param>
|
||||
/// <param name="timeout">Timeout.</param>
|
||||
/// <param name="duration">Duration.</param>
|
||||
@@ -103,7 +103,7 @@ namespace DiscImageChef.Devices
|
||||
/// <summary>
|
||||
/// Sets the drive to the specified lock state
|
||||
/// </summary>
|
||||
/// <returns><c>true</c> if the command failed and <paramref name="senseBuffer"/> contains the sense buffer.</returns>
|
||||
/// <returns><c>true</c> if the command failed and <paramref name="senseBuffer" /> contains the sense buffer.</returns>
|
||||
/// <param name="senseBuffer">Sense buffer.</param>
|
||||
/// <param name="timeout">Timeout.</param>
|
||||
/// <param name="duration">Duration.</param>
|
||||
@@ -132,7 +132,7 @@ namespace DiscImageChef.Devices
|
||||
/// <summary>
|
||||
/// Gets a list of supported features
|
||||
/// </summary>
|
||||
/// <returns><c>true</c> if the command failed and <paramref name="senseBuffer"/> contains the sense buffer.</returns>
|
||||
/// <returns><c>true</c> if the command failed and <paramref name="senseBuffer" /> contains the sense buffer.</returns>
|
||||
/// <param name="senseBuffer">Sense buffer.</param>
|
||||
/// <param name="timeout">Timeout.</param>
|
||||
/// <param name="duration">Duration.</param>
|
||||
@@ -207,7 +207,7 @@ namespace DiscImageChef.Devices
|
||||
/// <summary>
|
||||
/// Gets the SS sector.
|
||||
/// </summary>
|
||||
/// <returns><c>true</c> if the command failed and <paramref name="senseBuffer"/> contains the sense buffer.</returns>
|
||||
/// <returns><c>true</c> if the command failed and <paramref name="senseBuffer" /> contains the sense buffer.</returns>
|
||||
/// <param name="senseBuffer">Sense buffer.</param>
|
||||
/// <param name="timeout">Timeout.</param>
|
||||
/// <param name="duration">Duration.</param>
|
||||
|
||||
@@ -40,7 +40,7 @@ namespace DiscImageChef.Devices
|
||||
/// <summary>
|
||||
/// Sends the MMC GET CONFIGURATION command for all Features
|
||||
/// </summary>
|
||||
/// <returns><c>true</c> if the command failed and <paramref name="senseBuffer"/> contains the sense buffer.</returns>
|
||||
/// <returns><c>true</c> if the command failed and <paramref name="senseBuffer" /> contains the sense buffer.</returns>
|
||||
/// <param name="buffer">Buffer where the SCSI GET CONFIGURATION response will be stored</param>
|
||||
/// <param name="senseBuffer">Sense buffer.</param>
|
||||
/// <param name="timeout">Timeout in seconds.</param>
|
||||
@@ -54,7 +54,7 @@ namespace DiscImageChef.Devices
|
||||
/// <summary>
|
||||
/// Sends the MMC GET CONFIGURATION command for all Features starting with specified one
|
||||
/// </summary>
|
||||
/// <returns><c>true</c> if the command failed and <paramref name="senseBuffer"/> contains the sense buffer.</returns>
|
||||
/// <returns><c>true</c> if the command failed and <paramref name="senseBuffer" /> contains the sense buffer.</returns>
|
||||
/// <param name="buffer">Buffer where the SCSI GET CONFIGURATION response will be stored</param>
|
||||
/// <param name="senseBuffer">Sense buffer.</param>
|
||||
/// <param name="startingFeatureNumber">Feature number where the feature list should start from</param>
|
||||
@@ -70,13 +70,13 @@ namespace DiscImageChef.Devices
|
||||
/// <summary>
|
||||
/// Sends the MMC GET CONFIGURATION command
|
||||
/// </summary>
|
||||
/// <returns><c>true</c> if the command failed and <paramref name="senseBuffer"/> contains the sense buffer.</returns>
|
||||
/// <returns><c>true</c> if the command failed and <paramref name="senseBuffer" /> contains the sense buffer.</returns>
|
||||
/// <param name="buffer">Buffer where the SCSI GET CONFIGURATION response will be stored</param>
|
||||
/// <param name="senseBuffer">Sense buffer.</param>
|
||||
/// <param name="timeout">Timeout in seconds.</param>
|
||||
/// <param name="duration">Duration in milliseconds it took for the device to execute the command.</param>
|
||||
/// <param name="startingFeatureNumber">Starting Feature number.</param>
|
||||
/// <param name="rt">Return type, <see cref="MmcGetConfigurationRt"/>.</param>
|
||||
/// <param name="rt">Return type, <see cref="MmcGetConfigurationRt" />.</param>
|
||||
public bool GetConfiguration(out byte[] buffer, out byte[] senseBuffer, ushort startingFeatureNumber,
|
||||
MmcGetConfigurationRt rt, uint timeout, out double duration)
|
||||
{
|
||||
@@ -116,7 +116,7 @@ namespace DiscImageChef.Devices
|
||||
/// <summary>
|
||||
/// Sends the MMC READ DISC STRUCTURE command
|
||||
/// </summary>
|
||||
/// <returns><c>true</c> if the command failed and <paramref name="senseBuffer"/> contains the sense buffer.</returns>
|
||||
/// <returns><c>true</c> if the command failed and <paramref name="senseBuffer" /> contains the sense buffer.</returns>
|
||||
/// <param name="buffer">Buffer where the SCSI READ DISC STRUCTURE response will be stored</param>
|
||||
/// <param name="senseBuffer">Sense buffer.</param>
|
||||
/// <param name="mediaType">Medium type for requested disc structure</param>
|
||||
@@ -170,7 +170,7 @@ namespace DiscImageChef.Devices
|
||||
/// <summary>
|
||||
/// Sends the MMC READ TOC/PMA/ATIP command to get formatted TOC from disc, in MM:SS:FF format
|
||||
/// </summary>
|
||||
/// <returns><c>true</c> if the command failed and <paramref name="senseBuffer"/> contains the sense buffer.</returns>
|
||||
/// <returns><c>true</c> if the command failed and <paramref name="senseBuffer" /> contains the sense buffer.</returns>
|
||||
/// <param name="buffer">Buffer where the SCSI READ TOC/PMA/ATIP response will be stored</param>
|
||||
/// <param name="senseBuffer">Sense buffer.</param>
|
||||
/// <param name="track">Start TOC from this track</param>
|
||||
@@ -184,7 +184,7 @@ namespace DiscImageChef.Devices
|
||||
/// <summary>
|
||||
/// Sends the MMC READ TOC/PMA/ATIP command to get formatted TOC from disc
|
||||
/// </summary>
|
||||
/// <returns><c>true</c> if the command failed and <paramref name="senseBuffer"/> contains the sense buffer.</returns>
|
||||
/// <returns><c>true</c> if the command failed and <paramref name="senseBuffer" /> contains the sense buffer.</returns>
|
||||
/// <param name="buffer">Buffer where the SCSI READ TOC/PMA/ATIP response will be stored</param>
|
||||
/// <param name="senseBuffer">Sense buffer.</param>
|
||||
/// <param name="msf">If <c>true</c>, request data in MM:SS:FF units, otherwise, in blocks</param>
|
||||
@@ -200,7 +200,7 @@ namespace DiscImageChef.Devices
|
||||
/// <summary>
|
||||
/// Sends the MMC READ TOC/PMA/ATIP command to get multi-session information, in MM:SS:FF format
|
||||
/// </summary>
|
||||
/// <returns><c>true</c> if the command failed and <paramref name="senseBuffer"/> contains the sense buffer.</returns>
|
||||
/// <returns><c>true</c> if the command failed and <paramref name="senseBuffer" /> contains the sense buffer.</returns>
|
||||
/// <param name="buffer">Buffer where the SCSI READ TOC/PMA/ATIP response will be stored</param>
|
||||
/// <param name="senseBuffer">Sense buffer.</param>
|
||||
/// <param name="timeout">Timeout in seconds.</param>
|
||||
@@ -213,7 +213,7 @@ namespace DiscImageChef.Devices
|
||||
/// <summary>
|
||||
/// Sends the MMC READ TOC/PMA/ATIP command to get multi-session information
|
||||
/// </summary>
|
||||
/// <returns><c>true</c> if the command failed and <paramref name="senseBuffer"/> contains the sense buffer.</returns>
|
||||
/// <returns><c>true</c> if the command failed and <paramref name="senseBuffer" /> contains the sense buffer.</returns>
|
||||
/// <param name="buffer">Buffer where the SCSI READ TOC/PMA/ATIP response will be stored</param>
|
||||
/// <param name="senseBuffer">Sense buffer.</param>
|
||||
/// <param name="msf">If <c>true</c>, request data in MM:SS:FF units, otherwise, in blocks</param>
|
||||
@@ -228,7 +228,7 @@ namespace DiscImageChef.Devices
|
||||
/// <summary>
|
||||
/// Sends the MMC READ TOC/PMA/ATIP command to get raw TOC subchannels
|
||||
/// </summary>
|
||||
/// <returns><c>true</c> if the command failed and <paramref name="senseBuffer"/> contains the sense buffer.</returns>
|
||||
/// <returns><c>true</c> if the command failed and <paramref name="senseBuffer" /> contains the sense buffer.</returns>
|
||||
/// <param name="buffer">Buffer where the SCSI READ TOC/PMA/ATIP response will be stored</param>
|
||||
/// <param name="senseBuffer">Sense buffer.</param>
|
||||
/// <param name="sessionNumber">Session which TOC to get</param>
|
||||
@@ -243,7 +243,7 @@ namespace DiscImageChef.Devices
|
||||
/// <summary>
|
||||
/// Sends the MMC READ TOC/PMA/ATIP command to get PMA
|
||||
/// </summary>
|
||||
/// <returns><c>true</c> if the command failed and <paramref name="senseBuffer"/> contains the sense buffer.</returns>
|
||||
/// <returns><c>true</c> if the command failed and <paramref name="senseBuffer" /> contains the sense buffer.</returns>
|
||||
/// <param name="buffer">Buffer where the SCSI READ TOC/PMA/ATIP response will be stored</param>
|
||||
/// <param name="senseBuffer">Sense buffer.</param>
|
||||
/// <param name="timeout">Timeout in seconds.</param>
|
||||
@@ -256,7 +256,7 @@ namespace DiscImageChef.Devices
|
||||
/// <summary>
|
||||
/// Sends the MMC READ TOC/PMA/ATIP command to get ATIP
|
||||
/// </summary>
|
||||
/// <returns><c>true</c> if the command failed and <paramref name="senseBuffer"/> contains the sense buffer.</returns>
|
||||
/// <returns><c>true</c> if the command failed and <paramref name="senseBuffer" /> contains the sense buffer.</returns>
|
||||
/// <param name="buffer">Buffer where the SCSI READ TOC/PMA/ATIP response will be stored</param>
|
||||
/// <param name="senseBuffer">Sense buffer.</param>
|
||||
/// <param name="timeout">Timeout in seconds.</param>
|
||||
@@ -269,7 +269,7 @@ namespace DiscImageChef.Devices
|
||||
/// <summary>
|
||||
/// Sends the MMC READ TOC/PMA/ATIP command to get Lead-In CD-TEXT
|
||||
/// </summary>
|
||||
/// <returns><c>true</c> if the command failed and <paramref name="senseBuffer"/> contains the sense buffer.</returns>
|
||||
/// <returns><c>true</c> if the command failed and <paramref name="senseBuffer" /> contains the sense buffer.</returns>
|
||||
/// <param name="buffer">Buffer where the SCSI READ TOC/PMA/ATIP response will be stored</param>
|
||||
/// <param name="senseBuffer">Sense buffer.</param>
|
||||
/// <param name="timeout">Timeout in seconds.</param>
|
||||
@@ -282,7 +282,7 @@ namespace DiscImageChef.Devices
|
||||
/// <summary>
|
||||
/// Sends the MMC READ TOC/PMA/ATIP command
|
||||
/// </summary>
|
||||
/// <returns><c>true</c> if the command failed and <paramref name="senseBuffer"/> contains the sense buffer.</returns>
|
||||
/// <returns><c>true</c> if the command failed and <paramref name="senseBuffer" /> contains the sense buffer.</returns>
|
||||
/// <param name="buffer">Buffer where the SCSI READ TOC/PMA/ATIP response will be stored</param>
|
||||
/// <param name="senseBuffer">Sense buffer.</param>
|
||||
/// <param name="msf">If <c>true</c>, request data in MM:SS:FF units, otherwise, in blocks</param>
|
||||
@@ -333,7 +333,7 @@ namespace DiscImageChef.Devices
|
||||
/// <summary>
|
||||
/// Sends the MMC READ DISC INFORMATION command
|
||||
/// </summary>
|
||||
/// <returns><c>true</c> if the command failed and <paramref name="senseBuffer"/> contains the sense buffer.</returns>
|
||||
/// <returns><c>true</c> if the command failed and <paramref name="senseBuffer" /> contains the sense buffer.</returns>
|
||||
/// <param name="buffer">Buffer where the SCSI READ DISC INFORMATION response will be stored</param>
|
||||
/// <param name="senseBuffer">Sense buffer.</param>
|
||||
/// <param name="timeout">Timeout in seconds.</param>
|
||||
@@ -347,7 +347,7 @@ namespace DiscImageChef.Devices
|
||||
/// <summary>
|
||||
/// Sends the MMC READ DISC INFORMATION command
|
||||
/// </summary>
|
||||
/// <returns><c>true</c> if the command failed and <paramref name="senseBuffer"/> contains the sense buffer.</returns>
|
||||
/// <returns><c>true</c> if the command failed and <paramref name="senseBuffer" /> contains the sense buffer.</returns>
|
||||
/// <param name="buffer">Buffer where the SCSI READ DISC INFORMATION response will be stored</param>
|
||||
/// <param name="senseBuffer">Sense buffer.</param>
|
||||
/// <param name="dataType">Which disc information to read</param>
|
||||
@@ -381,7 +381,7 @@ namespace DiscImageChef.Devices
|
||||
/// <summary>
|
||||
/// Sends the MMC READ CD command
|
||||
/// </summary>
|
||||
/// <returns><c>true</c> if the command failed and <paramref name="senseBuffer"/> contains the sense buffer.</returns>
|
||||
/// <returns><c>true</c> if the command failed and <paramref name="senseBuffer" /> contains the sense buffer.</returns>
|
||||
/// <param name="buffer">Buffer where the MMC READ CD response will be stored</param>
|
||||
/// <param name="senseBuffer">Sense buffer.</param>
|
||||
/// <param name="timeout">Timeout in seconds.</param>
|
||||
@@ -438,7 +438,7 @@ namespace DiscImageChef.Devices
|
||||
/// <summary>
|
||||
/// Sends the MMC READ CD MSF command
|
||||
/// </summary>
|
||||
/// <returns><c>true</c> if the command failed and <paramref name="senseBuffer"/> contains the sense buffer.</returns>
|
||||
/// <returns><c>true</c> if the command failed and <paramref name="senseBuffer" /> contains the sense buffer.</returns>
|
||||
/// <param name="buffer">Buffer where the MMC READ CD MSF response will be stored</param>
|
||||
/// <param name="senseBuffer">Sense buffer.</param>
|
||||
/// <param name="timeout">Timeout in seconds.</param>
|
||||
|
||||
@@ -39,7 +39,7 @@ namespace DiscImageChef.Devices
|
||||
/// <summary>
|
||||
/// Sends the NEC READ CD-DA command
|
||||
/// </summary>
|
||||
/// <returns><c>true</c> if the command failed and <paramref name="senseBuffer"/> contains the sense buffer.</returns>
|
||||
/// <returns><c>true</c> if the command failed and <paramref name="senseBuffer" /> contains the sense buffer.</returns>
|
||||
/// <param name="buffer">Buffer where the NEC READ CD-DA response will be stored</param>
|
||||
/// <param name="senseBuffer">Sense buffer.</param>
|
||||
/// <param name="timeout">Timeout in seconds.</param>
|
||||
|
||||
@@ -39,7 +39,7 @@ namespace DiscImageChef.Devices
|
||||
/// <summary>
|
||||
/// Sends the Pioneer READ CD-DA command
|
||||
/// </summary>
|
||||
/// <returns><c>true</c> if the command failed and <paramref name="senseBuffer"/> contains the sense buffer.</returns>
|
||||
/// <returns><c>true</c> if the command failed and <paramref name="senseBuffer" /> contains the sense buffer.</returns>
|
||||
/// <param name="buffer">Buffer where the Pioneer READ CD-DA response will be stored</param>
|
||||
/// <param name="senseBuffer">Sense buffer.</param>
|
||||
/// <param name="timeout">Timeout in seconds.</param>
|
||||
@@ -79,7 +79,7 @@ namespace DiscImageChef.Devices
|
||||
/// <summary>
|
||||
/// Sends the Pioneer READ CD-DA MSF command
|
||||
/// </summary>
|
||||
/// <returns><c>true</c> if the command failed and <paramref name="senseBuffer"/> contains the sense buffer.</returns>
|
||||
/// <returns><c>true</c> if the command failed and <paramref name="senseBuffer" /> contains the sense buffer.</returns>
|
||||
/// <param name="buffer">Buffer where the Pioneer READ CD-DA MSF response will be stored</param>
|
||||
/// <param name="senseBuffer">Sense buffer.</param>
|
||||
/// <param name="timeout">Timeout in seconds.</param>
|
||||
@@ -118,12 +118,15 @@ namespace DiscImageChef.Devices
|
||||
/// <summary>
|
||||
/// Sends the Pioneer READ CD-XA command
|
||||
/// </summary>
|
||||
/// <returns><c>true</c> if the command failed and <paramref name="senseBuffer"/> contains the sense buffer.</returns>
|
||||
/// <returns><c>true</c> if the command failed and <paramref name="senseBuffer" /> contains the sense buffer.</returns>
|
||||
/// <param name="buffer">Buffer where the Pioneer READ CD-XA response will be stored</param>
|
||||
/// <param name="senseBuffer">Sense buffer.</param>
|
||||
/// <param name="timeout">Timeout in seconds.</param>
|
||||
/// <param name="duration">Duration in milliseconds it took for the device to execute the command.</param>
|
||||
/// <param name="errorFlags">If set to <c>true</c>, returns all sector data with 294 bytes of error flags. Superseedes <paramref name="wholeSector"/></param>
|
||||
/// <param name="errorFlags">
|
||||
/// If set to <c>true</c>, returns all sector data with 294 bytes of error flags. Superseedes
|
||||
/// <paramref name="wholeSector" />
|
||||
/// </param>
|
||||
/// <param name="wholeSector">If set to <c>true</c>, returns all 2352 bytes of sector data.</param>
|
||||
/// <param name="lba">Start block address.</param>
|
||||
/// <param name="transferLength">How many blocks to read.</param>
|
||||
|
||||
@@ -39,7 +39,7 @@ namespace DiscImageChef.Devices
|
||||
/// <summary>
|
||||
/// Sends the Plasmon READ LONG vendor command
|
||||
/// </summary>
|
||||
/// <returns><c>true</c> if the command failed and <paramref name="senseBuffer"/> contains the sense buffer.</returns>
|
||||
/// <returns><c>true</c> if the command failed and <paramref name="senseBuffer" /> contains the sense buffer.</returns>
|
||||
/// <param name="buffer">Buffer where the Plasmon READ LONG response will be stored</param>
|
||||
/// <param name="senseBuffer">Sense buffer.</param>
|
||||
/// <param name="relAddr">If set to <c>true</c> address contain two's complement offset from last read address.</param>
|
||||
@@ -58,7 +58,7 @@ namespace DiscImageChef.Devices
|
||||
/// <summary>
|
||||
/// Sends the Plasmon READ LONG vendor command
|
||||
/// </summary>
|
||||
/// <returns><c>true</c> if the command failed and <paramref name="senseBuffer"/> contains the sense buffer.</returns>
|
||||
/// <returns><c>true</c> if the command failed and <paramref name="senseBuffer" /> contains the sense buffer.</returns>
|
||||
/// <param name="buffer">Buffer where the Plasmon READ LONG response will be stored</param>
|
||||
/// <param name="senseBuffer">Sense buffer.</param>
|
||||
/// <param name="relAddr">If set to <c>true</c> address contain two's complement offset from last read address.</param>
|
||||
@@ -66,7 +66,10 @@ namespace DiscImageChef.Devices
|
||||
/// <param name="transferLen">How many blocks/bytes to read.</param>
|
||||
/// <param name="blockBytes">How many bytes per block.</param>
|
||||
/// <param name="pba">If set to <c>true</c> address contain physical block address.</param>
|
||||
/// <param name="sectorCount">If set to <c>true</c> <paramref name="transferLen"/> is a count of secors to read. Otherwise it will be ignored</param>
|
||||
/// <param name="sectorCount">
|
||||
/// If set to <c>true</c> <paramref name="transferLen" /> is a count of secors to read. Otherwise
|
||||
/// it will be ignored
|
||||
/// </param>
|
||||
/// <param name="timeout">Timeout in seconds.</param>
|
||||
/// <param name="duration">Duration in milliseconds it took for the device to execute the command.</param>
|
||||
public bool PlasmonReadLong(out byte[] buffer, out byte[] senseBuffer, bool relAddr, uint address,
|
||||
@@ -78,9 +81,9 @@ namespace DiscImageChef.Devices
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Retrieves the logical or physical block address for the specified <paramref name="address"/>
|
||||
/// Retrieves the logical or physical block address for the specified <paramref name="address" />
|
||||
/// </summary>
|
||||
/// <returns><c>true</c> if the command failed and <paramref name="senseBuffer"/> contains the sense buffer.</returns>
|
||||
/// <returns><c>true</c> if the command failed and <paramref name="senseBuffer" /> contains the sense buffer.</returns>
|
||||
/// <param name="buffer">Buffer where the block address will be stored</param>
|
||||
/// <param name="senseBuffer">Sense buffer.</param>
|
||||
/// <param name="address">PBA/LBA to read.</param>
|
||||
|
||||
@@ -40,7 +40,7 @@ namespace DiscImageChef.Devices
|
||||
/// <summary>
|
||||
/// Sends the Plextor READ CD-DA command
|
||||
/// </summary>
|
||||
/// <returns><c>true</c> if the command failed and <paramref name="senseBuffer"/> contains the sense buffer.</returns>
|
||||
/// <returns><c>true</c> if the command failed and <paramref name="senseBuffer" /> contains the sense buffer.</returns>
|
||||
/// <param name="buffer">Buffer where the Plextor READ CD-DA response will be stored</param>
|
||||
/// <param name="senseBuffer">Sense buffer.</param>
|
||||
/// <param name="timeout">Timeout in seconds.</param>
|
||||
@@ -81,7 +81,7 @@ namespace DiscImageChef.Devices
|
||||
/// <summary>
|
||||
/// Reads a "raw" sector from DVD on Plextor drives. Does it reading drive's cache.
|
||||
/// </summary>
|
||||
/// <returns><c>true</c> if the command failed and <paramref name="senseBuffer"/> contains the sense buffer.</returns>
|
||||
/// <returns><c>true</c> if the command failed and <paramref name="senseBuffer" /> contains the sense buffer.</returns>
|
||||
/// <param name="buffer">Buffer where the Plextor READ DVD (RAW) response will be stored</param>
|
||||
/// <param name="senseBuffer">Sense buffer.</param>
|
||||
/// <param name="timeout">Timeout in seconds.</param>
|
||||
|
||||
@@ -40,7 +40,7 @@ namespace DiscImageChef.Devices
|
||||
/// <summary>
|
||||
/// Sends the SBC READ (6) command
|
||||
/// </summary>
|
||||
/// <returns><c>true</c> if the command failed and <paramref name="senseBuffer"/> contains the sense buffer.</returns>
|
||||
/// <returns><c>true</c> if the command failed and <paramref name="senseBuffer" /> contains the sense buffer.</returns>
|
||||
/// <param name="buffer">Buffer where the SCSI READ response will be stored</param>
|
||||
/// <param name="senseBuffer">Sense buffer.</param>
|
||||
/// <param name="timeout">Timeout in seconds.</param>
|
||||
@@ -56,7 +56,7 @@ namespace DiscImageChef.Devices
|
||||
/// <summary>
|
||||
/// Sends the SBC READ (6) command
|
||||
/// </summary>
|
||||
/// <returns><c>true</c> if the command failed and <paramref name="senseBuffer"/> contains the sense buffer.</returns>
|
||||
/// <returns><c>true</c> if the command failed and <paramref name="senseBuffer" /> contains the sense buffer.</returns>
|
||||
/// <param name="buffer">Buffer where the SCSI READ response will be stored</param>
|
||||
/// <param name="senseBuffer">Sense buffer.</param>
|
||||
/// <param name="timeout">Timeout in seconds.</param>
|
||||
@@ -91,15 +91,21 @@ namespace DiscImageChef.Devices
|
||||
/// <summary>
|
||||
/// Sends the SBC READ (10) command
|
||||
/// </summary>
|
||||
/// <returns><c>true</c> if the command failed and <paramref name="senseBuffer"/> contains the sense buffer.</returns>
|
||||
/// <returns><c>true</c> if the command failed and <paramref name="senseBuffer" /> contains the sense buffer.</returns>
|
||||
/// <param name="buffer">Buffer where the SCSI READ response will be stored</param>
|
||||
/// <param name="senseBuffer">Sense buffer.</param>
|
||||
/// <param name="timeout">Timeout in seconds.</param>
|
||||
/// <param name="duration">Duration in milliseconds it took for the device to execute the command.</param>
|
||||
/// <param name="rdprotect">Instructs the drive how to check for protection information on the medium.</param>
|
||||
/// <param name="dpo">If set to <c>true</c> requested blocks shall be assigned the lowest retention priority on cache fetch/retain.</param>
|
||||
/// <param name="dpo">
|
||||
/// If set to <c>true</c> requested blocks shall be assigned the lowest retention priority on cache
|
||||
/// fetch/retain.
|
||||
/// </param>
|
||||
/// <param name="fua">If set to <c>true</c> requested blocks MUST bu read from medium and not the cache.</param>
|
||||
/// <param name="fuaNv">If set to <c>true</c> requested blocks will be returned from non-volatile cache. If they're not present they shall be stored there.</param>
|
||||
/// <param name="fuaNv">
|
||||
/// If set to <c>true</c> requested blocks will be returned from non-volatile cache. If they're not
|
||||
/// present they shall be stored there.
|
||||
/// </param>
|
||||
/// <param name="lba">Starting block.</param>
|
||||
/// <param name="blockSize">Block size in bytes.</param>
|
||||
/// <param name="groupNumber">Group number where attributes associated with this command should be collected.</param>
|
||||
@@ -140,15 +146,21 @@ namespace DiscImageChef.Devices
|
||||
/// <summary>
|
||||
/// Sends the SBC READ (12) command
|
||||
/// </summary>
|
||||
/// <returns><c>true</c> if the command failed and <paramref name="senseBuffer"/> contains the sense buffer.</returns>
|
||||
/// <returns><c>true</c> if the command failed and <paramref name="senseBuffer" /> contains the sense buffer.</returns>
|
||||
/// <param name="buffer">Buffer where the SCSI READ response will be stored</param>
|
||||
/// <param name="senseBuffer">Sense buffer.</param>
|
||||
/// <param name="timeout">Timeout in seconds.</param>
|
||||
/// <param name="duration">Duration in milliseconds it took for the device to execute the command.</param>
|
||||
/// <param name="rdprotect">Instructs the drive how to check for protection information on the medium.</param>
|
||||
/// <param name="dpo">If set to <c>true</c> requested blocks shall be assigned the lowest retention priority on cache fetch/retain.</param>
|
||||
/// <param name="dpo">
|
||||
/// If set to <c>true</c> requested blocks shall be assigned the lowest retention priority on cache
|
||||
/// fetch/retain.
|
||||
/// </param>
|
||||
/// <param name="fua">If set to <c>true</c> requested blocks MUST bu read from medium and not the cache.</param>
|
||||
/// <param name="fuaNv">If set to <c>true</c> requested blocks will be returned from non-volatile cache. If they're not present they shall be stored there.</param>
|
||||
/// <param name="fuaNv">
|
||||
/// If set to <c>true</c> requested blocks will be returned from non-volatile cache. If they're not
|
||||
/// present they shall be stored there.
|
||||
/// </param>
|
||||
/// <param name="lba">Starting block.</param>
|
||||
/// <param name="blockSize">Block size in bytes.</param>
|
||||
/// <param name="groupNumber">Group number where attributes associated with this command should be collected.</param>
|
||||
@@ -193,15 +205,21 @@ namespace DiscImageChef.Devices
|
||||
/// <summary>
|
||||
/// Sends the SBC READ (16) command
|
||||
/// </summary>
|
||||
/// <returns><c>true</c> if the command failed and <paramref name="senseBuffer"/> contains the sense buffer.</returns>
|
||||
/// <returns><c>true</c> if the command failed and <paramref name="senseBuffer" /> contains the sense buffer.</returns>
|
||||
/// <param name="buffer">Buffer where the SCSI READ response will be stored</param>
|
||||
/// <param name="senseBuffer">Sense buffer.</param>
|
||||
/// <param name="timeout">Timeout in seconds.</param>
|
||||
/// <param name="duration">Duration in milliseconds it took for the device to execute the command.</param>
|
||||
/// <param name="rdprotect">Instructs the drive how to check for protection information on the medium.</param>
|
||||
/// <param name="dpo">If set to <c>true</c> requested blocks shall be assigned the lowest retention priority on cache fetch/retain.</param>
|
||||
/// <param name="dpo">
|
||||
/// If set to <c>true</c> requested blocks shall be assigned the lowest retention priority on cache
|
||||
/// fetch/retain.
|
||||
/// </param>
|
||||
/// <param name="fua">If set to <c>true</c> requested blocks MUST bu read from medium and not the cache.</param>
|
||||
/// <param name="fuaNv">If set to <c>true</c> requested blocks will be returned from non-volatile cache. If they're not present they shall be stored there.</param>
|
||||
/// <param name="fuaNv">
|
||||
/// If set to <c>true</c> requested blocks will be returned from non-volatile cache. If they're not
|
||||
/// present they shall be stored there.
|
||||
/// </param>
|
||||
/// <param name="lba">Starting block.</param>
|
||||
/// <param name="blockSize">Block size in bytes.</param>
|
||||
/// <param name="groupNumber">Group number where attributes associated with this command should be collected.</param>
|
||||
@@ -249,15 +267,18 @@ namespace DiscImageChef.Devices
|
||||
/// <summary>
|
||||
/// Sends the SBC READ LONG (10) command
|
||||
/// </summary>
|
||||
/// <returns><c>true</c> if the command failed and <paramref name="senseBuffer"/> contains the sense buffer.</returns>
|
||||
/// <returns><c>true</c> if the command failed and <paramref name="senseBuffer" /> contains the sense buffer.</returns>
|
||||
/// <param name="buffer">Buffer where the SCSI READ LONG response will be stored</param>
|
||||
/// <param name="senseBuffer">Sense buffer.</param>
|
||||
/// <param name="timeout">Timeout in seconds.</param>
|
||||
/// <param name = "relAddr"></param>
|
||||
/// <param name="relAddr"></param>
|
||||
/// <param name="duration">Duration in milliseconds it took for the device to execute the command.</param>
|
||||
/// <param name="correct">If set to <c>true</c> ask the drive to try to correct errors in the sector.</param>
|
||||
/// <param name="lba">LBA to read.</param>
|
||||
/// <param name="transferBytes">How many bytes to read. If the number is not exactly the drive's size, the command will fail and incidate a delta of the size in SENSE.</param>
|
||||
/// <param name="transferBytes">
|
||||
/// How many bytes to read. If the number is not exactly the drive's size, the command will
|
||||
/// fail and incidate a delta of the size in SENSE.
|
||||
/// </param>
|
||||
public bool ReadLong10(out byte[] buffer, out byte[] senseBuffer, bool correct, bool relAddr, uint lba,
|
||||
ushort transferBytes, uint timeout, out double duration)
|
||||
{
|
||||
@@ -288,14 +309,17 @@ namespace DiscImageChef.Devices
|
||||
/// <summary>
|
||||
/// Sends the SBC READ LONG (16) command
|
||||
/// </summary>
|
||||
/// <returns><c>true</c> if the command failed and <paramref name="senseBuffer"/> contains the sense buffer.</returns>
|
||||
/// <returns><c>true</c> if the command failed and <paramref name="senseBuffer" /> contains the sense buffer.</returns>
|
||||
/// <param name="buffer">Buffer where the SCSI READ LONG response will be stored</param>
|
||||
/// <param name="senseBuffer">Sense buffer.</param>
|
||||
/// <param name="timeout">Timeout in seconds.</param>
|
||||
/// <param name="duration">Duration in milliseconds it took for the device to execute the command.</param>
|
||||
/// <param name="correct">If set to <c>true</c> ask the drive to try to correct errors in the sector.</param>
|
||||
/// <param name="lba">LBA to read.</param>
|
||||
/// <param name="transferBytes">How many bytes to read. If the number is not exactly the drive's size, the command will fail and incidate a delta of the size in SENSE.</param>
|
||||
/// <param name="transferBytes">
|
||||
/// How many bytes to read. If the number is not exactly the drive's size, the command will
|
||||
/// fail and incidate a delta of the size in SENSE.
|
||||
/// </param>
|
||||
public bool ReadLong16(out byte[] buffer, out byte[] senseBuffer, bool correct, ulong lba, uint transferBytes,
|
||||
uint timeout, out double duration)
|
||||
{
|
||||
|
||||
@@ -41,7 +41,7 @@ namespace DiscImageChef.Devices
|
||||
/// </summary>
|
||||
/// <param name="buffer">Buffer.</param>
|
||||
/// <param name="senseBuffer">Sense buffer.</param>
|
||||
/// <param name="action">What to do, <see cref="ScsiAttributeAction"/>.</param>
|
||||
/// <param name="action">What to do, <see cref="ScsiAttributeAction" />.</param>
|
||||
/// <param name="element">Element address.</param>
|
||||
/// <param name="elementType">Element type.</param>
|
||||
/// <param name="volume">Volume number.</param>
|
||||
@@ -79,8 +79,7 @@ namespace DiscImageChef.Devices
|
||||
|
||||
if(sense) return true;
|
||||
|
||||
uint attrLen = (uint)((buffer[0] << 24) + (buffer[1] << 16) + (buffer[2] << 8) + buffer[3] +
|
||||
4);
|
||||
uint attrLen = (uint)((buffer[0] << 24) + (buffer[1] << 16) + (buffer[2] << 8) + buffer[3] + 4);
|
||||
buffer = new byte[attrLen];
|
||||
cdb[10] = (byte)((buffer.Length & 0xFF000000) >> 24);
|
||||
cdb[11] = (byte)((buffer.Length & 0xFF0000) >> 16);
|
||||
|
||||
@@ -43,7 +43,7 @@ namespace DiscImageChef.Devices
|
||||
/// <summary>
|
||||
/// Sends the SPC INQUIRY command to the device using default device timeout.
|
||||
/// </summary>
|
||||
/// <returns><c>true</c> if the command failed and <paramref name="senseBuffer"/> contains the sense buffer.</returns>
|
||||
/// <returns><c>true</c> if the command failed and <paramref name="senseBuffer" /> contains the sense buffer.</returns>
|
||||
/// <param name="buffer">Buffer where the SCSI INQUIRY response will be stored</param>
|
||||
/// <param name="senseBuffer">Sense buffer.</param>
|
||||
public bool ScsiInquiry(out byte[] buffer, out byte[] senseBuffer)
|
||||
@@ -54,7 +54,7 @@ namespace DiscImageChef.Devices
|
||||
/// <summary>
|
||||
/// Sends the SPC INQUIRY command to the device using default device timeout.
|
||||
/// </summary>
|
||||
/// <returns><c>true</c> if the command failed and <paramref name="senseBuffer"/> contains the sense buffer.</returns>
|
||||
/// <returns><c>true</c> if the command failed and <paramref name="senseBuffer" /> contains the sense buffer.</returns>
|
||||
/// <param name="buffer">Buffer where the SCSI INQUIRY response will be stored</param>
|
||||
/// <param name="senseBuffer">Sense buffer.</param>
|
||||
/// <param name="duration">Duration in milliseconds it took for the device to execute the command.</param>
|
||||
@@ -66,7 +66,7 @@ namespace DiscImageChef.Devices
|
||||
/// <summary>
|
||||
/// Sends the SPC INQUIRY command to the device.
|
||||
/// </summary>
|
||||
/// <returns><c>true</c> if the command failed and <paramref name="senseBuffer"/> contains the sense buffer.</returns>
|
||||
/// <returns><c>true</c> if the command failed and <paramref name="senseBuffer" /> contains the sense buffer.</returns>
|
||||
/// <param name="buffer">Buffer where the SCSI INQUIRY response will be stored</param>
|
||||
/// <param name="senseBuffer">Sense buffer.</param>
|
||||
/// <param name="timeout">Timeout in seconds.</param>
|
||||
@@ -78,7 +78,7 @@ namespace DiscImageChef.Devices
|
||||
/// <summary>
|
||||
/// Sends the SPC INQUIRY command to the device.
|
||||
/// </summary>
|
||||
/// <returns><c>true</c> if the command failed and <paramref name="senseBuffer"/> contains the sense buffer.</returns>
|
||||
/// <returns><c>true</c> if the command failed and <paramref name="senseBuffer" /> contains the sense buffer.</returns>
|
||||
/// <param name="buffer">Buffer where the SCSI INQUIRY response will be stored</param>
|
||||
/// <param name="senseBuffer">Sense buffer.</param>
|
||||
/// <param name="timeout">Timeout in seconds.</param>
|
||||
@@ -113,7 +113,7 @@ namespace DiscImageChef.Devices
|
||||
/// <summary>
|
||||
/// Sends the SPC INQUIRY command to the device with an Extended Vital Product Data page using default device timeout.
|
||||
/// </summary>
|
||||
/// <returns><c>true</c> if the command failed and <paramref name="senseBuffer"/> contains the sense buffer.</returns>
|
||||
/// <returns><c>true</c> if the command failed and <paramref name="senseBuffer" /> contains the sense buffer.</returns>
|
||||
/// <param name="buffer">Buffer where the SCSI INQUIRY response will be stored</param>
|
||||
/// <param name="senseBuffer">Sense buffer.</param>
|
||||
/// <param name="page">The Extended Vital Product Data</param>
|
||||
@@ -125,7 +125,7 @@ namespace DiscImageChef.Devices
|
||||
/// <summary>
|
||||
/// Sends the SPC INQUIRY command to the device with an Extended Vital Product Data page using default device timeout.
|
||||
/// </summary>
|
||||
/// <returns><c>true</c> if the command failed and <paramref name="senseBuffer"/> contains the sense buffer.</returns>
|
||||
/// <returns><c>true</c> if the command failed and <paramref name="senseBuffer" /> contains the sense buffer.</returns>
|
||||
/// <param name="buffer">Buffer where the SCSI INQUIRY response will be stored</param>
|
||||
/// <param name="senseBuffer">Sense buffer.</param>
|
||||
/// <param name="duration">Duration in milliseconds it took for the device to execute the command.</param>
|
||||
@@ -138,7 +138,7 @@ namespace DiscImageChef.Devices
|
||||
/// <summary>
|
||||
/// Sends the SPC INQUIRY command to the device with an Extended Vital Product Data page.
|
||||
/// </summary>
|
||||
/// <returns><c>true</c> if the command failed and <paramref name="senseBuffer"/> contains the sense buffer.</returns>
|
||||
/// <returns><c>true</c> if the command failed and <paramref name="senseBuffer" /> contains the sense buffer.</returns>
|
||||
/// <param name="buffer">Buffer where the SCSI INQUIRY response will be stored</param>
|
||||
/// <param name="senseBuffer">Sense buffer.</param>
|
||||
/// <param name="timeout">Timeout in seconds.</param>
|
||||
@@ -151,7 +151,7 @@ namespace DiscImageChef.Devices
|
||||
/// <summary>
|
||||
/// Sends the SPC INQUIRY command to the device with an Extended Vital Product Data page.
|
||||
/// </summary>
|
||||
/// <returns><c>true</c> if the command failed and <paramref name="senseBuffer"/> contains the sense buffer.</returns>
|
||||
/// <returns><c>true</c> if the command failed and <paramref name="senseBuffer" /> contains the sense buffer.</returns>
|
||||
/// <param name="buffer">Buffer where the SCSI INQUIRY response will be stored</param>
|
||||
/// <param name="senseBuffer">Sense buffer.</param>
|
||||
/// <param name="timeout">Timeout in seconds.</param>
|
||||
@@ -212,7 +212,7 @@ namespace DiscImageChef.Devices
|
||||
/// <summary>
|
||||
/// Sends the SPC MODE SENSE(6) command to the device as introduced in SCSI-1
|
||||
/// </summary>
|
||||
/// <returns><c>true</c> if the command failed and <paramref name="senseBuffer"/> contains the sense buffer.</returns>
|
||||
/// <returns><c>true</c> if the command failed and <paramref name="senseBuffer" /> contains the sense buffer.</returns>
|
||||
/// <param name="buffer">Buffer where the SCSI MODE SENSE(6) response will be stored</param>
|
||||
/// <param name="senseBuffer">Sense buffer.</param>
|
||||
/// <param name="timeout">Timeout in seconds.</param>
|
||||
@@ -226,7 +226,7 @@ namespace DiscImageChef.Devices
|
||||
/// <summary>
|
||||
/// Sends the SPC MODE SENSE(6) command to the device as introduced in SCSI-2
|
||||
/// </summary>
|
||||
/// <returns><c>true</c> if the command failed and <paramref name="senseBuffer"/> contains the sense buffer.</returns>
|
||||
/// <returns><c>true</c> if the command failed and <paramref name="senseBuffer" /> contains the sense buffer.</returns>
|
||||
/// <param name="buffer">Buffer where the SCSI MODE SENSE(6) response will be stored</param>
|
||||
/// <param name="senseBuffer">Sense buffer.</param>
|
||||
/// <param name="timeout">Timeout in seconds.</param>
|
||||
@@ -243,7 +243,7 @@ namespace DiscImageChef.Devices
|
||||
/// <summary>
|
||||
/// Sends the SPC MODE SENSE(6) command to the device as introduced in SCSI-3 SPC-3
|
||||
/// </summary>
|
||||
/// <returns><c>true</c> if the command failed and <paramref name="senseBuffer"/> contains the sense buffer.</returns>
|
||||
/// <returns><c>true</c> if the command failed and <paramref name="senseBuffer" /> contains the sense buffer.</returns>
|
||||
/// <param name="buffer">Buffer where the SCSI MODE SENSE(6) response will be stored</param>
|
||||
/// <param name="senseBuffer">Sense buffer.</param>
|
||||
/// <param name="timeout">Timeout in seconds.</param>
|
||||
@@ -291,7 +291,7 @@ namespace DiscImageChef.Devices
|
||||
/// <summary>
|
||||
/// Sends the SPC MODE SENSE(10) command to the device as introduced in SCSI-2
|
||||
/// </summary>
|
||||
/// <returns><c>true</c> if the command failed and <paramref name="senseBuffer"/> contains the sense buffer.</returns>
|
||||
/// <returns><c>true</c> if the command failed and <paramref name="senseBuffer" /> contains the sense buffer.</returns>
|
||||
/// <param name="buffer">Buffer where the SCSI MODE SENSE(10) response will be stored</param>
|
||||
/// <param name="senseBuffer">Sense buffer.</param>
|
||||
/// <param name="timeout">Timeout in seconds.</param>
|
||||
@@ -309,7 +309,7 @@ namespace DiscImageChef.Devices
|
||||
/// <summary>
|
||||
/// Sends the SPC MODE SENSE(10) command to the device as introduced in SCSI-3 SPC-2
|
||||
/// </summary>
|
||||
/// <returns><c>true</c> if the command failed and <paramref name="senseBuffer"/> contains the sense buffer.</returns>
|
||||
/// <returns><c>true</c> if the command failed and <paramref name="senseBuffer" /> contains the sense buffer.</returns>
|
||||
/// <param name="buffer">Buffer where the SCSI MODE SENSE(10) response will be stored</param>
|
||||
/// <param name="senseBuffer">Sense buffer.</param>
|
||||
/// <param name="timeout">Timeout in seconds.</param>
|
||||
@@ -328,7 +328,7 @@ namespace DiscImageChef.Devices
|
||||
/// <summary>
|
||||
/// Sends the SPC MODE SENSE(10) command to the device as introduced in SCSI-3 SPC-3
|
||||
/// </summary>
|
||||
/// <returns><c>true</c> if the command failed and <paramref name="senseBuffer"/> contains the sense buffer.</returns>
|
||||
/// <returns><c>true</c> if the command failed and <paramref name="senseBuffer" /> contains the sense buffer.</returns>
|
||||
/// <param name="buffer">Buffer where the SCSI MODE SENSE(10) response will be stored</param>
|
||||
/// <param name="senseBuffer">Sense buffer.</param>
|
||||
/// <param name="timeout">Timeout in seconds.</param>
|
||||
@@ -380,7 +380,7 @@ namespace DiscImageChef.Devices
|
||||
/// <summary>
|
||||
/// Sends the SPC PREVENT ALLOW MEDIUM REMOVAL command to prevent medium removal
|
||||
/// </summary>
|
||||
/// <returns><c>true</c> if the command failed and <paramref name="senseBuffer"/> contains the sense buffer.</returns>
|
||||
/// <returns><c>true</c> if the command failed and <paramref name="senseBuffer" /> contains the sense buffer.</returns>
|
||||
/// <param name="senseBuffer">Sense buffer.</param>
|
||||
/// <param name="timeout">Timeout in seconds.</param>
|
||||
/// <param name="duration">Duration in milliseconds it took for the device to execute the command.</param>
|
||||
@@ -392,7 +392,7 @@ namespace DiscImageChef.Devices
|
||||
/// <summary>
|
||||
/// Sends the SPC PREVENT ALLOW MEDIUM REMOVAL command to allow medium removal
|
||||
/// </summary>
|
||||
/// <returns><c>true</c> if the command failed and <paramref name="senseBuffer"/> contains the sense buffer.</returns>
|
||||
/// <returns><c>true</c> if the command failed and <paramref name="senseBuffer" /> contains the sense buffer.</returns>
|
||||
/// <param name="senseBuffer">Sense buffer.</param>
|
||||
/// <param name="timeout">Timeout in seconds.</param>
|
||||
/// <param name="duration">Duration in milliseconds it took for the device to execute the command.</param>
|
||||
@@ -404,7 +404,7 @@ namespace DiscImageChef.Devices
|
||||
/// <summary>
|
||||
/// Sends the SPC PREVENT ALLOW MEDIUM REMOVAL command
|
||||
/// </summary>
|
||||
/// <returns><c>true</c> if the command failed and <paramref name="senseBuffer"/> contains the sense buffer.</returns>
|
||||
/// <returns><c>true</c> if the command failed and <paramref name="senseBuffer" /> contains the sense buffer.</returns>
|
||||
/// <param name="senseBuffer">Sense buffer.</param>
|
||||
/// <param name="timeout">Timeout in seconds.</param>
|
||||
/// <param name="duration">Duration in milliseconds it took for the device to execute the command.</param>
|
||||
@@ -422,7 +422,7 @@ namespace DiscImageChef.Devices
|
||||
/// <summary>
|
||||
/// Sends the SPC PREVENT ALLOW MEDIUM REMOVAL command
|
||||
/// </summary>
|
||||
/// <returns><c>true</c> if the command failed and <paramref name="senseBuffer"/> contains the sense buffer.</returns>
|
||||
/// <returns><c>true</c> if the command failed and <paramref name="senseBuffer" /> contains the sense buffer.</returns>
|
||||
/// <param name="senseBuffer">Sense buffer.</param>
|
||||
/// <param name="timeout">Timeout in seconds.</param>
|
||||
/// <param name="duration">Duration in milliseconds it took for the device to execute the command.</param>
|
||||
@@ -449,7 +449,7 @@ namespace DiscImageChef.Devices
|
||||
/// <summary>
|
||||
/// Sends the SPC READ CAPACITY command
|
||||
/// </summary>
|
||||
/// <returns><c>true</c> if the command failed and <paramref name="senseBuffer"/> contains the sense buffer.</returns>
|
||||
/// <returns><c>true</c> if the command failed and <paramref name="senseBuffer" /> contains the sense buffer.</returns>
|
||||
/// <param name="buffer">Buffer where the SCSI READ CAPACITY response will be stored</param>
|
||||
/// <param name="senseBuffer">Sense buffer.</param>
|
||||
/// <param name="timeout">Timeout in seconds.</param>
|
||||
@@ -462,11 +462,11 @@ namespace DiscImageChef.Devices
|
||||
/// <summary>
|
||||
/// Sends the SPC READ CAPACITY command
|
||||
/// </summary>
|
||||
/// <returns><c>true</c> if the command failed and <paramref name="senseBuffer"/> contains the sense buffer.</returns>
|
||||
/// <returns><c>true</c> if the command failed and <paramref name="senseBuffer" /> contains the sense buffer.</returns>
|
||||
/// <param name="buffer">Buffer where the SCSI READ CAPACITY response will be stored</param>
|
||||
/// <param name="senseBuffer">Sense buffer.</param>
|
||||
/// <param name="relAddr">Indicates that <paramref name="address"/> is relative to current medium position</param>
|
||||
/// <param name="address">Address where information is requested from, only valid if <paramref name="pmi"/> is set</param>
|
||||
/// <param name="relAddr">Indicates that <paramref name="address" /> is relative to current medium position</param>
|
||||
/// <param name="address">Address where information is requested from, only valid if <paramref name="pmi" /> is set</param>
|
||||
/// <param name="pmi">If set, it is requesting partial media capacity</param>
|
||||
/// <param name="timeout">Timeout in seconds.</param>
|
||||
/// <param name="duration">Duration in milliseconds it took for the device to execute the command.</param>
|
||||
@@ -502,7 +502,7 @@ namespace DiscImageChef.Devices
|
||||
/// <summary>
|
||||
/// Sends the SPC READ CAPACITY(16) command
|
||||
/// </summary>
|
||||
/// <returns><c>true</c> if the command failed and <paramref name="senseBuffer"/> contains the sense buffer.</returns>
|
||||
/// <returns><c>true</c> if the command failed and <paramref name="senseBuffer" /> contains the sense buffer.</returns>
|
||||
/// <param name="buffer">Buffer where the SCSI READ CAPACITY(16) response will be stored</param>
|
||||
/// <param name="senseBuffer">Sense buffer.</param>
|
||||
/// <param name="timeout">Timeout in seconds.</param>
|
||||
@@ -515,10 +515,10 @@ namespace DiscImageChef.Devices
|
||||
/// <summary>
|
||||
/// Sends the SPC READ CAPACITY(16) command
|
||||
/// </summary>
|
||||
/// <returns><c>true</c> if the command failed and <paramref name="senseBuffer"/> contains the sense buffer.</returns>
|
||||
/// <returns><c>true</c> if the command failed and <paramref name="senseBuffer" /> contains the sense buffer.</returns>
|
||||
/// <param name="buffer">Buffer where the SCSI READ CAPACITY(16) response will be stored</param>
|
||||
/// <param name="senseBuffer">Sense buffer.</param>
|
||||
/// <param name="address">Address where information is requested from, only valid if <paramref name="pmi"/> is set</param>
|
||||
/// <param name="address">Address where information is requested from, only valid if <paramref name="pmi" /> is set</param>
|
||||
/// <param name="pmi">If set, it is requesting partial media capacity</param>
|
||||
/// <param name="timeout">Timeout in seconds.</param>
|
||||
/// <param name="duration">Duration in milliseconds it took for the device to execute the command.</param>
|
||||
@@ -563,7 +563,7 @@ namespace DiscImageChef.Devices
|
||||
/// <summary>
|
||||
/// Sends the SPC READ MEDIA SERIAL NUMBER command
|
||||
/// </summary>
|
||||
/// <returns><c>true</c> if the command failed and <paramref name="senseBuffer"/> contains the sense buffer.</returns>
|
||||
/// <returns><c>true</c> if the command failed and <paramref name="senseBuffer" /> contains the sense buffer.</returns>
|
||||
/// <param name="buffer">Buffer where the SCSI READ MEDIA SERIAL NUMBER response will be stored</param>
|
||||
/// <param name="senseBuffer">Sense buffer.</param>
|
||||
/// <param name="timeout">Timeout in seconds.</param>
|
||||
@@ -587,8 +587,7 @@ namespace DiscImageChef.Devices
|
||||
|
||||
if(sense) return true;
|
||||
|
||||
uint strctLength = (uint)((buffer[0] << 24) + (buffer[1] << 16) + (buffer[2] << 8) +
|
||||
buffer[3] + 4);
|
||||
uint strctLength = (uint)((buffer[0] << 24) + (buffer[1] << 16) + (buffer[2] << 8) + buffer[3] + 4);
|
||||
buffer = new byte[strctLength];
|
||||
cdb[6] = (byte)((buffer.Length & 0xFF000000) >> 24);
|
||||
cdb[7] = (byte)((buffer.Length & 0xFF0000) >> 16);
|
||||
@@ -610,7 +609,7 @@ namespace DiscImageChef.Devices
|
||||
/// </summary>
|
||||
/// <param name="buffer">Buffer.</param>
|
||||
/// <param name="senseBuffer">Sense buffer.</param>
|
||||
/// <param name="action">What to do, <see cref="ScsiAttributeAction"/>.</param>
|
||||
/// <param name="action">What to do, <see cref="ScsiAttributeAction" />.</param>
|
||||
/// <param name="partition">Partition number.</param>
|
||||
/// <param name="firstAttribute">First attribute identifier.</param>
|
||||
/// <param name="cache">If set to <c>true</c> device can return cached data.</param>
|
||||
@@ -628,7 +627,7 @@ namespace DiscImageChef.Devices
|
||||
/// </summary>
|
||||
/// <param name="buffer">Buffer.</param>
|
||||
/// <param name="senseBuffer">Sense buffer.</param>
|
||||
/// <param name="action">What to do, <see cref="ScsiAttributeAction"/>.</param>
|
||||
/// <param name="action">What to do, <see cref="ScsiAttributeAction" />.</param>
|
||||
/// <param name="firstAttribute">First attribute identifier.</param>
|
||||
/// <param name="cache">If set to <c>true</c> device can return cached data.</param>
|
||||
/// <param name="timeout">Timeout.</param>
|
||||
@@ -645,7 +644,7 @@ namespace DiscImageChef.Devices
|
||||
/// </summary>
|
||||
/// <param name="buffer">Buffer.</param>
|
||||
/// <param name="senseBuffer">Sense buffer.</param>
|
||||
/// <param name="action">What to do, <see cref="ScsiAttributeAction"/>.</param>
|
||||
/// <param name="action">What to do, <see cref="ScsiAttributeAction" />.</param>
|
||||
/// <param name="partition">Partition number.</param>
|
||||
/// <param name="firstAttribute">First attribute identifier.</param>
|
||||
/// <param name="timeout">Timeout.</param>
|
||||
@@ -662,7 +661,7 @@ namespace DiscImageChef.Devices
|
||||
/// </summary>
|
||||
/// <param name="buffer">Buffer.</param>
|
||||
/// <param name="senseBuffer">Sense buffer.</param>
|
||||
/// <param name="action">What to do, <see cref="ScsiAttributeAction"/>.</param>
|
||||
/// <param name="action">What to do, <see cref="ScsiAttributeAction" />.</param>
|
||||
/// <param name="firstAttribute">First attribute identifier.</param>
|
||||
/// <param name="timeout">Timeout.</param>
|
||||
/// <param name="duration">Duration.</param>
|
||||
@@ -678,7 +677,7 @@ namespace DiscImageChef.Devices
|
||||
/// </summary>
|
||||
/// <param name="buffer">Buffer.</param>
|
||||
/// <param name="senseBuffer">Sense buffer.</param>
|
||||
/// <param name="action">What to do, <see cref="ScsiAttributeAction"/>.</param>
|
||||
/// <param name="action">What to do, <see cref="ScsiAttributeAction" />.</param>
|
||||
/// <param name="volume">Volume number.</param>
|
||||
/// <param name="partition">Partition number.</param>
|
||||
/// <param name="firstAttribute">First attribute identifier.</param>
|
||||
@@ -696,7 +695,7 @@ namespace DiscImageChef.Devices
|
||||
/// </summary>
|
||||
/// <param name="buffer">Buffer.</param>
|
||||
/// <param name="senseBuffer">Sense buffer.</param>
|
||||
/// <param name="action">What to do, <see cref="ScsiAttributeAction"/>.</param>
|
||||
/// <param name="action">What to do, <see cref="ScsiAttributeAction" />.</param>
|
||||
/// <param name="volume">Volume number.</param>
|
||||
/// <param name="partition">Partition number.</param>
|
||||
/// <param name="firstAttribute">First attribute identifier.</param>
|
||||
@@ -713,7 +712,7 @@ namespace DiscImageChef.Devices
|
||||
/// <summary>
|
||||
/// Sends the SPC MODE SELECT(6) command
|
||||
/// </summary>
|
||||
/// <returns><c>true</c> if the command failed and <paramref name="senseBuffer"/> contains the sense buffer.</returns>
|
||||
/// <returns><c>true</c> if the command failed and <paramref name="senseBuffer" /> contains the sense buffer.</returns>
|
||||
/// <param name="buffer">Buffer with the data to be sent to the device</param>
|
||||
/// <param name="senseBuffer">Sense buffer.</param>
|
||||
/// <param name="savePages">Set to save pages between resets.</param>
|
||||
@@ -730,8 +729,7 @@ namespace DiscImageChef.Devices
|
||||
{
|
||||
if(PlatformId != PlatformID.Win32NT && PlatformId != PlatformID.Win32S &&
|
||||
PlatformId != PlatformID.Win32Windows && PlatformId != PlatformID.WinCE &&
|
||||
PlatformId != PlatformID.WindowsPhone &&
|
||||
PlatformId != PlatformID.Xbox) LastError = 75;
|
||||
PlatformId != PlatformID.WindowsPhone && PlatformId != PlatformID.Xbox) LastError = 75;
|
||||
else LastError = 111;
|
||||
Error = true;
|
||||
duration = 0;
|
||||
@@ -757,7 +755,7 @@ namespace DiscImageChef.Devices
|
||||
/// <summary>
|
||||
/// Sends the SPC MODE SELECT(10) command
|
||||
/// </summary>
|
||||
/// <returns><c>true</c> if the command failed and <paramref name="senseBuffer"/> contains the sense buffer.</returns>
|
||||
/// <returns><c>true</c> if the command failed and <paramref name="senseBuffer" /> contains the sense buffer.</returns>
|
||||
/// <param name="buffer">Buffer with the data to be sent to the device</param>
|
||||
/// <param name="savePages">Set to save pages between resets.</param>
|
||||
/// <param name="senseBuffer">Sense buffer.</param>
|
||||
@@ -774,8 +772,7 @@ namespace DiscImageChef.Devices
|
||||
{
|
||||
if(PlatformId != PlatformID.Win32NT && PlatformId != PlatformID.Win32S &&
|
||||
PlatformId != PlatformID.Win32Windows && PlatformId != PlatformID.WinCE &&
|
||||
PlatformId != PlatformID.WindowsPhone &&
|
||||
PlatformId != PlatformID.Xbox) LastError = 75;
|
||||
PlatformId != PlatformID.WindowsPhone && PlatformId != PlatformID.Xbox) LastError = 75;
|
||||
else LastError = 111;
|
||||
Error = true;
|
||||
duration = 0;
|
||||
|
||||
@@ -70,7 +70,10 @@ namespace DiscImageChef.Devices
|
||||
/// <param name="load">If set to <c>true</c> load the medium for reading.</param>
|
||||
/// <param name="retense">If set to <c>true</c> retense the tape.</param>
|
||||
/// <param name="endOfTape">If set to <c>true</c> move the medium to the EOT mark.</param>
|
||||
/// <param name="hold">If set to <c>true</c> and <paramref name="load"/> is also set to <c>true</c>, moves the medium to the drive but does not prepare it for reading.</param>
|
||||
/// <param name="hold">
|
||||
/// If set to <c>true</c> and <paramref name="load" /> is also set to <c>true</c>, moves the medium to
|
||||
/// the drive but does not prepare it for reading.
|
||||
/// </param>
|
||||
/// <param name="timeout">Timeout.</param>
|
||||
/// <param name="duration">Duration.</param>
|
||||
public bool LoadUnload(out byte[] senseBuffer, bool immediate, bool load, bool retense, bool endOfTape,
|
||||
@@ -323,9 +326,15 @@ namespace DiscImageChef.Devices
|
||||
/// </summary>
|
||||
/// <param name="buffer">Buffer.</param>
|
||||
/// <param name="senseBuffer">Sense buffer.</param>
|
||||
/// <param name="sili">If set to <c>true</c> suppress the incorrect-length indication. Cannot be set while <paramref name="fixedLen"/> is set also.</param>
|
||||
/// <param name="fixedLen">If set to <c>true</c> <paramref name="transferLen"/> indicates how many blocks to read of a fixed size.</param>
|
||||
/// <param name="transferLen">Transfer length in blocks or bytes depending of <paramref name="fixedLen"/> status.</param>
|
||||
/// <param name="sili">
|
||||
/// If set to <c>true</c> suppress the incorrect-length indication. Cannot be set while
|
||||
/// <paramref name="fixedLen" /> is set also.
|
||||
/// </param>
|
||||
/// <param name="fixedLen">
|
||||
/// If set to <c>true</c> <paramref name="transferLen" /> indicates how many blocks to read of a
|
||||
/// fixed size.
|
||||
/// </param>
|
||||
/// <param name="transferLen">Transfer length in blocks or bytes depending of <paramref name="fixedLen" /> status.</param>
|
||||
/// <param name="blockSize">Block size in bytes.</param>
|
||||
/// <param name="timeout">Timeout.</param>
|
||||
/// <param name="duration">Duration.</param>
|
||||
@@ -429,11 +438,17 @@ namespace DiscImageChef.Devices
|
||||
/// </summary>
|
||||
/// <param name="buffer">Buffer.</param>
|
||||
/// <param name="senseBuffer">Sense buffer.</param>
|
||||
/// <param name="sili">If set to <c>true</c> suppress the incorrect-length indication. Cannot be set while <paramref name="fixedLen"/> is set also.</param>
|
||||
/// <param name="fixedLen">If set to <c>true</c> <paramref name="transferLen"/> indicates how many blocks to read of a fixed size.</param>
|
||||
/// <param name="sili">
|
||||
/// If set to <c>true</c> suppress the incorrect-length indication. Cannot be set while
|
||||
/// <paramref name="fixedLen" /> is set also.
|
||||
/// </param>
|
||||
/// <param name="fixedLen">
|
||||
/// If set to <c>true</c> <paramref name="transferLen" /> indicates how many blocks to read of a
|
||||
/// fixed size.
|
||||
/// </param>
|
||||
/// <param name="partition">Partition to read object from.</param>
|
||||
/// <param name="objectId">Object identifier.</param>
|
||||
/// <param name="transferLen">Transfer length in blocks or bytes depending of <paramref name="fixedLen"/> status.</param>
|
||||
/// <param name="transferLen">Transfer length in blocks or bytes depending of <paramref name="fixedLen" /> status.</param>
|
||||
/// <param name="objectSize">Object size in bytes.</param>
|
||||
/// <param name="timeout">Timeout.</param>
|
||||
/// <param name="duration">Duration.</param>
|
||||
@@ -629,9 +644,15 @@ namespace DiscImageChef.Devices
|
||||
/// <param name="buffer">Buffer.</param>
|
||||
/// <param name="senseBuffer">Sense buffer.</param>
|
||||
/// <param name="byteOrder">If set to <c>true</c> drive should un-reverse the blocks and bytes</param>
|
||||
/// <param name="sili">If set to <c>true</c> suppress the incorrect-length indication. Cannot be set while <paramref name="fixedLen"/> is set also.</param>
|
||||
/// <param name="fixedLen">If set to <c>true</c> <paramref name="transferLen"/> indicates how many blocks to read of a fixed size.</param>
|
||||
/// <param name="transferLen">Transfer length in blocks or bytes depending of <paramref name="fixedLen"/> status.</param>
|
||||
/// <param name="sili">
|
||||
/// If set to <c>true</c> suppress the incorrect-length indication. Cannot be set while
|
||||
/// <paramref name="fixedLen" /> is set also.
|
||||
/// </param>
|
||||
/// <param name="fixedLen">
|
||||
/// If set to <c>true</c> <paramref name="transferLen" /> indicates how many blocks to read of a
|
||||
/// fixed size.
|
||||
/// </param>
|
||||
/// <param name="transferLen">Transfer length in blocks or bytes depending of <paramref name="fixedLen" /> status.</param>
|
||||
/// <param name="blockSize">Block size in bytes.</param>
|
||||
/// <param name="timeout">Timeout.</param>
|
||||
/// <param name="duration">Duration.</param>
|
||||
@@ -737,11 +758,17 @@ namespace DiscImageChef.Devices
|
||||
/// <param name="buffer">Buffer.</param>
|
||||
/// <param name="senseBuffer">Sense buffer.</param>
|
||||
/// <param name="byteOrder">If set to <c>true</c> drive should un-reverse the blocks and bytes</param>
|
||||
/// <param name="sili">If set to <c>true</c> suppress the incorrect-length indication. Cannot be set while <paramref name="fixedLen"/> is set also.</param>
|
||||
/// <param name="fixedLen">If set to <c>true</c> <paramref name="transferLen"/> indicates how many blocks to read of a fixed size.</param>
|
||||
/// <param name="sili">
|
||||
/// If set to <c>true</c> suppress the incorrect-length indication. Cannot be set while
|
||||
/// <paramref name="fixedLen" /> is set also.
|
||||
/// </param>
|
||||
/// <param name="fixedLen">
|
||||
/// If set to <c>true</c> <paramref name="transferLen" /> indicates how many blocks to read of a
|
||||
/// fixed size.
|
||||
/// </param>
|
||||
/// <param name="partition">Partition to read object from.</param>
|
||||
/// <param name="objectId">Object identifier.</param>
|
||||
/// <param name="transferLen">Transfer length in blocks or bytes depending of <paramref name="fixedLen"/> status.</param>
|
||||
/// <param name="transferLen">Transfer length in blocks or bytes depending of <paramref name="fixedLen" /> status.</param>
|
||||
/// <param name="objectSize">Object size in bytes.</param>
|
||||
/// <param name="timeout">Timeout.</param>
|
||||
/// <param name="duration">Duration.</param>
|
||||
@@ -818,9 +845,15 @@ namespace DiscImageChef.Devices
|
||||
/// </summary>
|
||||
/// <param name="buffer">Buffer.</param>
|
||||
/// <param name="senseBuffer">Sense buffer.</param>
|
||||
/// <param name="sili">If set to <c>true</c> suppress the incorrect-length indication. Cannot be set while <paramref name="fixedLen"/> is set also.</param>
|
||||
/// <param name="fixedLen">If set to <c>true</c> <paramref name="transferLen"/> indicates how many blocks to read of a fixed size.</param>
|
||||
/// <param name="transferLen">Transfer length in blocks or bytes depending of <paramref name="fixedLen"/> status.</param>
|
||||
/// <param name="sili">
|
||||
/// If set to <c>true</c> suppress the incorrect-length indication. Cannot be set while
|
||||
/// <paramref name="fixedLen" /> is set also.
|
||||
/// </param>
|
||||
/// <param name="fixedLen">
|
||||
/// If set to <c>true</c> <paramref name="transferLen" /> indicates how many blocks to read of a
|
||||
/// fixed size.
|
||||
/// </param>
|
||||
/// <param name="transferLen">Transfer length in blocks or bytes depending of <paramref name="fixedLen" /> status.</param>
|
||||
/// <param name="blockSize">Block size in bytes.</param>
|
||||
/// <param name="timeout">Timeout.</param>
|
||||
/// <param name="duration">Duration.</param>
|
||||
|
||||
@@ -39,7 +39,7 @@ namespace DiscImageChef.Devices
|
||||
/// <summary>
|
||||
/// Sends the SyQuest READ (6) command
|
||||
/// </summary>
|
||||
/// <returns><c>true</c> if the command failed and <paramref name="senseBuffer"/> contains the sense buffer.</returns>
|
||||
/// <returns><c>true</c> if the command failed and <paramref name="senseBuffer" /> contains the sense buffer.</returns>
|
||||
/// <param name="buffer">Buffer where the SCSI READ response will be stored</param>
|
||||
/// <param name="senseBuffer">Sense buffer.</param>
|
||||
/// <param name="timeout">Timeout in seconds.</param>
|
||||
@@ -55,7 +55,7 @@ namespace DiscImageChef.Devices
|
||||
/// <summary>
|
||||
/// Sends the SyQuest READ LONG (6) command
|
||||
/// </summary>
|
||||
/// <returns><c>true</c> if the command failed and <paramref name="senseBuffer"/> contains the sense buffer.</returns>
|
||||
/// <returns><c>true</c> if the command failed and <paramref name="senseBuffer" /> contains the sense buffer.</returns>
|
||||
/// <param name="buffer">Buffer where the SCSI READ response will be stored</param>
|
||||
/// <param name="senseBuffer">Sense buffer.</param>
|
||||
/// <param name="timeout">Timeout in seconds.</param>
|
||||
@@ -71,7 +71,7 @@ namespace DiscImageChef.Devices
|
||||
/// <summary>
|
||||
/// Sends the SyQuest READ (6) command
|
||||
/// </summary>
|
||||
/// <returns><c>true</c> if the command failed and <paramref name="senseBuffer"/> contains the sense buffer.</returns>
|
||||
/// <returns><c>true</c> if the command failed and <paramref name="senseBuffer" /> contains the sense buffer.</returns>
|
||||
/// <param name="buffer">Buffer where the SCSI READ response will be stored</param>
|
||||
/// <param name="senseBuffer">Sense buffer.</param>
|
||||
/// <param name="timeout">Timeout in seconds.</param>
|
||||
@@ -135,7 +135,7 @@ namespace DiscImageChef.Devices
|
||||
/// <summary>
|
||||
/// Sends the SyQuest READ LONG (10) command
|
||||
/// </summary>
|
||||
/// <returns><c>true</c> if the command failed and <paramref name="senseBuffer"/> contains the sense buffer.</returns>
|
||||
/// <returns><c>true</c> if the command failed and <paramref name="senseBuffer" /> contains the sense buffer.</returns>
|
||||
/// <param name="buffer">Buffer where the SCSI READ response will be stored</param>
|
||||
/// <param name="senseBuffer">Sense buffer.</param>
|
||||
/// <param name="timeout">Timeout in seconds.</param>
|
||||
@@ -151,7 +151,7 @@ namespace DiscImageChef.Devices
|
||||
/// <summary>
|
||||
/// Sends the SyQuest READ (10) command
|
||||
/// </summary>
|
||||
/// <returns><c>true</c> if the command failed and <paramref name="senseBuffer"/> contains the sense buffer.</returns>
|
||||
/// <returns><c>true</c> if the command failed and <paramref name="senseBuffer" /> contains the sense buffer.</returns>
|
||||
/// <param name="buffer">Buffer where the SCSI READ response will be stored</param>
|
||||
/// <param name="senseBuffer">Sense buffer.</param>
|
||||
/// <param name="timeout">Timeout in seconds.</param>
|
||||
|
||||
@@ -69,7 +69,7 @@ namespace DiscImageChef.Devices
|
||||
public uint Timeout { get; }
|
||||
|
||||
/// <summary>
|
||||
/// Gets a value indicating whether this <see cref="Device"/> is in error.
|
||||
/// Gets a value indicating whether this <see cref="Device" /> is in error.
|
||||
/// </summary>
|
||||
/// <value><c>true</c> if error; otherwise, <c>false</c>.</value>
|
||||
public bool Error { get; private set; }
|
||||
@@ -132,19 +132,13 @@ namespace DiscImageChef.Devices
|
||||
/// Gets the USB vendor ID.
|
||||
/// </summary>
|
||||
/// <value>The USB vendor ID.</value>
|
||||
public ushort UsbVendorId
|
||||
{
|
||||
get => usbVendor;
|
||||
}
|
||||
public ushort UsbVendorId => usbVendor;
|
||||
|
||||
/// <summary>
|
||||
/// Gets the USB product ID.
|
||||
/// </summary>
|
||||
/// <value>The USB product ID.</value>
|
||||
public ushort UsbProductId
|
||||
{
|
||||
get => usbProduct;
|
||||
}
|
||||
public ushort UsbProductId => usbProduct;
|
||||
|
||||
/// <summary>
|
||||
/// Gets the USB descriptors.
|
||||
@@ -180,19 +174,13 @@ namespace DiscImageChef.Devices
|
||||
/// Gets the FireWire GUID
|
||||
/// </summary>
|
||||
/// <value>The FireWire GUID.</value>
|
||||
public ulong FireWireGuid
|
||||
{
|
||||
get => firewireGuid;
|
||||
}
|
||||
public ulong FireWireGuid => firewireGuid;
|
||||
|
||||
/// <summary>
|
||||
/// Gets the FireWire model number
|
||||
/// </summary>
|
||||
/// <value>The FireWire model.</value>
|
||||
public uint FireWireModel
|
||||
{
|
||||
get => firewireModel;
|
||||
}
|
||||
public uint FireWireModel => firewireModel;
|
||||
|
||||
/// <summary>
|
||||
/// Gets the FireWire model name.
|
||||
@@ -204,10 +192,7 @@ namespace DiscImageChef.Devices
|
||||
/// Gets the FireWire vendor number.
|
||||
/// </summary>
|
||||
/// <value>The FireWire vendor number.</value>
|
||||
public uint FireWireVendor
|
||||
{
|
||||
get => firewireVendor;
|
||||
}
|
||||
public uint FireWireVendor => firewireVendor;
|
||||
|
||||
/// <summary>
|
||||
/// Gets the FireWire vendor name.
|
||||
|
||||
@@ -31,6 +31,7 @@
|
||||
// ****************************************************************************/
|
||||
|
||||
using System;
|
||||
|
||||
// ReSharper disable MemberCanBeInternal
|
||||
// ReSharper disable InconsistentNaming
|
||||
|
||||
@@ -191,7 +192,7 @@ namespace DiscImageChef.Devices
|
||||
/// </summary>
|
||||
SetFeatures = 0xEF,
|
||||
/// <summary>
|
||||
/// Enables <see cref="ReadMultiple"/> and <see cref="WriteMultiple"/> and sets the block length for these commands
|
||||
/// Enables <see cref="ReadMultiple" /> and <see cref="WriteMultiple" /> and sets the block length for these commands
|
||||
/// </summary>
|
||||
SetMultipleMode = 0xC6,
|
||||
/// <summary>
|
||||
@@ -369,7 +370,7 @@ namespace DiscImageChef.Devices
|
||||
/// </summary>
|
||||
SecurityDisablePassword = 0xF6,
|
||||
/// <summary>
|
||||
/// Enables usage of <see cref="SecurityEraseUnit"/> command
|
||||
/// Enables usage of <see cref="SecurityEraseUnit" /> command
|
||||
/// </summary>
|
||||
SecurityErasePrepare = 0xF3,
|
||||
/// <summary>
|
||||
@@ -408,8 +409,8 @@ namespace DiscImageChef.Devices
|
||||
/// </summary>
|
||||
TranslateSector = 0x87,
|
||||
/// <summary>
|
||||
/// For CompactFlash cards that do not support security mode, this commands is equal to <see cref="Nop"/>
|
||||
/// For those that do, this command is equal to <see cref="SecurityFreezeLock"/>
|
||||
/// For CompactFlash cards that do not support security mode, this commands is equal to <see cref="Nop" />
|
||||
/// For those that do, this command is equal to <see cref="SecurityFreezeLock" />
|
||||
/// </summary>
|
||||
WearLevel = 0xF5,
|
||||
/// <summary>
|
||||
@@ -494,7 +495,8 @@ namespace DiscImageChef.Devices
|
||||
/// Reads sectors using DMA transfer, retrying on error (48-bit)
|
||||
/// </summary>
|
||||
ReadDmaExt = 0x25,
|
||||
/// <summary> (48-bit)
|
||||
/// <summary>
|
||||
/// (48-bit)
|
||||
/// Queues a read of sectors
|
||||
/// </summary>
|
||||
ReadDmaQueuedExt = 0x26,
|
||||
@@ -519,7 +521,7 @@ namespace DiscImageChef.Devices
|
||||
/// </summary>
|
||||
ReadVerifyExt = 0x42,
|
||||
/// <summary>
|
||||
/// Sends a SET MAX subcommand, <see cref="AtaSetMaxSubCommands"/>
|
||||
/// Sends a SET MAX subcommand, <see cref="AtaSetMaxSubCommands" />
|
||||
/// </summary>
|
||||
SetMaxCommands = 0xF9,
|
||||
/// <summary>
|
||||
@@ -573,15 +575,16 @@ namespace DiscImageChef.Devices
|
||||
|
||||
#region Commands defined on ATA/ATAPI-8 rev. 3f
|
||||
/// <summary>
|
||||
/// Sends a Non Volatile Cache subcommand. <see cref="AtaNonVolatileCacheSubCommands"/>
|
||||
/// Sends a Non Volatile Cache subcommand. <see cref="AtaNonVolatileCacheSubCommands" />
|
||||
/// </summary>
|
||||
NonVolatileCacheCommand = 0xB6,
|
||||
/// <summary>
|
||||
/// Retrieves security protocol information or the results from <see cref="TrustedSend"/> commands
|
||||
/// Retrieves security protocol information or the results from <see cref="TrustedSend" /> commands
|
||||
/// </summary>
|
||||
TrustedReceive = 0x5C,
|
||||
/// <summary>
|
||||
/// Retrieves security protocol information or the results from <see cref="TrustedSend"/> commands, using DMA transfers
|
||||
/// Retrieves security protocol information or the results from <see cref="TrustedSend" /> commands, using DMA
|
||||
/// transfers
|
||||
/// </summary>
|
||||
TrustedReceiveDma = 0x5D,
|
||||
/// <summary>
|
||||
@@ -601,7 +604,8 @@ namespace DiscImageChef.Devices
|
||||
/// </summary>
|
||||
WriteDmaQueuedFuaExt = 0x3E,
|
||||
/// <summary>
|
||||
/// Writes several sectors at once setting interrupts on end of block (48-bit), not returning until the operation is complete
|
||||
/// Writes several sectors at once setting interrupts on end of block (48-bit), not returning until the operation is
|
||||
/// complete
|
||||
/// </summary>
|
||||
WriteMultipleFuaExt = 0xCE,
|
||||
/// <summary>
|
||||
@@ -653,7 +657,7 @@ namespace DiscImageChef.Devices
|
||||
|
||||
#region Commands defined on ATA/ATAPI Command Set 3 (ACS-3) rev. 5
|
||||
/// <summary>
|
||||
/// Sends <see cref="AtaNcqQueueManagementSubcommands"/>
|
||||
/// Sends <see cref="AtaNcqQueueManagementSubcommands" />
|
||||
/// </summary>
|
||||
NcqQueueManagement = 0x63,
|
||||
/// <summary>
|
||||
@@ -737,11 +741,11 @@ namespace DiscImageChef.Devices
|
||||
{
|
||||
#region Commands defined on ATA/ATAPI-6 rev. 3b
|
||||
/// <summary>
|
||||
/// Disables any change made by <see cref="Set"/>
|
||||
/// Disables any change made by <see cref="Set" />
|
||||
/// </summary>
|
||||
Restore = 0xC0,
|
||||
/// <summary>
|
||||
/// Prevents any <see cref="AtaDeviceConfigurationSubCommands"/> from working until a power down cycle.
|
||||
/// Prevents any <see cref="AtaDeviceConfigurationSubCommands" /> from working until a power down cycle.
|
||||
/// </summary>
|
||||
FreezeLock = 0xC1,
|
||||
/// <summary>
|
||||
@@ -768,11 +772,12 @@ namespace DiscImageChef.Devices
|
||||
/// </summary>
|
||||
Address = 0x00,
|
||||
/// <summary>
|
||||
/// Disables any other <see cref="AtaSetMaxSubCommands"/> until power cycle
|
||||
/// Disables any other <see cref="AtaSetMaxSubCommands" /> until power cycle
|
||||
/// </summary>
|
||||
FreezeLock = 0x04,
|
||||
/// <summary>
|
||||
/// Disables any other <see cref="AtaSetMaxSubCommands"/> except <see cref="UnLock"/> and <see cref="FreezeLock"/> until power cycle
|
||||
/// Disables any other <see cref="AtaSetMaxSubCommands" /> except <see cref="UnLock" /> and <see cref="FreezeLock" />
|
||||
/// until power cycle
|
||||
/// </summary>
|
||||
Lock = 0x02,
|
||||
/// <summary>
|
||||
@@ -780,7 +785,7 @@ namespace DiscImageChef.Devices
|
||||
/// </summary>
|
||||
SetPassword = 0x01,
|
||||
/// <summary>
|
||||
/// Disables <see cref="Lock"/>
|
||||
/// Disables <see cref="Lock" />
|
||||
/// </summary>
|
||||
UnLock = 0x03,
|
||||
#endregion Commands defined on ATA/ATAPI-6 rev. 3b
|
||||
@@ -816,7 +821,7 @@ namespace DiscImageChef.Devices
|
||||
RemoveLbaFromNvCache = 0x11,
|
||||
/// <summary>
|
||||
/// Disables the Non Volatile Cache Power Mode
|
||||
/// <see cref="SetNvCachePowerMode"/>
|
||||
/// <see cref="SetNvCachePowerMode" />
|
||||
/// </summary>
|
||||
ReturnFromNvCachePowerMode = 0x01,
|
||||
/// <summary>
|
||||
@@ -847,7 +852,7 @@ namespace DiscImageChef.Devices
|
||||
/// </summary>
|
||||
OverwriteExt = 0x0014,
|
||||
/// <summary>
|
||||
/// Disables all <see cref="AtaSanitizeSubCommands"/> except <see cref="Status"/>
|
||||
/// Disables all <see cref="AtaSanitizeSubCommands" /> except <see cref="Status" />
|
||||
/// </summary>
|
||||
FreezeLockExt = 0x0020,
|
||||
/// <summary>
|
||||
@@ -858,7 +863,7 @@ namespace DiscImageChef.Devices
|
||||
|
||||
#region Commands defined on ATA/ATAPI Command Set 3 (ACS-3) rev. 5
|
||||
/// <summary>
|
||||
/// Disables the <see cref="FreezeLockExt"/> command
|
||||
/// Disables the <see cref="FreezeLockExt" /> command
|
||||
/// </summary>
|
||||
AntiFreezeLockExt = 0x0040
|
||||
#endregion Commands defined on ATA/ATAPI Command Set 3 (ACS-3) rev. 5
|
||||
@@ -1061,7 +1066,7 @@ namespace DiscImageChef.Devices
|
||||
/// </summary>
|
||||
WriteDiagnosticOld = 0x1B,
|
||||
/// <summary>
|
||||
/// Requests the data after completion of a <see cref="WriteDiagnostic"/>
|
||||
/// Requests the data after completion of a <see cref="WriteDiagnostic" />
|
||||
/// ANSI X3T9.3 No. 185 (SASI)
|
||||
/// </summary>
|
||||
ReadDiagnostic = 0x1C,
|
||||
@@ -1466,12 +1471,12 @@ namespace DiscImageChef.Devices
|
||||
/// </summary>
|
||||
ReadSerialNumber = 0xAB,
|
||||
/// <summary>
|
||||
/// Receives information about a previous or current <see cref="ExtendedCopy"/>
|
||||
/// Receives information about a previous or current <see cref="ExtendedCopy" />
|
||||
/// SPC-2 rev. 20
|
||||
/// </summary>
|
||||
ReceiveCopyResults = 0x84,
|
||||
/// <summary>
|
||||
/// Requests the data after completion of a <see cref="SendDiagnostic"/>
|
||||
/// Requests the data after completion of a <see cref="SendDiagnostic" />
|
||||
/// ECMA-111 (SCSI-1)
|
||||
/// </summary>
|
||||
ReceiveDiagnostic = SasiCommands.ReadDiagnostic,
|
||||
@@ -1739,17 +1744,17 @@ namespace DiscImageChef.Devices
|
||||
/// </summary>
|
||||
WriteSame16 = 0x93,
|
||||
/// <summary>
|
||||
/// Requets XOR data generated by an <see cref="XdWrite"/> or <see cref="Regenerate"/> command
|
||||
/// Requets XOR data generated by an <see cref="XdWrite" /> or <see cref="Regenerate" /> command
|
||||
/// SBC-1 rev. 8c
|
||||
/// </summary>
|
||||
XdRead = 0x52,
|
||||
/// <summary>
|
||||
/// XORs the data sent with data on the medium and stores it until an <see cref="XdRead"/> is issued
|
||||
/// XORs the data sent with data on the medium and stores it until an <see cref="XdRead" /> is issued
|
||||
/// SBC-1 rev. 8c
|
||||
/// </summary>
|
||||
XdWrite = 0x50,
|
||||
/// <summary>
|
||||
/// XORs the data sent with data on the medium and stores it until an <see cref="XdRead"/> is issued
|
||||
/// XORs the data sent with data on the medium and stores it until an <see cref="XdRead" /> is issued
|
||||
/// SBC-1 rev. 8c
|
||||
/// </summary>
|
||||
XdWrite16 = 0x80,
|
||||
@@ -2045,7 +2050,8 @@ namespace DiscImageChef.Devices
|
||||
/// </summary>
|
||||
RepairTrack = 0x58,
|
||||
/// <summary>
|
||||
/// Requests the start of the authentication process and provides data necessary for authentication and for generating a Bus Key
|
||||
/// Requests the start of the authentication process and provides data necessary for authentication and for generating
|
||||
/// a Bus Key
|
||||
/// MMC-2 rev. 11a
|
||||
/// </summary>
|
||||
ReportKey = 0xA4,
|
||||
@@ -2278,7 +2284,7 @@ namespace DiscImageChef.Devices
|
||||
/// </summary>
|
||||
ReportVolumeTypesSupported = 0x44,
|
||||
/// <summary>
|
||||
/// Gets the results of <see cref="SendVolumeTag"/>
|
||||
/// Gets the results of <see cref="SendVolumeTag" />
|
||||
/// SCSI-2 X3T9.2/375R rev. 10l
|
||||
/// </summary>
|
||||
RequestVolumeElementAddress = 0xB5,
|
||||
@@ -2394,7 +2400,7 @@ namespace DiscImageChef.Devices
|
||||
#region ATA Command Pass-Through
|
||||
/// <summary>
|
||||
/// Sends a 24-bit ATA command to the device
|
||||
/// Clashes with <see cref="Blank"/>
|
||||
/// Clashes with <see cref="Blank" />
|
||||
/// ATA CPT rev. 8a
|
||||
/// </summary>
|
||||
AtaPassThrough = 0xA1,
|
||||
@@ -3312,7 +3318,7 @@ namespace DiscImageChef.Devices
|
||||
/// </summary>
|
||||
VendorShort = 1,
|
||||
/// <summary>
|
||||
/// Equivalent to <see cref="Long"/> on SSC-1
|
||||
/// Equivalent to <see cref="Long" /> on SSC-1
|
||||
/// </summary>
|
||||
OldLong = 2,
|
||||
/// <summary>
|
||||
@@ -3475,7 +3481,8 @@ namespace DiscImageChef.Devices
|
||||
/// </summary>
|
||||
SendCid = 10,
|
||||
/// <summary>
|
||||
/// Reads data stream from device, starting at given address, until a <see cref="StopTransmission"/> follows (ADTC, R1)
|
||||
/// Reads data stream from device, starting at given address, until a <see cref="StopTransmission" /> follows (ADTC,
|
||||
/// R1)
|
||||
/// </summary>
|
||||
[Obsolete] ReadDatUntilStop = 11,
|
||||
/// <summary>
|
||||
@@ -3523,14 +3530,15 @@ namespace DiscImageChef.Devices
|
||||
|
||||
#region Class 3 MMC Commands (Stream write)
|
||||
/// <summary>
|
||||
/// Writes data stream from host until a <see cref="StopTransmission"/> follows (ADTC, R1)
|
||||
/// Writes data stream from host until a <see cref="StopTransmission" /> follows (ADTC, R1)
|
||||
/// </summary>
|
||||
[Obsolete] WriteDatUntilStop = 20,
|
||||
#endregion Class 3 MMC Commands (Stream write)
|
||||
|
||||
#region Class 4 MMC Commands (Block-oriented write)
|
||||
/// <summary>
|
||||
/// Defines the number of blocks which are going to be transferred in the immediately succeeding multiple block command (AC, R1)
|
||||
/// Defines the number of blocks which are going to be transferred in the immediately succeeding multiple block command
|
||||
/// (AC, R1)
|
||||
/// </summary>
|
||||
SetBlockCount = 23,
|
||||
/// <summary>
|
||||
@@ -3609,7 +3617,8 @@ namespace DiscImageChef.Devices
|
||||
|
||||
#region Class 9 MMC Commands (I/O mode)
|
||||
/// <summary>
|
||||
/// Used to write and read 8 bit data field, used to access application dependent registers not defined in MMC standard (AC, R4)
|
||||
/// Used to write and read 8 bit data field, used to access application dependent registers not defined in MMC standard
|
||||
/// (AC, R4)
|
||||
/// </summary>
|
||||
FastIo = 39,
|
||||
/// <summary>
|
||||
|
||||
@@ -56,7 +56,10 @@ namespace DiscImageChef.Devices.FreeBSD
|
||||
/// <param name="timeout">Timeout in seconds</param>
|
||||
/// <param name="direction">SCSI command transfer direction</param>
|
||||
/// <param name="duration">Time it took to execute the command in milliseconds</param>
|
||||
/// <param name="sense"><c>True</c> if SCSI error returned non-OK status and <paramref name="senseBuffer"/> contains SCSI sense</param>
|
||||
/// <param name="sense">
|
||||
/// <c>True</c> if SCSI error returned non-OK status and <paramref name="senseBuffer" /> contains SCSI
|
||||
/// sense
|
||||
/// </param>
|
||||
internal static int SendScsiCommand64(IntPtr dev, byte[] cdb, ref byte[] buffer, out byte[] senseBuffer,
|
||||
uint timeout, CcbFlags direction, out double duration, out bool sense)
|
||||
{
|
||||
@@ -161,7 +164,10 @@ namespace DiscImageChef.Devices.FreeBSD
|
||||
/// <param name="timeout">Timeout in seconds</param>
|
||||
/// <param name="direction">SCSI command transfer direction</param>
|
||||
/// <param name="duration">Time it took to execute the command in milliseconds</param>
|
||||
/// <param name="sense"><c>True</c> if SCSI error returned non-OK status and <paramref name="senseBuffer"/> contains SCSI sense</param>
|
||||
/// <param name="sense">
|
||||
/// <c>True</c> if SCSI error returned non-OK status and <paramref name="senseBuffer" /> contains SCSI
|
||||
/// sense
|
||||
/// </param>
|
||||
internal static int SendScsiCommand(IntPtr dev, byte[] cdb, ref byte[] buffer, out byte[] senseBuffer,
|
||||
uint timeout, CcbFlags direction, out double duration, out bool sense)
|
||||
{
|
||||
|
||||
@@ -40,79 +40,79 @@ namespace DiscImageChef.Devices.FreeBSD
|
||||
{
|
||||
/// <summary>
|
||||
/// O_RDONLY
|
||||
///</summary>
|
||||
/// </summary>
|
||||
ReadOnly = 0x00000000,
|
||||
/// <summary>
|
||||
/// O_WRONLY
|
||||
///</summary>
|
||||
/// </summary>
|
||||
WriteOnly = 0x00000001,
|
||||
/// <summary>
|
||||
/// O_RDWR
|
||||
///</summary>
|
||||
/// </summary>
|
||||
ReadWrite = 0x00000002,
|
||||
/// <summary>
|
||||
/// O_NONBLOCK
|
||||
///</summary>
|
||||
/// </summary>
|
||||
NonBlocking = 0x00000004,
|
||||
/// <summary>
|
||||
/// O_APPEND
|
||||
///</summary>
|
||||
/// </summary>
|
||||
Append = 0x00000008,
|
||||
/// <summary>
|
||||
/// O_SHLOCK
|
||||
///</summary>
|
||||
/// </summary>
|
||||
SharedLock = 0x00000010,
|
||||
/// <summary>
|
||||
/// O_EXLOCK
|
||||
///</summary>
|
||||
/// </summary>
|
||||
ExclusiveLock = 0x00000020,
|
||||
/// <summary>
|
||||
/// O_ASYNC
|
||||
///</summary>
|
||||
/// </summary>
|
||||
Async = 0x00000040,
|
||||
/// <summary>
|
||||
/// O_FSYNC
|
||||
///</summary>
|
||||
/// </summary>
|
||||
SyncWrites = 0x00000080,
|
||||
/// <summary>
|
||||
/// O_NOFOLLOW
|
||||
///</summary>
|
||||
/// </summary>
|
||||
NoFollowSymlink = 0x00000100,
|
||||
/// <summary>
|
||||
/// O_CREAT
|
||||
///</summary>
|
||||
/// </summary>
|
||||
OpenOrCreate = 0x00000200,
|
||||
/// <summary>
|
||||
/// O_TRUNC
|
||||
///</summary>
|
||||
/// </summary>
|
||||
Truncate = 0x00000400,
|
||||
/// <summary>
|
||||
/// O_EXCL
|
||||
///</summary>
|
||||
/// </summary>
|
||||
CreateNew = 0x00000800,
|
||||
/// <summary>
|
||||
/// O_NOCTTY
|
||||
///</summary>
|
||||
/// </summary>
|
||||
NoControlTty = 0x00008000,
|
||||
/// <summary>
|
||||
/// O_DIRECT
|
||||
///</summary>
|
||||
/// </summary>
|
||||
Direct = 0x00010000,
|
||||
/// <summary>
|
||||
/// O_DIRECTORY
|
||||
///</summary>
|
||||
/// </summary>
|
||||
Directory = 0x00020000,
|
||||
/// <summary>
|
||||
/// O_EXEC
|
||||
///</summary>
|
||||
/// </summary>
|
||||
Execute = 0x00040000,
|
||||
/// <summary>
|
||||
/// O_TTY_INIT
|
||||
///</summary>
|
||||
/// </summary>
|
||||
InitializeTty = 0x00080000,
|
||||
/// <summary>
|
||||
/// O_CLOEXEC
|
||||
///</summary>
|
||||
/// </summary>
|
||||
CloseOnExec = 0x00100000
|
||||
}
|
||||
|
||||
@@ -121,23 +121,23 @@ namespace DiscImageChef.Devices.FreeBSD
|
||||
{
|
||||
/// <summary>
|
||||
/// 48-bit command
|
||||
///</summary>
|
||||
/// </summary>
|
||||
ExtendedCommand = 0x01,
|
||||
/// <summary>
|
||||
/// FPDMA command
|
||||
///</summary>
|
||||
/// </summary>
|
||||
Fpdma = 0x02,
|
||||
/// <summary>
|
||||
/// Control, not a command
|
||||
///</summary>
|
||||
/// </summary>
|
||||
Control = 0x04,
|
||||
/// <summary>
|
||||
/// Needs result
|
||||
///</summary>
|
||||
/// </summary>
|
||||
NeedResult = 0x08,
|
||||
/// <summary>
|
||||
/// DMA command
|
||||
///</summary>
|
||||
/// </summary>
|
||||
Dma = 0x10
|
||||
}
|
||||
|
||||
@@ -642,7 +642,11 @@ namespace DiscImageChef.Devices.FreeBSD
|
||||
/// <summary>Request was too large for this host</summary>
|
||||
CamReqTooBig = 0x1a,
|
||||
|
||||
/// <summary>This request should be requeued to preserve transaction ordering. This typically occurs when the SIM recognizes an error that should freeze the queue and must place additional requests for the target at the sim level back into the XPT queue.</summary>
|
||||
/// <summary>
|
||||
/// This request should be requeued to preserve transaction ordering. This typically occurs when the SIM
|
||||
/// recognizes an error that should freeze the queue and must place additional requests for the target at the sim level
|
||||
/// back into the XPT queue.
|
||||
/// </summary>
|
||||
CamRequeueReq = 0x1b,
|
||||
|
||||
/// <summary>ATA error, look at error code in CCB</summary>
|
||||
|
||||
@@ -37,13 +37,17 @@ using System.Runtime.InteropServices;
|
||||
using lun_id_t = System.UInt32;
|
||||
using path_id_t = System.UInt32;
|
||||
using target_id_t = System.UInt32;
|
||||
|
||||
// ReSharper disable BuiltInTypeReferenceStyle
|
||||
|
||||
#pragma warning disable 649
|
||||
#pragma warning disable 169
|
||||
|
||||
namespace DiscImageChef.Devices.FreeBSD
|
||||
{
|
||||
[StructLayout(LayoutKind.Sequential)]
|
||||
[SuppressMessage("ReSharper", "MemberCanBePrivate.Global")] struct AtaCmd
|
||||
[SuppressMessage("ReSharper", "MemberCanBePrivate.Global")]
|
||||
struct AtaCmd
|
||||
{
|
||||
public CamAtaIoFlags flags;
|
||||
public byte command;
|
||||
@@ -62,7 +66,8 @@ namespace DiscImageChef.Devices.FreeBSD
|
||||
}
|
||||
|
||||
[StructLayout(LayoutKind.Sequential)]
|
||||
[SuppressMessage("ReSharper", "MemberCanBePrivate.Global")] struct AtaRes
|
||||
[SuppressMessage("ReSharper", "MemberCanBePrivate.Global")]
|
||||
struct AtaRes
|
||||
{
|
||||
public CamAtaIoFlags flags;
|
||||
public byte status;
|
||||
@@ -79,14 +84,16 @@ namespace DiscImageChef.Devices.FreeBSD
|
||||
}
|
||||
|
||||
[StructLayout(LayoutKind.Sequential)]
|
||||
[SuppressMessage("ReSharper", "MemberCanBePrivate.Global")] struct CamPinfo
|
||||
[SuppressMessage("ReSharper", "MemberCanBePrivate.Global")]
|
||||
struct CamPinfo
|
||||
{
|
||||
public uint priority;
|
||||
public uint generation;
|
||||
public int index;
|
||||
}
|
||||
|
||||
[SuppressMessage("ReSharper", "MemberCanBePrivate.Global")] struct ListEntry
|
||||
[SuppressMessage("ReSharper", "MemberCanBePrivate.Global")]
|
||||
struct ListEntry
|
||||
{
|
||||
/// <summary>
|
||||
/// LIST_ENTRY(ccb_hdr)=le->*le_next
|
||||
@@ -98,7 +105,8 @@ namespace DiscImageChef.Devices.FreeBSD
|
||||
public IntPtr LePrev;
|
||||
}
|
||||
|
||||
[SuppressMessage("ReSharper", "MemberCanBePrivate.Global")] struct SlistEntry
|
||||
[SuppressMessage("ReSharper", "MemberCanBePrivate.Global")]
|
||||
struct SlistEntry
|
||||
{
|
||||
/// <summary>
|
||||
/// SLIST_ENTRY(ccb_hdr)=sle->*sle_next
|
||||
@@ -106,7 +114,8 @@ namespace DiscImageChef.Devices.FreeBSD
|
||||
public IntPtr SleNext;
|
||||
}
|
||||
|
||||
[SuppressMessage("ReSharper", "MemberCanBePrivate.Global")] struct TailqEntry
|
||||
[SuppressMessage("ReSharper", "MemberCanBePrivate.Global")]
|
||||
struct TailqEntry
|
||||
{
|
||||
/// <summary>
|
||||
/// TAILQ_ENTRY(ccb_hdr)=tqe->*tqe_next
|
||||
@@ -118,7 +127,8 @@ namespace DiscImageChef.Devices.FreeBSD
|
||||
public IntPtr TqePrev;
|
||||
}
|
||||
|
||||
[SuppressMessage("ReSharper", "MemberCanBePrivate.Global")] struct StailqEntry
|
||||
[SuppressMessage("ReSharper", "MemberCanBePrivate.Global")]
|
||||
struct StailqEntry
|
||||
{
|
||||
/// <summary>
|
||||
/// STAILQ_ENTRY(ccb_hdr)=stqe->*stqe_next
|
||||
@@ -127,7 +137,8 @@ namespace DiscImageChef.Devices.FreeBSD
|
||||
}
|
||||
|
||||
[StructLayout(LayoutKind.Explicit)]
|
||||
[SuppressMessage("ReSharper", "MemberCanBePrivate.Global")] struct CamqEntry
|
||||
[SuppressMessage("ReSharper", "MemberCanBePrivate.Global")]
|
||||
struct CamqEntry
|
||||
{
|
||||
[FieldOffset(0)] public ListEntry le;
|
||||
[FieldOffset(0)] public SlistEntry sle;
|
||||
@@ -136,7 +147,8 @@ namespace DiscImageChef.Devices.FreeBSD
|
||||
}
|
||||
|
||||
[StructLayout(LayoutKind.Sequential)]
|
||||
[SuppressMessage("ReSharper", "MemberCanBePrivate.Global")] struct Timeval
|
||||
[SuppressMessage("ReSharper", "MemberCanBePrivate.Global")]
|
||||
struct Timeval
|
||||
{
|
||||
public long tv_sec;
|
||||
/// <summary>long</summary>
|
||||
@@ -144,7 +156,8 @@ namespace DiscImageChef.Devices.FreeBSD
|
||||
}
|
||||
|
||||
[StructLayout(LayoutKind.Sequential)]
|
||||
[SuppressMessage("ReSharper", "MemberCanBePrivate.Global")] struct CcbQosArea
|
||||
[SuppressMessage("ReSharper", "MemberCanBePrivate.Global")]
|
||||
struct CcbQosArea
|
||||
{
|
||||
public Timeval etime;
|
||||
public UIntPtr sim_data;
|
||||
@@ -152,7 +165,8 @@ namespace DiscImageChef.Devices.FreeBSD
|
||||
}
|
||||
|
||||
[StructLayout(LayoutKind.Sequential)]
|
||||
[SuppressMessage("ReSharper", "MemberCanBePrivate.Global")] struct CcbHdr
|
||||
[SuppressMessage("ReSharper", "MemberCanBePrivate.Global")]
|
||||
struct CcbHdr
|
||||
{
|
||||
public CamPinfo pinfo;
|
||||
public CamqEntry xpt_links;
|
||||
@@ -176,7 +190,8 @@ namespace DiscImageChef.Devices.FreeBSD
|
||||
}
|
||||
|
||||
[StructLayout(LayoutKind.Sequential)]
|
||||
[SuppressMessage("ReSharper", "MemberCanBePrivate.Global")] struct ScsiSenseData
|
||||
[SuppressMessage("ReSharper", "MemberCanBePrivate.Global")]
|
||||
struct ScsiSenseData
|
||||
{
|
||||
const int SSD_FULL_SIZE = 252;
|
||||
public byte error_code;
|
||||
@@ -187,7 +202,8 @@ namespace DiscImageChef.Devices.FreeBSD
|
||||
/// SCSI I/O Request CCB used for the XPT_SCSI_IO and XPT_CONT_TARGET_IO function codes.
|
||||
/// </summary>
|
||||
[StructLayout(LayoutKind.Sequential)]
|
||||
[SuppressMessage("ReSharper", "MemberCanBePrivate.Global")] struct CcbScsiio
|
||||
[SuppressMessage("ReSharper", "MemberCanBePrivate.Global")]
|
||||
struct CcbScsiio
|
||||
{
|
||||
public CcbHdr ccb_h;
|
||||
/// <summary>Ptr for next CCB for action</summary>
|
||||
@@ -221,7 +237,10 @@ namespace DiscImageChef.Devices.FreeBSD
|
||||
public IntPtr msg_ptr;
|
||||
/// <summary>Number of bytes for the Message</summary>
|
||||
public short msg_len;
|
||||
/// <summary>What to do for tag queueing. The tag action should be either the define below (to send a non-tagged transaction) or one of the defined scsi tag messages from scsi_message.h.</summary>
|
||||
/// <summary>
|
||||
/// What to do for tag queueing. The tag action should be either the define below (to send a non-tagged
|
||||
/// transaction) or one of the defined scsi tag messages from scsi_message.h.
|
||||
/// </summary>
|
||||
public byte tag_action;
|
||||
/// <summary>tag id from initator (target mode)</summary>
|
||||
public uint tag_id;
|
||||
@@ -233,7 +252,8 @@ namespace DiscImageChef.Devices.FreeBSD
|
||||
/// SCSI I/O Request CCB used for the XPT_SCSI_IO and XPT_CONT_TARGET_IO function codes.
|
||||
/// </summary>
|
||||
[StructLayout(LayoutKind.Sequential)]
|
||||
[SuppressMessage("ReSharper", "MemberCanBePrivate.Global")] struct CcbScsiio64
|
||||
[SuppressMessage("ReSharper", "MemberCanBePrivate.Global")]
|
||||
struct CcbScsiio64
|
||||
{
|
||||
public CcbHdr ccb_h;
|
||||
/// <summary>Ptr for next CCB for action</summary>
|
||||
@@ -268,7 +288,10 @@ namespace DiscImageChef.Devices.FreeBSD
|
||||
public IntPtr msg_ptr;
|
||||
/// <summary>Number of bytes for the Message</summary>
|
||||
public short msg_len;
|
||||
/// <summary>What to do for tag queueing. The tag action should be either the define below (to send a non-tagged transaction) or one of the defined scsi tag messages from scsi_message.h.</summary>
|
||||
/// <summary>
|
||||
/// What to do for tag queueing. The tag action should be either the define below (to send a non-tagged
|
||||
/// transaction) or one of the defined scsi tag messages from scsi_message.h.
|
||||
/// </summary>
|
||||
public byte tag_action;
|
||||
/// <summary>tag id from initator (target mode)</summary>
|
||||
public uint tag_id;
|
||||
@@ -280,7 +303,8 @@ namespace DiscImageChef.Devices.FreeBSD
|
||||
/// ATA I/O Request CCB used for the XPT_ATA_IO function code.
|
||||
/// </summary>
|
||||
[StructLayout(LayoutKind.Sequential)]
|
||||
[SuppressMessage("ReSharper", "MemberCanBePrivate.Global")] struct CcbAtaio
|
||||
[SuppressMessage("ReSharper", "MemberCanBePrivate.Global")]
|
||||
struct CcbAtaio
|
||||
{
|
||||
public CcbHdr ccb_h;
|
||||
/// <summary>Ptr for next CCB for action</summary>
|
||||
@@ -302,7 +326,8 @@ namespace DiscImageChef.Devices.FreeBSD
|
||||
}
|
||||
|
||||
[StructLayout(LayoutKind.Sequential)]
|
||||
[SuppressMessage("ReSharper", "MemberCanBePrivate.Global")] struct NvmeCommand
|
||||
[SuppressMessage("ReSharper", "MemberCanBePrivate.Global")]
|
||||
struct NvmeCommand
|
||||
{
|
||||
ushort opc_fuse_rsvd1;
|
||||
/// <summary>
|
||||
@@ -373,7 +398,8 @@ namespace DiscImageChef.Devices.FreeBSD
|
||||
}
|
||||
|
||||
[StructLayout(LayoutKind.Sequential)]
|
||||
[SuppressMessage("ReSharper", "MemberCanBePrivate.Global")] struct NvmeStatus
|
||||
[SuppressMessage("ReSharper", "MemberCanBePrivate.Global")]
|
||||
struct NvmeStatus
|
||||
{
|
||||
ushort status;
|
||||
|
||||
@@ -409,7 +435,8 @@ namespace DiscImageChef.Devices.FreeBSD
|
||||
}
|
||||
|
||||
[StructLayout(LayoutKind.Sequential)]
|
||||
[SuppressMessage("ReSharper", "MemberCanBePrivate.Global")] struct NvmeCompletion
|
||||
[SuppressMessage("ReSharper", "MemberCanBePrivate.Global")]
|
||||
struct NvmeCompletion
|
||||
{
|
||||
/// <summary>
|
||||
/// command-specific
|
||||
@@ -443,7 +470,8 @@ namespace DiscImageChef.Devices.FreeBSD
|
||||
/// NVMe I/O Request CCB used for the XPT_NVME_IO and XPT_NVME_ADMIN function codes.
|
||||
/// </summary>
|
||||
[StructLayout(LayoutKind.Sequential)]
|
||||
[SuppressMessage("ReSharper", "MemberCanBePrivate.Global")] struct CcbNvmeio
|
||||
[SuppressMessage("ReSharper", "MemberCanBePrivate.Global")]
|
||||
struct CcbNvmeio
|
||||
{
|
||||
public CcbHdr ccb_h;
|
||||
/// <summary>Ptr for next CCB for action</summary>
|
||||
@@ -463,7 +491,8 @@ namespace DiscImageChef.Devices.FreeBSD
|
||||
}
|
||||
|
||||
[StructLayout(LayoutKind.Sequential)]
|
||||
[SuppressMessage("ReSharper", "MemberCanBePrivate.Global")] struct PeriphMatchPattern
|
||||
[SuppressMessage("ReSharper", "MemberCanBePrivate.Global")]
|
||||
struct PeriphMatchPattern
|
||||
{
|
||||
const int DEV_IDLEN = 16;
|
||||
|
||||
@@ -476,14 +505,16 @@ namespace DiscImageChef.Devices.FreeBSD
|
||||
}
|
||||
|
||||
[StructLayout(LayoutKind.Sequential)]
|
||||
[SuppressMessage("ReSharper", "MemberCanBePrivate.Global")] struct DeviceIdMatchPattern
|
||||
[SuppressMessage("ReSharper", "MemberCanBePrivate.Global")]
|
||||
struct DeviceIdMatchPattern
|
||||
{
|
||||
public byte id_len;
|
||||
[MarshalAs(UnmanagedType.ByValArray, SizeConst = 256)] public byte[] id;
|
||||
}
|
||||
|
||||
[StructLayout(LayoutKind.Sequential)]
|
||||
[SuppressMessage("ReSharper", "MemberCanBePrivate.Global")] struct ScsiStaticInquiryPattern
|
||||
[SuppressMessage("ReSharper", "MemberCanBePrivate.Global")]
|
||||
struct ScsiStaticInquiryPattern
|
||||
{
|
||||
const int SID_VENDOR_SIZE = 8;
|
||||
const int SID_PRODUCT_SIZE = 16;
|
||||
@@ -496,24 +527,27 @@ namespace DiscImageChef.Devices.FreeBSD
|
||||
}
|
||||
|
||||
[StructLayout(LayoutKind.Explicit)]
|
||||
[SuppressMessage("ReSharper", "MemberCanBePrivate.Global")] struct DeviceMatchPatternData
|
||||
[SuppressMessage("ReSharper", "MemberCanBePrivate.Global")]
|
||||
struct DeviceMatchPatternData
|
||||
{
|
||||
[FieldOffset(0)] public ScsiStaticInquiryPattern inq_pat;
|
||||
[FieldOffset(0)] public DeviceIdMatchPattern devid_pat;
|
||||
}
|
||||
|
||||
[StructLayout(LayoutKind.Sequential)]
|
||||
[SuppressMessage("ReSharper", "MemberCanBePrivate.Global")] struct DeviceMatchPattern
|
||||
[SuppressMessage("ReSharper", "MemberCanBePrivate.Global")]
|
||||
struct DeviceMatchPattern
|
||||
{
|
||||
public path_id_t path_id;
|
||||
public target_id_t target_id;
|
||||
public lun_id_t target_lun;
|
||||
public uint path_id;
|
||||
public uint target_id;
|
||||
public uint target_lun;
|
||||
public DevPatternFlags flags;
|
||||
public DeviceMatchPatternData data;
|
||||
}
|
||||
|
||||
[StructLayout(LayoutKind.Sequential)]
|
||||
[SuppressMessage("ReSharper", "MemberCanBePrivate.Global")] struct BusMatchPattern
|
||||
[SuppressMessage("ReSharper", "MemberCanBePrivate.Global")]
|
||||
struct BusMatchPattern
|
||||
{
|
||||
const int DEV_IDLEN = 16;
|
||||
|
||||
@@ -525,7 +559,8 @@ namespace DiscImageChef.Devices.FreeBSD
|
||||
}
|
||||
|
||||
[StructLayout(LayoutKind.Explicit)]
|
||||
[SuppressMessage("ReSharper", "MemberCanBePrivate.Global")] struct MatchPattern
|
||||
[SuppressMessage("ReSharper", "MemberCanBePrivate.Global")]
|
||||
struct MatchPattern
|
||||
{
|
||||
[FieldOffset(0)] public PeriphMatchPattern periph_pattern;
|
||||
[FieldOffset(0)] public DeviceMatchPattern device_pattern;
|
||||
@@ -533,14 +568,16 @@ namespace DiscImageChef.Devices.FreeBSD
|
||||
}
|
||||
|
||||
[StructLayout(LayoutKind.Sequential)]
|
||||
[SuppressMessage("ReSharper", "MemberCanBePrivate.Global")] struct DevMatchPattern
|
||||
[SuppressMessage("ReSharper", "MemberCanBePrivate.Global")]
|
||||
struct DevMatchPattern
|
||||
{
|
||||
public DevMatchType type;
|
||||
public MatchPattern pattern;
|
||||
}
|
||||
|
||||
[StructLayout(LayoutKind.Sequential)]
|
||||
[SuppressMessage("ReSharper", "MemberCanBePrivate.Global")] struct PeriphMatchResult
|
||||
[SuppressMessage("ReSharper", "MemberCanBePrivate.Global")]
|
||||
struct PeriphMatchResult
|
||||
{
|
||||
[MarshalAs(UnmanagedType.ByValArray, SizeConst = 16)] public byte[] periph_name;
|
||||
public uint unit_number;
|
||||
@@ -550,7 +587,8 @@ namespace DiscImageChef.Devices.FreeBSD
|
||||
}
|
||||
|
||||
[StructLayout(LayoutKind.Sequential)]
|
||||
[SuppressMessage("ReSharper", "MemberCanBePrivate.Global")] struct MmcCid
|
||||
[SuppressMessage("ReSharper", "MemberCanBePrivate.Global")]
|
||||
struct MmcCid
|
||||
{
|
||||
public uint mid;
|
||||
[MarshalAs(UnmanagedType.ByValArray, SizeConst = 8)] public byte[] pnm;
|
||||
@@ -563,7 +601,8 @@ namespace DiscImageChef.Devices.FreeBSD
|
||||
}
|
||||
|
||||
[StructLayout(LayoutKind.Sequential)]
|
||||
[SuppressMessage("ReSharper", "MemberCanBePrivate.Global")] struct MmcParams
|
||||
[SuppressMessage("ReSharper", "MemberCanBePrivate.Global")]
|
||||
struct MmcParams
|
||||
{
|
||||
/// <summary>
|
||||
/// Card model
|
||||
@@ -609,7 +648,8 @@ namespace DiscImageChef.Devices.FreeBSD
|
||||
}
|
||||
|
||||
[StructLayout(LayoutKind.Sequential)]
|
||||
[SuppressMessage("ReSharper", "MemberCanBePrivate.Global")] struct DeviceMatchResult
|
||||
[SuppressMessage("ReSharper", "MemberCanBePrivate.Global")]
|
||||
struct DeviceMatchResult
|
||||
{
|
||||
public path_id_t path_id;
|
||||
public target_id_t target_id;
|
||||
@@ -622,7 +662,8 @@ namespace DiscImageChef.Devices.FreeBSD
|
||||
}
|
||||
|
||||
[StructLayout(LayoutKind.Sequential)]
|
||||
[SuppressMessage("ReSharper", "MemberCanBePrivate.Global")] struct BusMatchResult
|
||||
[SuppressMessage("ReSharper", "MemberCanBePrivate.Global")]
|
||||
struct BusMatchResult
|
||||
{
|
||||
public path_id_t path_id;
|
||||
const int DEV_IDLEN = 16;
|
||||
@@ -632,7 +673,8 @@ namespace DiscImageChef.Devices.FreeBSD
|
||||
}
|
||||
|
||||
[StructLayout(LayoutKind.Explicit)]
|
||||
[SuppressMessage("ReSharper", "MemberCanBePrivate.Global")] struct MatchResult
|
||||
[SuppressMessage("ReSharper", "MemberCanBePrivate.Global")]
|
||||
struct MatchResult
|
||||
{
|
||||
[FieldOffset(0)] public PeriphMatchResult periph_result;
|
||||
[FieldOffset(0)] public DeviceMatchResult device_result;
|
||||
@@ -640,14 +682,16 @@ namespace DiscImageChef.Devices.FreeBSD
|
||||
}
|
||||
|
||||
[StructLayout(LayoutKind.Sequential)]
|
||||
[SuppressMessage("ReSharper", "MemberCanBePrivate.Global")] struct DevMatchResult
|
||||
[SuppressMessage("ReSharper", "MemberCanBePrivate.Global")]
|
||||
struct DevMatchResult
|
||||
{
|
||||
public DevMatchType type;
|
||||
public MatchResult result;
|
||||
}
|
||||
|
||||
[StructLayout(LayoutKind.Sequential)]
|
||||
[SuppressMessage("ReSharper", "MemberCanBePrivate.Global")] struct CcbDmCookie
|
||||
[SuppressMessage("ReSharper", "MemberCanBePrivate.Global")]
|
||||
struct CcbDmCookie
|
||||
{
|
||||
public IntPtr bus;
|
||||
public IntPtr target;
|
||||
@@ -657,7 +701,8 @@ namespace DiscImageChef.Devices.FreeBSD
|
||||
}
|
||||
|
||||
[StructLayout(LayoutKind.Sequential)]
|
||||
[SuppressMessage("ReSharper", "MemberCanBePrivate.Global")] struct CcbDevPosition
|
||||
[SuppressMessage("ReSharper", "MemberCanBePrivate.Global")]
|
||||
struct CcbDevPosition
|
||||
{
|
||||
[MarshalAs(UnmanagedType.ByValArray, SizeConst = 4)] public CamGenerations[] generations;
|
||||
DevPosType position_type;
|
||||
@@ -665,7 +710,8 @@ namespace DiscImageChef.Devices.FreeBSD
|
||||
}
|
||||
|
||||
[StructLayout(LayoutKind.Sequential)]
|
||||
[SuppressMessage("ReSharper", "MemberCanBePrivate.Global")] struct CcbDevMatch
|
||||
[SuppressMessage("ReSharper", "MemberCanBePrivate.Global")]
|
||||
struct CcbDevMatch
|
||||
{
|
||||
public CcbHdr ccb_h;
|
||||
CcbDevMatchStatus status;
|
||||
@@ -689,14 +735,14 @@ namespace DiscImageChef.Devices.FreeBSD
|
||||
}
|
||||
|
||||
[SuppressMessage("ReSharper", "MemberCanBePrivate.Global")]
|
||||
[SuppressMessage("ReSharper", "BuiltInTypeReferenceStyle")]
|
||||
struct CamDevice
|
||||
{
|
||||
const int MAXPATHLEN = 1024;
|
||||
const int DEV_IDLEN = 16;
|
||||
const int SIM_IDLEN = 16;
|
||||
/// <summary>
|
||||
/// Pathname of the device given by the user. This may be null if the user states the device name and unit number separately.
|
||||
/// Pathname of the device given by the user. This may be null if the user states the device name and unit number
|
||||
/// separately.
|
||||
/// </summary>
|
||||
[MarshalAs(UnmanagedType.ByValArray, SizeConst = MAXPATHLEN)] public byte[] DevicePath;
|
||||
/// <summary>
|
||||
@@ -774,7 +820,8 @@ namespace DiscImageChef.Devices.FreeBSD
|
||||
}
|
||||
|
||||
[StructLayout(LayoutKind.Sequential)]
|
||||
[SuppressMessage("ReSharper", "MemberCanBePrivate.Global")] struct CcbGetdev
|
||||
[SuppressMessage("ReSharper", "MemberCanBePrivate.Global")]
|
||||
struct CcbGetdev
|
||||
{
|
||||
public CcbHdr ccb_h;
|
||||
public CamProto protocol;
|
||||
|
||||
@@ -52,7 +52,10 @@ namespace DiscImageChef.Devices.Linux
|
||||
/// <param name="timeout">Timeout in seconds</param>
|
||||
/// <param name="direction">SCSI command transfer direction</param>
|
||||
/// <param name="duration">Time it took to execute the command in milliseconds</param>
|
||||
/// <param name="sense"><c>True</c> if SCSI error returned non-OK status and <paramref name="senseBuffer"/> contains SCSI sense</param>
|
||||
/// <param name="sense">
|
||||
/// <c>True</c> if SCSI error returned non-OK status and <paramref name="senseBuffer" /> contains SCSI
|
||||
/// sense
|
||||
/// </param>
|
||||
internal static int SendScsiCommand(int fd, byte[] cdb, ref byte[] buffer, out byte[] senseBuffer, uint timeout,
|
||||
ScsiIoctlDirection direction, out double duration, out bool sense)
|
||||
{
|
||||
|
||||
@@ -65,8 +65,8 @@ namespace DiscImageChef.Devices.Linux
|
||||
|
||||
if(hasUdev)
|
||||
{
|
||||
IntPtr udevDev = Extern.udev_device_new_from_subsystem_sysname(udev, "block",
|
||||
Path.GetFileName(sysdevs[i]));
|
||||
IntPtr udevDev =
|
||||
Extern.udev_device_new_from_subsystem_sysname(udev, "block", Path.GetFileName(sysdevs[i]));
|
||||
devices[i].Vendor = Extern.udev_device_get_property_value(udevDev, "ID_VENDOR");
|
||||
devices[i].Model = Extern.udev_device_get_property_value(udevDev, "ID_MODEL");
|
||||
if(!string.IsNullOrEmpty(devices[i].Model)) devices[i].Model = devices[i].Model.Replace('_', ' ');
|
||||
|
||||
@@ -90,16 +90,16 @@ namespace DiscImageChef.Devices.Linux
|
||||
public uint blksz;
|
||||
public uint blocks;
|
||||
/// <summary>
|
||||
/// Sleep at least <see cref="postsleep_min_us"/> useconds, and at most
|
||||
/// <see cref="postsleep_max_us"/> useconds *after* issuing command.Needed for
|
||||
/// Sleep at least <see cref="postsleep_min_us" /> useconds, and at most
|
||||
/// <see cref="postsleep_max_us" /> useconds *after* issuing command.Needed for
|
||||
/// some read commands for which cards have no other way of indicating
|
||||
/// they're ready for the next command (i.e. there is no equivalent of
|
||||
/// a "busy" indicator for read operations).
|
||||
/// </summary>
|
||||
public uint postsleep_min_us;
|
||||
/// <summary>
|
||||
/// Sleep at least <see cref="postsleep_min_us"/> useconds, and at most
|
||||
/// <see cref="postsleep_max_us"/> useconds *after* issuing command.Needed for
|
||||
/// Sleep at least <see cref="postsleep_min_us" /> useconds, and at most
|
||||
/// <see cref="postsleep_max_us" /> useconds *after* issuing command.Needed for
|
||||
/// some read commands for which cards have no other way of indicating
|
||||
/// they're ready for the next command (i.e. there is no equivalent of
|
||||
/// a "busy" indicator for read operations).
|
||||
@@ -114,7 +114,7 @@ namespace DiscImageChef.Devices.Linux
|
||||
/// </summary>
|
||||
public uint cmd_timeout_ms;
|
||||
/// <summary>
|
||||
/// For 64-bit machines <see cref="data_ptr"/> , wants to
|
||||
/// For 64-bit machines <see cref="data_ptr" /> , wants to
|
||||
/// be 8-byte aligned.Make sure this struct is the same size when
|
||||
/// built for 32-bit.
|
||||
/// </summary>
|
||||
|
||||
@@ -54,7 +54,10 @@ namespace DiscImageChef.Devices.Windows
|
||||
/// <param name="timeout">Timeout in seconds</param>
|
||||
/// <param name="direction">SCSI command transfer direction</param>
|
||||
/// <param name="duration">Time it took to execute the command in milliseconds</param>
|
||||
/// <param name="sense"><c>True</c> if SCSI error returned non-OK status and <paramref name="senseBuffer"/> contains SCSI sense</param>
|
||||
/// <param name="sense">
|
||||
/// <c>True</c> if SCSI error returned non-OK status and <paramref name="senseBuffer" /> contains SCSI
|
||||
/// sense
|
||||
/// </param>
|
||||
internal static int SendScsiCommand(SafeFileHandle fd, byte[] cdb, ref byte[] buffer, out byte[] senseBuffer,
|
||||
uint timeout, ScsiIoctlDirection direction, out double duration,
|
||||
out bool sense)
|
||||
@@ -157,13 +160,16 @@ namespace DiscImageChef.Devices.Windows
|
||||
dataBuffer = new byte[64 * 512]
|
||||
};
|
||||
|
||||
switch(protocol) {
|
||||
switch(protocol)
|
||||
{
|
||||
case AtaProtocol.PioIn:
|
||||
case AtaProtocol.UDmaIn:
|
||||
case AtaProtocol.Dma: aptdBuf.aptd.AtaFlags = AtaFlags.DataIn;
|
||||
case AtaProtocol.Dma:
|
||||
aptdBuf.aptd.AtaFlags = AtaFlags.DataIn;
|
||||
break;
|
||||
case AtaProtocol.PioOut:
|
||||
case AtaProtocol.UDmaOut: aptdBuf.aptd.AtaFlags = AtaFlags.DataOut;
|
||||
case AtaProtocol.UDmaOut:
|
||||
aptdBuf.aptd.AtaFlags = AtaFlags.DataOut;
|
||||
break;
|
||||
}
|
||||
|
||||
@@ -258,13 +264,16 @@ namespace DiscImageChef.Devices.Windows
|
||||
dataBuffer = new byte[64 * 512]
|
||||
};
|
||||
|
||||
switch(protocol) {
|
||||
switch(protocol)
|
||||
{
|
||||
case AtaProtocol.PioIn:
|
||||
case AtaProtocol.UDmaIn:
|
||||
case AtaProtocol.Dma: aptdBuf.aptd.AtaFlags = AtaFlags.DataIn;
|
||||
case AtaProtocol.Dma:
|
||||
aptdBuf.aptd.AtaFlags = AtaFlags.DataIn;
|
||||
break;
|
||||
case AtaProtocol.PioOut:
|
||||
case AtaProtocol.UDmaOut: aptdBuf.aptd.AtaFlags = AtaFlags.DataOut;
|
||||
case AtaProtocol.UDmaOut:
|
||||
aptdBuf.aptd.AtaFlags = AtaFlags.DataOut;
|
||||
break;
|
||||
}
|
||||
|
||||
@@ -367,13 +376,16 @@ namespace DiscImageChef.Devices.Windows
|
||||
dataBuffer = new byte[64 * 512]
|
||||
};
|
||||
|
||||
switch(protocol) {
|
||||
switch(protocol)
|
||||
{
|
||||
case AtaProtocol.PioIn:
|
||||
case AtaProtocol.UDmaIn:
|
||||
case AtaProtocol.Dma: aptdBuf.aptd.AtaFlags = AtaFlags.DataIn;
|
||||
case AtaProtocol.Dma:
|
||||
aptdBuf.aptd.AtaFlags = AtaFlags.DataIn;
|
||||
break;
|
||||
case AtaProtocol.PioOut:
|
||||
case AtaProtocol.UDmaOut: aptdBuf.aptd.AtaFlags = AtaFlags.DataOut;
|
||||
case AtaProtocol.UDmaOut:
|
||||
aptdBuf.aptd.AtaFlags = AtaFlags.DataOut;
|
||||
break;
|
||||
}
|
||||
|
||||
@@ -732,9 +744,8 @@ namespace DiscImageChef.Devices.Windows
|
||||
|
||||
int error = 0;
|
||||
DateTime start = DateTime.Now;
|
||||
sense = !Extern.DeviceIoControl(fd, WindowsIoctl.IoctlSffdiskDeviceCommand, commandB,
|
||||
(uint)commandB.Length, commandB, (uint)commandB.Length,
|
||||
out _, IntPtr.Zero);
|
||||
sense = !Extern.DeviceIoControl(fd, WindowsIoctl.IoctlSffdiskDeviceCommand, commandB, (uint)commandB.Length,
|
||||
commandB, (uint)commandB.Length, out _, IntPtr.Zero);
|
||||
DateTime end = DateTime.Now;
|
||||
|
||||
if(sense) error = Marshal.GetLastWin32Error();
|
||||
|
||||
@@ -53,7 +53,8 @@ namespace DiscImageChef.Devices.Windows
|
||||
StringBuilder result = new StringBuilder();
|
||||
const string HEXTABLE = "0123456789abcdef";
|
||||
|
||||
for(int i = 0; i < hex.Length / 2; i++) result.Append((char)(16 * HEXTABLE.IndexOf(hex[2 * i]) + HEXTABLE.IndexOf(hex[2 * i + 1])));
|
||||
for(int i = 0; i < hex.Length / 2; i++)
|
||||
result.Append((char)(16 * HEXTABLE.IndexOf(hex[2 * i]) + HEXTABLE.IndexOf(hex[2 * i + 1])));
|
||||
|
||||
return result.ToString();
|
||||
}
|
||||
@@ -159,12 +160,11 @@ namespace DiscImageChef.Devices.Windows
|
||||
if(descriptor.SerialNumberOffset > 0)
|
||||
{
|
||||
info.Serial =
|
||||
StringHandlers.CToString(descriptorB, Encoding.ASCII,
|
||||
start: descriptor.SerialNumberOffset);
|
||||
StringHandlers.CToString(descriptorB, Encoding.ASCII, start: descriptor.SerialNumberOffset);
|
||||
|
||||
// fix any serial numbers that are returned as hex-strings
|
||||
if(Array.TrueForAll(info.Serial.ToCharArray(), c => "0123456789abcdef".IndexOf(c) >= 0)
|
||||
&& info.Serial.Length == 40) info.Serial = HexStringToString(info.Serial).Trim();
|
||||
if(Array.TrueForAll(info.Serial.ToCharArray(), c => "0123456789abcdef".IndexOf(c) >= 0) &&
|
||||
info.Serial.Length == 40) info.Serial = HexStringToString(info.Serial).Trim();
|
||||
}
|
||||
|
||||
if(string.IsNullOrEmpty(info.Vendor) || info.Vendor == "ATA")
|
||||
|
||||
File diff suppressed because it is too large
Load Diff
@@ -47,6 +47,11 @@ namespace DiscImageChef.Devices.Windows
|
||||
/// </summary>
|
||||
static partial class Usb
|
||||
{
|
||||
const int IOCTL_STORAGE_GET_DEVICE_NUMBER = 0x2D1080;
|
||||
internal const string GuidDevinterfaceDisk = "53f56307-b6bf-11d0-94f2-00a0c91efb8b";
|
||||
internal const string GuidDevinterfaceCdrom = "53f56308-b6bf-11d0-94f2-00a0c91efb8b";
|
||||
internal const string GuidDevinterfaceFloppy = "53f56311-b6bf-11d0-94f2-00a0c91efb8b";
|
||||
|
||||
/// <summary>
|
||||
/// Get a list of all connected devices
|
||||
/// </summary>
|
||||
@@ -152,19 +157,6 @@ namespace DiscImageChef.Devices.Windows
|
||||
}
|
||||
}
|
||||
|
||||
const int IOCTL_STORAGE_GET_DEVICE_NUMBER = 0x2D1080;
|
||||
internal const string GuidDevinterfaceDisk = "53f56307-b6bf-11d0-94f2-00a0c91efb8b";
|
||||
internal const string GuidDevinterfaceCdrom = "53f56308-b6bf-11d0-94f2-00a0c91efb8b";
|
||||
internal const string GuidDevinterfaceFloppy = "53f56311-b6bf-11d0-94f2-00a0c91efb8b";
|
||||
|
||||
[StructLayout(LayoutKind.Sequential)]
|
||||
struct StorageDeviceNumber
|
||||
{
|
||||
internal int DeviceType;
|
||||
internal int DeviceNumber;
|
||||
internal int PartitionNumber;
|
||||
}
|
||||
|
||||
[DllImport("setupapi.dll")]
|
||||
static extern int CM_Get_Parent(out IntPtr pdnDevInst, IntPtr dnDevInst, int ulFlags);
|
||||
|
||||
@@ -267,7 +259,8 @@ namespace DiscImageChef.Devices.Windows
|
||||
}
|
||||
|
||||
// Did we find an InterfaceID of a USB device?
|
||||
if(instanceId?.StartsWith("USB\\", StringComparison.Ordinal) == true) foundDevice = FindDeviceByInstanceId(instanceId);
|
||||
if(instanceId?.StartsWith("USB\\", StringComparison.Ordinal) == true)
|
||||
foundDevice = FindDeviceByInstanceId(instanceId);
|
||||
return foundDevice;
|
||||
}
|
||||
|
||||
@@ -287,8 +280,7 @@ namespace DiscImageChef.Devices.Windows
|
||||
int nBytes = Marshal.SizeOf(sdn);
|
||||
IntPtr ptrSdn = Marshal.AllocHGlobal(nBytes);
|
||||
|
||||
if(DeviceIoControl(h, IOCTL_STORAGE_GET_DEVICE_NUMBER, IntPtr.Zero, 0, ptrSdn, nBytes, out _,
|
||||
IntPtr.Zero))
|
||||
if(DeviceIoControl(h, IOCTL_STORAGE_GET_DEVICE_NUMBER, IntPtr.Zero, 0, ptrSdn, nBytes, out _, IntPtr.Zero))
|
||||
{
|
||||
sdn = (StorageDeviceNumber)Marshal.PtrToStructure(ptrSdn, typeof(StorageDeviceNumber));
|
||||
// just my way of combining the relevant parts of the
|
||||
@@ -299,5 +291,13 @@ namespace DiscImageChef.Devices.Windows
|
||||
CloseHandle(h);
|
||||
return ans;
|
||||
}
|
||||
|
||||
[StructLayout(LayoutKind.Sequential)]
|
||||
struct StorageDeviceNumber
|
||||
{
|
||||
internal int DeviceType;
|
||||
internal int DeviceNumber;
|
||||
internal int PartitionNumber;
|
||||
}
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user