mirror of
https://github.com/aaru-dps/Aaru.Server.git
synced 2025-12-16 19:24:27 +00:00
REFACTOR: Use preferred braces style.
This commit is contained in:
@@ -205,7 +205,7 @@ namespace DiscImageChef.Core.Devices.Dumping
|
||||
if(tracksArray[i].point >= 0xA0) continue;
|
||||
if(!trackLengths.TryGetValue(tracksArray[i].point, out uint trkLen)) continue;
|
||||
|
||||
if(tracksArray[i].mode == AlcoholTrackMode.Dvd) { tracksArray[i].extraOffset = trkLen; }
|
||||
if(tracksArray[i].mode == AlcoholTrackMode.Dvd) tracksArray[i].extraOffset = trkLen;
|
||||
else
|
||||
{
|
||||
AlcoholTrackExtra extra = new AlcoholTrackExtra();
|
||||
@@ -274,7 +274,6 @@ namespace DiscImageChef.Core.Devices.Dumping
|
||||
|
||||
if(header.type == AlcoholMediumType.Cd || header.type == AlcoholMediumType.Cdr ||
|
||||
header.type == AlcoholMediumType.Cdrw)
|
||||
{
|
||||
foreach(AlcoholTrackExtra extra in extrasArray)
|
||||
{
|
||||
tmp = new byte[8];
|
||||
@@ -284,7 +283,6 @@ namespace DiscImageChef.Core.Devices.Dumping
|
||||
descriptorFile.Write(tmp, 0, tmp.Length);
|
||||
Marshal.FreeHGlobal(trkxPtr);
|
||||
}
|
||||
}
|
||||
|
||||
if(bca != null && bca.Length > 0)
|
||||
{
|
||||
@@ -502,7 +500,7 @@ namespace DiscImageChef.Core.Devices.Dumping
|
||||
|
||||
AlcoholSession[] sess = sessions.ToArray();
|
||||
|
||||
for(int i = 0; i < sess.Length; i++) { if(sess[i].sessionSequence == session) sess[i].nonTrackBlocks++; }
|
||||
for(int i = 0; i < sess.Length; i++) if(sess[i].sessionSequence == session) sess[i].nonTrackBlocks++;
|
||||
|
||||
sessions = new List<AlcoholSession>(sess);
|
||||
}
|
||||
|
||||
@@ -132,10 +132,7 @@ namespace DiscImageChef.Core.Devices.Dumping
|
||||
Decoders.SCSI.MMC.DiscInformation.StandardDiscInformation? discInfo =
|
||||
Decoders.SCSI.MMC.DiscInformation.Decode000b(cmdBuf);
|
||||
if(discInfo.HasValue)
|
||||
{
|
||||
// If it is a read-only CD, check CD type if available
|
||||
if(dskType == MediaType.CD)
|
||||
{
|
||||
switch(discInfo.Value.DiscType)
|
||||
{
|
||||
case 0x10:
|
||||
@@ -145,8 +142,6 @@ namespace DiscImageChef.Core.Devices.Dumping
|
||||
dskType = MediaType.CDROMXA;
|
||||
break;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
int sessions = 1;
|
||||
@@ -172,15 +167,11 @@ namespace DiscImageChef.Core.Devices.Dumping
|
||||
bool hasVideoTrack = false;
|
||||
|
||||
if(toc.HasValue)
|
||||
{
|
||||
foreach(FullTOC.TrackDataDescriptor track in toc.Value.TrackDescriptors)
|
||||
{
|
||||
if(track.TNO == 1 && ((TOC_CONTROL)(track.CONTROL & 0x0D) == TOC_CONTROL.DataTrack ||
|
||||
(TOC_CONTROL)(track.CONTROL & 0x0D) ==
|
||||
TOC_CONTROL.DataTrackIncremental))
|
||||
{
|
||||
allFirstSessionTracksAreAudio &= firstTrackLastSession != 1;
|
||||
}
|
||||
TOC_CONTROL.DataTrackIncremental)) allFirstSessionTracksAreAudio &= firstTrackLastSession != 1;
|
||||
|
||||
if((TOC_CONTROL)(track.CONTROL & 0x0D) == TOC_CONTROL.DataTrack ||
|
||||
(TOC_CONTROL)(track.CONTROL & 0x0D) == TOC_CONTROL.DataTrackIncremental)
|
||||
@@ -192,7 +183,6 @@ namespace DiscImageChef.Core.Devices.Dumping
|
||||
|
||||
hasVideoTrack |= track.ADR == 4;
|
||||
}
|
||||
}
|
||||
|
||||
if(hasDataTrack && hasAudioTrack && allFirstSessionTracksAreAudio && sessions == 2)
|
||||
dskType = MediaType.CDPLUS;
|
||||
@@ -204,7 +194,6 @@ namespace DiscImageChef.Core.Devices.Dumping
|
||||
dumpLog.WriteLine("Reading PMA");
|
||||
sense = dev.ReadPma(out cmdBuf, out senseBuf, dev.Timeout, out duration);
|
||||
if(!sense)
|
||||
{
|
||||
if(PMA.Decode(cmdBuf).HasValue)
|
||||
{
|
||||
tmpBuf = new byte[cmdBuf.Length - 4];
|
||||
@@ -217,12 +206,10 @@ namespace DiscImageChef.Core.Devices.Dumping
|
||||
};
|
||||
DataFile.WriteTo("SCSI Dump", sidecar.OpticalDisc[0].PMA.Image, tmpBuf);
|
||||
}
|
||||
}
|
||||
|
||||
dumpLog.WriteLine("Reading CD-Text from Lead-In");
|
||||
sense = dev.ReadCdText(out cmdBuf, out senseBuf, dev.Timeout, out duration);
|
||||
if(!sense)
|
||||
{
|
||||
if(CDTextOnLeadIn.Decode(cmdBuf).HasValue)
|
||||
{
|
||||
tmpBuf = new byte[cmdBuf.Length - 4];
|
||||
@@ -235,7 +222,6 @@ namespace DiscImageChef.Core.Devices.Dumping
|
||||
};
|
||||
DataFile.WriteTo("SCSI Dump", sidecar.OpticalDisc[0].LeadInCdText.Image, tmpBuf);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -259,7 +245,6 @@ namespace DiscImageChef.Core.Devices.Dumping
|
||||
sessionsForAlcohol[i].StartTrack = ushort.MaxValue;
|
||||
}
|
||||
foreach(FullTOC.TrackDataDescriptor trk in toc.Value.TrackDescriptors)
|
||||
{
|
||||
if(trk.POINT > 0 && trk.POINT < 0xA0 && trk.SessionNumber <= sessionsForAlcohol.Length)
|
||||
{
|
||||
if(trk.POINT < sessionsForAlcohol[trk.SessionNumber - 1].StartTrack)
|
||||
@@ -267,15 +252,12 @@ namespace DiscImageChef.Core.Devices.Dumping
|
||||
if(trk.POINT > sessionsForAlcohol[trk.SessionNumber - 1].EndTrack)
|
||||
sessionsForAlcohol[trk.SessionNumber - 1].EndTrack = trk.POINT;
|
||||
}
|
||||
}
|
||||
|
||||
alcohol.AddSessions(sessionsForAlcohol);
|
||||
|
||||
foreach(FullTOC.TrackDataDescriptor trk in toc.Value.TrackDescriptors)
|
||||
{
|
||||
alcohol.AddTrack((byte)((trk.ADR << 4) & trk.CONTROL), trk.TNO, trk.POINT, trk.Min, trk.Sec, trk.Frame,
|
||||
trk.Zero, trk.PMIN, trk.PSEC, trk.PFRAME, trk.SessionNumber);
|
||||
}
|
||||
|
||||
FullTOC.TrackDataDescriptor[] sortedTracks =
|
||||
toc.Value.TrackDescriptors.OrderBy(track => track.POINT).ToArray();
|
||||
@@ -283,9 +265,7 @@ namespace DiscImageChef.Core.Devices.Dumping
|
||||
long lastSector = 0;
|
||||
string lastMsf = null;
|
||||
foreach(FullTOC.TrackDataDescriptor trk in sortedTracks)
|
||||
{
|
||||
if(trk.ADR == 1 || trk.ADR == 4)
|
||||
{
|
||||
if(trk.POINT >= 0x01 && trk.POINT <= 0x63)
|
||||
{
|
||||
TrackType track = new TrackType
|
||||
@@ -345,8 +325,6 @@ namespace DiscImageChef.Core.Devices.Dumping
|
||||
else lastMsf = string.Format("{0:D2}:{1:D2}:{2:D2}", pmin, psec, pframe);
|
||||
lastSector = phour * 3600 * 75 + pmin * 60 * 75 + psec * 75 + pframe - 150;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
TrackType[] tracks = trackList.ToArray();
|
||||
for(int t = 1; t < tracks.Length; t++)
|
||||
@@ -386,7 +364,7 @@ namespace DiscImageChef.Core.Devices.Dumping
|
||||
return;
|
||||
}
|
||||
|
||||
if(dumpRaw) { throw new NotImplementedException("Raw CD dumping not yet implemented"); }
|
||||
if(dumpRaw) throw new NotImplementedException("Raw CD dumping not yet implemented");
|
||||
else
|
||||
{
|
||||
// TODO: Check subchannel capabilities
|
||||
@@ -472,7 +450,6 @@ namespace DiscImageChef.Core.Devices.Dumping
|
||||
|
||||
dumpFile.Close();
|
||||
if(leadInSectorsGood > 0)
|
||||
{
|
||||
sidecar.OpticalDisc[0].LeadIn = new BorderType[]
|
||||
{
|
||||
new BorderType
|
||||
@@ -482,7 +459,6 @@ namespace DiscImageChef.Core.Devices.Dumping
|
||||
Size = leadInSectorsTotal * blockSize
|
||||
}
|
||||
};
|
||||
}
|
||||
else File.Delete(outputPrefix + ".leadin.bin");
|
||||
|
||||
DicConsole.WriteLine();
|
||||
@@ -602,13 +578,11 @@ namespace DiscImageChef.Core.Devices.Dumping
|
||||
ibgLog.Write(i, currentSpeed * 1024);
|
||||
extents.Add(i, blocksToRead, true);
|
||||
if(separateSubchannel)
|
||||
{
|
||||
for(int b = 0; b < blocksToRead; b++)
|
||||
{
|
||||
dumpFile.Write(readBuffer, (int)(0 + b * blockSize), sectorSize);
|
||||
subFile.Write(readBuffer, (int)(sectorSize + b * blockSize), (int)subSize);
|
||||
}
|
||||
}
|
||||
else dumpFile.Write(readBuffer);
|
||||
}
|
||||
else
|
||||
@@ -644,7 +618,6 @@ namespace DiscImageChef.Core.Devices.Dumping
|
||||
{
|
||||
0x00, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0x00
|
||||
}))
|
||||
{
|
||||
switch(readBuffer[15])
|
||||
{
|
||||
case 0:
|
||||
@@ -660,7 +633,6 @@ namespace DiscImageChef.Core.Devices.Dumping
|
||||
checkedDataFormat = true;
|
||||
break;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
#pragma warning disable IDE0004 // Remove Unnecessary Cast
|
||||
@@ -812,7 +784,7 @@ namespace DiscImageChef.Core.Devices.Dumping
|
||||
|
||||
dumpLog.WriteLine("Sending MODE SELECT to drive.");
|
||||
sense = dev.ModeSelect(md6, out senseBuf, true, false, dev.Timeout, out duration);
|
||||
if(sense) { sense = dev.ModeSelect10(md10, out senseBuf, true, false, dev.Timeout, out duration); }
|
||||
if(sense) sense = dev.ModeSelect10(md10, out senseBuf, true, false, dev.Timeout, out duration);
|
||||
|
||||
runningPersistent = true;
|
||||
if(!sense && !dev.Error)
|
||||
@@ -833,7 +805,7 @@ namespace DiscImageChef.Core.Devices.Dumping
|
||||
|
||||
dumpLog.WriteLine("Sending MODE SELECT to drive.");
|
||||
sense = dev.ModeSelect(md6, out senseBuf, true, false, dev.Timeout, out duration);
|
||||
if(sense) { sense = dev.ModeSelect10(md10, out senseBuf, true, false, dev.Timeout, out duration); }
|
||||
if(sense) sense = dev.ModeSelect10(md10, out senseBuf, true, false, dev.Timeout, out duration);
|
||||
}
|
||||
|
||||
DicConsole.WriteLine();
|
||||
|
||||
@@ -233,15 +233,12 @@ namespace DiscImageChef.Core.Devices.Dumping
|
||||
sense = dev.ModeSense10(out cmdBuf, out senseBuf, false, true, ScsiModeSensePageControl.Current,
|
||||
0x3F, 0xFF, 5, out duration);
|
||||
if(!sense || dev.Error)
|
||||
{
|
||||
sense = dev.ModeSense10(out cmdBuf, out senseBuf, false, true,
|
||||
ScsiModeSensePageControl.Current, 0x3F, 0x00, 5, out duration);
|
||||
}
|
||||
|
||||
Decoders.SCSI.Modes.DecodedMode? decMode = null;
|
||||
|
||||
if(!sense && !dev.Error)
|
||||
{
|
||||
if(Decoders.SCSI.Modes.DecodeMode10(cmdBuf, dev.ScsiType).HasValue)
|
||||
{
|
||||
decMode = Decoders.SCSI.Modes.DecodeMode10(cmdBuf, dev.ScsiType);
|
||||
@@ -253,7 +250,6 @@ namespace DiscImageChef.Core.Devices.Dumping
|
||||
};
|
||||
DataFile.WriteTo("SCSI Dump", sidecar.BlockMedia[0].SCSI.ModeSense10.Image, cmdBuf);
|
||||
}
|
||||
}
|
||||
|
||||
dumpLog.WriteLine("Requesting MODE SENSE (6).");
|
||||
sense = dev.ModeSense6(out cmdBuf, out senseBuf, false, ScsiModeSensePageControl.Current, 0x3F,
|
||||
@@ -264,7 +260,6 @@ namespace DiscImageChef.Core.Devices.Dumping
|
||||
if(sense || dev.Error) sense = dev.ModeSense(out cmdBuf, out senseBuf, 5, out duration);
|
||||
|
||||
if(!sense && !dev.Error)
|
||||
{
|
||||
if(Decoders.SCSI.Modes.DecodeMode6(cmdBuf, dev.ScsiType).HasValue)
|
||||
{
|
||||
decMode = Decoders.SCSI.Modes.DecodeMode6(cmdBuf, dev.ScsiType);
|
||||
@@ -276,7 +271,6 @@ namespace DiscImageChef.Core.Devices.Dumping
|
||||
};
|
||||
DataFile.WriteTo("SCSI Dump", sidecar.BlockMedia[0].SCSI.ModeSense.Image, cmdBuf);
|
||||
}
|
||||
}
|
||||
|
||||
if(decMode.HasValue)
|
||||
{
|
||||
@@ -295,18 +289,12 @@ namespace DiscImageChef.Core.Devices.Dumping
|
||||
uint longBlockSize = scsiReader.LongBlockSize;
|
||||
|
||||
if(dumpRaw)
|
||||
{
|
||||
if(blockSize == longBlockSize)
|
||||
{
|
||||
if(!scsiReader.CanReadRaw)
|
||||
{
|
||||
DicConsole.ErrorWriteLine("Device doesn't seem capable of reading raw data from media.");
|
||||
}
|
||||
if(!scsiReader.CanReadRaw) DicConsole.ErrorWriteLine("Device doesn't seem capable of reading raw data from media.");
|
||||
else
|
||||
{
|
||||
DicConsole
|
||||
.ErrorWriteLine("Device is capable of reading raw data but I've been unable to guess correct sector size.");
|
||||
}
|
||||
|
||||
if(!force)
|
||||
{
|
||||
@@ -330,7 +318,6 @@ namespace DiscImageChef.Core.Devices.Dumping
|
||||
physicalBlockSize = longBlockSize;
|
||||
blockSize = longBlockSize;
|
||||
}
|
||||
}
|
||||
|
||||
DicConsole.WriteLine("Reading {0} sectors at a time.", blocksToRead);
|
||||
|
||||
@@ -548,7 +535,7 @@ namespace DiscImageChef.Core.Devices.Dumping
|
||||
|
||||
dumpLog.WriteLine("Sending MODE SELECT to drive.");
|
||||
sense = dev.ModeSelect(md6, out senseBuf, true, false, dev.Timeout, out duration);
|
||||
if(sense) { sense = dev.ModeSelect10(md10, out senseBuf, true, false, dev.Timeout, out duration); }
|
||||
if(sense) sense = dev.ModeSelect10(md10, out senseBuf, true, false, dev.Timeout, out duration);
|
||||
|
||||
runningPersistent = true;
|
||||
if(!sense && !dev.Error)
|
||||
@@ -569,7 +556,7 @@ namespace DiscImageChef.Core.Devices.Dumping
|
||||
|
||||
dumpLog.WriteLine("Sending MODE SELECT to drive.");
|
||||
sense = dev.ModeSelect(md6, out senseBuf, true, false, dev.Timeout, out duration);
|
||||
if(sense) { sense = dev.ModeSelect10(md10, out senseBuf, true, false, dev.Timeout, out duration); }
|
||||
if(sense) sense = dev.ModeSelect10(md10, out senseBuf, true, false, dev.Timeout, out duration);
|
||||
}
|
||||
|
||||
DicConsole.WriteLine();
|
||||
@@ -662,7 +649,6 @@ namespace DiscImageChef.Core.Devices.Dumping
|
||||
partitions[i].Scheme);
|
||||
|
||||
foreach(Filesystem plugin in plugins.PluginsList.Values)
|
||||
{
|
||||
try
|
||||
{
|
||||
if(plugin.Identify(imageFormat, partitions[i]))
|
||||
@@ -686,7 +672,6 @@ namespace DiscImageChef.Core.Devices.Dumping
|
||||
{
|
||||
//DicConsole.DebugWriteLine("Dump-media command", "Plugin {0} crashed", _plugin.Name);
|
||||
}
|
||||
}
|
||||
|
||||
if(lstFs.Count > 0) xmlFileSysInfo[i].FileSystems = lstFs.ToArray();
|
||||
}
|
||||
@@ -702,7 +687,6 @@ namespace DiscImageChef.Core.Devices.Dumping
|
||||
new Partition {Name = "Whole device", Length = blocks, Size = blocks * blockSize};
|
||||
|
||||
foreach(Filesystem plugin in plugins.PluginsList.Values)
|
||||
{
|
||||
try
|
||||
{
|
||||
if(plugin.Identify(imageFormat, wholePart))
|
||||
@@ -724,7 +708,6 @@ namespace DiscImageChef.Core.Devices.Dumping
|
||||
{
|
||||
//DicConsole.DebugWriteLine("Create-sidecar command", "Plugin {0} crashed", _plugin.Name);
|
||||
}
|
||||
}
|
||||
|
||||
if(lstFs.Count > 0) xmlFileSysInfo[0].FileSystems = lstFs.ToArray();
|
||||
}
|
||||
@@ -820,12 +803,10 @@ namespace DiscImageChef.Core.Devices.Dumping
|
||||
Value = outputPrefix + ".bin"
|
||||
};
|
||||
if(!dev.IsRemovable || dev.IsUsb)
|
||||
{
|
||||
if(dev.Type == DeviceType.ATAPI) sidecar.BlockMedia[0].Interface = "ATAPI";
|
||||
else if(dev.IsUsb) sidecar.BlockMedia[0].Interface = "USB";
|
||||
else if(dev.IsFireWire) sidecar.BlockMedia[0].Interface = "FireWire";
|
||||
else sidecar.BlockMedia[0].Interface = "SCSI";
|
||||
}
|
||||
sidecar.BlockMedia[0].LogicalBlocks = (long)blocks;
|
||||
sidecar.BlockMedia[0].PhysicalBlockSize = (int)physicalBlockSize;
|
||||
sidecar.BlockMedia[0].LogicalBlockSize = (int)logicalBlockSize;
|
||||
|
||||
@@ -604,7 +604,7 @@ namespace DiscImageChef.Core.Devices.Dumping
|
||||
{
|
||||
List<ulong> tmpList = new List<ulong>();
|
||||
|
||||
foreach(ulong ur in resume.BadBlocks) { for(ulong i = ur; i < ur + blocksToRead; i++) tmpList.Add(i); }
|
||||
foreach(ulong ur in resume.BadBlocks) for(ulong i = ur; i < ur + blocksToRead; i++) tmpList.Add(i);
|
||||
|
||||
tmpList.Sort();
|
||||
|
||||
@@ -732,7 +732,7 @@ namespace DiscImageChef.Core.Devices.Dumping
|
||||
|
||||
dumpLog.WriteLine("Sending MODE SELECT to drive.");
|
||||
sense = dev.ModeSelect(md6, out senseBuf, true, false, dev.Timeout, out duration);
|
||||
if(sense) { sense = dev.ModeSelect10(md10, out senseBuf, true, false, dev.Timeout, out duration); }
|
||||
if(sense) sense = dev.ModeSelect10(md10, out senseBuf, true, false, dev.Timeout, out duration);
|
||||
|
||||
runningPersistent = true;
|
||||
if(!sense && !dev.Error)
|
||||
@@ -753,7 +753,7 @@ namespace DiscImageChef.Core.Devices.Dumping
|
||||
|
||||
dumpLog.WriteLine("Sending MODE SELECT to drive.");
|
||||
sense = dev.ModeSelect(md6, out senseBuf, true, false, dev.Timeout, out duration);
|
||||
if(sense) { sense = dev.ModeSelect10(md10, out senseBuf, true, false, dev.Timeout, out duration); }
|
||||
if(sense) sense = dev.ModeSelect10(md10, out senseBuf, true, false, dev.Timeout, out duration);
|
||||
}
|
||||
|
||||
DicConsole.WriteLine();
|
||||
@@ -848,7 +848,6 @@ namespace DiscImageChef.Core.Devices.Dumping
|
||||
partitions[i].Scheme);
|
||||
|
||||
foreach(Filesystem plugin in plugins.PluginsList.Values)
|
||||
{
|
||||
try
|
||||
{
|
||||
if(plugin.Identify(imageFormat, partitions[i]))
|
||||
@@ -872,7 +871,6 @@ namespace DiscImageChef.Core.Devices.Dumping
|
||||
{
|
||||
//DicConsole.DebugWriteLine("Dump-media command", "Plugin {0} crashed", _plugin.Name);
|
||||
}
|
||||
}
|
||||
|
||||
if(lstFs.Count > 0) xmlFileSysInfo[i].FileSystems = lstFs.ToArray();
|
||||
}
|
||||
@@ -888,7 +886,6 @@ namespace DiscImageChef.Core.Devices.Dumping
|
||||
new Partition {Name = "Whole device", Length = blocks, Size = blocks * blockSize};
|
||||
|
||||
foreach(Filesystem plugin in plugins.PluginsList.Values)
|
||||
{
|
||||
try
|
||||
{
|
||||
if(plugin.Identify(imageFormat, wholePart))
|
||||
@@ -910,7 +907,6 @@ namespace DiscImageChef.Core.Devices.Dumping
|
||||
{
|
||||
//DicConsole.DebugWriteLine("Create-sidecar command", "Plugin {0} crashed", _plugin.Name);
|
||||
}
|
||||
}
|
||||
|
||||
if(lstFs.Count > 0) xmlFileSysInfo[0].FileSystems = lstFs.ToArray();
|
||||
}
|
||||
|
||||
@@ -350,12 +350,16 @@ namespace DiscImageChef.Core.Devices
|
||||
else
|
||||
{
|
||||
if(dev.Manufacturer == "HL-DT-ST")
|
||||
{
|
||||
hldtstReadRaw =
|
||||
!dev.HlDtStReadRawDvd(out readBuffer, out senseBuf, 0, 1, timeout, out duration);
|
||||
}
|
||||
|
||||
if(dev.Manufacturer == "PLEXTOR")
|
||||
{
|
||||
plextorReadRaw =
|
||||
!dev.PlextorReadRawDvd(out readBuffer, out senseBuf, 0, 1, timeout, out duration);
|
||||
}
|
||||
|
||||
if(hldtstReadRaw || plextorReadRaw)
|
||||
{
|
||||
@@ -500,39 +504,59 @@ namespace DiscImageChef.Core.Devices
|
||||
if(readRaw)
|
||||
{
|
||||
if(readLong16)
|
||||
{
|
||||
sense = dev.ReadLong16(out buffer, out senseBuf, false, block, longBlockSize, timeout,
|
||||
out duration);
|
||||
}
|
||||
else if(readLong10)
|
||||
{
|
||||
sense = dev.ReadLong10(out buffer, out senseBuf, false, false, (uint)block, (ushort)longBlockSize,
|
||||
timeout, out duration);
|
||||
}
|
||||
else if(syqReadLong10)
|
||||
{
|
||||
sense = dev.SyQuestReadLong10(out buffer, out senseBuf, (uint)block, longBlockSize, timeout,
|
||||
out duration);
|
||||
}
|
||||
else if(syqReadLong6)
|
||||
{
|
||||
sense = dev.SyQuestReadLong6(out buffer, out senseBuf, (uint)block, longBlockSize, timeout,
|
||||
out duration);
|
||||
}
|
||||
else if(hldtstReadRaw)
|
||||
{
|
||||
sense = dev.HlDtStReadRawDvd(out buffer, out senseBuf, (uint)block, longBlockSize, timeout,
|
||||
out duration);
|
||||
}
|
||||
else if(plextorReadRaw)
|
||||
{
|
||||
sense = dev.PlextorReadRawDvd(out buffer, out senseBuf, (uint)block, longBlockSize, timeout,
|
||||
out duration);
|
||||
}
|
||||
else return true;
|
||||
}
|
||||
else
|
||||
{
|
||||
if(read16)
|
||||
{
|
||||
sense = dev.Read16(out buffer, out senseBuf, 0, false, true, false, block, blockSize, 0, count,
|
||||
false, timeout, out duration);
|
||||
}
|
||||
else if(read12)
|
||||
{
|
||||
sense = dev.Read12(out buffer, out senseBuf, 0, false, false, false, false, (uint)block, blockSize,
|
||||
0, count, false, timeout, out duration);
|
||||
}
|
||||
else if(read10)
|
||||
{
|
||||
sense = dev.Read10(out buffer, out senseBuf, 0, false, true, false, false, (uint)block, blockSize,
|
||||
0, (ushort)count, timeout, out duration);
|
||||
}
|
||||
else if(read6)
|
||||
{
|
||||
sense = dev.Read6(out buffer, out senseBuf, (uint)block, blockSize, (byte)count, timeout,
|
||||
out duration);
|
||||
}
|
||||
else return true;
|
||||
}
|
||||
|
||||
|
||||
@@ -553,9 +553,11 @@ namespace DiscImageChef.Core.Devices.Report
|
||||
mediaTest.CurrentCHS.Heads = ataId.CurrentHeads;
|
||||
mediaTest.CurrentCHS.Sectors = ataId.CurrentSectorsPerTrack;
|
||||
if(mediaTest.Blocks == 0)
|
||||
{
|
||||
mediaTest.Blocks =
|
||||
(ulong)(ataId.CurrentCylinders * ataId.CurrentHeads *
|
||||
ataId.CurrentSectorsPerTrack);
|
||||
}
|
||||
mediaTest.BlocksSpecified = true;
|
||||
}
|
||||
|
||||
@@ -696,9 +698,11 @@ namespace DiscImageChef.Core.Devices.Report
|
||||
"Sense = {0}, Status = 0x{1:X2}, Error = 0x{2:X2}, Length = {3}",
|
||||
sense, errorChs.status, errorChs.error, readBuf.Length);
|
||||
if(debug)
|
||||
{
|
||||
DataFile.WriteTo("ATA Report", "readsectorschs",
|
||||
"_debug_" + mediaTest.MediumTypeName + ".bin", "read results",
|
||||
readBuf);
|
||||
}
|
||||
|
||||
DicConsole.WriteLine("Trying READ SECTOR(S) RETRY in CHS mode...");
|
||||
sense = dev.Read(out readBuf, out errorChs, true, 0, 0, 1, 1, timeout, out duration);
|
||||
@@ -709,9 +713,11 @@ namespace DiscImageChef.Core.Devices.Report
|
||||
"Sense = {0}, Status = 0x{1:X2}, Error = 0x{2:X2}, Length = {3}",
|
||||
sense, errorChs.status, errorChs.error, readBuf.Length);
|
||||
if(debug)
|
||||
{
|
||||
DataFile.WriteTo("ATA Report", "readsectorsretrychs",
|
||||
"_debug_" + mediaTest.MediumTypeName + ".bin", "read results",
|
||||
readBuf);
|
||||
}
|
||||
|
||||
DicConsole.WriteLine("Trying READ DMA in CHS mode...");
|
||||
sense = dev.ReadDma(out readBuf, out errorChs, false, 0, 0, 1, 1, timeout,
|
||||
@@ -723,9 +729,11 @@ namespace DiscImageChef.Core.Devices.Report
|
||||
"Sense = {0}, Status = 0x{1:X2}, Error = 0x{2:X2}, Length = {3}",
|
||||
sense, errorChs.status, errorChs.error, readBuf.Length);
|
||||
if(debug)
|
||||
{
|
||||
DataFile.WriteTo("ATA Report", "readdmachs",
|
||||
"_debug_" + mediaTest.MediumTypeName + ".bin", "read results",
|
||||
readBuf);
|
||||
}
|
||||
|
||||
DicConsole.WriteLine("Trying READ DMA RETRY in CHS mode...");
|
||||
sense = dev.ReadDma(out readBuf, out errorChs, true, 0, 0, 1, 1, timeout, out duration);
|
||||
@@ -736,9 +744,11 @@ namespace DiscImageChef.Core.Devices.Report
|
||||
"Sense = {0}, Status = 0x{1:X2}, Error = 0x{2:X2}, Length = {3}",
|
||||
sense, errorChs.status, errorChs.error, readBuf.Length);
|
||||
if(debug)
|
||||
{
|
||||
DataFile.WriteTo("ATA Report", "readdmaretrychs",
|
||||
"_debug_" + mediaTest.MediumTypeName + ".bin", "read results",
|
||||
readBuf);
|
||||
}
|
||||
|
||||
DicConsole.WriteLine("Trying SEEK in CHS mode...");
|
||||
sense = dev.Seek(out errorChs, 0, 0, 1, timeout, out duration);
|
||||
@@ -757,9 +767,11 @@ namespace DiscImageChef.Core.Devices.Report
|
||||
"Sense = {0}, Status = 0x{1:X2}, Error = 0x{2:X2}, Length = {3}",
|
||||
sense, errorChs.status, errorChs.error, readBuf.Length);
|
||||
if(debug)
|
||||
{
|
||||
DataFile.WriteTo("ATA Report", "readsectors",
|
||||
"_debug_" + mediaTest.MediumTypeName + ".bin", "read results",
|
||||
readBuf);
|
||||
}
|
||||
|
||||
DicConsole.WriteLine("Trying READ SECTOR(S) RETRY in LBA mode...");
|
||||
sense = dev.Read(out readBuf, out errorLba, true, 0, 1, timeout, out duration);
|
||||
@@ -770,9 +782,11 @@ namespace DiscImageChef.Core.Devices.Report
|
||||
"Sense = {0}, Status = 0x{1:X2}, Error = 0x{2:X2}, Length = {3}",
|
||||
sense, errorChs.status, errorChs.error, readBuf.Length);
|
||||
if(debug)
|
||||
{
|
||||
DataFile.WriteTo("ATA Report", "readsectorsretry",
|
||||
"_debug_" + mediaTest.MediumTypeName + ".bin", "read results",
|
||||
readBuf);
|
||||
}
|
||||
|
||||
DicConsole.WriteLine("Trying READ DMA in LBA mode...");
|
||||
sense = dev.ReadDma(out readBuf, out errorLba, false, 0, 1, timeout, out duration);
|
||||
@@ -783,9 +797,11 @@ namespace DiscImageChef.Core.Devices.Report
|
||||
"Sense = {0}, Status = 0x{1:X2}, Error = 0x{2:X2}, Length = {3}",
|
||||
sense, errorChs.status, errorChs.error, readBuf.Length);
|
||||
if(debug)
|
||||
{
|
||||
DataFile.WriteTo("ATA Report", "readdma",
|
||||
"_debug_" + mediaTest.MediumTypeName + ".bin", "read results",
|
||||
readBuf);
|
||||
}
|
||||
|
||||
DicConsole.WriteLine("Trying READ DMA RETRY in LBA mode...");
|
||||
sense = dev.ReadDma(out readBuf, out errorLba, true, 0, 1, timeout, out duration);
|
||||
@@ -796,9 +812,11 @@ namespace DiscImageChef.Core.Devices.Report
|
||||
"Sense = {0}, Status = 0x{1:X2}, Error = 0x{2:X2}, Length = {3}",
|
||||
sense, errorChs.status, errorChs.error, readBuf.Length);
|
||||
if(debug)
|
||||
{
|
||||
DataFile.WriteTo("ATA Report", "readdmaretry",
|
||||
"_debug_" + mediaTest.MediumTypeName + ".bin", "read results",
|
||||
readBuf);
|
||||
}
|
||||
|
||||
DicConsole.WriteLine("Trying SEEK in LBA mode...");
|
||||
sense = dev.Seek(out errorLba, 0, timeout, out duration);
|
||||
@@ -817,9 +835,11 @@ namespace DiscImageChef.Core.Devices.Report
|
||||
"Sense = {0}, Status = 0x{1:X2}, Error = 0x{2:X2}, Length = {3}",
|
||||
sense, errorChs.status, errorChs.error, readBuf.Length);
|
||||
if(debug)
|
||||
{
|
||||
DataFile.WriteTo("ATA Report", "readsectors48",
|
||||
"_debug_" + mediaTest.MediumTypeName + ".bin", "read results",
|
||||
readBuf);
|
||||
}
|
||||
|
||||
DicConsole.WriteLine("Trying READ DMA in LBA48 mode...");
|
||||
sense = dev.ReadDma(out readBuf, out errorLba48, 0, 1, timeout, out duration);
|
||||
@@ -830,9 +850,11 @@ namespace DiscImageChef.Core.Devices.Report
|
||||
"Sense = {0}, Status = 0x{1:X2}, Error = 0x{2:X2}, Length = {3}",
|
||||
sense, errorChs.status, errorChs.error, readBuf.Length);
|
||||
if(debug)
|
||||
{
|
||||
DataFile.WriteTo("ATA Report", "readdma48",
|
||||
"_debug_" + mediaTest.MediumTypeName + ".bin", "read results",
|
||||
readBuf);
|
||||
}
|
||||
|
||||
DicConsole.WriteLine("Trying READ LONG in CHS mode...");
|
||||
sense = dev.ReadLong(out readBuf, out errorChs, false, 0, 0, 1, mediaTest.LongBlockSize,
|
||||
@@ -844,9 +866,11 @@ namespace DiscImageChef.Core.Devices.Report
|
||||
"Sense = {0}, Status = 0x{1:X2}, Error = 0x{2:X2}, Length = {3}",
|
||||
sense, errorChs.status, errorChs.error, readBuf.Length);
|
||||
if(debug)
|
||||
{
|
||||
DataFile.WriteTo("ATA Report", "readlongchs",
|
||||
"_debug_" + mediaTest.MediumTypeName + ".bin", "read results",
|
||||
readBuf);
|
||||
}
|
||||
|
||||
DicConsole.WriteLine("Trying READ LONG RETRY in CHS mode...");
|
||||
sense = dev.ReadLong(out readBuf, out errorChs, true, 0, 0, 1, mediaTest.LongBlockSize,
|
||||
@@ -858,9 +882,11 @@ namespace DiscImageChef.Core.Devices.Report
|
||||
"Sense = {0}, Status = 0x{1:X2}, Error = 0x{2:X2}, Length = {3}",
|
||||
sense, errorChs.status, errorChs.error, readBuf.Length);
|
||||
if(debug)
|
||||
{
|
||||
DataFile.WriteTo("ATA Report", "readlongretrychs",
|
||||
"_debug_" + mediaTest.MediumTypeName + ".bin", "read results",
|
||||
readBuf);
|
||||
}
|
||||
|
||||
DicConsole.WriteLine("Trying READ LONG in LBA mode...");
|
||||
sense = dev.ReadLong(out readBuf, out errorLba, false, 0, mediaTest.LongBlockSize,
|
||||
@@ -872,9 +898,11 @@ namespace DiscImageChef.Core.Devices.Report
|
||||
"Sense = {0}, Status = 0x{1:X2}, Error = 0x{2:X2}, Length = {3}",
|
||||
sense, errorChs.status, errorChs.error, readBuf.Length);
|
||||
if(debug)
|
||||
{
|
||||
DataFile.WriteTo("ATA Report", "readlong",
|
||||
"_debug_" + mediaTest.MediumTypeName + ".bin", "read results",
|
||||
readBuf);
|
||||
}
|
||||
|
||||
DicConsole.WriteLine("Trying READ LONG RETRY in LBA mode...");
|
||||
sense = dev.ReadLong(out readBuf, out errorLba, true, 0, mediaTest.LongBlockSize,
|
||||
@@ -886,9 +914,11 @@ namespace DiscImageChef.Core.Devices.Report
|
||||
"Sense = {0}, Status = 0x{1:X2}, Error = 0x{2:X2}, Length = {3}",
|
||||
sense, errorChs.status, errorChs.error, readBuf.Length);
|
||||
if(debug)
|
||||
{
|
||||
DataFile.WriteTo("ATA Report", "readlongretry",
|
||||
"_debug_" + mediaTest.MediumTypeName + ".bin", "read results",
|
||||
readBuf);
|
||||
}
|
||||
}
|
||||
else mediaTest.MediaIsRecognized = false;
|
||||
|
||||
@@ -1070,8 +1100,10 @@ namespace DiscImageChef.Core.Devices.Report
|
||||
"Sense = {0}, Status = 0x{1:X2}, Error = 0x{2:X2}, Length = {3}", sense,
|
||||
errorChs.status, errorChs.error, readBuf.Length);
|
||||
if(debug)
|
||||
{
|
||||
DataFile.WriteTo("ATA Report", "readsectorschs", "_debug_" + report.ATA.Model + ".bin",
|
||||
"read results", readBuf);
|
||||
}
|
||||
|
||||
DicConsole.WriteLine("Trying READ SECTOR(S) RETRY in CHS mode...");
|
||||
sense = dev.Read(out readBuf, out errorChs, true, 0, 0, 1, 1, timeout, out duration);
|
||||
@@ -1081,8 +1113,10 @@ namespace DiscImageChef.Core.Devices.Report
|
||||
"Sense = {0}, Status = 0x{1:X2}, Error = 0x{2:X2}, Length = {3}", sense,
|
||||
errorChs.status, errorChs.error, readBuf.Length);
|
||||
if(debug)
|
||||
{
|
||||
DataFile.WriteTo("ATA Report", "readsectorsretrychs", "_debug_" + report.ATA.Model + ".bin",
|
||||
"read results", readBuf);
|
||||
}
|
||||
|
||||
DicConsole.WriteLine("Trying READ DMA in CHS mode...");
|
||||
sense = dev.ReadDma(out readBuf, out errorChs, false, 0, 0, 1, 1, timeout, out duration);
|
||||
@@ -1092,8 +1126,10 @@ namespace DiscImageChef.Core.Devices.Report
|
||||
"Sense = {0}, Status = 0x{1:X2}, Error = 0x{2:X2}, Length = {3}", sense,
|
||||
errorChs.status, errorChs.error, readBuf.Length);
|
||||
if(debug)
|
||||
{
|
||||
DataFile.WriteTo("ATA Report", "readdmachs", "_debug_" + report.ATA.Model + ".bin",
|
||||
"read results", readBuf);
|
||||
}
|
||||
|
||||
DicConsole.WriteLine("Trying READ DMA RETRY in CHS mode...");
|
||||
sense = dev.ReadDma(out readBuf, out errorChs, true, 0, 0, 1, 1, timeout, out duration);
|
||||
@@ -1103,8 +1139,10 @@ namespace DiscImageChef.Core.Devices.Report
|
||||
"Sense = {0}, Status = 0x{1:X2}, Error = 0x{2:X2}, Length = {3}", sense,
|
||||
errorChs.status, errorChs.error, readBuf.Length);
|
||||
if(debug)
|
||||
{
|
||||
DataFile.WriteTo("ATA Report", "readdmaretrychs", "_debug_" + report.ATA.Model + ".bin",
|
||||
"read results", readBuf);
|
||||
}
|
||||
|
||||
DicConsole.WriteLine("Trying SEEK in CHS mode...");
|
||||
sense = dev.Seek(out errorChs, 0, 0, 1, timeout, out duration);
|
||||
@@ -1121,8 +1159,10 @@ namespace DiscImageChef.Core.Devices.Report
|
||||
"Sense = {0}, Status = 0x{1:X2}, Error = 0x{2:X2}, Length = {3}", sense,
|
||||
errorLba.status, errorLba.error, readBuf.Length);
|
||||
if(debug)
|
||||
{
|
||||
DataFile.WriteTo("ATA Report", "readsectors", "_debug_" + report.ATA.Model + ".bin",
|
||||
"read results", readBuf);
|
||||
}
|
||||
|
||||
DicConsole.WriteLine("Trying READ SECTOR(S) RETRY in LBA mode...");
|
||||
sense = dev.Read(out readBuf, out errorLba, true, 0, 1, timeout, out duration);
|
||||
@@ -1132,8 +1172,10 @@ namespace DiscImageChef.Core.Devices.Report
|
||||
"Sense = {0}, Status = 0x{1:X2}, Error = 0x{2:X2}, Length = {3}", sense,
|
||||
errorLba.status, errorLba.error, readBuf.Length);
|
||||
if(debug)
|
||||
{
|
||||
DataFile.WriteTo("ATA Report", "readsectorsretry", "_debug_" + report.ATA.Model + ".bin",
|
||||
"read results", readBuf);
|
||||
}
|
||||
|
||||
DicConsole.WriteLine("Trying READ DMA in LBA mode...");
|
||||
sense = dev.ReadDma(out readBuf, out errorLba, false, 0, 1, timeout, out duration);
|
||||
@@ -1143,8 +1185,10 @@ namespace DiscImageChef.Core.Devices.Report
|
||||
"Sense = {0}, Status = 0x{1:X2}, Error = 0x{2:X2}, Length = {3}", sense,
|
||||
errorLba.status, errorLba.error, readBuf.Length);
|
||||
if(debug)
|
||||
{
|
||||
DataFile.WriteTo("ATA Report", "readdma", "_debug_" + report.ATA.Model + ".bin", "read results",
|
||||
readBuf);
|
||||
}
|
||||
|
||||
DicConsole.WriteLine("Trying READ DMA RETRY in LBA mode...");
|
||||
sense = dev.ReadDma(out readBuf, out errorLba, true, 0, 1, timeout, out duration);
|
||||
@@ -1154,8 +1198,10 @@ namespace DiscImageChef.Core.Devices.Report
|
||||
"Sense = {0}, Status = 0x{1:X2}, Error = 0x{2:X2}, Length = {3}", sense,
|
||||
errorLba.status, errorLba.error, readBuf.Length);
|
||||
if(debug)
|
||||
{
|
||||
DataFile.WriteTo("ATA Report", "readdmaretry", "_debug_" + report.ATA.Model + ".bin",
|
||||
"read results", readBuf);
|
||||
}
|
||||
|
||||
DicConsole.WriteLine("Trying SEEK in LBA mode...");
|
||||
sense = dev.Seek(out errorLba, 0, timeout, out duration);
|
||||
@@ -1172,8 +1218,10 @@ namespace DiscImageChef.Core.Devices.Report
|
||||
"Sense = {0}, Status = 0x{1:X2}, Error = 0x{2:X2}, Length = {3}", sense,
|
||||
errorLba48.status, errorLba48.error, readBuf.Length);
|
||||
if(debug)
|
||||
{
|
||||
DataFile.WriteTo("ATA Report", "readsectors48", "_debug_" + report.ATA.Model + ".bin",
|
||||
"read results", readBuf);
|
||||
}
|
||||
|
||||
DicConsole.WriteLine("Trying READ DMA in LBA48 mode...");
|
||||
sense = dev.ReadDma(out readBuf, out errorLba48, 0, 1, timeout, out duration);
|
||||
@@ -1183,8 +1231,10 @@ namespace DiscImageChef.Core.Devices.Report
|
||||
"Sense = {0}, Status = 0x{1:X2}, Error = 0x{2:X2}, Length = {3}", sense,
|
||||
errorLba48.status, errorLba48.error, readBuf.Length);
|
||||
if(debug)
|
||||
{
|
||||
DataFile.WriteTo("ATA Report", "readdma48", "_debug_" + report.ATA.Model + ".bin",
|
||||
"read results", readBuf);
|
||||
}
|
||||
|
||||
DicConsole.WriteLine("Trying READ LONG in CHS mode...");
|
||||
sense = dev.ReadLong(out readBuf, out errorChs, false, 0, 0, 1,
|
||||
@@ -1196,8 +1246,10 @@ namespace DiscImageChef.Core.Devices.Report
|
||||
"Sense = {0}, Status = 0x{1:X2}, Error = 0x{2:X2}, Length = {3}", sense,
|
||||
errorChs.status, errorChs.error, readBuf.Length);
|
||||
if(debug)
|
||||
{
|
||||
DataFile.WriteTo("ATA Report", "readlongchs", "_debug_" + report.ATA.Model + ".bin",
|
||||
"read results", readBuf);
|
||||
}
|
||||
|
||||
DicConsole.WriteLine("Trying READ LONG RETRY in CHS mode...");
|
||||
sense = dev.ReadLong(out readBuf, out errorChs, true, 0, 0, 1,
|
||||
@@ -1209,8 +1261,10 @@ namespace DiscImageChef.Core.Devices.Report
|
||||
"Sense = {0}, Status = 0x{1:X2}, Error = 0x{2:X2}, Length = {3}", sense,
|
||||
errorChs.status, errorChs.error, readBuf.Length);
|
||||
if(debug)
|
||||
{
|
||||
DataFile.WriteTo("ATA Report", "readlongretrychs", "_debug_" + report.ATA.Model + ".bin",
|
||||
"read results", readBuf);
|
||||
}
|
||||
|
||||
DicConsole.WriteLine("Trying READ LONG in LBA mode...");
|
||||
sense = dev.ReadLong(out readBuf, out errorLba, false, 0, report.ATA.ReadCapabilities.LongBlockSize,
|
||||
@@ -1222,8 +1276,10 @@ namespace DiscImageChef.Core.Devices.Report
|
||||
"Sense = {0}, Status = 0x{1:X2}, Error = 0x{2:X2}, Length = {3}", sense,
|
||||
errorLba.status, errorLba.error, readBuf.Length);
|
||||
if(debug)
|
||||
{
|
||||
DataFile.WriteTo("ATA Report", "readlong", "_debug_" + report.ATA.Model + ".bin",
|
||||
"read results", readBuf);
|
||||
}
|
||||
|
||||
DicConsole.WriteLine("Trying READ LONG RETRY in LBA mode...");
|
||||
sense = dev.ReadLong(out readBuf, out errorLba, true, 0, report.ATA.ReadCapabilities.LongBlockSize,
|
||||
@@ -1235,8 +1291,10 @@ namespace DiscImageChef.Core.Devices.Report
|
||||
"Sense = {0}, Status = 0x{1:X2}, Error = 0x{2:X2}, Length = {3}", sense,
|
||||
errorLba.status, errorLba.error, readBuf.Length);
|
||||
if(debug)
|
||||
{
|
||||
DataFile.WriteTo("ATA Report", "readlongretry", "_debug_" + report.ATA.Model + ".bin",
|
||||
"read results", readBuf);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -133,10 +133,7 @@ namespace DiscImageChef.Core.Devices.Report.SCSI
|
||||
}
|
||||
if(inq.VersionDescriptors != null)
|
||||
{
|
||||
foreach(ushort descriptor in inq.VersionDescriptors)
|
||||
{
|
||||
if(descriptor != 0) versionDescriptors.Add(descriptor);
|
||||
}
|
||||
foreach(ushort descriptor in inq.VersionDescriptors) if(descriptor != 0) versionDescriptors.Add(descriptor);
|
||||
|
||||
if(versionDescriptors.Count > 0)
|
||||
report.SCSI.Inquiry.VersionDescriptors = versionDescriptors.ToArray();
|
||||
@@ -305,10 +302,7 @@ namespace DiscImageChef.Core.Devices.Report.SCSI
|
||||
modePage.value = page.PageResponse;
|
||||
modePages.Add(modePage);
|
||||
|
||||
if(modePage.page == 0x2A && modePage.subpage == 0x00)
|
||||
{
|
||||
cdromMode = Decoders.SCSI.Modes.DecodeModePage_2A(page.PageResponse);
|
||||
}
|
||||
if(modePage.page == 0x2A && modePage.subpage == 0x00) cdromMode = Decoders.SCSI.Modes.DecodeModePage_2A(page.PageResponse);
|
||||
}
|
||||
|
||||
if(modePages.Count > 0) report.SCSI.ModeSense.ModePages = modePages.ToArray();
|
||||
@@ -477,9 +471,11 @@ namespace DiscImageChef.Core.Devices.Report.SCSI
|
||||
timeout, out duration);
|
||||
DicConsole.DebugWriteLine("SCSI Report", "Sense = {0}", !mediaTest.SupportsRead);
|
||||
if(debug)
|
||||
{
|
||||
DataFile.WriteTo("SCSI Report", "read6",
|
||||
"_debug_" + mediaTest.MediumTypeName + ".bin", "read results",
|
||||
buffer);
|
||||
}
|
||||
|
||||
DicConsole.WriteLine("Trying SCSI READ (10)...");
|
||||
mediaTest.SupportsRead10 =
|
||||
@@ -487,9 +483,11 @@ namespace DiscImageChef.Core.Devices.Report.SCSI
|
||||
mediaTest.BlockSize, 0, 1, timeout, out duration);
|
||||
DicConsole.DebugWriteLine("SCSI Report", "Sense = {0}", !mediaTest.SupportsRead10);
|
||||
if(debug)
|
||||
{
|
||||
DataFile.WriteTo("SCSI Report", "read10",
|
||||
"_debug_" + mediaTest.MediumTypeName + ".bin", "read results",
|
||||
buffer);
|
||||
}
|
||||
|
||||
DicConsole.WriteLine("Trying SCSI READ (12)...");
|
||||
mediaTest.SupportsRead12 =
|
||||
@@ -497,9 +495,11 @@ namespace DiscImageChef.Core.Devices.Report.SCSI
|
||||
mediaTest.BlockSize, 0, 1, false, timeout, out duration);
|
||||
DicConsole.DebugWriteLine("SCSI Report", "Sense = {0}", !mediaTest.SupportsRead12);
|
||||
if(debug)
|
||||
{
|
||||
DataFile.WriteTo("SCSI Report", "read12",
|
||||
"_debug_" + mediaTest.MediumTypeName + ".bin", "read results",
|
||||
buffer);
|
||||
}
|
||||
|
||||
DicConsole.WriteLine("Trying SCSI READ (16)...");
|
||||
mediaTest.SupportsRead16 =
|
||||
@@ -507,9 +507,11 @@ namespace DiscImageChef.Core.Devices.Report.SCSI
|
||||
mediaTest.BlockSize, 0, 1, false, timeout, out duration);
|
||||
DicConsole.DebugWriteLine("SCSI Report", "Sense = {0}", !mediaTest.SupportsRead16);
|
||||
if(debug)
|
||||
{
|
||||
DataFile.WriteTo("SCSI Report", "read16",
|
||||
"_debug_" + mediaTest.MediumTypeName + ".bin", "read results",
|
||||
buffer);
|
||||
}
|
||||
|
||||
mediaTest.LongBlockSize = mediaTest.BlockSize;
|
||||
DicConsole.WriteLine("Trying SCSI READ LONG (10)...");
|
||||
@@ -653,9 +655,11 @@ namespace DiscImageChef.Core.Devices.Report.SCSI
|
||||
sense = dev.ReadLong10(out buffer, out senseBuffer, false, false, 0,
|
||||
(ushort)mediaTest.LongBlockSize, timeout, out duration);
|
||||
if(!sense)
|
||||
{
|
||||
DataFile.WriteTo("SCSI Report", "readlong10",
|
||||
"_debug_" + mediaTest.MediumTypeName + ".bin", "read results",
|
||||
buffer);
|
||||
}
|
||||
}
|
||||
|
||||
mediaTest.CanReadMediaSerialSpecified = true;
|
||||
@@ -753,9 +757,11 @@ namespace DiscImageChef.Core.Devices.Report.SCSI
|
||||
timeout, out duration);
|
||||
DicConsole.DebugWriteLine("SCSI Report", "Sense = {0}", !report.SCSI.ReadCapabilities.SupportsRead);
|
||||
if(debug)
|
||||
{
|
||||
DataFile.WriteTo("SCSI Report", "read6",
|
||||
"_debug_" + report.SCSI.Inquiry.ProductIdentification + ".bin", "read results",
|
||||
buffer);
|
||||
}
|
||||
|
||||
DicConsole.WriteLine("Trying SCSI READ (10)...");
|
||||
report.SCSI.ReadCapabilities.SupportsRead10 =
|
||||
@@ -764,9 +770,11 @@ namespace DiscImageChef.Core.Devices.Report.SCSI
|
||||
DicConsole.DebugWriteLine("SCSI Report", "Sense = {0}",
|
||||
!report.SCSI.ReadCapabilities.SupportsRead10);
|
||||
if(debug)
|
||||
{
|
||||
DataFile.WriteTo("SCSI Report", "read10",
|
||||
"_debug_" + report.SCSI.Inquiry.ProductIdentification + ".bin", "read results",
|
||||
buffer);
|
||||
}
|
||||
|
||||
DicConsole.WriteLine("Trying SCSI READ (12)...");
|
||||
report.SCSI.ReadCapabilities.SupportsRead12 =
|
||||
@@ -775,9 +783,11 @@ namespace DiscImageChef.Core.Devices.Report.SCSI
|
||||
DicConsole.DebugWriteLine("SCSI Report", "Sense = {0}",
|
||||
!report.SCSI.ReadCapabilities.SupportsRead12);
|
||||
if(debug)
|
||||
{
|
||||
DataFile.WriteTo("SCSI Report", "read12",
|
||||
"_debug_" + report.SCSI.Inquiry.ProductIdentification + ".bin", "read results",
|
||||
buffer);
|
||||
}
|
||||
|
||||
DicConsole.WriteLine("Trying SCSI READ (16)...");
|
||||
report.SCSI.ReadCapabilities.SupportsRead16 =
|
||||
@@ -786,9 +796,11 @@ namespace DiscImageChef.Core.Devices.Report.SCSI
|
||||
DicConsole.DebugWriteLine("SCSI Report", "Sense = {0}",
|
||||
!report.SCSI.ReadCapabilities.SupportsRead16);
|
||||
if(debug)
|
||||
{
|
||||
DataFile.WriteTo("SCSI Report", "read16",
|
||||
"_debug_" + report.SCSI.Inquiry.ProductIdentification + ".bin", "read results",
|
||||
buffer);
|
||||
}
|
||||
|
||||
report.SCSI.ReadCapabilities.LongBlockSize = report.SCSI.ReadCapabilities.BlockSize;
|
||||
DicConsole.WriteLine("Trying SCSI READ LONG (10)...");
|
||||
@@ -943,9 +955,11 @@ namespace DiscImageChef.Core.Devices.Report.SCSI
|
||||
(ushort)report.SCSI.ReadCapabilities.LongBlockSize, timeout,
|
||||
out duration);
|
||||
if(!sense)
|
||||
{
|
||||
DataFile.WriteTo("SCSI Report", "readlong10",
|
||||
"_debug_" + report.SCSI.Inquiry.ProductIdentification + ".bin",
|
||||
"read results", buffer);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -318,10 +318,7 @@ namespace DiscImageChef.Core.Devices.Report.SCSI
|
||||
report.SCSI.MultiMediaDevice.Features.CanReadDVDPlusRW = true;
|
||||
Decoders.SCSI.MMC.Feature_002A? ftr002A =
|
||||
Decoders.SCSI.MMC.Features.Decode_002A(desc.Data);
|
||||
if(ftr002A.HasValue)
|
||||
{
|
||||
report.SCSI.MultiMediaDevice.Features.CanWriteDVDPlusRW = ftr002A.Value.Write;
|
||||
}
|
||||
if(ftr002A.HasValue) report.SCSI.MultiMediaDevice.Features.CanWriteDVDPlusRW = ftr002A.Value.Write;
|
||||
}
|
||||
break;
|
||||
case 0x002B:
|
||||
@@ -329,10 +326,7 @@ namespace DiscImageChef.Core.Devices.Report.SCSI
|
||||
report.SCSI.MultiMediaDevice.Features.CanReadDVDPlusR = true;
|
||||
Decoders.SCSI.MMC.Feature_002B? ftr002B =
|
||||
Decoders.SCSI.MMC.Features.Decode_002B(desc.Data);
|
||||
if(ftr002B.HasValue)
|
||||
{
|
||||
report.SCSI.MultiMediaDevice.Features.CanWriteDVDPlusR = ftr002B.Value.Write;
|
||||
}
|
||||
if(ftr002B.HasValue) report.SCSI.MultiMediaDevice.Features.CanWriteDVDPlusR = ftr002B.Value.Write;
|
||||
}
|
||||
break;
|
||||
case 0x002D:
|
||||
@@ -686,10 +680,7 @@ namespace DiscImageChef.Core.Devices.Report.SCSI
|
||||
if(!mediaTypes.Contains("CD-RW")) mediaTypes.Add("CD-RW");
|
||||
}
|
||||
|
||||
if(report.SCSI.MultiMediaDevice.Features.CanReadCDMRW)
|
||||
{
|
||||
if(!mediaTypes.Contains("CD-MRW")) mediaTypes.Add("CD-MRW");
|
||||
}
|
||||
if(report.SCSI.MultiMediaDevice.Features.CanReadCDMRW) if(!mediaTypes.Contains("CD-MRW")) mediaTypes.Add("CD-MRW");
|
||||
|
||||
if(report.SCSI.MultiMediaDevice.Features.CanReadDDCD)
|
||||
{
|
||||
@@ -714,10 +705,7 @@ namespace DiscImageChef.Core.Devices.Report.SCSI
|
||||
if(!mediaTypes.Contains("DVD+R DL")) mediaTypes.Add("DVD+R DL");
|
||||
}
|
||||
|
||||
if(report.SCSI.MultiMediaDevice.Features.CanReadDVDPlusMRW)
|
||||
{
|
||||
if(!mediaTypes.Contains("DVD+MRW")) mediaTypes.Add("DVD+MRW");
|
||||
}
|
||||
if(report.SCSI.MultiMediaDevice.Features.CanReadDVDPlusMRW) if(!mediaTypes.Contains("DVD+MRW")) mediaTypes.Add("DVD+MRW");
|
||||
|
||||
if(report.SCSI.MultiMediaDevice.Features.CanReadHDDVD ||
|
||||
report.SCSI.MultiMediaDevice.Features.CanReadHDDVDR)
|
||||
@@ -727,10 +715,7 @@ namespace DiscImageChef.Core.Devices.Report.SCSI
|
||||
if(!mediaTypes.Contains("HD DVD-RW")) mediaTypes.Add("HD DVD-RW");
|
||||
}
|
||||
|
||||
if(report.SCSI.MultiMediaDevice.Features.CanReadHDDVDRAM)
|
||||
{
|
||||
if(!mediaTypes.Contains("HD DVD-RAM")) mediaTypes.Add("HD DVD-RAM");
|
||||
}
|
||||
if(report.SCSI.MultiMediaDevice.Features.CanReadHDDVDRAM) if(!mediaTypes.Contains("HD DVD-RAM")) mediaTypes.Add("HD DVD-RAM");
|
||||
}
|
||||
|
||||
bool tryPlextor = false, tryHldtst = false, tryPioneer = false, tryNec = false;
|
||||
@@ -905,18 +890,22 @@ namespace DiscImageChef.Core.Devices.Report.SCSI
|
||||
!dev.ReadTocPmaAtip(out buffer, out senseBuffer, false, 0, 0, timeout, out duration);
|
||||
DicConsole.DebugWriteLine("SCSI Report", "Sense = {0}", !mediaTest.CanReadTOC);
|
||||
if(debug)
|
||||
{
|
||||
DataFile.WriteTo("SCSI Report", "readtoc",
|
||||
"_debug_" + report.SCSI.Inquiry.ProductIdentification + "_" +
|
||||
mediaType + ".bin", "read results", buffer);
|
||||
}
|
||||
|
||||
DicConsole.WriteLine("Querying CD Full TOC...");
|
||||
mediaTest.CanReadFullTOC =
|
||||
!dev.ReadRawToc(out buffer, out senseBuffer, 1, timeout, out duration);
|
||||
DicConsole.DebugWriteLine("SCSI Report", "Sense = {0}", !mediaTest.CanReadFullTOC);
|
||||
if(debug)
|
||||
{
|
||||
DataFile.WriteTo("SCSI Report", "readfulltoc",
|
||||
"_debug_" + report.SCSI.Inquiry.ProductIdentification + "_" +
|
||||
mediaType + ".bin", "read results", buffer);
|
||||
}
|
||||
}
|
||||
|
||||
if(mediaType.StartsWith("CD-R", StringComparison.Ordinal) ||
|
||||
@@ -928,16 +917,20 @@ namespace DiscImageChef.Core.Devices.Report.SCSI
|
||||
mediaTest.CanReadATIP = !dev.ReadAtip(out buffer, out senseBuffer, timeout, out duration);
|
||||
DicConsole.DebugWriteLine("SCSI Report", "Sense = {0}", !mediaTest.CanReadATIP);
|
||||
if(debug)
|
||||
{
|
||||
DataFile.WriteTo("SCSI Report", "atip",
|
||||
"_debug_" + report.SCSI.Inquiry.ProductIdentification + "_" +
|
||||
mediaType + ".bin", "read results", buffer);
|
||||
}
|
||||
DicConsole.WriteLine("Querying CD PMA...");
|
||||
mediaTest.CanReadPMA = !dev.ReadPma(out buffer, out senseBuffer, timeout, out duration);
|
||||
DicConsole.DebugWriteLine("SCSI Report", "Sense = {0}", !mediaTest.CanReadPMA);
|
||||
if(debug)
|
||||
{
|
||||
DataFile.WriteTo("SCSI Report", "pma",
|
||||
"_debug_" + report.SCSI.Inquiry.ProductIdentification + "_" +
|
||||
mediaType + ".bin", "read results", buffer);
|
||||
}
|
||||
}
|
||||
|
||||
if(mediaType.StartsWith("DVD-", StringComparison.Ordinal) ||
|
||||
@@ -952,9 +945,11 @@ namespace DiscImageChef.Core.Devices.Report.SCSI
|
||||
out duration);
|
||||
DicConsole.DebugWriteLine("SCSI Report", "Sense = {0}", !mediaTest.CanReadPFI);
|
||||
if(debug)
|
||||
{
|
||||
DataFile.WriteTo("SCSI Report", "pfi",
|
||||
"_debug_" + report.SCSI.Inquiry.ProductIdentification + "_" +
|
||||
mediaType + ".bin", "read results", buffer);
|
||||
}
|
||||
DicConsole.WriteLine("Querying DVD DMI...");
|
||||
mediaTest.CanReadDMI =
|
||||
!dev.ReadDiscStructure(out buffer, out senseBuffer, MmcDiscStructureMediaType.Dvd, 0, 0,
|
||||
@@ -962,9 +957,11 @@ namespace DiscImageChef.Core.Devices.Report.SCSI
|
||||
out duration);
|
||||
DicConsole.DebugWriteLine("SCSI Report", "Sense = {0}", !mediaTest.CanReadDMI);
|
||||
if(debug)
|
||||
{
|
||||
DataFile.WriteTo("SCSI Report", "dmi",
|
||||
"_debug_" + report.SCSI.Inquiry.ProductIdentification + "_" +
|
||||
mediaType + ".bin", "read results", buffer);
|
||||
}
|
||||
}
|
||||
|
||||
if(mediaType == "DVD-ROM")
|
||||
@@ -977,9 +974,11 @@ namespace DiscImageChef.Core.Devices.Report.SCSI
|
||||
out duration);
|
||||
DicConsole.DebugWriteLine("SCSI Report", "Sense = {0}", !mediaTest.CanReadCMI);
|
||||
if(debug)
|
||||
{
|
||||
DataFile.WriteTo("SCSI Report", "cmi",
|
||||
"_debug_" + report.SCSI.Inquiry.ProductIdentification + "_" +
|
||||
mediaType + ".bin", "read results", buffer);
|
||||
}
|
||||
}
|
||||
|
||||
if(mediaType == "DVD-ROM" || mediaType == "HD DVD-ROM")
|
||||
@@ -992,9 +991,11 @@ namespace DiscImageChef.Core.Devices.Report.SCSI
|
||||
out duration);
|
||||
DicConsole.DebugWriteLine("SCSI Report", "Sense = {0}", !mediaTest.CanReadBCA);
|
||||
if(debug)
|
||||
{
|
||||
DataFile.WriteTo("SCSI Report", "bca",
|
||||
"_debug_" + report.SCSI.Inquiry.ProductIdentification + "_" +
|
||||
mediaType + ".bin", "read results", buffer);
|
||||
}
|
||||
mediaTest.CanReadAACSSpecified = true;
|
||||
DicConsole.WriteLine("Querying DVD AACS...");
|
||||
mediaTest.CanReadAACS =
|
||||
@@ -1002,9 +1003,11 @@ namespace DiscImageChef.Core.Devices.Report.SCSI
|
||||
MmcDiscStructureFormat.DvdAacs, 0, timeout, out duration);
|
||||
DicConsole.DebugWriteLine("SCSI Report", "Sense = {0}", !mediaTest.CanReadAACS);
|
||||
if(debug)
|
||||
{
|
||||
DataFile.WriteTo("SCSI Report", "aacs",
|
||||
"_debug_" + report.SCSI.Inquiry.ProductIdentification + "_" +
|
||||
mediaType + ".bin", "read results", buffer);
|
||||
}
|
||||
}
|
||||
|
||||
if(mediaType == "BD-ROM")
|
||||
@@ -1017,9 +1020,11 @@ namespace DiscImageChef.Core.Devices.Report.SCSI
|
||||
out duration);
|
||||
DicConsole.DebugWriteLine("SCSI Report", "Sense = {0}", !mediaTest.CanReadBCA);
|
||||
if(debug)
|
||||
{
|
||||
DataFile.WriteTo("SCSI Report", "bdbca",
|
||||
"_debug_" + report.SCSI.Inquiry.ProductIdentification + "_" +
|
||||
mediaType + ".bin", "read results", buffer);
|
||||
}
|
||||
}
|
||||
|
||||
if(mediaType == "DVD-RAM" || mediaType == "HD DVD-RAM")
|
||||
@@ -1031,9 +1036,11 @@ namespace DiscImageChef.Core.Devices.Report.SCSI
|
||||
MmcDiscStructureFormat.DvdramDds, 0, timeout, out duration);
|
||||
DicConsole.DebugWriteLine("SCSI Report", "Sense = {0}", !mediaTest.CanReadDDS);
|
||||
if(debug)
|
||||
{
|
||||
DataFile.WriteTo("SCSI Report", "dds",
|
||||
"_debug_" + report.SCSI.Inquiry.ProductIdentification + "_" +
|
||||
mediaType + ".bin", "read results", buffer);
|
||||
}
|
||||
mediaTest.CanReadSpareAreaInformation =
|
||||
!dev.ReadDiscStructure(out buffer, out senseBuffer, MmcDiscStructureMediaType.Dvd, 0, 0,
|
||||
MmcDiscStructureFormat.DvdramSpareAreaInformation, 0, timeout,
|
||||
@@ -1041,9 +1048,11 @@ namespace DiscImageChef.Core.Devices.Report.SCSI
|
||||
DicConsole.DebugWriteLine("SCSI Report", "Sense = {0}",
|
||||
!mediaTest.CanReadSpareAreaInformation);
|
||||
if(debug)
|
||||
{
|
||||
DataFile.WriteTo("SCSI Report", "sai",
|
||||
"_debug_" + report.SCSI.Inquiry.ProductIdentification + "_" +
|
||||
mediaType + ".bin", "read results", buffer);
|
||||
}
|
||||
}
|
||||
|
||||
if(mediaType.StartsWith("BD-R", StringComparison.Ordinal) && mediaType != "BD-ROM")
|
||||
@@ -1056,9 +1065,11 @@ namespace DiscImageChef.Core.Devices.Report.SCSI
|
||||
MmcDiscStructureFormat.BdDds, 0, timeout, out duration);
|
||||
DicConsole.DebugWriteLine("SCSI Report", "Sense = {0}", !mediaTest.CanReadDDS);
|
||||
if(debug)
|
||||
{
|
||||
DataFile.WriteTo("SCSI Report", "bddds",
|
||||
"_debug_" + report.SCSI.Inquiry.ProductIdentification + "_" +
|
||||
mediaType + ".bin", "read results", buffer);
|
||||
}
|
||||
DicConsole.WriteLine("Querying BD SAI...");
|
||||
mediaTest.CanReadSpareAreaInformation =
|
||||
!dev.ReadDiscStructure(out buffer, out senseBuffer, MmcDiscStructureMediaType.Bd, 0, 0,
|
||||
@@ -1067,9 +1078,11 @@ namespace DiscImageChef.Core.Devices.Report.SCSI
|
||||
DicConsole.DebugWriteLine("SCSI Report", "Sense = {0}",
|
||||
!mediaTest.CanReadSpareAreaInformation);
|
||||
if(debug)
|
||||
{
|
||||
DataFile.WriteTo("SCSI Report", "bdsai",
|
||||
"_debug_" + report.SCSI.Inquiry.ProductIdentification + "_" +
|
||||
mediaType + ".bin", "read results", buffer);
|
||||
}
|
||||
}
|
||||
|
||||
if(mediaType == "DVD-R" || mediaType == "DVD-RW")
|
||||
@@ -1082,9 +1095,11 @@ namespace DiscImageChef.Core.Devices.Report.SCSI
|
||||
out duration);
|
||||
DicConsole.DebugWriteLine("SCSI Report", "Sense = {0}", !mediaTest.CanReadPRI);
|
||||
if(debug)
|
||||
{
|
||||
DataFile.WriteTo("SCSI Report", "pri",
|
||||
"_debug_" + report.SCSI.Inquiry.ProductIdentification + "_" +
|
||||
mediaType + ".bin", "read results", buffer);
|
||||
}
|
||||
}
|
||||
|
||||
if(mediaType == "DVD-R" || mediaType == "DVD-RW" || mediaType == "HD DVD-R")
|
||||
@@ -1098,9 +1113,11 @@ namespace DiscImageChef.Core.Devices.Report.SCSI
|
||||
out duration);
|
||||
DicConsole.DebugWriteLine("SCSI Report", "Sense = {0}", !mediaTest.CanReadMediaID);
|
||||
if(debug)
|
||||
{
|
||||
DataFile.WriteTo("SCSI Report", "mediaid",
|
||||
"_debug_" + report.SCSI.Inquiry.ProductIdentification + "_" +
|
||||
mediaType + ".bin", "read results", buffer);
|
||||
}
|
||||
DicConsole.WriteLine("Querying DVD Embossed PFI...");
|
||||
mediaTest.CanReadRecordablePFI =
|
||||
!dev.ReadDiscStructure(out buffer, out senseBuffer, MmcDiscStructureMediaType.Dvd, 0, 0,
|
||||
@@ -1108,9 +1125,11 @@ namespace DiscImageChef.Core.Devices.Report.SCSI
|
||||
out duration);
|
||||
DicConsole.DebugWriteLine("SCSI Report", "Sense = {0}", !mediaTest.CanReadRecordablePFI);
|
||||
if(debug)
|
||||
{
|
||||
DataFile.WriteTo("SCSI Report", "epfi",
|
||||
"_debug_" + report.SCSI.Inquiry.ProductIdentification + "_" +
|
||||
mediaType + ".bin", "read results", buffer);
|
||||
}
|
||||
}
|
||||
|
||||
if(mediaType.StartsWith("DVD+R", StringComparison.Ordinal) || mediaType == "DVD+MRW")
|
||||
@@ -1123,18 +1142,22 @@ namespace DiscImageChef.Core.Devices.Report.SCSI
|
||||
MmcDiscStructureFormat.Adip, 0, timeout, out duration);
|
||||
DicConsole.DebugWriteLine("SCSI Report", "Sense = {0}", !mediaTest.CanReadADIP);
|
||||
if(debug)
|
||||
{
|
||||
DataFile.WriteTo("SCSI Report", "adip",
|
||||
"_debug_" + report.SCSI.Inquiry.ProductIdentification + "_" +
|
||||
mediaType + ".bin", "read results", buffer);
|
||||
}
|
||||
DicConsole.WriteLine("Querying DVD DCB...");
|
||||
mediaTest.CanReadDCB =
|
||||
!dev.ReadDiscStructure(out buffer, out senseBuffer, MmcDiscStructureMediaType.Dvd, 0, 0,
|
||||
MmcDiscStructureFormat.Dcb, 0, timeout, out duration);
|
||||
DicConsole.DebugWriteLine("SCSI Report", "Sense = {0}", !mediaTest.CanReadDCB);
|
||||
if(debug)
|
||||
{
|
||||
DataFile.WriteTo("SCSI Report", "dcb",
|
||||
"_debug_" + report.SCSI.Inquiry.ProductIdentification + "_" +
|
||||
mediaType + ".bin", "read results", buffer);
|
||||
}
|
||||
}
|
||||
|
||||
if(mediaType == "HD DVD-ROM")
|
||||
@@ -1147,9 +1170,11 @@ namespace DiscImageChef.Core.Devices.Report.SCSI
|
||||
out duration);
|
||||
DicConsole.DebugWriteLine("SCSI Report", "Sense = {0}", !mediaTest.CanReadHDCMI);
|
||||
if(debug)
|
||||
{
|
||||
DataFile.WriteTo("SCSI Report", "hdcmi",
|
||||
"_debug_" + report.SCSI.Inquiry.ProductIdentification + "_" +
|
||||
mediaType + ".bin", "read results", buffer);
|
||||
}
|
||||
}
|
||||
|
||||
if(mediaType.EndsWith(" DL", StringComparison.Ordinal))
|
||||
@@ -1162,9 +1187,11 @@ namespace DiscImageChef.Core.Devices.Report.SCSI
|
||||
out duration);
|
||||
DicConsole.DebugWriteLine("SCSI Report", "Sense = {0}", !mediaTest.CanReadLayerCapacity);
|
||||
if(debug)
|
||||
{
|
||||
DataFile.WriteTo("SCSI Report", "layer",
|
||||
"_debug_" + report.SCSI.Inquiry.ProductIdentification + "_" +
|
||||
mediaType + ".bin", "read results", buffer);
|
||||
}
|
||||
}
|
||||
|
||||
if(mediaType.StartsWith("BD-R", StringComparison.Ordinal))
|
||||
@@ -1178,18 +1205,22 @@ namespace DiscImageChef.Core.Devices.Report.SCSI
|
||||
out duration);
|
||||
DicConsole.DebugWriteLine("SCSI Report", "Sense = {0}", !mediaTest.CanReadDiscInformation);
|
||||
if(debug)
|
||||
{
|
||||
DataFile.WriteTo("SCSI Report", "di",
|
||||
"_debug_" + report.SCSI.Inquiry.ProductIdentification + "_" +
|
||||
mediaType + ".bin", "read results", buffer);
|
||||
}
|
||||
DicConsole.WriteLine("Querying BD PAC...");
|
||||
mediaTest.CanReadPAC =
|
||||
!dev.ReadDiscStructure(out buffer, out senseBuffer, MmcDiscStructureMediaType.Bd, 0, 0,
|
||||
MmcDiscStructureFormat.Pac, 0, timeout, out duration);
|
||||
DicConsole.DebugWriteLine("SCSI Report", "Sense = {0}", !mediaTest.CanReadPAC);
|
||||
if(debug)
|
||||
{
|
||||
DataFile.WriteTo("SCSI Report", "pac",
|
||||
"_debug_" + report.SCSI.Inquiry.ProductIdentification + "_" +
|
||||
mediaType + ".bin", "read results", buffer);
|
||||
}
|
||||
}
|
||||
|
||||
mediaTest.SupportsReadSpecified = true;
|
||||
@@ -1202,33 +1233,41 @@ namespace DiscImageChef.Core.Devices.Report.SCSI
|
||||
!dev.Read6(out buffer, out senseBuffer, 0, 2048, timeout, out duration);
|
||||
DicConsole.DebugWriteLine("SCSI Report", "Sense = {0}", !mediaTest.SupportsRead);
|
||||
if(debug)
|
||||
{
|
||||
DataFile.WriteTo("SCSI Report", "read6",
|
||||
"_debug_" + report.SCSI.Inquiry.ProductIdentification + "_" + mediaType +
|
||||
".bin", "read results", buffer);
|
||||
}
|
||||
DicConsole.WriteLine("Trying SCSI READ (10)...");
|
||||
mediaTest.SupportsRead10 = !dev.Read10(out buffer, out senseBuffer, 0, false, true, false,
|
||||
false, 0, 2048, 0, 1, timeout, out duration);
|
||||
DicConsole.DebugWriteLine("SCSI Report", "Sense = {0}", !mediaTest.SupportsRead10);
|
||||
if(debug)
|
||||
{
|
||||
DataFile.WriteTo("SCSI Report", "read10",
|
||||
"_debug_" + report.SCSI.Inquiry.ProductIdentification + "_" + mediaType +
|
||||
".bin", "read results", buffer);
|
||||
}
|
||||
DicConsole.WriteLine("Trying SCSI READ (12)...");
|
||||
mediaTest.SupportsRead12 = !dev.Read12(out buffer, out senseBuffer, 0, false, true, false,
|
||||
false, 0, 2048, 0, 1, false, timeout, out duration);
|
||||
DicConsole.DebugWriteLine("SCSI Report", "Sense = {0}", !mediaTest.SupportsRead12);
|
||||
if(debug)
|
||||
{
|
||||
DataFile.WriteTo("SCSI Report", "read12",
|
||||
"_debug_" + report.SCSI.Inquiry.ProductIdentification + "_" + mediaType +
|
||||
".bin", "read results", buffer);
|
||||
}
|
||||
DicConsole.WriteLine("Trying SCSI READ (16)...");
|
||||
mediaTest.SupportsRead16 = !dev.Read16(out buffer, out senseBuffer, 0, false, true, false, 0,
|
||||
2048, 0, 1, false, timeout, out duration);
|
||||
DicConsole.DebugWriteLine("SCSI Report", "Sense = {0}", !mediaTest.SupportsRead16);
|
||||
if(debug)
|
||||
{
|
||||
DataFile.WriteTo("SCSI Report", "read16",
|
||||
"_debug_" + report.SCSI.Inquiry.ProductIdentification + "_" + mediaType +
|
||||
".bin", "read results", buffer);
|
||||
}
|
||||
|
||||
if(debug)
|
||||
{
|
||||
@@ -1274,9 +1313,11 @@ namespace DiscImageChef.Core.Devices.Report.SCSI
|
||||
out duration);
|
||||
DicConsole.DebugWriteLine("SCSI Report", "Sense = {0}", !mediaTest.SupportsReadCd);
|
||||
if(debug)
|
||||
{
|
||||
DataFile.WriteTo("SCSI Report", "readcd",
|
||||
"_debug_" + report.SCSI.Inquiry.ProductIdentification + "_" +
|
||||
mediaType + ".bin", "read results", buffer);
|
||||
}
|
||||
DicConsole.WriteLine("Trying SCSI READ CD MSF...");
|
||||
mediaTest.SupportsReadCdMsf = !dev.ReadCdMsf(out buffer, out senseBuffer, 0x00000200,
|
||||
0x00000201, 2352, MmcSectorTypes.Cdda,
|
||||
@@ -1285,9 +1326,11 @@ namespace DiscImageChef.Core.Devices.Report.SCSI
|
||||
MmcSubchannel.None, timeout, out duration);
|
||||
DicConsole.DebugWriteLine("SCSI Report", "Sense = {0}", !mediaTest.SupportsReadCdMsf);
|
||||
if(debug)
|
||||
{
|
||||
DataFile.WriteTo("SCSI Report", "readcdmsf",
|
||||
"_debug_" + report.SCSI.Inquiry.ProductIdentification + "_" +
|
||||
mediaType + ".bin", "read results", buffer);
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
@@ -1299,9 +1342,11 @@ namespace DiscImageChef.Core.Devices.Report.SCSI
|
||||
out duration);
|
||||
DicConsole.DebugWriteLine("SCSI Report", "Sense = {0}", !mediaTest.SupportsReadCd);
|
||||
if(debug)
|
||||
{
|
||||
DataFile.WriteTo("SCSI Report", "readcd",
|
||||
"_debug_" + report.SCSI.Inquiry.ProductIdentification + "_" +
|
||||
mediaType + ".bin", "read results", buffer);
|
||||
}
|
||||
DicConsole.WriteLine("Trying SCSI READ CD MSF...");
|
||||
mediaTest.SupportsReadCdMsf = !dev.ReadCdMsf(out buffer, out senseBuffer, 0x00000200,
|
||||
0x00000201, 2048, MmcSectorTypes.AllTypes,
|
||||
@@ -1310,9 +1355,11 @@ namespace DiscImageChef.Core.Devices.Report.SCSI
|
||||
MmcSubchannel.None, timeout, out duration);
|
||||
DicConsole.DebugWriteLine("SCSI Report", "Sense = {0}", !mediaTest.SupportsReadCdMsf);
|
||||
if(debug)
|
||||
{
|
||||
DataFile.WriteTo("SCSI Report", "readcdmsf",
|
||||
"_debug_" + report.SCSI.Inquiry.ProductIdentification + "_" +
|
||||
mediaType + ".bin", "read results", buffer);
|
||||
}
|
||||
DicConsole.WriteLine("Trying SCSI READ CD full sector...");
|
||||
mediaTest.SupportsReadCdRaw = !dev.ReadCd(out buffer, out senseBuffer, 0, 2352, 1,
|
||||
MmcSectorTypes.AllTypes, false, false, true,
|
||||
@@ -1321,9 +1368,11 @@ namespace DiscImageChef.Core.Devices.Report.SCSI
|
||||
timeout, out duration);
|
||||
DicConsole.DebugWriteLine("SCSI Report", "Sense = {0}", !mediaTest.SupportsReadCdRaw);
|
||||
if(debug)
|
||||
{
|
||||
DataFile.WriteTo("SCSI Report", "readcdraw",
|
||||
"_debug_" + report.SCSI.Inquiry.ProductIdentification + "_" +
|
||||
mediaType + ".bin", "read results", buffer);
|
||||
}
|
||||
DicConsole.WriteLine("Trying SCSI READ CD MSF full sector...");
|
||||
mediaTest.SupportsReadCdMsfRaw = !dev.ReadCdMsf(out buffer, out senseBuffer, 0x00000200,
|
||||
0x00000201, 2352,
|
||||
@@ -1334,9 +1383,11 @@ namespace DiscImageChef.Core.Devices.Report.SCSI
|
||||
DicConsole.DebugWriteLine("SCSI Report", "Sense = {0}",
|
||||
!mediaTest.SupportsReadCdMsfRaw);
|
||||
if(debug)
|
||||
{
|
||||
DataFile.WriteTo("SCSI Report", "readcdmsfraw",
|
||||
"_debug_" + report.SCSI.Inquiry.ProductIdentification + "_" +
|
||||
mediaType + ".bin", "read results", buffer);
|
||||
}
|
||||
}
|
||||
|
||||
if(mediaTest.SupportsReadCdRaw || mediaType == "Audio CD")
|
||||
@@ -1345,20 +1396,26 @@ namespace DiscImageChef.Core.Devices.Report.SCSI
|
||||
for(int i = -150; i < 0; i++)
|
||||
{
|
||||
if(mediaType == "Audio CD")
|
||||
{
|
||||
sense = dev.ReadCd(out buffer, out senseBuffer, (uint)i, 2352, 1,
|
||||
MmcSectorTypes.Cdda, false, false, false,
|
||||
MmcHeaderCodes.None, true, false, MmcErrorField.None,
|
||||
MmcSubchannel.None, timeout, out duration);
|
||||
}
|
||||
else
|
||||
{
|
||||
sense = dev.ReadCd(out buffer, out senseBuffer, (uint)i, 2352, 1,
|
||||
MmcSectorTypes.AllTypes, false, false, true,
|
||||
MmcHeaderCodes.AllHeaders, true, true, MmcErrorField.None,
|
||||
MmcSubchannel.None, timeout, out duration);
|
||||
}
|
||||
DicConsole.DebugWriteLine("SCSI Report", "Sense = {0}", sense);
|
||||
if(debug)
|
||||
{
|
||||
DataFile.WriteTo("SCSI Report", "leadin",
|
||||
"_debug_" + report.SCSI.Inquiry.ProductIdentification + "_" +
|
||||
mediaType + ".bin", "read results", buffer);
|
||||
}
|
||||
if(!sense)
|
||||
{
|
||||
mediaTest.CanReadLeadIn = true;
|
||||
@@ -1368,24 +1425,30 @@ namespace DiscImageChef.Core.Devices.Report.SCSI
|
||||
|
||||
DicConsole.WriteLine("Trying to read CD Lead-Out...");
|
||||
if(mediaType == "Audio CD")
|
||||
{
|
||||
mediaTest.CanReadLeadOut = !dev.ReadCd(out buffer, out senseBuffer,
|
||||
(uint)(mediaTest.Blocks + 1), 2352, 1,
|
||||
MmcSectorTypes.Cdda, false, false, false,
|
||||
MmcHeaderCodes.None, true, false,
|
||||
MmcErrorField.None, MmcSubchannel.None,
|
||||
timeout, out duration);
|
||||
}
|
||||
else
|
||||
{
|
||||
mediaTest.CanReadLeadOut = !dev.ReadCd(out buffer, out senseBuffer,
|
||||
(uint)(mediaTest.Blocks + 1), 2352, 1,
|
||||
MmcSectorTypes.AllTypes, false, false, true,
|
||||
MmcHeaderCodes.AllHeaders, true, true,
|
||||
MmcErrorField.None, MmcSubchannel.None,
|
||||
timeout, out duration);
|
||||
}
|
||||
DicConsole.DebugWriteLine("SCSI Report", "Sense = {0}", !mediaTest.CanReadLeadOut);
|
||||
if(debug)
|
||||
{
|
||||
DataFile.WriteTo("SCSI Report", "leadout",
|
||||
"_debug_" + report.SCSI.Inquiry.ProductIdentification + "_" +
|
||||
mediaType + ".bin", "read results", buffer);
|
||||
}
|
||||
}
|
||||
|
||||
if(mediaType == "Audio CD")
|
||||
@@ -1397,17 +1460,21 @@ namespace DiscImageChef.Core.Devices.Report.SCSI
|
||||
MmcErrorField.C2Pointers, MmcSubchannel.None,
|
||||
timeout, out duration);
|
||||
if(!mediaTest.CanReadC2Pointers)
|
||||
{
|
||||
mediaTest.CanReadC2Pointers = !dev.ReadCd(out buffer, out senseBuffer, 0, 2648, 1,
|
||||
MmcSectorTypes.Cdda, false, false, false,
|
||||
MmcHeaderCodes.None, true, false,
|
||||
MmcErrorField.C2PointersAndBlock,
|
||||
MmcSubchannel.None, timeout,
|
||||
out duration);
|
||||
}
|
||||
DicConsole.DebugWriteLine("SCSI Report", "Sense = {0}", !mediaTest.CanReadC2Pointers);
|
||||
if(debug)
|
||||
{
|
||||
DataFile.WriteTo("SCSI Report", "readcdc2",
|
||||
"_debug_" + report.SCSI.Inquiry.ProductIdentification + "_" +
|
||||
mediaType + ".bin", "read results", buffer);
|
||||
}
|
||||
|
||||
DicConsole.WriteLine("Trying to read subchannels...");
|
||||
mediaTest.CanReadPQSubchannel = !dev.ReadCd(out buffer, out senseBuffer, 0, 2368, 1,
|
||||
@@ -1417,9 +1484,11 @@ namespace DiscImageChef.Core.Devices.Report.SCSI
|
||||
timeout, out duration);
|
||||
DicConsole.DebugWriteLine("SCSI Report", "Sense = {0}", !mediaTest.CanReadPQSubchannel);
|
||||
if(debug)
|
||||
{
|
||||
DataFile.WriteTo("SCSI Report", "readcdpq",
|
||||
"_debug_" + report.SCSI.Inquiry.ProductIdentification + "_" +
|
||||
mediaType + ".bin", "read results", buffer);
|
||||
}
|
||||
mediaTest.CanReadRWSubchannel = !dev.ReadCd(out buffer, out senseBuffer, 0, 2448, 1,
|
||||
MmcSectorTypes.Cdda, false, false, false,
|
||||
MmcHeaderCodes.None, true, false,
|
||||
@@ -1427,9 +1496,11 @@ namespace DiscImageChef.Core.Devices.Report.SCSI
|
||||
timeout, out duration);
|
||||
DicConsole.DebugWriteLine("SCSI Report", "Sense = {0}", !mediaTest.CanReadRWSubchannel);
|
||||
if(debug)
|
||||
{
|
||||
DataFile.WriteTo("SCSI Report", "readcdrw",
|
||||
"_debug_" + report.SCSI.Inquiry.ProductIdentification + "_" +
|
||||
mediaType + ".bin", "read results", buffer);
|
||||
}
|
||||
mediaTest.CanReadCorrectedSubchannel = !dev.ReadCd(out buffer, out senseBuffer, 0, 2448,
|
||||
1, MmcSectorTypes.Cdda, false, false,
|
||||
false, MmcHeaderCodes.None, true,
|
||||
@@ -1439,9 +1510,11 @@ namespace DiscImageChef.Core.Devices.Report.SCSI
|
||||
DicConsole.DebugWriteLine("SCSI Report", "Sense = {0}",
|
||||
!mediaTest.CanReadCorrectedSubchannel);
|
||||
if(debug)
|
||||
{
|
||||
DataFile.WriteTo("SCSI Report", "readcdsub",
|
||||
"_debug_" + report.SCSI.Inquiry.ProductIdentification + "_" +
|
||||
mediaType + ".bin", "read results", buffer);
|
||||
}
|
||||
|
||||
DicConsole.WriteLine("Trying to read subchannels with C2 Pointers...");
|
||||
mediaTest.CanReadPQSubchannelWithC2 = !dev.ReadCd(out buffer, out senseBuffer, 0, 2662,
|
||||
@@ -1451,6 +1524,7 @@ namespace DiscImageChef.Core.Devices.Report.SCSI
|
||||
MmcSubchannel.Q16, timeout,
|
||||
out duration);
|
||||
if(!mediaTest.CanReadPQSubchannelWithC2)
|
||||
{
|
||||
mediaTest.CanReadPQSubchannelWithC2 = !dev.ReadCd(out buffer, out senseBuffer, 0,
|
||||
2664, 1, MmcSectorTypes.Cdda,
|
||||
false, false, false,
|
||||
@@ -1458,12 +1532,15 @@ namespace DiscImageChef.Core.Devices.Report.SCSI
|
||||
MmcErrorField.C2PointersAndBlock,
|
||||
MmcSubchannel.Q16, timeout,
|
||||
out duration);
|
||||
}
|
||||
DicConsole.DebugWriteLine("SCSI Report", "Sense = {0}",
|
||||
!mediaTest.CanReadPQSubchannelWithC2);
|
||||
if(debug)
|
||||
{
|
||||
DataFile.WriteTo("SCSI Report", "readcdpqc2",
|
||||
"_debug_" + report.SCSI.Inquiry.ProductIdentification + "_" +
|
||||
mediaType + ".bin", "read results", buffer);
|
||||
}
|
||||
|
||||
mediaTest.CanReadRWSubchannelWithC2 = !dev.ReadCd(out buffer, out senseBuffer, 0, 2712,
|
||||
1, MmcSectorTypes.Cdda, false, false,
|
||||
@@ -1472,6 +1549,7 @@ namespace DiscImageChef.Core.Devices.Report.SCSI
|
||||
MmcSubchannel.Raw, timeout,
|
||||
out duration);
|
||||
if(!mediaTest.CanReadRWSubchannelWithC2)
|
||||
{
|
||||
mediaTest.CanReadRWSubchannelWithC2 = !dev.ReadCd(out buffer, out senseBuffer, 0,
|
||||
2714, 1, MmcSectorTypes.Cdda,
|
||||
false, false, false,
|
||||
@@ -1479,12 +1557,15 @@ namespace DiscImageChef.Core.Devices.Report.SCSI
|
||||
MmcErrorField.C2PointersAndBlock,
|
||||
MmcSubchannel.Raw, timeout,
|
||||
out duration);
|
||||
}
|
||||
DicConsole.DebugWriteLine("SCSI Report", "Sense = {0}",
|
||||
!mediaTest.CanReadRWSubchannelWithC2);
|
||||
if(debug)
|
||||
{
|
||||
DataFile.WriteTo("SCSI Report", "readcdrwc2",
|
||||
"_debug_" + report.SCSI.Inquiry.ProductIdentification + "_" +
|
||||
mediaType + ".bin", "read results", buffer);
|
||||
}
|
||||
|
||||
mediaTest.CanReadCorrectedSubchannelWithC2 = !dev.ReadCd(out buffer, out senseBuffer, 0,
|
||||
2712, 1, MmcSectorTypes.Cdda,
|
||||
@@ -1495,17 +1576,21 @@ namespace DiscImageChef.Core.Devices.Report.SCSI
|
||||
MmcSubchannel.Rw, timeout,
|
||||
out duration);
|
||||
if(!mediaTest.CanReadCorrectedSubchannelWithC2)
|
||||
{
|
||||
mediaTest.CanReadCorrectedSubchannelWithC2 =
|
||||
!dev.ReadCd(out buffer, out senseBuffer, 0, 2714, 1, MmcSectorTypes.Cdda, false,
|
||||
false, false, MmcHeaderCodes.None, true, false,
|
||||
MmcErrorField.C2PointersAndBlock, MmcSubchannel.Rw, timeout,
|
||||
out duration);
|
||||
}
|
||||
DicConsole.DebugWriteLine("SCSI Report", "Sense = {0}",
|
||||
!mediaTest.CanReadCorrectedSubchannelWithC2);
|
||||
if(debug)
|
||||
{
|
||||
DataFile.WriteTo("SCSI Report", "readcdsubc2",
|
||||
"_debug_" + report.SCSI.Inquiry.ProductIdentification + "_" +
|
||||
mediaType + ".bin", "read results", buffer);
|
||||
}
|
||||
}
|
||||
else if(mediaTest.SupportsReadCdRaw)
|
||||
{
|
||||
@@ -1516,17 +1601,21 @@ namespace DiscImageChef.Core.Devices.Report.SCSI
|
||||
MmcErrorField.C2Pointers, MmcSubchannel.None,
|
||||
timeout, out duration);
|
||||
if(!mediaTest.CanReadC2Pointers)
|
||||
{
|
||||
mediaTest.CanReadC2Pointers = !dev.ReadCd(out buffer, out senseBuffer, 0, 2648, 1,
|
||||
MmcSectorTypes.AllTypes, false, false,
|
||||
true, MmcHeaderCodes.AllHeaders, true,
|
||||
true, MmcErrorField.C2PointersAndBlock,
|
||||
MmcSubchannel.None, timeout,
|
||||
out duration);
|
||||
}
|
||||
DicConsole.DebugWriteLine("SCSI Report", "Sense = {0}", !mediaTest.CanReadC2Pointers);
|
||||
if(debug)
|
||||
{
|
||||
DataFile.WriteTo("SCSI Report", "readcdc2",
|
||||
"_debug_" + report.SCSI.Inquiry.ProductIdentification + "_" +
|
||||
mediaType + ".bin", "read results", buffer);
|
||||
}
|
||||
|
||||
DicConsole.WriteLine("Trying to read subchannels...");
|
||||
mediaTest.CanReadPQSubchannel = !dev.ReadCd(out buffer, out senseBuffer, 0, 2368, 1,
|
||||
@@ -1536,9 +1625,11 @@ namespace DiscImageChef.Core.Devices.Report.SCSI
|
||||
timeout, out duration);
|
||||
DicConsole.DebugWriteLine("SCSI Report", "Sense = {0}", !mediaTest.CanReadPQSubchannel);
|
||||
if(debug)
|
||||
{
|
||||
DataFile.WriteTo("SCSI Report", "readcdpq",
|
||||
"_debug_" + report.SCSI.Inquiry.ProductIdentification + "_" +
|
||||
mediaType + ".bin", "read results", buffer);
|
||||
}
|
||||
mediaTest.CanReadRWSubchannel = !dev.ReadCd(out buffer, out senseBuffer, 0, 2448, 1,
|
||||
MmcSectorTypes.AllTypes, false, false, true,
|
||||
MmcHeaderCodes.AllHeaders, true, true,
|
||||
@@ -1546,9 +1637,11 @@ namespace DiscImageChef.Core.Devices.Report.SCSI
|
||||
timeout, out duration);
|
||||
DicConsole.DebugWriteLine("SCSI Report", "Sense = {0}", !mediaTest.CanReadRWSubchannel);
|
||||
if(debug)
|
||||
{
|
||||
DataFile.WriteTo("SCSI Report", "readcdrw",
|
||||
"_debug_" + report.SCSI.Inquiry.ProductIdentification + "_" +
|
||||
mediaType + ".bin", "read results", buffer);
|
||||
}
|
||||
mediaTest.CanReadCorrectedSubchannel = !dev.ReadCd(out buffer, out senseBuffer, 0, 2448,
|
||||
1, MmcSectorTypes.AllTypes, false,
|
||||
false, true,
|
||||
@@ -1559,9 +1652,11 @@ namespace DiscImageChef.Core.Devices.Report.SCSI
|
||||
DicConsole.DebugWriteLine("SCSI Report", "Sense = {0}",
|
||||
!mediaTest.CanReadCorrectedSubchannel);
|
||||
if(debug)
|
||||
{
|
||||
DataFile.WriteTo("SCSI Report", "readcdsub",
|
||||
"_debug_" + report.SCSI.Inquiry.ProductIdentification + "_" +
|
||||
mediaType + ".bin", "read results", buffer);
|
||||
}
|
||||
|
||||
DicConsole.WriteLine("Trying to read subchannels with C2 Pointers...");
|
||||
mediaTest.CanReadPQSubchannelWithC2 = !dev.ReadCd(out buffer, out senseBuffer, 0, 2662,
|
||||
@@ -1572,6 +1667,7 @@ namespace DiscImageChef.Core.Devices.Report.SCSI
|
||||
MmcSubchannel.Q16, timeout,
|
||||
out duration);
|
||||
if(!mediaTest.CanReadPQSubchannelWithC2)
|
||||
{
|
||||
mediaTest.CanReadPQSubchannelWithC2 = !dev.ReadCd(out buffer, out senseBuffer, 0,
|
||||
2664, 1, MmcSectorTypes.AllTypes,
|
||||
false, false, true,
|
||||
@@ -1580,12 +1676,15 @@ namespace DiscImageChef.Core.Devices.Report.SCSI
|
||||
MmcErrorField.C2PointersAndBlock,
|
||||
MmcSubchannel.Q16, timeout,
|
||||
out duration);
|
||||
}
|
||||
DicConsole.DebugWriteLine("SCSI Report", "Sense = {0}",
|
||||
!mediaTest.CanReadPQSubchannelWithC2);
|
||||
if(debug)
|
||||
{
|
||||
DataFile.WriteTo("SCSI Report", "readcdpqc2",
|
||||
"_debug_" + report.SCSI.Inquiry.ProductIdentification + "_" +
|
||||
mediaType + ".bin", "read results", buffer);
|
||||
}
|
||||
|
||||
mediaTest.CanReadRWSubchannelWithC2 = !dev.ReadCd(out buffer, out senseBuffer, 0, 2712,
|
||||
1, MmcSectorTypes.AllTypes, false,
|
||||
@@ -1595,6 +1694,7 @@ namespace DiscImageChef.Core.Devices.Report.SCSI
|
||||
MmcSubchannel.Raw, timeout,
|
||||
out duration);
|
||||
if(!mediaTest.CanReadRWSubchannelWithC2)
|
||||
{
|
||||
mediaTest.CanReadRWSubchannelWithC2 = !dev.ReadCd(out buffer, out senseBuffer, 0,
|
||||
2714, 1, MmcSectorTypes.AllTypes,
|
||||
false, false, true,
|
||||
@@ -1603,12 +1703,15 @@ namespace DiscImageChef.Core.Devices.Report.SCSI
|
||||
MmcErrorField.C2PointersAndBlock,
|
||||
MmcSubchannel.Raw, timeout,
|
||||
out duration);
|
||||
}
|
||||
DicConsole.DebugWriteLine("SCSI Report", "Sense = {0}",
|
||||
!mediaTest.CanReadRWSubchannelWithC2);
|
||||
if(debug)
|
||||
{
|
||||
DataFile.WriteTo("SCSI Report", "readcdrwc2",
|
||||
"_debug_" + report.SCSI.Inquiry.ProductIdentification + "_" +
|
||||
mediaType + ".bin", "read results", buffer);
|
||||
}
|
||||
|
||||
mediaTest.CanReadCorrectedSubchannelWithC2 = !dev.ReadCd(out buffer, out senseBuffer, 0,
|
||||
2712, 1,
|
||||
@@ -1620,17 +1723,21 @@ namespace DiscImageChef.Core.Devices.Report.SCSI
|
||||
MmcSubchannel.Rw, timeout,
|
||||
out duration);
|
||||
if(!mediaTest.CanReadCorrectedSubchannelWithC2)
|
||||
{
|
||||
mediaTest.CanReadCorrectedSubchannelWithC2 =
|
||||
!dev.ReadCd(out buffer, out senseBuffer, 0, 2714, 1, MmcSectorTypes.AllTypes,
|
||||
false, false, true, MmcHeaderCodes.AllHeaders, true, true,
|
||||
MmcErrorField.C2PointersAndBlock, MmcSubchannel.Rw, timeout,
|
||||
out duration);
|
||||
}
|
||||
DicConsole.DebugWriteLine("SCSI Report", "Sense = {0}",
|
||||
!mediaTest.CanReadCorrectedSubchannelWithC2);
|
||||
if(debug)
|
||||
{
|
||||
DataFile.WriteTo("SCSI Report", "readcdsubc2",
|
||||
"_debug_" + report.SCSI.Inquiry.ProductIdentification + "_" +
|
||||
mediaType + ".bin", "read results", buffer);
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
@@ -1641,17 +1748,21 @@ namespace DiscImageChef.Core.Devices.Report.SCSI
|
||||
MmcErrorField.C2Pointers, MmcSubchannel.None,
|
||||
timeout, out duration);
|
||||
if(!mediaTest.CanReadC2Pointers)
|
||||
{
|
||||
mediaTest.CanReadC2Pointers = !dev.ReadCd(out buffer, out senseBuffer, 0, 2344, 1,
|
||||
MmcSectorTypes.AllTypes, false, false,
|
||||
false, MmcHeaderCodes.None, true, false,
|
||||
MmcErrorField.C2PointersAndBlock,
|
||||
MmcSubchannel.None, timeout,
|
||||
out duration);
|
||||
}
|
||||
DicConsole.DebugWriteLine("SCSI Report", "Sense = {0}", !mediaTest.CanReadC2Pointers);
|
||||
if(debug)
|
||||
{
|
||||
DataFile.WriteTo("SCSI Report", "readcdc2",
|
||||
"_debug_" + report.SCSI.Inquiry.ProductIdentification + "_" +
|
||||
mediaType + ".bin", "read results", buffer);
|
||||
}
|
||||
|
||||
DicConsole.WriteLine("Trying to read subchannels...");
|
||||
mediaTest.CanReadPQSubchannel = !dev.ReadCd(out buffer, out senseBuffer, 0, 2064, 1,
|
||||
@@ -1661,9 +1772,11 @@ namespace DiscImageChef.Core.Devices.Report.SCSI
|
||||
timeout, out duration);
|
||||
DicConsole.DebugWriteLine("SCSI Report", "Sense = {0}", !mediaTest.CanReadPQSubchannel);
|
||||
if(debug)
|
||||
{
|
||||
DataFile.WriteTo("SCSI Report", "readcdpq",
|
||||
"_debug_" + report.SCSI.Inquiry.ProductIdentification + "_" +
|
||||
mediaType + ".bin", "read results", buffer);
|
||||
}
|
||||
mediaTest.CanReadRWSubchannel = !dev.ReadCd(out buffer, out senseBuffer, 0, 2144, 1,
|
||||
MmcSectorTypes.AllTypes, false, false,
|
||||
false, MmcHeaderCodes.None, true, false,
|
||||
@@ -1671,9 +1784,11 @@ namespace DiscImageChef.Core.Devices.Report.SCSI
|
||||
timeout, out duration);
|
||||
DicConsole.DebugWriteLine("SCSI Report", "Sense = {0}", !mediaTest.CanReadRWSubchannel);
|
||||
if(debug)
|
||||
{
|
||||
DataFile.WriteTo("SCSI Report", "readcdrw",
|
||||
"_debug_" + report.SCSI.Inquiry.ProductIdentification + "_" +
|
||||
mediaType + ".bin", "read results", buffer);
|
||||
}
|
||||
mediaTest.CanReadCorrectedSubchannel = !dev.ReadCd(out buffer, out senseBuffer, 0, 2144,
|
||||
1, MmcSectorTypes.AllTypes, false,
|
||||
false, false, MmcHeaderCodes.None,
|
||||
@@ -1683,9 +1798,11 @@ namespace DiscImageChef.Core.Devices.Report.SCSI
|
||||
DicConsole.DebugWriteLine("SCSI Report", "Sense = {0}",
|
||||
!mediaTest.CanReadCorrectedSubchannel);
|
||||
if(debug)
|
||||
{
|
||||
DataFile.WriteTo("SCSI Report", "readcdsub",
|
||||
"_debug_" + report.SCSI.Inquiry.ProductIdentification + "_" +
|
||||
mediaType + ".bin", "read results", buffer);
|
||||
}
|
||||
|
||||
DicConsole.WriteLine("Trying to read subchannels with C2 Pointers...");
|
||||
mediaTest.CanReadPQSubchannelWithC2 = !dev.ReadCd(out buffer, out senseBuffer, 0, 2358,
|
||||
@@ -1695,6 +1812,7 @@ namespace DiscImageChef.Core.Devices.Report.SCSI
|
||||
MmcSubchannel.Q16, timeout,
|
||||
out duration);
|
||||
if(!mediaTest.CanReadPQSubchannelWithC2)
|
||||
{
|
||||
mediaTest.CanReadPQSubchannelWithC2 = !dev.ReadCd(out buffer, out senseBuffer, 0,
|
||||
2360, 1, MmcSectorTypes.AllTypes,
|
||||
false, false, false,
|
||||
@@ -1702,12 +1820,15 @@ namespace DiscImageChef.Core.Devices.Report.SCSI
|
||||
MmcErrorField.C2PointersAndBlock,
|
||||
MmcSubchannel.Q16, timeout,
|
||||
out duration);
|
||||
}
|
||||
DicConsole.DebugWriteLine("SCSI Report", "Sense = {0}",
|
||||
!mediaTest.CanReadPQSubchannelWithC2);
|
||||
if(debug)
|
||||
{
|
||||
DataFile.WriteTo("SCSI Report", "readcdpqc2",
|
||||
"_debug_" + report.SCSI.Inquiry.ProductIdentification + "_" +
|
||||
mediaType + ".bin", "read results", buffer);
|
||||
}
|
||||
|
||||
mediaTest.CanReadRWSubchannelWithC2 = !dev.ReadCd(out buffer, out senseBuffer, 0, 2438,
|
||||
1, MmcSectorTypes.AllTypes, false,
|
||||
@@ -1716,6 +1837,7 @@ namespace DiscImageChef.Core.Devices.Report.SCSI
|
||||
MmcSubchannel.Raw, timeout,
|
||||
out duration);
|
||||
if(!mediaTest.CanReadRWSubchannelWithC2)
|
||||
{
|
||||
mediaTest.CanReadRWSubchannelWithC2 = !dev.ReadCd(out buffer, out senseBuffer, 0,
|
||||
2440, 1, MmcSectorTypes.AllTypes,
|
||||
false, false, false,
|
||||
@@ -1723,12 +1845,15 @@ namespace DiscImageChef.Core.Devices.Report.SCSI
|
||||
MmcErrorField.C2PointersAndBlock,
|
||||
MmcSubchannel.Raw, timeout,
|
||||
out duration);
|
||||
}
|
||||
DicConsole.DebugWriteLine("SCSI Report", "Sense = {0}",
|
||||
!mediaTest.CanReadRWSubchannelWithC2);
|
||||
if(debug)
|
||||
{
|
||||
DataFile.WriteTo("SCSI Report", "readcdrwc2",
|
||||
"_debug_" + report.SCSI.Inquiry.ProductIdentification + "_" +
|
||||
mediaType + ".bin", "read results", buffer);
|
||||
}
|
||||
|
||||
mediaTest.CanReadCorrectedSubchannelWithC2 = !dev.ReadCd(out buffer, out senseBuffer, 0,
|
||||
2438, 1,
|
||||
@@ -1740,17 +1865,21 @@ namespace DiscImageChef.Core.Devices.Report.SCSI
|
||||
MmcSubchannel.Rw, timeout,
|
||||
out duration);
|
||||
if(!mediaTest.CanReadCorrectedSubchannelWithC2)
|
||||
{
|
||||
mediaTest.CanReadCorrectedSubchannelWithC2 =
|
||||
!dev.ReadCd(out buffer, out senseBuffer, 0, 2440, 1, MmcSectorTypes.AllTypes,
|
||||
false, false, false, MmcHeaderCodes.None, true, false,
|
||||
MmcErrorField.C2PointersAndBlock, MmcSubchannel.Rw, timeout,
|
||||
out duration);
|
||||
}
|
||||
DicConsole.DebugWriteLine("SCSI Report", "Sense = {0}",
|
||||
!mediaTest.CanReadCorrectedSubchannelWithC2);
|
||||
if(debug)
|
||||
{
|
||||
DataFile.WriteTo("SCSI Report", "readcdsubc2",
|
||||
"_debug_" + report.SCSI.Inquiry.ProductIdentification + "_" +
|
||||
mediaType + ".bin", "read results", buffer);
|
||||
}
|
||||
}
|
||||
|
||||
if(debug)
|
||||
@@ -1794,9 +1923,11 @@ namespace DiscImageChef.Core.Devices.Report.SCSI
|
||||
DicConsole.DebugWriteLine("SCSI Report", "Sense = {0}",
|
||||
!mediaTest.SupportsPlextorReadCDDA);
|
||||
if(debug)
|
||||
{
|
||||
DataFile.WriteTo("SCSI Report", "plextorreadcdda",
|
||||
"_debug_" + report.SCSI.Inquiry.ProductIdentification + "_" +
|
||||
mediaType + ".bin", "read results", buffer);
|
||||
}
|
||||
}
|
||||
|
||||
if(tryPioneer)
|
||||
@@ -1810,9 +1941,11 @@ namespace DiscImageChef.Core.Devices.Report.SCSI
|
||||
DicConsole.DebugWriteLine("SCSI Report", "Sense = {0}",
|
||||
!mediaTest.SupportsPioneerReadCDDA);
|
||||
if(debug)
|
||||
{
|
||||
DataFile.WriteTo("SCSI Report", "pioneerreadcdda",
|
||||
"_debug_" + report.SCSI.Inquiry.ProductIdentification + "_" +
|
||||
mediaType + ".bin", "read results", buffer);
|
||||
}
|
||||
DicConsole.WriteLine("Trying Pioneer READ CD-DA MSF...");
|
||||
mediaTest.SupportsPioneerReadCDDAMSF =
|
||||
!dev.PioneerReadCdDaMsf(out buffer, out senseBuffer, 0x00000200, 0x00000201, 2352,
|
||||
@@ -1820,9 +1953,11 @@ namespace DiscImageChef.Core.Devices.Report.SCSI
|
||||
DicConsole.DebugWriteLine("SCSI Report", "Sense = {0}",
|
||||
!mediaTest.SupportsPioneerReadCDDAMSF);
|
||||
if(debug)
|
||||
{
|
||||
DataFile.WriteTo("SCSI Report", "pioneerreadcddamsf",
|
||||
"_debug_" + report.SCSI.Inquiry.ProductIdentification + "_" +
|
||||
mediaType + ".bin", "read results", buffer);
|
||||
}
|
||||
}
|
||||
|
||||
if(tryNec)
|
||||
@@ -1833,9 +1968,11 @@ namespace DiscImageChef.Core.Devices.Report.SCSI
|
||||
!dev.NecReadCdDa(out buffer, out senseBuffer, 0, 1, timeout, out duration);
|
||||
DicConsole.DebugWriteLine("SCSI Report", "Sense = {0}", !mediaTest.SupportsNECReadCDDA);
|
||||
if(debug)
|
||||
{
|
||||
DataFile.WriteTo("SCSI Report", "necreadcdda",
|
||||
"_debug_" + report.SCSI.Inquiry.ProductIdentification + "_" +
|
||||
mediaType + ".bin", "read results", buffer);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -1900,9 +2037,11 @@ namespace DiscImageChef.Core.Devices.Report.SCSI
|
||||
DicConsole.DebugWriteLine("SCSI Report", "Sense = {0}",
|
||||
!mediaTest.SupportsPlextorReadRawDVD);
|
||||
if(debug)
|
||||
{
|
||||
DataFile.WriteTo("SCSI Report", "plextorrawdvd",
|
||||
"_debug_" + report.SCSI.Inquiry.ProductIdentification + "_" +
|
||||
mediaType + ".bin", "read results", buffer);
|
||||
}
|
||||
if(mediaTest.SupportsPlextorReadRawDVD)
|
||||
mediaTest.SupportsPlextorReadRawDVD = !ArrayHelpers.ArrayIsNullOrEmpty(buffer);
|
||||
}
|
||||
@@ -1916,9 +2055,11 @@ namespace DiscImageChef.Core.Devices.Report.SCSI
|
||||
DicConsole.DebugWriteLine("SCSI Report", "Sense = {0}",
|
||||
!mediaTest.SupportsHLDTSTReadRawDVD);
|
||||
if(debug)
|
||||
{
|
||||
DataFile.WriteTo("SCSI Report", "hldtstrawdvd",
|
||||
"_debug_" + report.SCSI.Inquiry.ProductIdentification + "_" +
|
||||
mediaType + ".bin", "read results", buffer);
|
||||
}
|
||||
}
|
||||
|
||||
if(mediaTest.SupportsReadLong && mediaTest.LongBlockSize == mediaTest.BlockSize)
|
||||
@@ -1967,9 +2108,11 @@ namespace DiscImageChef.Core.Devices.Report.SCSI
|
||||
sense = dev.ReadLong10(out buffer, out senseBuffer, false, false, 0,
|
||||
(ushort)mediaTest.LongBlockSize, timeout, out duration);
|
||||
if(!sense)
|
||||
{
|
||||
DataFile.WriteTo("SCSI Report", "readlong10",
|
||||
"_debug_" + report.SCSI.Inquiry.ProductIdentification + "_" +
|
||||
mediaType + ".bin", "read results", buffer);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -138,8 +138,10 @@ namespace DiscImageChef.Core.Devices.Report.SCSI
|
||||
report.SCSI.SequentialDevice.SupportedMediaTypes[i].DensityCodes =
|
||||
new int[mtsh.Value.descriptors[i].densityCodes.Length];
|
||||
for(int j = 0; j < mtsh.Value.descriptors.Length; j++)
|
||||
{
|
||||
report.SCSI.SequentialDevice.SupportedMediaTypes[i].DensityCodes[j] =
|
||||
mtsh.Value.descriptors[i].densityCodes[j];
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -300,8 +302,10 @@ namespace DiscImageChef.Core.Devices.Report.SCSI
|
||||
seqTest.SupportedMediaTypes[i].DensityCodes =
|
||||
new int[mtsh.Value.descriptors[i].densityCodes.Length];
|
||||
for(int j = 0; j < mtsh.Value.descriptors.Length; j++)
|
||||
{
|
||||
seqTest.SupportedMediaTypes[i].DensityCodes[j] =
|
||||
mtsh.Value.descriptors[i].densityCodes[j];
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -145,12 +145,12 @@ namespace DiscImageChef.Core.Devices.Scanning
|
||||
|
||||
if(!error)
|
||||
{
|
||||
if(duration >= 500) { results.F += blocksToRead; }
|
||||
else if(duration >= 150) { results.E += blocksToRead; }
|
||||
else if(duration >= 50) { results.D += blocksToRead; }
|
||||
else if(duration >= 10) { results.C += blocksToRead; }
|
||||
else if(duration >= 3) { results.B += blocksToRead; }
|
||||
else { results.A += blocksToRead; }
|
||||
if(duration >= 500) results.F += blocksToRead;
|
||||
else if(duration >= 150) results.E += blocksToRead;
|
||||
else if(duration >= 50) results.D += blocksToRead;
|
||||
else if(duration >= 10) results.C += blocksToRead;
|
||||
else if(duration >= 3) results.B += blocksToRead;
|
||||
else results.A += blocksToRead;
|
||||
|
||||
mhddLog.Write(i, duration);
|
||||
ibgLog.Write(i, currentSpeed * 1024);
|
||||
@@ -182,7 +182,6 @@ namespace DiscImageChef.Core.Devices.Scanning
|
||||
#pragma warning restore IDE0004 // Without this specific cast, it gives incorrect values
|
||||
|
||||
if(ataReader.CanSeekLba)
|
||||
{
|
||||
for(int i = 0; i < SEEK_TIMES; i++)
|
||||
{
|
||||
if(aborted) break;
|
||||
@@ -201,7 +200,6 @@ namespace DiscImageChef.Core.Devices.Scanning
|
||||
results.SeekTotal += seekCur;
|
||||
GC.Collect();
|
||||
}
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
@@ -233,12 +231,12 @@ namespace DiscImageChef.Core.Devices.Scanning
|
||||
|
||||
if(!error)
|
||||
{
|
||||
if(duration >= 500) { results.F += blocksToRead; }
|
||||
else if(duration >= 150) { results.E += blocksToRead; }
|
||||
else if(duration >= 50) { results.D += blocksToRead; }
|
||||
else if(duration >= 10) { results.C += blocksToRead; }
|
||||
else if(duration >= 3) { results.B += blocksToRead; }
|
||||
else { results.A += blocksToRead; }
|
||||
if(duration >= 500) results.F += blocksToRead;
|
||||
else if(duration >= 150) results.E += blocksToRead;
|
||||
else if(duration >= 50) results.D += blocksToRead;
|
||||
else if(duration >= 10) results.C += blocksToRead;
|
||||
else if(duration >= 3) results.B += blocksToRead;
|
||||
else results.A += blocksToRead;
|
||||
|
||||
mhddLog.Write(currentBlock, duration);
|
||||
ibgLog.Write(currentBlock, currentSpeed * 1024);
|
||||
@@ -273,7 +271,6 @@ namespace DiscImageChef.Core.Devices.Scanning
|
||||
#pragma warning restore IDE0004 // Without this specific cast, it gives incorrect values
|
||||
|
||||
if(ataReader.CanSeek)
|
||||
{
|
||||
for(int i = 0; i < SEEK_TIMES; i++)
|
||||
{
|
||||
if(aborted) break;
|
||||
@@ -295,7 +292,6 @@ namespace DiscImageChef.Core.Devices.Scanning
|
||||
results.SeekTotal += seekCur;
|
||||
GC.Collect();
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
DicConsole.WriteLine();
|
||||
|
||||
@@ -61,7 +61,6 @@ namespace DiscImageChef.Core.Devices.Scanning
|
||||
{
|
||||
Decoders.SCSI.FixedSense? decSense = Decoders.SCSI.Sense.DecodeFixed(senseBuf);
|
||||
if(decSense.HasValue)
|
||||
{
|
||||
if(decSense.Value.ASC == 0x3A)
|
||||
{
|
||||
int leftRetries = 5;
|
||||
@@ -128,7 +127,6 @@ namespace DiscImageChef.Core.Devices.Scanning
|
||||
Decoders.SCSI.Sense.PrettifySense(senseBuf));
|
||||
return results;
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
DicConsole.ErrorWriteLine("Unknown testing unit was ready.");
|
||||
@@ -307,12 +305,12 @@ namespace DiscImageChef.Core.Devices.Scanning
|
||||
|
||||
if(!sense)
|
||||
{
|
||||
if(cmdDuration >= 500) { results.F += blocksToRead; }
|
||||
else if(cmdDuration >= 150) { results.E += blocksToRead; }
|
||||
else if(cmdDuration >= 50) { results.D += blocksToRead; }
|
||||
else if(cmdDuration >= 10) { results.C += blocksToRead; }
|
||||
else if(cmdDuration >= 3) { results.B += blocksToRead; }
|
||||
else { results.A += blocksToRead; }
|
||||
if(cmdDuration >= 500) results.F += blocksToRead;
|
||||
else if(cmdDuration >= 150) results.E += blocksToRead;
|
||||
else if(cmdDuration >= 50) results.D += blocksToRead;
|
||||
else if(cmdDuration >= 10) results.C += blocksToRead;
|
||||
else if(cmdDuration >= 3) results.B += blocksToRead;
|
||||
else results.A += blocksToRead;
|
||||
|
||||
mhddLog.Write(i, cmdDuration);
|
||||
ibgLog.Write(i, currentSpeed * 1024);
|
||||
|
||||
@@ -179,12 +179,12 @@ namespace DiscImageChef.Core.Devices.Scanning
|
||||
|
||||
if(!error)
|
||||
{
|
||||
if(duration >= 500) { results.F += blocksToRead; }
|
||||
else if(duration >= 150) { results.E += blocksToRead; }
|
||||
else if(duration >= 50) { results.D += blocksToRead; }
|
||||
else if(duration >= 10) { results.C += blocksToRead; }
|
||||
else if(duration >= 3) { results.B += blocksToRead; }
|
||||
else { results.A += blocksToRead; }
|
||||
if(duration >= 500) results.F += blocksToRead;
|
||||
else if(duration >= 150) results.E += blocksToRead;
|
||||
else if(duration >= 50) results.D += blocksToRead;
|
||||
else if(duration >= 10) results.C += blocksToRead;
|
||||
else if(duration >= 3) results.B += blocksToRead;
|
||||
else results.A += blocksToRead;
|
||||
|
||||
mhddLog.Write(i, duration);
|
||||
ibgLog.Write(i, currentSpeed * 1024);
|
||||
|
||||
@@ -45,10 +45,7 @@ namespace DiscImageChef.Core
|
||||
PluginBase plugins = new PluginBase();
|
||||
plugins.RegisterAllPlugins();
|
||||
|
||||
foreach(Filesystem plugin in plugins.PluginsList.Values)
|
||||
{
|
||||
if(plugin.Identify(imagePlugin, partition)) idPlugins.Add(plugin.Name.ToLower());
|
||||
}
|
||||
foreach(Filesystem plugin in plugins.PluginsList.Values) if(plugin.Identify(imagePlugin, partition)) idPlugins.Add(plugin.Name.ToLower());
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -93,7 +93,7 @@ namespace DiscImageChef.Core
|
||||
}
|
||||
|
||||
// Still not recognized
|
||||
if(imageFormat == null) { return null; }
|
||||
if(imageFormat == null) return null;
|
||||
|
||||
return imageFormat;
|
||||
}
|
||||
|
||||
@@ -135,10 +135,7 @@ namespace DiscImageChef.Core
|
||||
|
||||
foreach(Partition detectedPartition in childPartitions) startLocations.Add(detectedPartition.Start);
|
||||
|
||||
foreach(Partition imagePartition in image.GetPartitions())
|
||||
{
|
||||
if(!startLocations.Contains(imagePartition.Start)) childPartitions.Add(imagePartition);
|
||||
}
|
||||
foreach(Partition imagePartition in image.GetPartitions()) if(!startLocations.Contains(imagePartition.Start)) childPartitions.Add(imagePartition);
|
||||
}
|
||||
|
||||
Partition[] childArray = childPartitions
|
||||
@@ -155,7 +152,7 @@ namespace DiscImageChef.Core
|
||||
|
||||
List<string> schemes = new List<string>();
|
||||
|
||||
foreach(Partition part in partitions) { if(!schemes.Contains(part.Scheme)) schemes.Add(part.Scheme); }
|
||||
foreach(Partition part in partitions) if(!schemes.Contains(part.Scheme)) schemes.Add(part.Scheme);
|
||||
|
||||
foreach(string scheme in schemes) Statistics.AddPartition(scheme);
|
||||
}
|
||||
|
||||
@@ -98,8 +98,10 @@ namespace DiscImageChef.Core
|
||||
{
|
||||
Filesystem plugin;
|
||||
if(encoding != null)
|
||||
{
|
||||
plugin = (Filesystem)type.GetConstructor(new Type[] {encoding.GetType()})
|
||||
.Invoke(new object[] {encoding});
|
||||
}
|
||||
else plugin = (Filesystem)type.GetConstructor(Type.EmptyTypes).Invoke(new object[] { });
|
||||
RegisterPlugin(plugin);
|
||||
}
|
||||
@@ -110,23 +112,17 @@ namespace DiscImageChef.Core
|
||||
|
||||
void RegisterImagePlugin(ImagePlugin plugin)
|
||||
{
|
||||
if(!ImagePluginsList.ContainsKey(plugin.Name.ToLower()))
|
||||
{
|
||||
ImagePluginsList.Add(plugin.Name.ToLower(), plugin);
|
||||
}
|
||||
if(!ImagePluginsList.ContainsKey(plugin.Name.ToLower())) ImagePluginsList.Add(plugin.Name.ToLower(), plugin);
|
||||
}
|
||||
|
||||
void RegisterPlugin(Filesystem plugin)
|
||||
{
|
||||
if(!PluginsList.ContainsKey(plugin.Name.ToLower())) { PluginsList.Add(plugin.Name.ToLower(), plugin); }
|
||||
if(!PluginsList.ContainsKey(plugin.Name.ToLower())) PluginsList.Add(plugin.Name.ToLower(), plugin);
|
||||
}
|
||||
|
||||
void RegisterPartPlugin(PartitionPlugin partplugin)
|
||||
{
|
||||
if(!PartPluginsList.ContainsKey(partplugin.Name.ToLower()))
|
||||
{
|
||||
PartPluginsList.Add(partplugin.Name.ToLower(), partplugin);
|
||||
}
|
||||
if(!PartPluginsList.ContainsKey(partplugin.Name.ToLower())) PartPluginsList.Add(partplugin.Name.ToLower(), partplugin);
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -234,10 +234,7 @@ namespace DiscImageChef.Core
|
||||
|
||||
// If there is only one track, and it's the same as the image file (e.g. ".iso" files), don't re-checksum.
|
||||
if(image.PluginUuid == new System.Guid("12345678-AAAA-BBBB-CCCC-123456789000") &&
|
||||
filterId == new System.Guid("12345678-AAAA-BBBB-CCCC-123456789000"))
|
||||
{
|
||||
sidecar.BlockMedia[0].ContentChecksums = sidecar.BlockMedia[0].Checksums;
|
||||
}
|
||||
filterId == new System.Guid("12345678-AAAA-BBBB-CCCC-123456789000")) sidecar.BlockMedia[0].ContentChecksums = sidecar.BlockMedia[0].Checksums;
|
||||
else
|
||||
{
|
||||
Checksum contentChkWorker = new Checksum();
|
||||
@@ -593,14 +590,18 @@ namespace DiscImageChef.Core
|
||||
scpBlockTrackTypes.OrderBy(t => t.Cylinder).ThenBy(t => t.Head).ToArray();
|
||||
}
|
||||
else
|
||||
{
|
||||
DicConsole
|
||||
.ErrorWriteLine("SuperCardPro image do not contain same number of tracks ({0}) than disk image ({1}), ignoring...",
|
||||
scpImage.Header.end + 1, image.ImageInfo.Cylinders);
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
DicConsole
|
||||
.ErrorWriteLine("SuperCardPro image do not contain same number of heads ({0}) than disk image ({1}), ignoring...",
|
||||
2, image.ImageInfo.Heads);
|
||||
}
|
||||
}
|
||||
}
|
||||
#endregion
|
||||
@@ -679,14 +680,18 @@ namespace DiscImageChef.Core
|
||||
kfBlockTrackTypes.OrderBy(t => t.Cylinder).ThenBy(t => t.Head).ToArray();
|
||||
}
|
||||
else
|
||||
{
|
||||
DicConsole
|
||||
.ErrorWriteLine("KryoFlux image do not contain same number of tracks ({0}) than disk image ({1}), ignoring...",
|
||||
kfImage.ImageInfo.Cylinders, image.ImageInfo.Cylinders);
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
DicConsole
|
||||
.ErrorWriteLine("KryoFluximage do not contain same number of heads ({0}) than disk image ({1}), ignoring...",
|
||||
kfImage.ImageInfo.Heads, image.ImageInfo.Heads);
|
||||
}
|
||||
}
|
||||
}
|
||||
#endregion
|
||||
@@ -751,14 +756,18 @@ namespace DiscImageChef.Core
|
||||
dfiBlockTrackTypes.OrderBy(t => t.Cylinder).ThenBy(t => t.Head).ToArray();
|
||||
}
|
||||
else
|
||||
{
|
||||
DicConsole
|
||||
.ErrorWriteLine("DiscFerret image do not contain same number of tracks ({0}) than disk image ({1}), ignoring...",
|
||||
dfiImage.ImageInfo.Cylinders, image.ImageInfo.Cylinders);
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
DicConsole
|
||||
.ErrorWriteLine("DiscFerret image do not contain same number of heads ({0}) than disk image ({1}), ignoring...",
|
||||
dfiImage.ImageInfo.Heads, image.ImageInfo.Heads);
|
||||
}
|
||||
}
|
||||
}
|
||||
#endregion
|
||||
|
||||
@@ -75,7 +75,6 @@ namespace DiscImageChef.Core
|
||||
MediaType dskType = image.ImageInfo.MediaType;
|
||||
|
||||
foreach(MediaTagType tagType in image.ImageInfo.ReadableMediaTags)
|
||||
{
|
||||
switch(tagType)
|
||||
{
|
||||
case MediaTagType.CD_ATIP:
|
||||
@@ -87,10 +86,8 @@ namespace DiscImageChef.Core
|
||||
Decoders.CD.ATIP.CDATIP?
|
||||
atip = Decoders.CD.ATIP.Decode(image.ReadDiskTag(MediaTagType.CD_ATIP));
|
||||
if(atip.HasValue)
|
||||
{
|
||||
if(atip.Value.DDCD) dskType = atip.Value.DiscType ? MediaType.DDCDRW : MediaType.DDCDR;
|
||||
else dskType = atip.Value.DiscType ? MediaType.CDRW : MediaType.CDR;
|
||||
}
|
||||
break;
|
||||
case MediaTagType.DVD_BCA:
|
||||
sidecar.OpticalDisc[0].BCA = new DumpType
|
||||
@@ -115,7 +112,6 @@ namespace DiscImageChef.Core
|
||||
Decoders.DVD.CSS_CPRM.LeadInCopyright? cmi =
|
||||
Decoders.DVD.CSS_CPRM.DecodeLeadInCopyright(image.ReadDiskTag(MediaTagType.DVD_CMI));
|
||||
if(cmi.HasValue)
|
||||
{
|
||||
switch(cmi.Value.CopyrightType)
|
||||
{
|
||||
case Decoders.DVD.CopyrightType.AACS:
|
||||
@@ -128,7 +124,6 @@ namespace DiscImageChef.Core
|
||||
sidecar.OpticalDisc[0].CopyProtection = "CPRM";
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
break;
|
||||
case MediaTagType.DVD_DMI:
|
||||
@@ -157,7 +152,6 @@ namespace DiscImageChef.Core
|
||||
Decoders.DVD.PFI.PhysicalFormatInformation? pfi =
|
||||
Decoders.DVD.PFI.Decode(image.ReadDiskTag(MediaTagType.DVD_PFI));
|
||||
if(pfi.HasValue)
|
||||
{
|
||||
if(dskType != MediaType.XGD && dskType != MediaType.XGD2 && dskType != MediaType.XGD3)
|
||||
{
|
||||
switch(pfi.Value.DiskCategory)
|
||||
@@ -219,7 +213,6 @@ namespace DiscImageChef.Core
|
||||
else if(pfi.Value.DiscSize == Decoders.DVD.DVDSize.OneTwenty)
|
||||
sidecar.OpticalDisc[0].Dimensions.Diameter = 120;
|
||||
}
|
||||
}
|
||||
|
||||
break;
|
||||
case MediaTagType.CD_PMA:
|
||||
@@ -230,7 +223,6 @@ namespace DiscImageChef.Core
|
||||
};
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
try
|
||||
{
|
||||
@@ -297,10 +289,7 @@ namespace DiscImageChef.Core
|
||||
xmlTrk.StartSector = (long)trk.TrackStartSector;
|
||||
xmlTrk.EndSector = (long)trk.TrackEndSector;
|
||||
|
||||
if(trk.Indexes != null && trk.Indexes.ContainsKey(0))
|
||||
{
|
||||
if(trk.Indexes.TryGetValue(0, out ulong idx0)) xmlTrk.StartSector = (long)idx0;
|
||||
}
|
||||
if(trk.Indexes != null && trk.Indexes.ContainsKey(0)) if(trk.Indexes.TryGetValue(0, out ulong idx0)) xmlTrk.StartSector = (long)idx0;
|
||||
|
||||
if(sidecar.OpticalDisc[0].DiscType == "CD" || sidecar.OpticalDisc[0].DiscType == "GD")
|
||||
{
|
||||
@@ -333,10 +322,7 @@ namespace DiscImageChef.Core
|
||||
// Only if filter is none...
|
||||
(filterId == new System.Guid("12345678-AAAA-BBBB-CCCC-123456789000") ||
|
||||
// ...or AppleDouble
|
||||
filterId == new System.Guid("1b2165ee-c9df-4b21-bbbb-9e5892b2df4d")))
|
||||
{
|
||||
xmlTrk.Checksums = sidecar.OpticalDisc[0].Checksums;
|
||||
}
|
||||
filterId == new System.Guid("1b2165ee-c9df-4b21-bbbb-9e5892b2df4d"))) xmlTrk.Checksums = sidecar.OpticalDisc[0].Checksums;
|
||||
else
|
||||
{
|
||||
UpdateProgress("Track {0} of {1}", trk.TrackSequence, tracks.Count);
|
||||
@@ -474,7 +460,6 @@ namespace DiscImageChef.Core
|
||||
List<FileSystemType> lstFs = new List<FileSystemType>();
|
||||
|
||||
foreach(Filesystem plugin in plugins.PluginsList.Values)
|
||||
{
|
||||
try
|
||||
{
|
||||
if(plugin.Identify(image, partitions[i]))
|
||||
@@ -497,7 +482,6 @@ namespace DiscImageChef.Core
|
||||
{
|
||||
//DicConsole.DebugWriteLine("Create-sidecar command", "Plugin {0} crashed", _plugin.Name);
|
||||
}
|
||||
}
|
||||
|
||||
if(lstFs.Count > 0) xmlTrk.FileSystemInformation[i].FileSystems = lstFs.ToArray();
|
||||
}
|
||||
@@ -520,7 +504,6 @@ namespace DiscImageChef.Core
|
||||
Sequence = (ulong)xmlTrk.Sequence.TrackNumber
|
||||
};
|
||||
foreach(Filesystem plugin in plugins.PluginsList.Values)
|
||||
{
|
||||
try
|
||||
{
|
||||
if(plugin.Identify(image, xmlPart))
|
||||
@@ -541,7 +524,6 @@ namespace DiscImageChef.Core
|
||||
{
|
||||
//DicConsole.DebugWriteLine("Create-sidecar command", "Plugin {0} crashed", _plugin.Name);
|
||||
}
|
||||
}
|
||||
|
||||
if(lstFs.Count > 0) xmlTrk.FileSystemInformation[0].FileSystems = lstFs.ToArray();
|
||||
}
|
||||
@@ -573,7 +555,6 @@ namespace DiscImageChef.Core
|
||||
!string.IsNullOrEmpty(image.ImageInfo.DriveModel) ||
|
||||
!string.IsNullOrEmpty(image.ImageInfo.DriveFirmwareRevision) ||
|
||||
!string.IsNullOrEmpty(image.ImageInfo.DriveSerialNumber))
|
||||
{
|
||||
sidecar.OpticalDisc[0].DumpHardwareArray = new[]
|
||||
{
|
||||
new DumpHardwareType
|
||||
@@ -590,7 +571,6 @@ namespace DiscImageChef.Core
|
||||
}
|
||||
}
|
||||
};
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user