mirror of
https://github.com/aaru-dps/Aaru.Server.git
synced 2025-12-16 19:24:27 +00:00
REFACTOR: Convert variables to auto setters.
This commit is contained in:
@@ -75,9 +75,9 @@ namespace DiscImageChef.Devices
|
||||
cdb[3] = (byte)(lba & 0xFF);
|
||||
if(drive1) cdb[1] += 0x20;
|
||||
|
||||
lastError = SendScsiCommand(cdb, ref buffer, out senseBuffer, timeout, ScsiDirection.In, out duration,
|
||||
LastError = SendScsiCommand(cdb, ref buffer, out senseBuffer, timeout, ScsiDirection.In, out duration,
|
||||
out sense);
|
||||
error = lastError != 0;
|
||||
Error = LastError != 0;
|
||||
|
||||
DicConsole.DebugWriteLine("SCSI Device", "ADAPTEC TRANSLATE took {0} ms.", duration);
|
||||
|
||||
@@ -119,9 +119,9 @@ namespace DiscImageChef.Devices
|
||||
if(drive1) cdb[1] += 0x20;
|
||||
cdb[4] = 1;
|
||||
|
||||
lastError = SendScsiCommand(cdb, ref buffer, out senseBuffer, timeout, ScsiDirection.Out, out duration,
|
||||
LastError = SendScsiCommand(cdb, ref buffer, out senseBuffer, timeout, ScsiDirection.Out, out duration,
|
||||
out sense);
|
||||
error = lastError != 0;
|
||||
Error = LastError != 0;
|
||||
|
||||
DicConsole.DebugWriteLine("SCSI Device", "ADAPTEC SET ERROR THRESHOLD took {0} ms.", duration);
|
||||
|
||||
@@ -161,9 +161,9 @@ namespace DiscImageChef.Devices
|
||||
if(drive1) cdb[1] += 0x20;
|
||||
cdb[4] = (byte)buffer.Length;
|
||||
|
||||
lastError = SendScsiCommand(cdb, ref buffer, out senseBuffer, timeout, ScsiDirection.In, out duration,
|
||||
LastError = SendScsiCommand(cdb, ref buffer, out senseBuffer, timeout, ScsiDirection.In, out duration,
|
||||
out sense);
|
||||
error = lastError != 0;
|
||||
Error = LastError != 0;
|
||||
|
||||
DicConsole.DebugWriteLine("SCSI Device", "ADAPTEC READ/RESET USAGE COUNTER took {0} ms.", duration);
|
||||
|
||||
@@ -189,9 +189,9 @@ namespace DiscImageChef.Devices
|
||||
|
||||
cdb[0] = (byte)ScsiCommands.AdaptecWriteBuffer;
|
||||
|
||||
lastError = SendScsiCommand(cdb, ref oneKBuffer, out senseBuffer, timeout, ScsiDirection.Out, out duration,
|
||||
LastError = SendScsiCommand(cdb, ref oneKBuffer, out senseBuffer, timeout, ScsiDirection.Out, out duration,
|
||||
out sense);
|
||||
error = lastError != 0;
|
||||
Error = LastError != 0;
|
||||
|
||||
DicConsole.DebugWriteLine("SCSI Device", "ADAPTEC WRITE DATA BUFFER took {0} ms.", duration);
|
||||
|
||||
@@ -214,9 +214,9 @@ namespace DiscImageChef.Devices
|
||||
|
||||
cdb[0] = (byte)ScsiCommands.AdaptecReadBuffer;
|
||||
|
||||
lastError = SendScsiCommand(cdb, ref buffer, out senseBuffer, timeout, ScsiDirection.In, out duration,
|
||||
LastError = SendScsiCommand(cdb, ref buffer, out senseBuffer, timeout, ScsiDirection.In, out duration,
|
||||
out sense);
|
||||
error = lastError != 0;
|
||||
Error = LastError != 0;
|
||||
|
||||
DicConsole.DebugWriteLine("SCSI Device", "ADAPTEC READ DATA BUFFER took {0} ms.", duration);
|
||||
|
||||
|
||||
@@ -57,9 +57,9 @@ namespace DiscImageChef.Devices
|
||||
cdb[3] = (byte)(lba & 0xFF);
|
||||
cdb[4] = 3;
|
||||
|
||||
lastError = SendScsiCommand(cdb, ref buffer, out senseBuffer, timeout, ScsiDirection.In, out duration,
|
||||
LastError = SendScsiCommand(cdb, ref buffer, out senseBuffer, timeout, ScsiDirection.In, out duration,
|
||||
out sense);
|
||||
error = lastError != 0;
|
||||
Error = LastError != 0;
|
||||
|
||||
DicConsole.DebugWriteLine("SCSI Device", "ARCHIVE CORP. REQUEST BLOCK ADDRESS took {0} ms.", duration);
|
||||
|
||||
@@ -100,9 +100,9 @@ namespace DiscImageChef.Devices
|
||||
cdb[3] = (byte)(lba & 0xFF);
|
||||
if(immediate) cdb[1] += 0x01;
|
||||
|
||||
lastError = SendScsiCommand(cdb, ref buffer, out senseBuffer, timeout, ScsiDirection.None, out duration,
|
||||
LastError = SendScsiCommand(cdb, ref buffer, out senseBuffer, timeout, ScsiDirection.None, out duration,
|
||||
out sense);
|
||||
error = lastError != 0;
|
||||
Error = LastError != 0;
|
||||
|
||||
DicConsole.DebugWriteLine("SCSI Device", "ARCHIVE CORP. SEEK BLOCK took {0} ms.", duration);
|
||||
|
||||
|
||||
@@ -75,9 +75,9 @@ namespace DiscImageChef.Devices
|
||||
cdb[0] = (byte)ScsiCommands.CertanceParkUnpark;
|
||||
if(park) cdb[4] = 1;
|
||||
|
||||
lastError = SendScsiCommand(cdb, ref buffer, out senseBuffer, timeout, ScsiDirection.None, out duration,
|
||||
LastError = SendScsiCommand(cdb, ref buffer, out senseBuffer, timeout, ScsiDirection.None, out duration,
|
||||
out sense);
|
||||
error = lastError != 0;
|
||||
Error = LastError != 0;
|
||||
|
||||
DicConsole.DebugWriteLine("SCSI Device", "CERTANCE PARK UNPARK took {0} ms.", duration);
|
||||
|
||||
|
||||
@@ -97,9 +97,9 @@ namespace DiscImageChef.Devices
|
||||
cdb[0] = (byte)ScsiCommands.FujitsuDisplay;
|
||||
cdb[6] = (byte)buffer.Length;
|
||||
|
||||
lastError = SendScsiCommand(cdb, ref buffer, out senseBuffer, timeout, ScsiDirection.Out, out duration,
|
||||
LastError = SendScsiCommand(cdb, ref buffer, out senseBuffer, timeout, ScsiDirection.Out, out duration,
|
||||
out sense);
|
||||
error = lastError != 0;
|
||||
Error = LastError != 0;
|
||||
|
||||
DicConsole.DebugWriteLine("SCSI Device", "FUJITSU DISPLAY took {0} ms.", duration);
|
||||
|
||||
|
||||
@@ -66,9 +66,9 @@ namespace DiscImageChef.Devices
|
||||
cdb[10] = (byte)((buffer.Length & 0xFF00) >> 8);
|
||||
cdb[11] = (byte)(buffer.Length & 0xFF);
|
||||
|
||||
lastError = SendScsiCommand(cdb, ref buffer, out senseBuffer, timeout, ScsiDirection.In, out duration,
|
||||
LastError = SendScsiCommand(cdb, ref buffer, out senseBuffer, timeout, ScsiDirection.In, out duration,
|
||||
out sense);
|
||||
error = lastError != 0;
|
||||
Error = LastError != 0;
|
||||
|
||||
DicConsole.DebugWriteLine("SCSI Device", "HL-DT-ST READ DVD (RAW) took {0} ms.", duration);
|
||||
|
||||
|
||||
@@ -91,9 +91,9 @@ namespace DiscImageChef.Devices
|
||||
if(sectorCount) buffer = new byte[blockBytes * transferLen];
|
||||
else buffer = new byte[transferLen];
|
||||
|
||||
lastError = SendScsiCommand(cdb, ref buffer, out senseBuffer, timeout, ScsiDirection.In, out duration,
|
||||
LastError = SendScsiCommand(cdb, ref buffer, out senseBuffer, timeout, ScsiDirection.In, out duration,
|
||||
out sense);
|
||||
error = lastError != 0;
|
||||
Error = LastError != 0;
|
||||
|
||||
DicConsole.DebugWriteLine("SCSI Device", "HP READ LONG took {0} ms.", duration);
|
||||
|
||||
|
||||
@@ -56,9 +56,9 @@ namespace DiscImageChef.Devices
|
||||
cdb[2] = 0x01;
|
||||
cdb[3] = 0x01;
|
||||
|
||||
lastError = SendScsiCommand(cdb, ref buffer, out senseBuffer, timeout, ScsiDirection.None, out duration,
|
||||
LastError = SendScsiCommand(cdb, ref buffer, out senseBuffer, timeout, ScsiDirection.None, out duration,
|
||||
out sense);
|
||||
error = lastError != 0;
|
||||
Error = LastError != 0;
|
||||
|
||||
DicConsole.DebugWriteLine("SCSI Device", "KREON DEPRECATED UNLOCK took {0} ms.", duration);
|
||||
|
||||
@@ -122,9 +122,9 @@ namespace DiscImageChef.Devices
|
||||
cdb[3] = 0x11;
|
||||
cdb[4] = (byte)state;
|
||||
|
||||
lastError = SendScsiCommand(cdb, ref buffer, out senseBuffer, timeout, ScsiDirection.None, out duration,
|
||||
LastError = SendScsiCommand(cdb, ref buffer, out senseBuffer, timeout, ScsiDirection.None, out duration,
|
||||
out sense);
|
||||
error = lastError != 0;
|
||||
Error = LastError != 0;
|
||||
|
||||
DicConsole.DebugWriteLine("SCSI Device", "KREON SET LOCK STATE took {0} ms.", duration);
|
||||
|
||||
@@ -153,9 +153,9 @@ namespace DiscImageChef.Devices
|
||||
cdb[2] = 0x01;
|
||||
cdb[3] = 0x10;
|
||||
|
||||
lastError = SendScsiCommand(cdb, ref buffer, out senseBuffer, timeout, ScsiDirection.In, out duration,
|
||||
LastError = SendScsiCommand(cdb, ref buffer, out senseBuffer, timeout, ScsiDirection.In, out duration,
|
||||
out sense);
|
||||
error = lastError != 0;
|
||||
Error = LastError != 0;
|
||||
|
||||
DicConsole.DebugWriteLine("SCSI Device", "KREON GET FEATURE LIST took {0} ms.", duration);
|
||||
|
||||
@@ -236,9 +236,9 @@ namespace DiscImageChef.Devices
|
||||
cdb[10] = requestNumber;
|
||||
cdb[11] = 0xC0;
|
||||
|
||||
lastError = SendScsiCommand(cdb, ref buffer, out senseBuffer, timeout, ScsiDirection.In, out duration,
|
||||
LastError = SendScsiCommand(cdb, ref buffer, out senseBuffer, timeout, ScsiDirection.In, out duration,
|
||||
out sense);
|
||||
error = lastError != 0;
|
||||
Error = LastError != 0;
|
||||
|
||||
DicConsole.DebugWriteLine("SCSI Device", "KREON EXTRACT SS took {0} ms.", duration);
|
||||
|
||||
|
||||
@@ -93,9 +93,9 @@ namespace DiscImageChef.Devices
|
||||
cdb[8] = (byte)(buffer.Length & 0xFF);
|
||||
cdb[9] = 0;
|
||||
|
||||
lastError = SendScsiCommand(cdb, ref buffer, out senseBuffer, timeout, ScsiDirection.In, out duration,
|
||||
LastError = SendScsiCommand(cdb, ref buffer, out senseBuffer, timeout, ScsiDirection.In, out duration,
|
||||
out sense);
|
||||
error = lastError != 0;
|
||||
Error = LastError != 0;
|
||||
|
||||
if(sense) return true;
|
||||
|
||||
@@ -107,9 +107,9 @@ namespace DiscImageChef.Devices
|
||||
cdb[8] = (byte)(buffer.Length & 0xFF);
|
||||
senseBuffer = new byte[32];
|
||||
|
||||
lastError = SendScsiCommand(cdb, ref buffer, out senseBuffer, timeout, ScsiDirection.In, out duration,
|
||||
LastError = SendScsiCommand(cdb, ref buffer, out senseBuffer, timeout, ScsiDirection.In, out duration,
|
||||
out sense);
|
||||
error = lastError != 0;
|
||||
Error = LastError != 0;
|
||||
|
||||
DicConsole.DebugWriteLine("SCSI Device", "GET CONFIGURATION took {0} ms.", duration);
|
||||
|
||||
@@ -150,9 +150,9 @@ namespace DiscImageChef.Devices
|
||||
cdb[9] = (byte)(buffer.Length & 0xFF);
|
||||
cdb[10] = (byte)((agid & 0x03) << 6);
|
||||
|
||||
lastError = SendScsiCommand(cdb, ref buffer, out senseBuffer, timeout, ScsiDirection.In, out duration,
|
||||
LastError = SendScsiCommand(cdb, ref buffer, out senseBuffer, timeout, ScsiDirection.In, out duration,
|
||||
out sense);
|
||||
error = lastError != 0;
|
||||
Error = LastError != 0;
|
||||
|
||||
if(sense) return true;
|
||||
|
||||
@@ -164,9 +164,9 @@ namespace DiscImageChef.Devices
|
||||
cdb[9] = (byte)(buffer.Length & 0xFF);
|
||||
senseBuffer = new byte[32];
|
||||
|
||||
lastError = SendScsiCommand(cdb, ref buffer, out senseBuffer, timeout, ScsiDirection.In, out duration,
|
||||
LastError = SendScsiCommand(cdb, ref buffer, out senseBuffer, timeout, ScsiDirection.In, out duration,
|
||||
out sense);
|
||||
error = lastError != 0;
|
||||
Error = LastError != 0;
|
||||
|
||||
DicConsole.DebugWriteLine("SCSI Device", "READ DISC STRUCTURE took {0} ms.", duration);
|
||||
|
||||
@@ -314,9 +314,9 @@ namespace DiscImageChef.Devices
|
||||
cdb[7] = (byte)((tmpBuffer.Length & 0xFF00) >> 8);
|
||||
cdb[8] = (byte)(tmpBuffer.Length & 0xFF);
|
||||
|
||||
lastError = SendScsiCommand(cdb, ref tmpBuffer, out senseBuffer, timeout, ScsiDirection.In, out duration,
|
||||
LastError = SendScsiCommand(cdb, ref tmpBuffer, out senseBuffer, timeout, ScsiDirection.In, out duration,
|
||||
out sense);
|
||||
error = lastError != 0;
|
||||
Error = LastError != 0;
|
||||
|
||||
#pragma warning disable IDE0004 // Cast is necessary or an invalid bitshift happens
|
||||
uint strctLength = (uint)(((int)tmpBuffer[0] << 8) + tmpBuffer[1] + 2);
|
||||
@@ -332,9 +332,9 @@ namespace DiscImageChef.Devices
|
||||
|
||||
double tmpDuration = duration;
|
||||
|
||||
lastError = SendScsiCommand(cdb, ref buffer, out senseBuffer, timeout, ScsiDirection.In, out duration,
|
||||
LastError = SendScsiCommand(cdb, ref buffer, out senseBuffer, timeout, ScsiDirection.In, out duration,
|
||||
out sense);
|
||||
error = lastError != 0;
|
||||
Error = LastError != 0;
|
||||
|
||||
duration += tmpDuration;
|
||||
DicConsole.DebugWriteLine("SCSI Device", "READ TOC/PMA/ATIP took {0} ms.", duration);
|
||||
@@ -377,9 +377,9 @@ namespace DiscImageChef.Devices
|
||||
cdb[7] = (byte)((tmpBuffer.Length & 0xFF00) >> 8);
|
||||
cdb[8] = (byte)(tmpBuffer.Length & 0xFF);
|
||||
|
||||
lastError = SendScsiCommand(cdb, ref tmpBuffer, out senseBuffer, timeout, ScsiDirection.In, out duration,
|
||||
LastError = SendScsiCommand(cdb, ref tmpBuffer, out senseBuffer, timeout, ScsiDirection.In, out duration,
|
||||
out sense);
|
||||
error = lastError != 0;
|
||||
Error = LastError != 0;
|
||||
|
||||
#pragma warning disable IDE0004 // Cast is necessary or an invalid bitshift happens
|
||||
uint strctLength = (uint)(((int)tmpBuffer[0] << 8) + tmpBuffer[1] + 2);
|
||||
@@ -441,9 +441,9 @@ namespace DiscImageChef.Devices
|
||||
|
||||
buffer = new byte[blockSize * transferLength];
|
||||
|
||||
lastError = SendScsiCommand(cdb, ref buffer, out senseBuffer, timeout, ScsiDirection.In, out duration,
|
||||
LastError = SendScsiCommand(cdb, ref buffer, out senseBuffer, timeout, ScsiDirection.In, out duration,
|
||||
out sense);
|
||||
error = lastError != 0;
|
||||
Error = LastError != 0;
|
||||
|
||||
DicConsole.DebugWriteLine("SCSI Device", "READ CD took {0} ms.", duration);
|
||||
|
||||
@@ -498,9 +498,9 @@ namespace DiscImageChef.Devices
|
||||
|
||||
buffer = new byte[blockSize * transferLength];
|
||||
|
||||
lastError = SendScsiCommand(cdb, ref buffer, out senseBuffer, timeout, ScsiDirection.In, out duration,
|
||||
LastError = SendScsiCommand(cdb, ref buffer, out senseBuffer, timeout, ScsiDirection.In, out duration,
|
||||
out sense);
|
||||
error = lastError != 0;
|
||||
Error = LastError != 0;
|
||||
|
||||
DicConsole.DebugWriteLine("SCSI Device", "READ CD MSF took {0} ms.", duration);
|
||||
|
||||
@@ -529,9 +529,9 @@ namespace DiscImageChef.Devices
|
||||
if(prevent) cdb[4] += 0x01;
|
||||
if(persistent) cdb[4] += 0x02;
|
||||
|
||||
lastError = SendScsiCommand(cdb, ref buffer, out senseBuffer, timeout, ScsiDirection.None, out duration,
|
||||
LastError = SendScsiCommand(cdb, ref buffer, out senseBuffer, timeout, ScsiDirection.None, out duration,
|
||||
out sense);
|
||||
error = lastError != 0;
|
||||
Error = LastError != 0;
|
||||
|
||||
DicConsole.DebugWriteLine("SCSI Device", "PREVENT ALLOW MEDIUM REMOVAL took {0} ms.", duration);
|
||||
|
||||
@@ -580,9 +580,9 @@ namespace DiscImageChef.Devices
|
||||
}
|
||||
cdb[4] += (byte)((powerConditions & 0x0F) << 4);
|
||||
|
||||
lastError = SendScsiCommand(cdb, ref buffer, out senseBuffer, timeout, ScsiDirection.None, out duration,
|
||||
LastError = SendScsiCommand(cdb, ref buffer, out senseBuffer, timeout, ScsiDirection.None, out duration,
|
||||
out sense);
|
||||
error = lastError != 0;
|
||||
Error = LastError != 0;
|
||||
|
||||
DicConsole.DebugWriteLine("SCSI Device", "START STOP UNIT took {0} ms.", duration);
|
||||
|
||||
|
||||
@@ -63,9 +63,9 @@ namespace DiscImageChef.Devices
|
||||
|
||||
buffer = new byte[2352 * transferLength];
|
||||
|
||||
lastError = SendScsiCommand(cdb, ref buffer, out senseBuffer, timeout, ScsiDirection.In, out duration,
|
||||
LastError = SendScsiCommand(cdb, ref buffer, out senseBuffer, timeout, ScsiDirection.In, out duration,
|
||||
out sense);
|
||||
error = lastError != 0;
|
||||
Error = LastError != 0;
|
||||
|
||||
DicConsole.DebugWriteLine("SCSI Device", "READ CD-DA took {0} ms.", duration);
|
||||
|
||||
|
||||
@@ -68,9 +68,9 @@ namespace DiscImageChef.Devices
|
||||
|
||||
buffer = new byte[blockSize * transferLength];
|
||||
|
||||
lastError = SendScsiCommand(cdb, ref buffer, out senseBuffer, timeout, ScsiDirection.In, out duration,
|
||||
LastError = SendScsiCommand(cdb, ref buffer, out senseBuffer, timeout, ScsiDirection.In, out duration,
|
||||
out sense);
|
||||
error = lastError != 0;
|
||||
Error = LastError != 0;
|
||||
|
||||
DicConsole.DebugWriteLine("SCSI Device", "PIONEER READ CD-DA took {0} ms.", duration);
|
||||
|
||||
@@ -108,9 +108,9 @@ namespace DiscImageChef.Devices
|
||||
uint transferLength = (uint)((cdb[7] - cdb[3]) * 60 * 75 + (cdb[8] - cdb[4]) * 75 + (cdb[9] - cdb[5]));
|
||||
buffer = new byte[blockSize * transferLength];
|
||||
|
||||
lastError = SendScsiCommand(cdb, ref buffer, out senseBuffer, timeout, ScsiDirection.In, out duration,
|
||||
LastError = SendScsiCommand(cdb, ref buffer, out senseBuffer, timeout, ScsiDirection.In, out duration,
|
||||
out sense);
|
||||
error = lastError != 0;
|
||||
Error = LastError != 0;
|
||||
|
||||
DicConsole.DebugWriteLine("SCSI Device", "PIONEER READ CD-DA MSF took {0} ms.", duration);
|
||||
|
||||
@@ -161,9 +161,9 @@ namespace DiscImageChef.Devices
|
||||
cdb[6] = 0x00;
|
||||
}
|
||||
|
||||
lastError = SendScsiCommand(cdb, ref buffer, out senseBuffer, timeout, ScsiDirection.In, out duration,
|
||||
LastError = SendScsiCommand(cdb, ref buffer, out senseBuffer, timeout, ScsiDirection.In, out duration,
|
||||
out sense);
|
||||
error = lastError != 0;
|
||||
Error = LastError != 0;
|
||||
|
||||
DicConsole.DebugWriteLine("SCSI Device", "PIONEER READ CD-XA took {0} ms.", duration);
|
||||
|
||||
|
||||
@@ -103,9 +103,9 @@ namespace DiscImageChef.Devices
|
||||
|
||||
buffer = new byte[8];
|
||||
|
||||
lastError = SendScsiCommand(cdb, ref buffer, out senseBuffer, timeout, ScsiDirection.In, out duration,
|
||||
LastError = SendScsiCommand(cdb, ref buffer, out senseBuffer, timeout, ScsiDirection.In, out duration,
|
||||
out sense);
|
||||
error = lastError != 0;
|
||||
Error = LastError != 0;
|
||||
|
||||
DicConsole.DebugWriteLine("SCSI Device", "PLASMON READ SECTOR LOCATION took {0} ms.", duration);
|
||||
|
||||
|
||||
@@ -70,9 +70,9 @@ namespace DiscImageChef.Devices
|
||||
|
||||
buffer = new byte[blockSize * transferLength];
|
||||
|
||||
lastError = SendScsiCommand(cdb, ref buffer, out senseBuffer, timeout, ScsiDirection.In, out duration,
|
||||
LastError = SendScsiCommand(cdb, ref buffer, out senseBuffer, timeout, ScsiDirection.In, out duration,
|
||||
out sense);
|
||||
error = lastError != 0;
|
||||
Error = LastError != 0;
|
||||
|
||||
DicConsole.DebugWriteLine("SCSI Device", "READ CD-DA took {0} ms.", duration);
|
||||
|
||||
@@ -106,9 +106,9 @@ namespace DiscImageChef.Devices
|
||||
cdb[4] = (byte)((buffer.Length & 0xFF00) >> 8);
|
||||
cdb[5] = (byte)(buffer.Length & 0xFF);
|
||||
|
||||
lastError = SendScsiCommand(cdb, ref buffer, out senseBuffer, timeout, ScsiDirection.In, out duration,
|
||||
LastError = SendScsiCommand(cdb, ref buffer, out senseBuffer, timeout, ScsiDirection.In, out duration,
|
||||
out sense);
|
||||
error = lastError != 0;
|
||||
Error = LastError != 0;
|
||||
|
||||
DicConsole.DebugWriteLine("SCSI Device", "Plextor READ DVD (RAW) took {0} ms.", duration);
|
||||
|
||||
@@ -133,9 +133,9 @@ namespace DiscImageChef.Devices
|
||||
cdb[0] = (byte)ScsiCommands.PlextorReadEeprom;
|
||||
cdb[8] = 1;
|
||||
|
||||
lastError = SendScsiCommand(cdb, ref buffer, out senseBuffer, timeout, ScsiDirection.In, out duration,
|
||||
LastError = SendScsiCommand(cdb, ref buffer, out senseBuffer, timeout, ScsiDirection.In, out duration,
|
||||
out sense);
|
||||
error = lastError != 0;
|
||||
Error = LastError != 0;
|
||||
|
||||
DicConsole.DebugWriteLine("SCSI Device", "PLEXTOR READ EEPROM took {0} ms.", duration);
|
||||
|
||||
@@ -160,9 +160,9 @@ namespace DiscImageChef.Devices
|
||||
cdb[0] = (byte)ScsiCommands.PlextorReadEeprom;
|
||||
cdb[8] = 2;
|
||||
|
||||
lastError = SendScsiCommand(cdb, ref buffer, out senseBuffer, timeout, ScsiDirection.In, out duration,
|
||||
LastError = SendScsiCommand(cdb, ref buffer, out senseBuffer, timeout, ScsiDirection.In, out duration,
|
||||
out sense);
|
||||
error = lastError != 0;
|
||||
Error = LastError != 0;
|
||||
|
||||
DicConsole.DebugWriteLine("SCSI Device", "PLEXTOR READ EEPROM took {0} ms.", duration);
|
||||
|
||||
@@ -193,9 +193,9 @@ namespace DiscImageChef.Devices
|
||||
cdb[8] = (byte)((blockSize & 0xFF00) >> 8);
|
||||
cdb[9] = (byte)(blockSize & 0xFF);
|
||||
|
||||
lastError = SendScsiCommand(cdb, ref buffer, out senseBuffer, timeout, ScsiDirection.In, out duration,
|
||||
LastError = SendScsiCommand(cdb, ref buffer, out senseBuffer, timeout, ScsiDirection.In, out duration,
|
||||
out sense);
|
||||
error = lastError != 0;
|
||||
Error = LastError != 0;
|
||||
|
||||
DicConsole.DebugWriteLine("SCSI Device", "PLEXTOR READ EEPROM took {0} ms.", duration);
|
||||
|
||||
@@ -227,13 +227,13 @@ namespace DiscImageChef.Devices
|
||||
cdb[0] = (byte)ScsiCommands.PlextorPoweRec;
|
||||
cdb[9] = (byte)buf.Length;
|
||||
|
||||
lastError = SendScsiCommand(cdb, ref buf, out senseBuffer, timeout, ScsiDirection.In, out duration,
|
||||
LastError = SendScsiCommand(cdb, ref buf, out senseBuffer, timeout, ScsiDirection.In, out duration,
|
||||
out sense);
|
||||
error = lastError != 0;
|
||||
Error = LastError != 0;
|
||||
|
||||
DicConsole.DebugWriteLine("SCSI Device", "PLEXTOR POWEREC GET SPEEDS took {0} ms.", duration);
|
||||
|
||||
if(sense || error) return sense;
|
||||
if(sense || Error) return sense;
|
||||
|
||||
BigEndianBitConverter.IsLittleEndian = BitConverter.IsLittleEndian;
|
||||
selected = BigEndianBitConverter.ToUInt16(buf, 4);
|
||||
@@ -267,13 +267,13 @@ namespace DiscImageChef.Devices
|
||||
cdb[1] = (byte)PlextorSubCommands.GetMode;
|
||||
cdb[9] = (byte)buf.Length;
|
||||
|
||||
lastError = SendScsiCommand(cdb, ref buf, out senseBuffer, timeout, ScsiDirection.In, out duration,
|
||||
LastError = SendScsiCommand(cdb, ref buf, out senseBuffer, timeout, ScsiDirection.In, out duration,
|
||||
out sense);
|
||||
error = lastError != 0;
|
||||
Error = LastError != 0;
|
||||
|
||||
DicConsole.DebugWriteLine("SCSI Device", "PLEXTOR POWEREC GET SPEEDS took {0} ms.", duration);
|
||||
|
||||
if(sense || error) return sense;
|
||||
if(sense || Error) return sense;
|
||||
|
||||
BigEndianBitConverter.IsLittleEndian = BitConverter.IsLittleEndian;
|
||||
enabled = buf[2] != 0;
|
||||
@@ -303,9 +303,9 @@ namespace DiscImageChef.Devices
|
||||
cdb[3] = 4;
|
||||
cdb[10] = (byte)buffer.Length;
|
||||
|
||||
lastError = SendScsiCommand(cdb, ref buffer, out senseBuffer, timeout, ScsiDirection.In, out duration,
|
||||
LastError = SendScsiCommand(cdb, ref buffer, out senseBuffer, timeout, ScsiDirection.In, out duration,
|
||||
out sense);
|
||||
error = lastError != 0;
|
||||
Error = LastError != 0;
|
||||
|
||||
DicConsole.DebugWriteLine("SCSI Device", "PLEXTOR GET SILENT MODE took {0} ms.", duration);
|
||||
|
||||
@@ -332,9 +332,9 @@ namespace DiscImageChef.Devices
|
||||
cdb[2] = (byte)PlextorSubCommands.GigaRec;
|
||||
cdb[10] = (byte)buffer.Length;
|
||||
|
||||
lastError = SendScsiCommand(cdb, ref buffer, out senseBuffer, timeout, ScsiDirection.In, out duration,
|
||||
LastError = SendScsiCommand(cdb, ref buffer, out senseBuffer, timeout, ScsiDirection.In, out duration,
|
||||
out sense);
|
||||
error = lastError != 0;
|
||||
Error = LastError != 0;
|
||||
|
||||
DicConsole.DebugWriteLine("SCSI Device", "PLEXTOR GET GIGAREC took {0} ms.", duration);
|
||||
|
||||
@@ -365,9 +365,9 @@ namespace DiscImageChef.Devices
|
||||
if(dvd) cdb[3] = 0x12;
|
||||
else cdb[3] = 0x02;
|
||||
|
||||
lastError = SendScsiCommand(cdb, ref buffer, out senseBuffer, timeout, ScsiDirection.In, out duration,
|
||||
LastError = SendScsiCommand(cdb, ref buffer, out senseBuffer, timeout, ScsiDirection.In, out duration,
|
||||
out sense);
|
||||
error = lastError != 0;
|
||||
Error = LastError != 0;
|
||||
|
||||
DicConsole.DebugWriteLine("SCSI Device", "PLEXTOR GET VARIREC took {0} ms.", duration);
|
||||
|
||||
@@ -393,9 +393,9 @@ namespace DiscImageChef.Devices
|
||||
cdb[2] = (byte)PlextorSubCommands.SecuRec;
|
||||
cdb[10] = (byte)buffer.Length;
|
||||
|
||||
lastError = SendScsiCommand(cdb, ref buffer, out senseBuffer, timeout, ScsiDirection.In, out duration,
|
||||
LastError = SendScsiCommand(cdb, ref buffer, out senseBuffer, timeout, ScsiDirection.In, out duration,
|
||||
out sense);
|
||||
error = lastError != 0;
|
||||
Error = LastError != 0;
|
||||
|
||||
DicConsole.DebugWriteLine("SCSI Device", "PLEXTOR GET SECUREC took {0} ms.", duration);
|
||||
|
||||
@@ -422,9 +422,9 @@ namespace DiscImageChef.Devices
|
||||
cdb[2] = (byte)PlextorSubCommands.SpeedRead;
|
||||
cdb[10] = (byte)buffer.Length;
|
||||
|
||||
lastError = SendScsiCommand(cdb, ref buffer, out senseBuffer, timeout, ScsiDirection.In, out duration,
|
||||
LastError = SendScsiCommand(cdb, ref buffer, out senseBuffer, timeout, ScsiDirection.In, out duration,
|
||||
out sense);
|
||||
error = lastError != 0;
|
||||
Error = LastError != 0;
|
||||
|
||||
DicConsole.DebugWriteLine("SCSI Device", "PLEXTOR GET SPEEDREAD took {0} ms.", duration);
|
||||
|
||||
@@ -451,9 +451,9 @@ namespace DiscImageChef.Devices
|
||||
cdb[2] = (byte)PlextorSubCommands.SessionHide;
|
||||
cdb[9] = (byte)buffer.Length;
|
||||
|
||||
lastError = SendScsiCommand(cdb, ref buffer, out senseBuffer, timeout, ScsiDirection.In, out duration,
|
||||
LastError = SendScsiCommand(cdb, ref buffer, out senseBuffer, timeout, ScsiDirection.In, out duration,
|
||||
out sense);
|
||||
error = lastError != 0;
|
||||
Error = LastError != 0;
|
||||
|
||||
DicConsole.DebugWriteLine("SCSI Device", "PLEXTOR GET SINGLE-SESSION / HIDE CD-R took {0} ms.", duration);
|
||||
|
||||
@@ -484,9 +484,9 @@ namespace DiscImageChef.Devices
|
||||
if(dualLayer) cdb[3] = (byte)PlextorSubCommands.BitSetRdl;
|
||||
else cdb[3] = (byte)PlextorSubCommands.BitSetR;
|
||||
|
||||
lastError = SendScsiCommand(cdb, ref buffer, out senseBuffer, timeout, ScsiDirection.In, out duration,
|
||||
LastError = SendScsiCommand(cdb, ref buffer, out senseBuffer, timeout, ScsiDirection.In, out duration,
|
||||
out sense);
|
||||
error = lastError != 0;
|
||||
Error = LastError != 0;
|
||||
|
||||
DicConsole.DebugWriteLine("SCSI Device", "PLEXTOR GET BOOK BITSETTING took {0} ms.", duration);
|
||||
|
||||
@@ -514,9 +514,9 @@ namespace DiscImageChef.Devices
|
||||
cdb[2] = (byte)PlextorSubCommands.TestWriteDvdPlus;
|
||||
cdb[10] = (byte)buffer.Length;
|
||||
|
||||
lastError = SendScsiCommand(cdb, ref buffer, out senseBuffer, timeout, ScsiDirection.In, out duration,
|
||||
LastError = SendScsiCommand(cdb, ref buffer, out senseBuffer, timeout, ScsiDirection.In, out duration,
|
||||
out sense);
|
||||
error = lastError != 0;
|
||||
Error = LastError != 0;
|
||||
|
||||
DicConsole.DebugWriteLine("SCSI Device", "PLEXTOR GET TEST WRITE DVD+ took {0} ms.", duration);
|
||||
|
||||
|
||||
@@ -80,9 +80,9 @@ namespace DiscImageChef.Devices
|
||||
if(transferLength == 0) buffer = new byte[256 * blockSize];
|
||||
else buffer = new byte[transferLength * blockSize];
|
||||
|
||||
lastError = SendScsiCommand(cdb, ref buffer, out senseBuffer, timeout, ScsiDirection.In, out duration,
|
||||
LastError = SendScsiCommand(cdb, ref buffer, out senseBuffer, timeout, ScsiDirection.In, out duration,
|
||||
out sense);
|
||||
error = lastError != 0;
|
||||
Error = LastError != 0;
|
||||
|
||||
DicConsole.DebugWriteLine("SCSI Device", "READ (6) took {0} ms.", duration);
|
||||
|
||||
@@ -130,9 +130,9 @@ namespace DiscImageChef.Devices
|
||||
|
||||
buffer = new byte[transferLength * blockSize];
|
||||
|
||||
lastError = SendScsiCommand(cdb, ref buffer, out senseBuffer, timeout, ScsiDirection.In, out duration,
|
||||
LastError = SendScsiCommand(cdb, ref buffer, out senseBuffer, timeout, ScsiDirection.In, out duration,
|
||||
out sense);
|
||||
error = lastError != 0;
|
||||
Error = LastError != 0;
|
||||
|
||||
DicConsole.DebugWriteLine("SCSI Device", "READ (10) took {0} ms.", duration);
|
||||
|
||||
@@ -184,9 +184,9 @@ namespace DiscImageChef.Devices
|
||||
|
||||
buffer = new byte[transferLength * blockSize];
|
||||
|
||||
lastError = SendScsiCommand(cdb, ref buffer, out senseBuffer, timeout, ScsiDirection.In, out duration,
|
||||
LastError = SendScsiCommand(cdb, ref buffer, out senseBuffer, timeout, ScsiDirection.In, out duration,
|
||||
out sense);
|
||||
error = lastError != 0;
|
||||
Error = LastError != 0;
|
||||
|
||||
DicConsole.DebugWriteLine("SCSI Device", "READ (12) took {0} ms.", duration);
|
||||
|
||||
@@ -241,9 +241,9 @@ namespace DiscImageChef.Devices
|
||||
|
||||
buffer = new byte[transferLength * blockSize];
|
||||
|
||||
lastError = SendScsiCommand(cdb, ref buffer, out senseBuffer, timeout, ScsiDirection.In, out duration,
|
||||
LastError = SendScsiCommand(cdb, ref buffer, out senseBuffer, timeout, ScsiDirection.In, out duration,
|
||||
out sense);
|
||||
error = lastError != 0;
|
||||
Error = LastError != 0;
|
||||
|
||||
DicConsole.DebugWriteLine("SCSI Device", "READ (16) took {0} ms.", duration);
|
||||
|
||||
@@ -281,9 +281,9 @@ namespace DiscImageChef.Devices
|
||||
|
||||
buffer = new byte[transferBytes];
|
||||
|
||||
lastError = SendScsiCommand(cdb, ref buffer, out senseBuffer, timeout, ScsiDirection.In, out duration,
|
||||
LastError = SendScsiCommand(cdb, ref buffer, out senseBuffer, timeout, ScsiDirection.In, out duration,
|
||||
out sense);
|
||||
error = lastError != 0;
|
||||
Error = LastError != 0;
|
||||
|
||||
DicConsole.DebugWriteLine("SCSI Device", "READ LONG (10) took {0} ms.", duration);
|
||||
|
||||
@@ -325,9 +325,9 @@ namespace DiscImageChef.Devices
|
||||
|
||||
buffer = new byte[transferBytes];
|
||||
|
||||
lastError = SendScsiCommand(cdb, ref buffer, out senseBuffer, timeout, ScsiDirection.In, out duration,
|
||||
LastError = SendScsiCommand(cdb, ref buffer, out senseBuffer, timeout, ScsiDirection.In, out duration,
|
||||
out sense);
|
||||
error = lastError != 0;
|
||||
Error = LastError != 0;
|
||||
|
||||
DicConsole.DebugWriteLine("SCSI Device", "READ LONG (16) took {0} ms.", duration);
|
||||
|
||||
@@ -353,9 +353,9 @@ namespace DiscImageChef.Devices
|
||||
cdb[2] = (byte)((lba & 0xFF00) >> 8);
|
||||
cdb[3] = (byte)(lba & 0xFF);
|
||||
|
||||
lastError = SendScsiCommand(cdb, ref buffer, out senseBuffer, timeout, ScsiDirection.None, out duration,
|
||||
LastError = SendScsiCommand(cdb, ref buffer, out senseBuffer, timeout, ScsiDirection.None, out duration,
|
||||
out sense);
|
||||
error = lastError != 0;
|
||||
Error = LastError != 0;
|
||||
|
||||
DicConsole.DebugWriteLine("SCSI Device", "SEEK (6) took {0} ms.", duration);
|
||||
|
||||
@@ -382,9 +382,9 @@ namespace DiscImageChef.Devices
|
||||
cdb[4] = (byte)((lba & 0xFF00) >> 8);
|
||||
cdb[5] = (byte)(lba & 0xFF);
|
||||
|
||||
lastError = SendScsiCommand(cdb, ref buffer, out senseBuffer, timeout, ScsiDirection.None, out duration,
|
||||
LastError = SendScsiCommand(cdb, ref buffer, out senseBuffer, timeout, ScsiDirection.None, out duration,
|
||||
out sense);
|
||||
error = lastError != 0;
|
||||
Error = LastError != 0;
|
||||
|
||||
DicConsole.DebugWriteLine("SCSI Device", "SEEK (10) took {0} ms.", duration);
|
||||
|
||||
|
||||
@@ -74,9 +74,9 @@ namespace DiscImageChef.Devices
|
||||
cdb[13] = (byte)(buffer.Length & 0xFF);
|
||||
if(cache) cdb[14] += 0x01;
|
||||
|
||||
lastError = SendScsiCommand(cdb, ref buffer, out senseBuffer, timeout, ScsiDirection.In, out duration,
|
||||
LastError = SendScsiCommand(cdb, ref buffer, out senseBuffer, timeout, ScsiDirection.In, out duration,
|
||||
out sense);
|
||||
error = lastError != 0;
|
||||
Error = LastError != 0;
|
||||
|
||||
if(sense) return true;
|
||||
|
||||
@@ -91,9 +91,9 @@ namespace DiscImageChef.Devices
|
||||
cdb[13] = (byte)(buffer.Length & 0xFF);
|
||||
senseBuffer = new byte[32];
|
||||
|
||||
lastError = SendScsiCommand(cdb, ref buffer, out senseBuffer, timeout, ScsiDirection.In, out duration,
|
||||
LastError = SendScsiCommand(cdb, ref buffer, out senseBuffer, timeout, ScsiDirection.In, out duration,
|
||||
out sense);
|
||||
error = lastError != 0;
|
||||
Error = LastError != 0;
|
||||
|
||||
DicConsole.DebugWriteLine("SCSI Device", "READ ATTRIBUTE took {0} ms.", duration);
|
||||
|
||||
|
||||
@@ -88,9 +88,9 @@ namespace DiscImageChef.Devices
|
||||
byte[] cdb = {(byte)ScsiCommands.Inquiry, 0, 0, 0, 36, 0};
|
||||
bool sense;
|
||||
|
||||
lastError = SendScsiCommand(cdb, ref buffer, out senseBuffer, timeout, ScsiDirection.In, out duration,
|
||||
LastError = SendScsiCommand(cdb, ref buffer, out senseBuffer, timeout, ScsiDirection.In, out duration,
|
||||
out sense);
|
||||
error = lastError != 0;
|
||||
Error = LastError != 0;
|
||||
|
||||
if(sense) return true;
|
||||
|
||||
@@ -100,9 +100,9 @@ namespace DiscImageChef.Devices
|
||||
buffer = new byte[pagesLength];
|
||||
senseBuffer = new byte[32];
|
||||
|
||||
lastError = SendScsiCommand(cdb, ref buffer, out senseBuffer, timeout, ScsiDirection.In, out duration,
|
||||
LastError = SendScsiCommand(cdb, ref buffer, out senseBuffer, timeout, ScsiDirection.In, out duration,
|
||||
out sense);
|
||||
error = lastError != 0;
|
||||
Error = LastError != 0;
|
||||
|
||||
DicConsole.DebugWriteLine("SCSI Device", "INQUIRY took {0} ms.", duration);
|
||||
|
||||
@@ -164,9 +164,9 @@ namespace DiscImageChef.Devices
|
||||
byte[] cdb = {(byte)ScsiCommands.Inquiry, 1, page, 0, 36, 0};
|
||||
bool sense;
|
||||
|
||||
lastError = SendScsiCommand(cdb, ref buffer, out senseBuffer, timeout, ScsiDirection.In, out duration,
|
||||
LastError = SendScsiCommand(cdb, ref buffer, out senseBuffer, timeout, ScsiDirection.In, out duration,
|
||||
out sense);
|
||||
error = lastError != 0;
|
||||
Error = LastError != 0;
|
||||
|
||||
if(sense) return true;
|
||||
|
||||
@@ -179,9 +179,9 @@ namespace DiscImageChef.Devices
|
||||
buffer = new byte[pagesLength];
|
||||
senseBuffer = new byte[32];
|
||||
|
||||
lastError = SendScsiCommand(cdb, ref buffer, out senseBuffer, timeout, ScsiDirection.In, out duration,
|
||||
LastError = SendScsiCommand(cdb, ref buffer, out senseBuffer, timeout, ScsiDirection.In, out duration,
|
||||
out sense);
|
||||
error = lastError != 0;
|
||||
Error = LastError != 0;
|
||||
|
||||
DicConsole.DebugWriteLine("SCSI Device", "INQUIRY took {0} ms.", duration);
|
||||
|
||||
@@ -202,9 +202,9 @@ namespace DiscImageChef.Devices
|
||||
bool sense;
|
||||
byte[] buffer = new byte[0];
|
||||
|
||||
lastError = SendScsiCommand(cdb, ref buffer, out senseBuffer, timeout, ScsiDirection.None, out duration,
|
||||
LastError = SendScsiCommand(cdb, ref buffer, out senseBuffer, timeout, ScsiDirection.None, out duration,
|
||||
out sense);
|
||||
error = lastError != 0;
|
||||
Error = LastError != 0;
|
||||
|
||||
DicConsole.DebugWriteLine("SCSI Device", "TEST UNIT READY took {0} ms.", duration);
|
||||
|
||||
@@ -271,9 +271,9 @@ namespace DiscImageChef.Devices
|
||||
cdb[4] = (byte)buffer.Length;
|
||||
cdb[5] = 0;
|
||||
|
||||
lastError = SendScsiCommand(cdb, ref buffer, out senseBuffer, timeout, ScsiDirection.In, out duration,
|
||||
LastError = SendScsiCommand(cdb, ref buffer, out senseBuffer, timeout, ScsiDirection.In, out duration,
|
||||
out sense);
|
||||
error = lastError != 0;
|
||||
Error = LastError != 0;
|
||||
|
||||
if(sense) return true;
|
||||
|
||||
@@ -282,9 +282,9 @@ namespace DiscImageChef.Devices
|
||||
cdb[4] = (byte)buffer.Length;
|
||||
senseBuffer = new byte[32];
|
||||
|
||||
lastError = SendScsiCommand(cdb, ref buffer, out senseBuffer, timeout, ScsiDirection.In, out duration,
|
||||
LastError = SendScsiCommand(cdb, ref buffer, out senseBuffer, timeout, ScsiDirection.In, out duration,
|
||||
out sense);
|
||||
error = lastError != 0;
|
||||
Error = LastError != 0;
|
||||
|
||||
DicConsole.DebugWriteLine("SCSI Device", "MODE SENSE(6) took {0} ms.", duration);
|
||||
|
||||
@@ -360,9 +360,9 @@ namespace DiscImageChef.Devices
|
||||
cdb[8] = (byte)(buffer.Length & 0xFF);
|
||||
cdb[9] = 0;
|
||||
|
||||
lastError = SendScsiCommand(cdb, ref buffer, out senseBuffer, timeout, ScsiDirection.In, out duration,
|
||||
LastError = SendScsiCommand(cdb, ref buffer, out senseBuffer, timeout, ScsiDirection.In, out duration,
|
||||
out sense);
|
||||
error = lastError != 0;
|
||||
Error = LastError != 0;
|
||||
|
||||
if(sense) return true;
|
||||
|
||||
@@ -374,9 +374,9 @@ namespace DiscImageChef.Devices
|
||||
cdb[8] = (byte)(buffer.Length & 0xFF);
|
||||
senseBuffer = new byte[32];
|
||||
|
||||
lastError = SendScsiCommand(cdb, ref buffer, out senseBuffer, timeout, ScsiDirection.In, out duration,
|
||||
LastError = SendScsiCommand(cdb, ref buffer, out senseBuffer, timeout, ScsiDirection.In, out duration,
|
||||
out sense);
|
||||
error = lastError != 0;
|
||||
Error = LastError != 0;
|
||||
|
||||
DicConsole.DebugWriteLine("SCSI Device", "MODE SENSE(10) took {0} ms.", duration);
|
||||
|
||||
@@ -444,9 +444,9 @@ namespace DiscImageChef.Devices
|
||||
cdb[0] = (byte)ScsiCommands.PreventAllowMediumRemoval;
|
||||
cdb[4] = (byte)((byte)preventMode & 0x03);
|
||||
|
||||
lastError = SendScsiCommand(cdb, ref buffer, out senseBuffer, timeout, ScsiDirection.None, out duration,
|
||||
LastError = SendScsiCommand(cdb, ref buffer, out senseBuffer, timeout, ScsiDirection.None, out duration,
|
||||
out sense);
|
||||
error = lastError != 0;
|
||||
Error = LastError != 0;
|
||||
|
||||
DicConsole.DebugWriteLine("SCSI Device", "PREVENT ALLOW MEDIUM REMOVAL took {0} ms.", duration);
|
||||
|
||||
@@ -498,9 +498,9 @@ namespace DiscImageChef.Devices
|
||||
cdb[5] = (byte)(address & 0xFF);
|
||||
}
|
||||
|
||||
lastError = SendScsiCommand(cdb, ref buffer, out senseBuffer, timeout, ScsiDirection.In, out duration,
|
||||
LastError = SendScsiCommand(cdb, ref buffer, out senseBuffer, timeout, ScsiDirection.In, out duration,
|
||||
out sense);
|
||||
error = lastError != 0;
|
||||
Error = LastError != 0;
|
||||
|
||||
DicConsole.DebugWriteLine("SCSI Device", "READ CAPACITY took {0} ms.", duration);
|
||||
|
||||
@@ -560,9 +560,9 @@ namespace DiscImageChef.Devices
|
||||
cdb[12] = (byte)((buffer.Length & 0xFF00) >> 8);
|
||||
cdb[13] = (byte)(buffer.Length & 0xFF);
|
||||
|
||||
lastError = SendScsiCommand(cdb, ref buffer, out senseBuffer, timeout, ScsiDirection.In, out duration,
|
||||
LastError = SendScsiCommand(cdb, ref buffer, out senseBuffer, timeout, ScsiDirection.In, out duration,
|
||||
out sense);
|
||||
error = lastError != 0;
|
||||
Error = LastError != 0;
|
||||
|
||||
DicConsole.DebugWriteLine("SCSI Device", "READ CAPACITY(16) took {0} ms.", duration);
|
||||
|
||||
@@ -591,9 +591,9 @@ namespace DiscImageChef.Devices
|
||||
cdb[8] = (byte)((buffer.Length & 0xFF00) >> 8);
|
||||
cdb[9] = (byte)(buffer.Length & 0xFF);
|
||||
|
||||
lastError = SendScsiCommand(cdb, ref buffer, out senseBuffer, timeout, ScsiDirection.In, out duration,
|
||||
LastError = SendScsiCommand(cdb, ref buffer, out senseBuffer, timeout, ScsiDirection.In, out duration,
|
||||
out sense);
|
||||
error = lastError != 0;
|
||||
Error = LastError != 0;
|
||||
|
||||
if(sense) return true;
|
||||
|
||||
@@ -608,9 +608,9 @@ namespace DiscImageChef.Devices
|
||||
cdb[9] = (byte)(buffer.Length & 0xFF);
|
||||
senseBuffer = new byte[32];
|
||||
|
||||
lastError = SendScsiCommand(cdb, ref buffer, out senseBuffer, timeout, ScsiDirection.In, out duration,
|
||||
LastError = SendScsiCommand(cdb, ref buffer, out senseBuffer, timeout, ScsiDirection.In, out duration,
|
||||
out sense);
|
||||
error = lastError != 0;
|
||||
Error = LastError != 0;
|
||||
|
||||
DicConsole.DebugWriteLine("SCSI Device", "READ MEDIA SERIAL NUMBER took {0} ms.", duration);
|
||||
|
||||
@@ -738,12 +738,12 @@ namespace DiscImageChef.Devices
|
||||
// Prevent overflows
|
||||
if(buffer.Length > 255)
|
||||
{
|
||||
if(platformId != Interop.PlatformID.Win32NT && platformId != Interop.PlatformID.Win32S &&
|
||||
platformId != Interop.PlatformID.Win32Windows && platformId != Interop.PlatformID.WinCE &&
|
||||
platformId != Interop.PlatformID.WindowsPhone &&
|
||||
platformId != Interop.PlatformID.Xbox) lastError = 75;
|
||||
else lastError = 111;
|
||||
error = true;
|
||||
if(PlatformId != Interop.PlatformID.Win32NT && PlatformId != Interop.PlatformID.Win32S &&
|
||||
PlatformId != Interop.PlatformID.Win32Windows && PlatformId != Interop.PlatformID.WinCE &&
|
||||
PlatformId != Interop.PlatformID.WindowsPhone &&
|
||||
PlatformId != Interop.PlatformID.Xbox) LastError = 75;
|
||||
else LastError = 111;
|
||||
Error = true;
|
||||
duration = 0;
|
||||
return true;
|
||||
}
|
||||
@@ -756,9 +756,9 @@ namespace DiscImageChef.Devices
|
||||
if(savePages) cdb[1] += 0x01;
|
||||
cdb[4] = (byte)buffer.Length;
|
||||
|
||||
lastError = SendScsiCommand(cdb, ref buffer, out senseBuffer, timeout, ScsiDirection.Out, out duration,
|
||||
LastError = SendScsiCommand(cdb, ref buffer, out senseBuffer, timeout, ScsiDirection.Out, out duration,
|
||||
out sense);
|
||||
error = lastError != 0;
|
||||
Error = LastError != 0;
|
||||
|
||||
DicConsole.DebugWriteLine("SCSI Device", "MODE SELECT(6) took {0} ms.", duration);
|
||||
|
||||
@@ -781,12 +781,12 @@ namespace DiscImageChef.Devices
|
||||
// Prevent overflows
|
||||
if(buffer.Length > 65535)
|
||||
{
|
||||
if(platformId != Interop.PlatformID.Win32NT && platformId != Interop.PlatformID.Win32S &&
|
||||
platformId != Interop.PlatformID.Win32Windows && platformId != Interop.PlatformID.WinCE &&
|
||||
platformId != Interop.PlatformID.WindowsPhone &&
|
||||
platformId != Interop.PlatformID.Xbox) lastError = 75;
|
||||
else lastError = 111;
|
||||
error = true;
|
||||
if(PlatformId != Interop.PlatformID.Win32NT && PlatformId != Interop.PlatformID.Win32S &&
|
||||
PlatformId != Interop.PlatformID.Win32Windows && PlatformId != Interop.PlatformID.WinCE &&
|
||||
PlatformId != Interop.PlatformID.WindowsPhone &&
|
||||
PlatformId != Interop.PlatformID.Xbox) LastError = 75;
|
||||
else LastError = 111;
|
||||
Error = true;
|
||||
duration = 0;
|
||||
return true;
|
||||
}
|
||||
@@ -800,9 +800,9 @@ namespace DiscImageChef.Devices
|
||||
cdb[7] = (byte)((buffer.Length & 0xFF00) << 8);
|
||||
cdb[8] = (byte)(buffer.Length & 0xFF);
|
||||
|
||||
lastError = SendScsiCommand(cdb, ref buffer, out senseBuffer, timeout, ScsiDirection.Out, out duration,
|
||||
LastError = SendScsiCommand(cdb, ref buffer, out senseBuffer, timeout, ScsiDirection.Out, out duration,
|
||||
out sense);
|
||||
error = lastError != 0;
|
||||
Error = LastError != 0;
|
||||
|
||||
DicConsole.DebugWriteLine("SCSI Device", "MODE SELECT(10) took {0} ms.", duration);
|
||||
|
||||
@@ -828,9 +828,9 @@ namespace DiscImageChef.Devices
|
||||
cdb[4] = (byte)buffer.Length;
|
||||
cdb[5] = 0;
|
||||
|
||||
lastError = SendScsiCommand(cdb, ref buffer, out senseBuffer, timeout, ScsiDirection.In, out duration,
|
||||
LastError = SendScsiCommand(cdb, ref buffer, out senseBuffer, timeout, ScsiDirection.In, out duration,
|
||||
out sense);
|
||||
error = lastError != 0;
|
||||
Error = LastError != 0;
|
||||
|
||||
DicConsole.DebugWriteLine("SCSI Device", "REQUEST SENSE took {0} ms.", duration);
|
||||
|
||||
|
||||
@@ -88,9 +88,9 @@ namespace DiscImageChef.Devices
|
||||
if(endOfTape) cdb[4] += 0x04;
|
||||
if(hold) cdb[4] += 0x08;
|
||||
|
||||
lastError = SendScsiCommand(cdb, ref buffer, out senseBuffer, timeout, ScsiDirection.None, out duration,
|
||||
LastError = SendScsiCommand(cdb, ref buffer, out senseBuffer, timeout, ScsiDirection.None, out duration,
|
||||
out sense);
|
||||
error = lastError != 0;
|
||||
Error = LastError != 0;
|
||||
|
||||
DicConsole.DebugWriteLine("SCSI Device", "LOAD UNLOAD (6) took {0} ms.", duration);
|
||||
|
||||
@@ -179,9 +179,9 @@ namespace DiscImageChef.Devices
|
||||
cdb[6] = (byte)(objectId & 0xFF);
|
||||
cdb[8] = partition;
|
||||
|
||||
lastError = SendScsiCommand(cdb, ref buffer, out senseBuffer, timeout, ScsiDirection.None, out duration,
|
||||
LastError = SendScsiCommand(cdb, ref buffer, out senseBuffer, timeout, ScsiDirection.None, out duration,
|
||||
out sense);
|
||||
error = lastError != 0;
|
||||
Error = LastError != 0;
|
||||
|
||||
DicConsole.DebugWriteLine("SCSI Device", "LOCATE (10) took {0} ms.", duration);
|
||||
|
||||
@@ -282,9 +282,9 @@ namespace DiscImageChef.Devices
|
||||
cdb[10] = idBytes[1];
|
||||
cdb[11] = idBytes[0];
|
||||
|
||||
lastError = SendScsiCommand(cdb, ref buffer, out senseBuffer, timeout, ScsiDirection.None, out duration,
|
||||
LastError = SendScsiCommand(cdb, ref buffer, out senseBuffer, timeout, ScsiDirection.None, out duration,
|
||||
out sense);
|
||||
error = lastError != 0;
|
||||
Error = LastError != 0;
|
||||
|
||||
DicConsole.DebugWriteLine("SCSI Device", "LOCATE (16) took {0} ms.", duration);
|
||||
|
||||
@@ -348,9 +348,9 @@ namespace DiscImageChef.Devices
|
||||
cdb[3] = (byte)((transferLen & 0xFF00) >> 8);
|
||||
cdb[4] = (byte)(transferLen & 0xFF);
|
||||
|
||||
lastError = SendScsiCommand(cdb, ref buffer, out senseBuffer, timeout, ScsiDirection.In, out duration,
|
||||
LastError = SendScsiCommand(cdb, ref buffer, out senseBuffer, timeout, ScsiDirection.In, out duration,
|
||||
out sense);
|
||||
error = lastError != 0;
|
||||
Error = LastError != 0;
|
||||
|
||||
DicConsole.DebugWriteLine("SCSI Device", "READ (6) took {0} ms.", duration);
|
||||
|
||||
@@ -468,9 +468,9 @@ namespace DiscImageChef.Devices
|
||||
cdb[13] = (byte)((transferLen & 0xFF00) >> 8);
|
||||
cdb[14] = (byte)(transferLen & 0xFF);
|
||||
|
||||
lastError = SendScsiCommand(cdb, ref buffer, out senseBuffer, timeout, ScsiDirection.In, out duration,
|
||||
LastError = SendScsiCommand(cdb, ref buffer, out senseBuffer, timeout, ScsiDirection.In, out duration,
|
||||
out sense);
|
||||
error = lastError != 0;
|
||||
Error = LastError != 0;
|
||||
|
||||
DicConsole.DebugWriteLine("SCSI Device", "READ (16) took {0} ms.", duration);
|
||||
|
||||
@@ -493,9 +493,9 @@ namespace DiscImageChef.Devices
|
||||
|
||||
cdb[0] = (byte)ScsiCommands.ReadBlockLimits;
|
||||
|
||||
lastError = SendScsiCommand(cdb, ref buffer, out senseBuffer, timeout, ScsiDirection.In, out duration,
|
||||
LastError = SendScsiCommand(cdb, ref buffer, out senseBuffer, timeout, ScsiDirection.In, out duration,
|
||||
out sense);
|
||||
error = lastError != 0;
|
||||
Error = LastError != 0;
|
||||
|
||||
DicConsole.DebugWriteLine("SCSI Device", "READ BLOCK LIMITS took {0} ms.", duration);
|
||||
|
||||
@@ -590,9 +590,9 @@ namespace DiscImageChef.Devices
|
||||
cdb[8] = (byte)(buffer.Length & 0xFF);
|
||||
}
|
||||
|
||||
lastError = SendScsiCommand(cdb, ref buffer, out senseBuffer, timeout, ScsiDirection.In, out duration,
|
||||
LastError = SendScsiCommand(cdb, ref buffer, out senseBuffer, timeout, ScsiDirection.In, out duration,
|
||||
out sense);
|
||||
error = lastError != 0;
|
||||
Error = LastError != 0;
|
||||
|
||||
DicConsole.DebugWriteLine("SCSI Device", "READ POSITION took {0} ms.", duration);
|
||||
|
||||
@@ -661,9 +661,9 @@ namespace DiscImageChef.Devices
|
||||
cdb[3] = (byte)((transferLen & 0xFF00) >> 8);
|
||||
cdb[4] = (byte)(transferLen & 0xFF);
|
||||
|
||||
lastError = SendScsiCommand(cdb, ref buffer, out senseBuffer, timeout, ScsiDirection.In, out duration,
|
||||
LastError = SendScsiCommand(cdb, ref buffer, out senseBuffer, timeout, ScsiDirection.In, out duration,
|
||||
out sense);
|
||||
error = lastError != 0;
|
||||
Error = LastError != 0;
|
||||
|
||||
DicConsole.DebugWriteLine("SCSI Device", "READ REVERSE (6) took {0} ms.", duration);
|
||||
|
||||
@@ -784,9 +784,9 @@ namespace DiscImageChef.Devices
|
||||
cdb[13] = (byte)((transferLen & 0xFF00) >> 8);
|
||||
cdb[14] = (byte)(transferLen & 0xFF);
|
||||
|
||||
lastError = SendScsiCommand(cdb, ref buffer, out senseBuffer, timeout, ScsiDirection.In, out duration,
|
||||
LastError = SendScsiCommand(cdb, ref buffer, out senseBuffer, timeout, ScsiDirection.In, out duration,
|
||||
out sense);
|
||||
error = lastError != 0;
|
||||
Error = LastError != 0;
|
||||
|
||||
DicConsole.DebugWriteLine("SCSI Device", "READ REVERSE (16) took {0} ms.", duration);
|
||||
|
||||
@@ -853,9 +853,9 @@ namespace DiscImageChef.Devices
|
||||
cdb[3] = (byte)((transferLen & 0xFF00) >> 8);
|
||||
cdb[4] = (byte)(transferLen & 0xFF);
|
||||
|
||||
lastError = SendScsiCommand(cdb, ref buffer, out senseBuffer, timeout, ScsiDirection.In, out duration,
|
||||
LastError = SendScsiCommand(cdb, ref buffer, out senseBuffer, timeout, ScsiDirection.In, out duration,
|
||||
out sense);
|
||||
error = lastError != 0;
|
||||
Error = LastError != 0;
|
||||
|
||||
DicConsole.DebugWriteLine("SCSI Device", "RECOVER BUFFERED DATA took {0} ms.", duration);
|
||||
|
||||
@@ -911,9 +911,9 @@ namespace DiscImageChef.Devices
|
||||
cdb[7] = (byte)((buffer.Length & 0xFF00) >> 8);
|
||||
cdb[8] = (byte)(buffer.Length & 0xFF);
|
||||
|
||||
lastError = SendScsiCommand(cdb, ref buffer, out senseBuffer, timeout, ScsiDirection.In, out duration,
|
||||
LastError = SendScsiCommand(cdb, ref buffer, out senseBuffer, timeout, ScsiDirection.In, out duration,
|
||||
out sense);
|
||||
error = lastError != 0;
|
||||
Error = LastError != 0;
|
||||
|
||||
if(sense) return true;
|
||||
|
||||
@@ -925,9 +925,9 @@ namespace DiscImageChef.Devices
|
||||
cdb[8] = (byte)(buffer.Length & 0xFF);
|
||||
senseBuffer = new byte[32];
|
||||
|
||||
lastError = SendScsiCommand(cdb, ref buffer, out senseBuffer, timeout, ScsiDirection.In, out duration,
|
||||
LastError = SendScsiCommand(cdb, ref buffer, out senseBuffer, timeout, ScsiDirection.In, out duration,
|
||||
out sense);
|
||||
error = lastError != 0;
|
||||
Error = LastError != 0;
|
||||
|
||||
DicConsole.DebugWriteLine("SCSI Device", "REPORT DENSITY SUPPORT took {0} ms.", duration);
|
||||
|
||||
@@ -962,9 +962,9 @@ namespace DiscImageChef.Devices
|
||||
cdb[0] = (byte)ScsiCommands.Rewind;
|
||||
if(immediate) cdb[1] += 0x01;
|
||||
|
||||
lastError = SendScsiCommand(cdb, ref buffer, out senseBuffer, timeout, ScsiDirection.None, out duration,
|
||||
LastError = SendScsiCommand(cdb, ref buffer, out senseBuffer, timeout, ScsiDirection.None, out duration,
|
||||
out sense);
|
||||
error = lastError != 0;
|
||||
Error = LastError != 0;
|
||||
|
||||
DicConsole.DebugWriteLine("SCSI Device", "REWIND took {0} ms.", duration);
|
||||
|
||||
@@ -989,9 +989,9 @@ namespace DiscImageChef.Devices
|
||||
cdb[0] = (byte)ScsiCommands.TrackSelect;
|
||||
cdb[5] = track;
|
||||
|
||||
lastError = SendScsiCommand(cdb, ref buffer, out senseBuffer, timeout, ScsiDirection.None, out duration,
|
||||
LastError = SendScsiCommand(cdb, ref buffer, out senseBuffer, timeout, ScsiDirection.None, out duration,
|
||||
out sense);
|
||||
error = lastError != 0;
|
||||
Error = LastError != 0;
|
||||
|
||||
DicConsole.DebugWriteLine("SCSI Device", "TRACK SELECT took {0} ms.", duration);
|
||||
|
||||
@@ -1012,9 +1012,9 @@ namespace DiscImageChef.Devices
|
||||
cdb[3] = countB[1];
|
||||
cdb[4] = countB[0];
|
||||
|
||||
lastError = SendScsiCommand(cdb, ref buffer, out senseBuffer, timeout, ScsiDirection.None, out duration,
|
||||
LastError = SendScsiCommand(cdb, ref buffer, out senseBuffer, timeout, ScsiDirection.None, out duration,
|
||||
out sense);
|
||||
error = lastError != 0;
|
||||
Error = LastError != 0;
|
||||
|
||||
DicConsole.DebugWriteLine("SCSI Device", "SPACE took {0} ms.", duration);
|
||||
|
||||
|
||||
@@ -107,13 +107,13 @@ namespace DiscImageChef.Devices
|
||||
else buffer = new byte[0];
|
||||
|
||||
if(!inhibitDma)
|
||||
lastError = SendScsiCommand(cdb, ref buffer, out senseBuffer, timeout, ScsiDirection.In, out duration,
|
||||
LastError = SendScsiCommand(cdb, ref buffer, out senseBuffer, timeout, ScsiDirection.In, out duration,
|
||||
out sense);
|
||||
else
|
||||
lastError = SendScsiCommand(cdb, ref buffer, out senseBuffer, timeout, ScsiDirection.None, out duration,
|
||||
LastError = SendScsiCommand(cdb, ref buffer, out senseBuffer, timeout, ScsiDirection.None, out duration,
|
||||
out sense);
|
||||
|
||||
error = lastError != 0;
|
||||
Error = LastError != 0;
|
||||
|
||||
DicConsole.DebugWriteLine("SCSI Device", "SYQUEST READ (6) took {0} ms.", duration);
|
||||
|
||||
@@ -189,12 +189,12 @@ namespace DiscImageChef.Devices
|
||||
else buffer = new byte[0];
|
||||
|
||||
if(!inhibitDma)
|
||||
lastError = SendScsiCommand(cdb, ref buffer, out senseBuffer, timeout, ScsiDirection.In, out duration,
|
||||
LastError = SendScsiCommand(cdb, ref buffer, out senseBuffer, timeout, ScsiDirection.In, out duration,
|
||||
out sense);
|
||||
else
|
||||
lastError = SendScsiCommand(cdb, ref buffer, out senseBuffer, timeout, ScsiDirection.None, out duration,
|
||||
LastError = SendScsiCommand(cdb, ref buffer, out senseBuffer, timeout, ScsiDirection.None, out duration,
|
||||
out sense);
|
||||
error = lastError != 0;
|
||||
Error = LastError != 0;
|
||||
|
||||
DicConsole.DebugWriteLine("SCSI Device", "SYQUEST READ (10) took {0} ms.", duration);
|
||||
|
||||
|
||||
Reference in New Issue
Block a user