REFACTOR: Use preferred braces style.

This commit is contained in:
2017-12-21 00:44:33 +00:00
parent e9443388ee
commit bce69c9161
171 changed files with 5 additions and 1412 deletions

View File

@@ -107,14 +107,12 @@ namespace DiscImageChef.Core
if(!string.IsNullOrEmpty(filename))
{
if(File.Exists(filename))
{
if(overwrite) File.Delete(filename);
else
{
DicConsole.ErrorWriteLine("Not overwriting file {0}", filename);
return;
}
}
try
{

View File

@@ -117,9 +117,7 @@ namespace DiscImageChef.Core.Devices.Dumping
dumpLog.WriteLine("Decoding PCMCIA CIS.");
Decoders.PCMCIA.Tuple[] tuples = CIS.GetTuples(dev.Cis);
if(tuples != null)
{
foreach(Decoders.PCMCIA.Tuple tuple in tuples)
{
if(tuple.Code == TupleCodes.CISTPL_MANFID)
{
ManufacturerIdentificationTuple manfid =
@@ -146,8 +144,6 @@ namespace DiscImageChef.Core.Devices.Dumping
sidecar.BlockMedia[0].PCMCIA.AdditionalInformation = vers.AdditionalInformation;
}
}
}
}
}
sidecar.BlockMedia[0].ATA = new ATAType
@@ -506,7 +502,6 @@ namespace DiscImageChef.Core.Devices.Dumping
partitions[i].Scheme);
foreach(Filesystem plugin in plugins.PluginsList.Values)
{
try
{
if(plugin.Identify(imageFormat, partitions[i]))
@@ -523,7 +518,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();
}
@@ -544,7 +538,6 @@ namespace DiscImageChef.Core.Devices.Dumping
};
foreach(Filesystem plugin in plugins.PluginsList.Values)
{
try
{
if(plugin.Identify(imageFormat, wholePart))
@@ -561,7 +554,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();
}

View File

@@ -188,7 +188,6 @@ namespace DiscImageChef.Core.Devices.Dumping
{
Decoders.DVD.PFI.PhysicalFormatInformation? nintendoPfi = Decoders.DVD.PFI.Decode(cmdBuf);
if(nintendoPfi != null)
{
if(nintendoPfi.Value.DiskCategory == Decoders.DVD.DiskCategory.Nintendo &&
nintendoPfi.Value.PartVersion == 15)
{
@@ -196,7 +195,6 @@ namespace DiscImageChef.Core.Devices.Dumping
throw new
NotImplementedException("Dumping Nintendo GameCube or Wii discs is not yet implemented.");
}
}
}
}
#endregion Nintendo
@@ -232,7 +230,6 @@ namespace DiscImageChef.Core.Devices.Dumping
// False book types
if(dskType == MediaType.DVDROM)
{
switch(decPfi.DiskCategory)
{
case Decoders.DVD.DiskCategory.DVDPR:
@@ -281,7 +278,6 @@ namespace DiscImageChef.Core.Devices.Dumping
dskType = MediaType.UMD;
break;
}
}
}
}
@@ -353,7 +349,6 @@ namespace DiscImageChef.Core.Devices.Dumping
MmcDiscStructureFormat.CopyrightInformation, 0, dev.Timeout,
out duration);
if(!sense)
{
if(Decoders.DVD.CSS_CPRM.DecodeLeadInCopyright(cmdBuf).HasValue)
{
tmpBuf = new byte[cmdBuf.Length - 4];
@@ -371,7 +366,6 @@ namespace DiscImageChef.Core.Devices.Dumping
if(cpy.CopyrightType != Decoders.DVD.CopyrightType.NoProtection)
sidecar.OpticalDisc[0].CopyProtection = cpy.CopyrightType.ToString();
}
}
}
#endregion DVD-ROM
@@ -404,7 +398,6 @@ namespace DiscImageChef.Core.Devices.Dumping
sense = dev.ReadDiscStructure(out cmdBuf, out senseBuf, MmcDiscStructureMediaType.Dvd, 0, 0,
MmcDiscStructureFormat.DvdramDds, 0, dev.Timeout, out duration);
if(!sense)
{
if(Decoders.DVD.DDS.Decode(cmdBuf).HasValue)
{
tmpBuf = new byte[cmdBuf.Length - 4];
@@ -417,14 +410,12 @@ namespace DiscImageChef.Core.Devices.Dumping
};
DataFile.WriteTo("SCSI Dump", sidecar.OpticalDisc[0].DDS.Image, tmpBuf);
}
}
dumpLog.WriteLine("Reading Spare Area Information.");
sense = dev.ReadDiscStructure(out cmdBuf, out senseBuf, MmcDiscStructureMediaType.Dvd, 0, 0,
MmcDiscStructureFormat.DvdramSpareAreaInformation, 0, dev.Timeout,
out duration);
if(!sense)
{
if(Decoders.DVD.Spare.Decode(cmdBuf).HasValue)
{
tmpBuf = new byte[cmdBuf.Length - 4];
@@ -437,7 +428,6 @@ namespace DiscImageChef.Core.Devices.Dumping
};
DataFile.WriteTo("SCSI Dump", sidecar.OpticalDisc[0].SAI.Image, tmpBuf);
}
}
}
#endregion DVD-RAM and HD DVD-RAM
@@ -569,7 +559,6 @@ namespace DiscImageChef.Core.Devices.Dumping
sense = dev.ReadDiscStructure(out cmdBuf, out senseBuf, MmcDiscStructureMediaType.Bd, 0, 0,
MmcDiscStructureFormat.DiscInformation, 0, dev.Timeout, out duration);
if(!sense)
{
if(Decoders.Bluray.DI.Decode(cmdBuf).HasValue)
{
tmpBuf = new byte[cmdBuf.Length - 4];
@@ -582,7 +571,6 @@ namespace DiscImageChef.Core.Devices.Dumping
};
DataFile.WriteTo("SCSI Dump", sidecar.OpticalDisc[0].DI.Image, tmpBuf);
}
}
dumpLog.WriteLine("Reading PAC.");
sense = dev.ReadDiscStructure(out cmdBuf, out senseBuf, MmcDiscStructureMediaType.Bd, 0, 0,

View File

@@ -217,15 +217,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);
@@ -237,7 +234,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, 0x00, 5,
@@ -248,7 +244,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);
@@ -260,7 +255,6 @@ namespace DiscImageChef.Core.Devices.Dumping
};
DataFile.WriteTo("SCSI Dump", sidecar.BlockMedia[0].SCSI.ModeSense.Image, cmdBuf);
}
}
// TODO: Check partitions page
if(decMode.HasValue)
@@ -302,7 +296,6 @@ namespace DiscImageChef.Core.Devices.Dumping
{
fxSense = Decoders.SCSI.Sense.DecodeFixed(senseBuf, out strSense);
if(fxSense.HasValue)
{
if(fxSense.Value.SenseKey == Decoders.SCSI.SenseKeys.IllegalRequest)
{
sense = dev.Space(out senseBuf, SscSpaceCodes.LogicalBlock, -1, dev.Timeout, out duration);
@@ -346,7 +339,6 @@ namespace DiscImageChef.Core.Devices.Dumping
fxSense.Value.SenseKey, fxSense.Value.ASC, fxSense.Value.ASCQ);
return;
}
}
else
{
DicConsole.WriteLine();

View File

@@ -489,7 +489,6 @@ namespace DiscImageChef.Core.Devices.Dumping
partitions[i].Scheme);
foreach(Filesystem plugin in plugins.PluginsList.Values)
{
try
{
if(plugin.Identify(imageFormat, partitions[i]))
@@ -506,7 +505,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();
}
@@ -523,7 +521,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))
@@ -540,7 +537,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();
}

View File

@@ -200,10 +200,8 @@ namespace DiscImageChef.Core.Devices
if((ataId.PhysLogSectorSize & 0x8000) == 0x0000 && (ataId.PhysLogSectorSize & 0x4000) == 0x4000)
{
if((ataId.PhysLogSectorSize & 0x1000) == 0x1000)
{
if(ataId.LogicalSectorWords <= 255 || ataId.LogicalAlignment == 0xFFFF) blockSize = 512;
else blockSize = ataId.LogicalSectorWords * 2;
}
else blockSize = 512;
if((ataId.PhysLogSectorSize & 0x2000) == 0x2000)

View File

@@ -137,7 +137,6 @@ namespace DiscImageChef.Core.Devices
{
decSense = Decoders.SCSI.Sense.DecodeFixed(senseBuf);
if(decSense.HasValue)
{
if(decSense.Value.SenseKey == Decoders.SCSI.SenseKeys.IllegalRequest &&
decSense.Value.ASC == 0x24 && decSense.Value.ASCQ == 0x00)
{
@@ -149,13 +148,10 @@ namespace DiscImageChef.Core.Devices
(ushort)longBlockSize, timeout, out duration);
}
}
}
}
if(readRaw && longBlockSize == blockSize)
{
if(blockSize == 512)
{
foreach(ushort testSize in new[]
{
// Long sector sizes for floppies
@@ -186,9 +182,7 @@ namespace DiscImageChef.Core.Devices
break;
}
}
}
else if(blockSize == 1024)
{
foreach(ushort testSize in new[]
{
// Long sector sizes for floppies
@@ -217,7 +211,6 @@ namespace DiscImageChef.Core.Devices
break;
}
}
}
else if(blockSize == 2048)
{
testSense = dev.ReadLong16(out readBuffer, out senseBuf, false, 0, 2380, timeout,
@@ -284,7 +277,6 @@ namespace DiscImageChef.Core.Devices
}
}
}
}
if(!readRaw && dev.Manufacturer == "SYQUEST")
{
@@ -294,7 +286,6 @@ namespace DiscImageChef.Core.Devices
{
decSense = Decoders.SCSI.Sense.DecodeFixed(senseBuf);
if(decSense.HasValue)
{
if(decSense.Value.SenseKey == Decoders.SCSI.SenseKeys.IllegalRequest &&
decSense.Value.ASC == 0x24 && decSense.Value.ASCQ == 0x00)
{
@@ -315,7 +306,6 @@ namespace DiscImageChef.Core.Devices
{
decSense = Decoders.SCSI.Sense.DecodeFixed(senseBuf);
if(decSense.HasValue)
{
if(decSense.Value.SenseKey == Decoders.SCSI.SenseKeys.IllegalRequest &&
decSense.Value.ASC == 0x24 && decSense.Value.ASCQ == 0x00)
{
@@ -328,10 +318,8 @@ namespace DiscImageChef.Core.Devices
longBlockSize, timeout, out duration);
}
}
}
}
}
}
}
if(!readRaw && blockSize == 256)
@@ -350,16 +338,12 @@ 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)
{
@@ -419,8 +403,6 @@ namespace DiscImageChef.Core.Devices
sense = dev.ReadCapacity16(out cmdBuf, out senseBuf, timeout, out duration);
if(sense && blocks == 0)
{
// Not all MMC devices support READ CAPACITY, as they have READ TOC
if(dev.ScsiType != Decoders.SCSI.PeripheralDeviceTypes.MultiMediaDevice)
{
errorMessage = string.Format("Unable to get media capacity\n" + "{0}",
@@ -428,7 +410,6 @@ namespace DiscImageChef.Core.Devices
return true;
}
}
if(!sense)
{
@@ -502,61 +483,39 @@ namespace DiscImageChef.Core.Devices
duration = 0;
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;
}

View File

@@ -553,11 +553,9 @@ 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;
}
@@ -578,7 +576,6 @@ namespace DiscImageChef.Core.Devices.Report
}
if(ataId.NominalRotationRate != 0x0000 && ataId.NominalRotationRate != 0xFFFF)
{
if(ataId.NominalRotationRate == 0x0001)
{
mediaTest.SolidStateDevice = true;
@@ -591,7 +588,6 @@ namespace DiscImageChef.Core.Devices.Report
mediaTest.NominalRotationRate = ataId.NominalRotationRate;
mediaTest.NominalRotationRateSpecified = true;
}
}
uint logicalsectorsize = 0;
uint physicalsectorsize;
@@ -599,11 +595,9 @@ namespace DiscImageChef.Core.Devices.Report
(ataId.PhysLogSectorSize & 0x4000) == 0x4000)
{
if((ataId.PhysLogSectorSize & 0x1000) == 0x1000)
{
if(ataId.LogicalSectorWords <= 255 || ataId.LogicalAlignment == 0xFFFF)
logicalsectorsize = 512;
else logicalsectorsize = ataId.LogicalSectorWords * 2;
}
else logicalsectorsize = 512;
if((ataId.PhysLogSectorSize & 0x2000) == 0x2000)
@@ -698,11 +692,9 @@ 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);
@@ -713,11 +705,9 @@ 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,
@@ -729,11 +719,9 @@ 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);
@@ -744,11 +732,9 @@ 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);
@@ -767,11 +753,9 @@ 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);
@@ -782,11 +766,9 @@ 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);
@@ -797,11 +779,9 @@ 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);
@@ -812,11 +792,9 @@ 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);
@@ -835,11 +813,9 @@ 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);
@@ -850,11 +826,9 @@ 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,
@@ -866,11 +840,9 @@ 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,
@@ -882,11 +854,9 @@ 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,
@@ -898,11 +868,9 @@ 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,
@@ -914,11 +882,9 @@ 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;
@@ -982,7 +948,6 @@ namespace DiscImageChef.Core.Devices.Report
}
if(ataId.NominalRotationRate != 0x0000 && ataId.NominalRotationRate != 0xFFFF)
{
if(ataId.NominalRotationRate == 0x0001)
{
report.ATA.ReadCapabilities.SolidStateDevice = true;
@@ -995,18 +960,15 @@ namespace DiscImageChef.Core.Devices.Report
report.ATA.ReadCapabilities.NominalRotationRate = ataId.NominalRotationRate;
report.ATA.ReadCapabilities.NominalRotationRateSpecified = true;
}
}
uint logicalsectorsize = 0;
uint physicalsectorsize;
if((ataId.PhysLogSectorSize & 0x8000) == 0x0000 && (ataId.PhysLogSectorSize & 0x4000) == 0x4000)
{
if((ataId.PhysLogSectorSize & 0x1000) == 0x1000)
{
if(ataId.LogicalSectorWords <= 255 || ataId.LogicalAlignment == 0xFFFF)
logicalsectorsize = 512;
else logicalsectorsize = ataId.LogicalSectorWords * 2;
}
else logicalsectorsize = 512;
if((ataId.PhysLogSectorSize & 0x2000) == 0x2000)
@@ -1100,10 +1062,8 @@ 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);
@@ -1113,10 +1073,8 @@ 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);
@@ -1126,10 +1084,8 @@ 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);
@@ -1139,10 +1095,8 @@ 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);
@@ -1159,10 +1113,8 @@ 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);
@@ -1172,10 +1124,8 @@ 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);
@@ -1185,10 +1135,8 @@ 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);
@@ -1198,10 +1146,8 @@ 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);
@@ -1218,10 +1164,8 @@ 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);
@@ -1231,10 +1175,8 @@ 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,
@@ -1246,10 +1188,8 @@ 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,
@@ -1261,10 +1201,8 @@ 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,
@@ -1276,10 +1214,8 @@ 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,
@@ -1291,10 +1227,8 @@ 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);
}
}
}
}

View File

@@ -44,9 +44,7 @@ namespace DiscImageChef.Core.Devices.Report
report.PCMCIA.CIS = dev.Cis;
Tuple[] tuples = CIS.GetTuples(dev.Cis);
if(tuples != null)
{
foreach(Tuple tuple in tuples)
{
if(tuple.Code == TupleCodes.CISTPL_MANFID)
{
ManufacturerIdentificationTuple manfid = CIS.DecodeManufacturerIdentificationTuple(tuple);
@@ -71,8 +69,6 @@ namespace DiscImageChef.Core.Devices.Report
report.PCMCIA.AdditionalInformation = vers.AdditionalInformation;
}
}
}
}
}
}
}

View File

@@ -185,7 +185,6 @@ namespace DiscImageChef.Core.Devices.Report.SCSI
{
List<pageType> evpds = new List<pageType>();
foreach(byte page in evpdPages)
{
if(page != 0x80)
{
DicConsole.WriteLine("Querying SCSI EVPD {0:X2}h...", page);
@@ -198,7 +197,6 @@ namespace DiscImageChef.Core.Devices.Report.SCSI
evpds.Add(evpd);
}
}
}
if(evpds.Count > 0) report.SCSI.EVPDPages = evpds.ToArray();
}
@@ -354,7 +352,6 @@ namespace DiscImageChef.Core.Devices.Report.SCSI
{
Decoders.SCSI.FixedSense? decSense = Decoders.SCSI.Sense.DecodeFixed(senseBuffer);
if(decSense.HasValue)
{
if(decSense.Value.ASC == 0x3A)
{
int leftRetries = 20;
@@ -386,7 +383,6 @@ namespace DiscImageChef.Core.Devices.Report.SCSI
mediaTest.MediaIsRecognized &= !sense;
}
else mediaTest.MediaIsRecognized = false;
}
else mediaTest.MediaIsRecognized = false;
}
@@ -471,11 +467,9 @@ 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 =
@@ -483,11 +477,9 @@ 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 =
@@ -495,11 +487,9 @@ 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,11 +497,9 @@ 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)...");
@@ -521,7 +509,6 @@ namespace DiscImageChef.Core.Devices.Report.SCSI
{
Decoders.SCSI.FixedSense? decSense = Decoders.SCSI.Sense.DecodeFixed(senseBuffer);
if(decSense.HasValue)
{
if(decSense.Value.SenseKey == Decoders.SCSI.SenseKeys.IllegalRequest &&
decSense.Value.ASC == 0x24 && decSense.Value.ASCQ == 0x00)
{
@@ -533,13 +520,10 @@ namespace DiscImageChef.Core.Devices.Report.SCSI
mediaTest.LongBlockSizeSpecified = true;
}
}
}
}
if(mediaTest.SupportsReadLong && mediaTest.LongBlockSize == mediaTest.BlockSize)
{
if(mediaTest.BlockSize == 512)
{
foreach(ushort testSize in new[]
{
// Long sector sizes for floppies
@@ -560,9 +544,7 @@ namespace DiscImageChef.Core.Devices.Report.SCSI
break;
}
}
}
else if(mediaTest.BlockSize == 1024)
{
foreach(ushort testSize in new[]
{
// Long sector sizes for floppies
@@ -581,7 +563,6 @@ namespace DiscImageChef.Core.Devices.Report.SCSI
break;
}
}
}
else if(mediaTest.BlockSize == 2048)
{
sense = dev.ReadLong10(out buffer, out senseBuffer, false, false, 0, 2380,
@@ -615,7 +596,6 @@ namespace DiscImageChef.Core.Devices.Report.SCSI
mediaTest.LongBlockSizeSpecified = true;
}
}
}
if(mediaTest.SupportsReadLong && mediaTest.LongBlockSize == mediaTest.BlockSize)
{
@@ -655,11 +635,9 @@ 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;
@@ -757,11 +735,9 @@ 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 =
@@ -770,11 +746,9 @@ 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 =
@@ -783,11 +757,9 @@ 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 =
@@ -796,11 +768,9 @@ 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)...");
@@ -809,7 +779,6 @@ namespace DiscImageChef.Core.Devices.Report.SCSI
{
Decoders.SCSI.FixedSense? decSense = Decoders.SCSI.Sense.DecodeFixed(senseBuffer);
if(decSense.HasValue)
{
if(decSense.Value.SenseKey == Decoders.SCSI.SenseKeys.IllegalRequest &&
decSense.Value.ASC == 0x24 && decSense.Value.ASCQ == 0x00)
{
@@ -821,14 +790,11 @@ namespace DiscImageChef.Core.Devices.Report.SCSI
report.SCSI.ReadCapabilities.LongBlockSizeSpecified = true;
}
}
}
}
if(report.SCSI.ReadCapabilities.SupportsReadLong && report.SCSI.ReadCapabilities.LongBlockSize ==
report.SCSI.ReadCapabilities.BlockSize)
{
if(report.SCSI.ReadCapabilities.BlockSize == 512)
{
foreach(ushort testSize in new[]
{
// Long sector sizes for floppies
@@ -849,9 +815,7 @@ namespace DiscImageChef.Core.Devices.Report.SCSI
break;
}
}
}
else if(report.SCSI.ReadCapabilities.BlockSize == 1024)
{
foreach(ushort testSize in new[]
{
// Long sector sizes for floppies
@@ -870,7 +834,6 @@ namespace DiscImageChef.Core.Devices.Report.SCSI
break;
}
}
}
else if(report.SCSI.ReadCapabilities.BlockSize == 2048)
{
sense = dev.ReadLong10(out buffer, out senseBuffer, false, false, 0, 2380, timeout,
@@ -904,7 +867,6 @@ namespace DiscImageChef.Core.Devices.Report.SCSI
report.SCSI.ReadCapabilities.LongBlockSizeSpecified = true;
}
}
}
if(report.SCSI.ReadCapabilities.SupportsReadLong && report.SCSI.ReadCapabilities.LongBlockSize ==
report.SCSI.ReadCapabilities.BlockSize)
@@ -955,11 +917,9 @@ 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);
}
}
}
}

View File

@@ -168,7 +168,6 @@ namespace DiscImageChef.Core.Devices.Report.SCSI
{
report.SCSI.MultiMediaDevice.Features = new mmcFeaturesType();
foreach(Decoders.SCSI.MMC.Features.FeatureDescriptor desc in ftr.Descriptors)
{
switch(desc.Code)
{
case 0x0001:
@@ -523,13 +522,11 @@ namespace DiscImageChef.Core.Devices.Report.SCSI
Decoders.SCSI.MMC.Feature_0106? ftr0106 =
Decoders.SCSI.MMC.Features.Decode_0106(desc.Data);
if(ftr0106.HasValue)
{
if(ftr0106.Value.CSSVersion > 0)
{
report.SCSI.MultiMediaDevice.Features.CSSVersionSpecified = true;
report.SCSI.MultiMediaDevice.Features.CSSVersion = ftr0106.Value.CSSVersion;
}
}
}
break;
case 0x0108:
@@ -544,13 +541,11 @@ namespace DiscImageChef.Core.Devices.Report.SCSI
Decoders.SCSI.MMC.Feature_010B? ftr010B =
Decoders.SCSI.MMC.Features.Decode_010B(desc.Data);
if(ftr010B.HasValue)
{
if(ftr010B.Value.CPRMVersion > 0)
{
report.SCSI.MultiMediaDevice.Features.CPRMVersionSpecified = true;
report.SCSI.MultiMediaDevice.Features.CPRMVersion = ftr010B.Value.CPRMVersion;
}
}
}
break;
case 0x010C:
@@ -653,7 +648,6 @@ namespace DiscImageChef.Core.Devices.Report.SCSI
report.SCSI.MultiMediaDevice.Features.SupportsVCPS = true;
break;
}
}
}
if(report.SCSI.MultiMediaDevice.Features.CanReadBD ||
@@ -763,7 +757,6 @@ namespace DiscImageChef.Core.Devices.Report.SCSI
{
Decoders.SCSI.FixedSense? decSense = Decoders.SCSI.Sense.DecodeFixed(senseBuffer);
if(decSense.HasValue)
{
if(decSense.Value.ASC == 0x3A)
{
int leftRetries = 20;
@@ -811,7 +804,6 @@ namespace DiscImageChef.Core.Devices.Report.SCSI
mediaTest.MediaIsRecognized &= !sense;
}
else mediaTest.MediaIsRecognized = false;
}
else mediaTest.MediaIsRecognized = false;
}
@@ -890,22 +882,18 @@ 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) ||
@@ -917,20 +905,16 @@ 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) ||
@@ -945,11 +929,9 @@ 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,
@@ -957,11 +939,9 @@ 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")
@@ -974,11 +954,9 @@ 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")
@@ -991,11 +969,9 @@ 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 =
@@ -1003,11 +979,9 @@ 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")
@@ -1020,11 +994,9 @@ 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")
@@ -1036,11 +1008,9 @@ 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,
@@ -1048,11 +1018,9 @@ 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")
@@ -1065,11 +1033,9 @@ 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,
@@ -1078,11 +1044,9 @@ 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")
@@ -1095,11 +1059,9 @@ 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")
@@ -1113,11 +1075,9 @@ 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,
@@ -1125,11 +1085,9 @@ 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")
@@ -1142,22 +1100,18 @@ 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")
@@ -1170,11 +1124,9 @@ 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))
@@ -1187,11 +1139,9 @@ 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))
@@ -1205,22 +1155,18 @@ 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;
@@ -1233,44 +1179,35 @@ 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)
{
if(!tryPlextor)
{
pressedKey = new ConsoleKeyInfo();
@@ -1284,7 +1221,6 @@ namespace DiscImageChef.Core.Devices.Report.SCSI
tryPlextor |= pressedKey.Key == ConsoleKey.Y;
}
}
if(mediaType.StartsWith("CD-", StringComparison.Ordinal) ||
mediaType.StartsWith("DDCD-", StringComparison.Ordinal) || mediaType == "Audio CD")
@@ -1313,11 +1249,9 @@ 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,
@@ -1326,11 +1260,9 @@ 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
{
@@ -1342,11 +1274,9 @@ 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,
@@ -1355,11 +1285,9 @@ 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,
@@ -1368,11 +1296,9 @@ 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,
@@ -1383,11 +1309,9 @@ 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")
@@ -1396,26 +1320,20 @@ 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;
@@ -1425,30 +1343,24 @@ 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")
@@ -1460,21 +1372,17 @@ 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,
@@ -1484,11 +1392,9 @@ 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,
@@ -1496,11 +1402,9 @@ 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,
@@ -1510,11 +1414,9 @@ 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,
@@ -1524,7 +1426,6 @@ 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,
@@ -1532,15 +1433,12 @@ 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,
@@ -1549,7 +1447,6 @@ 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,
@@ -1557,15 +1454,12 @@ 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,
@@ -1576,21 +1470,17 @@ 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)
{
@@ -1601,21 +1491,17 @@ 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,
@@ -1625,11 +1511,9 @@ 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,
@@ -1637,11 +1521,9 @@ 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,
@@ -1652,11 +1534,9 @@ 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,
@@ -1667,7 +1547,6 @@ 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,
@@ -1676,15 +1555,12 @@ 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,
@@ -1694,7 +1570,6 @@ 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,
@@ -1703,15 +1578,12 @@ 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,
@@ -1723,21 +1595,17 @@ 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
{
@@ -1748,21 +1616,17 @@ 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,
@@ -1772,11 +1636,9 @@ 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,
@@ -1784,11 +1646,9 @@ 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,
@@ -1798,11 +1658,9 @@ 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,
@@ -1812,7 +1670,6 @@ 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,
@@ -1820,15 +1677,12 @@ 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,
@@ -1837,7 +1691,6 @@ 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,
@@ -1845,15 +1698,12 @@ 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,
@@ -1865,21 +1715,17 @@ 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)
@@ -1923,11 +1769,9 @@ 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)
@@ -1941,11 +1785,9 @@ 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,
@@ -1953,11 +1795,9 @@ 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)
@@ -1968,11 +1808,9 @@ 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);
}
}
}
@@ -1984,7 +1822,6 @@ namespace DiscImageChef.Core.Devices.Report.SCSI
{
Decoders.SCSI.FixedSense? decSense = Decoders.SCSI.Sense.DecodeFixed(senseBuffer);
if(decSense.HasValue)
{
if(decSense.Value.SenseKey == Decoders.SCSI.SenseKeys.IllegalRequest &&
decSense.Value.ASC == 0x24 && decSense.Value.ASCQ == 0x00)
{
@@ -1995,11 +1832,9 @@ namespace DiscImageChef.Core.Devices.Report.SCSI
mediaTest.LongBlockSizeSpecified = true;
}
}
}
}
if(debug)
{
if(!tryHldtst)
{
pressedKey = new ConsoleKeyInfo();
@@ -2013,7 +1848,6 @@ namespace DiscImageChef.Core.Devices.Report.SCSI
tryHldtst |= pressedKey.Key == ConsoleKey.Y;
}
}
if(mediaTest.SupportsReadLong && mediaTest.LongBlockSize == mediaTest.BlockSize)
{
@@ -2037,11 +1871,9 @@ 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);
}
@@ -2055,11 +1887,9 @@ 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)
@@ -2108,11 +1938,9 @@ 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);
}
}
}

View File

@@ -138,10 +138,8 @@ 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];
}
}
}
}
@@ -181,7 +179,6 @@ namespace DiscImageChef.Core.Devices.Report.SCSI
{
Decoders.SCSI.FixedSense? decSense = Decoders.SCSI.Sense.DecodeFixed(senseBuffer);
if(decSense.HasValue)
{
if(decSense.Value.ASC == 0x3A)
{
int leftRetries = 20;
@@ -213,7 +210,6 @@ namespace DiscImageChef.Core.Devices.Report.SCSI
seqTest.MediaIsRecognized &= !sense;
}
else seqTest.MediaIsRecognized = false;
}
else seqTest.MediaIsRecognized = false;
}
@@ -302,10 +298,8 @@ 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];
}
}
}
}

View File

@@ -51,7 +51,6 @@ namespace DiscImageChef.Core
// Check all but RAW plugin
foreach(ImagePlugin imageplugin in plugins.ImagePluginsList.Values)
{
if(imageplugin.PluginUuid != new Guid("12345678-AAAA-BBBB-CCCC-123456789000"))
{
try
@@ -67,13 +66,10 @@ namespace DiscImageChef.Core
catch { }
#pragma warning restore RECS0022 // A catch clause that catches System.Exception and has an empty body
}
}
// Check only RAW plugin
if(imageFormat == null)
{
foreach(ImagePlugin imageplugin in plugins.ImagePluginsList.Values)
{
if(imageplugin.PluginUuid == new Guid("12345678-AAAA-BBBB-CCCC-123456789000"))
{
try
@@ -89,8 +85,6 @@ namespace DiscImageChef.Core
catch { }
#pragma warning restore RECS0022 // A catch clause that catches System.Exception and has an empty body
}
}
}
// Still not recognized
if(imageFormat == null) return null;

View File

@@ -51,33 +51,27 @@ namespace DiscImageChef.Core
// Getting all partitions from device (e.g. tracks)
if(image.ImageInfo.ImageHasPartitions)
{
foreach(Partition imagePartition in image.GetPartitions())
{
foreach(PartitionPlugin _partplugin in plugins.PartPluginsList.Values)
{
if(_partplugin.GetInformation(image, out List<Partition> _partitions, imagePartition.Start))
{
partitions.AddRange(_partitions);
DicConsole.DebugWriteLine("Partitions", "Found {0} @ {1}", _partplugin.Name,
imagePartition.Start);
}
}
checkedLocations.Add(imagePartition.Start);
}
}
// Getting all partitions at start of device
else
{
foreach(PartitionPlugin _partplugin in plugins.PartPluginsList.Values)
{
if(_partplugin.GetInformation(image, out List<Partition> _partitions, 0))
{
partitions.AddRange(_partitions);
DicConsole.DebugWriteLine("Partitions", "Found {0} @ 0", _partplugin.Name);
}
}
checkedLocations.Add(0);
}
@@ -113,10 +107,8 @@ namespace DiscImageChef.Core
partitions.RemoveAt(0);
foreach(Partition child in childs)
{
if(checkedLocations.Contains(child.Start)) childPartitions.Add(child);
else partitions.Add(child);
}
}
else
{

View File

@@ -61,7 +61,6 @@ namespace DiscImageChef.Core
assembly = Assembly.GetAssembly(typeof(ImagePlugin));
foreach(Type type in assembly.GetTypes())
{
try
{
if(type.IsSubclassOf(typeof(ImagePlugin)))
@@ -71,12 +70,10 @@ namespace DiscImageChef.Core
}
}
catch(Exception exception) { DicConsole.ErrorWriteLine("Exception {0}", exception); }
}
assembly = Assembly.GetAssembly(typeof(PartitionPlugin));
foreach(Type type in assembly.GetTypes())
{
try
{
if(type.IsSubclassOf(typeof(PartitionPlugin)))
@@ -86,28 +83,23 @@ namespace DiscImageChef.Core
}
}
catch(Exception exception) { DicConsole.ErrorWriteLine("Exception {0}", exception); }
}
assembly = Assembly.GetAssembly(typeof(Filesystem));
foreach(Type type in assembly.GetTypes())
{
try
{
if(type.IsSubclassOf(typeof(Filesystem)))
{
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);
}
}
catch(Exception exception) { DicConsole.ErrorWriteLine("Exception {0}", exception); }
}
}
void RegisterImagePlugin(ImagePlugin plugin)

View File

@@ -79,7 +79,6 @@ namespace DiscImageChef.Core
}
foreach(MediaTagType tagType in image.ImageInfo.ReadableMediaTags)
{
switch(tagType)
{
case MediaTagType.ATAPI_IDENTIFY:
@@ -112,9 +111,7 @@ namespace DiscImageChef.Core
};
Tuple[] tuples = CIS.GetTuples(cis);
if(tuples != null)
{
foreach(Tuple tuple in tuples)
{
if(tuple.Code == TupleCodes.CISTPL_MANFID)
{
ManufacturerIdentificationTuple manfid =
@@ -141,8 +138,6 @@ namespace DiscImageChef.Core
sidecar.BlockMedia[0].PCMCIA.AdditionalInformation = vers.AdditionalInformation;
}
}
}
}
break;
case MediaTagType.SCSI_INQUIRY:
@@ -230,7 +225,6 @@ namespace DiscImageChef.Core
};
break;
}
}
// 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") &&
@@ -312,7 +306,6 @@ namespace DiscImageChef.Core
List<FileSystemType> lstFs = new List<FileSystemType>();
foreach(Filesystem plugin in plugins.PluginsList.Values)
{
try
{
if(plugin.Identify(image, partitions[i]))
@@ -328,7 +321,6 @@ namespace DiscImageChef.Core
{
//DicConsole.DebugWriteLine("Create-sidecar command", "Plugin {0} crashed", _plugin.Name);
}
}
if(lstFs.Count > 0) sidecar.BlockMedia[0].FileSystemInformation[i].FileSystems = lstFs.ToArray();
}
@@ -348,7 +340,6 @@ namespace DiscImageChef.Core
List<FileSystemType> lstFs = new List<FileSystemType>();
foreach(Filesystem plugin in plugins.PluginsList.Values)
{
try
{
if(plugin.Identify(image, wholePart))
@@ -364,7 +355,6 @@ namespace DiscImageChef.Core
{
//DicConsole.DebugWriteLine("Create-sidecar command", "Plugin {0} crashed", _plugin.Name);
}
}
if(lstFs.Count > 0) sidecar.BlockMedia[0].FileSystemInformation[0].FileSystems = lstFs.ToArray();
}
@@ -384,7 +374,6 @@ namespace DiscImageChef.Core
Decoders.ATA.Identify.IdentifyDevice? ataId =
Decoders.ATA.Identify.Decode(image.ReadDiskTag(MediaTagType.ATA_IDENTIFY));
if(ataId.HasValue)
{
if(ataId.Value.CurrentCylinders > 0 && ataId.Value.CurrentHeads > 0 &&
ataId.Value.CurrentSectorsPerTrack > 0)
{
@@ -404,7 +393,6 @@ namespace DiscImageChef.Core
sidecar.BlockMedia[0].Heads = ataId.Value.Heads;
sidecar.BlockMedia[0].SectorsPerTrack = ataId.Value.SectorsPerTrack;
}
}
}
// TODO: This is more of a hack, redo it planned for >4.0
@@ -544,7 +532,6 @@ namespace DiscImageChef.Core
if(image.ImageInfo.Heads == 2 && scpImage.Header.heads == 0 ||
image.ImageInfo.Heads == 1 && (scpImage.Header.heads == 1 || scpImage.Header.heads == 2))
{
if(scpImage.Header.end + 1 >= image.ImageInfo.Cylinders)
{
List<BlockTrackType> scpBlockTrackTypes = new List<BlockTrackType>();
@@ -590,18 +577,13 @@ 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
@@ -635,7 +617,6 @@ namespace DiscImageChef.Core
catch(NotImplementedException) { }
if(kfImage.ImageInfo.Heads == image.ImageInfo.Heads)
{
if(kfImage.ImageInfo.Cylinders >= image.ImageInfo.Cylinders)
{
List<BlockTrackType> kfBlockTrackTypes = new List<BlockTrackType>();
@@ -680,18 +661,13 @@ 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
@@ -712,7 +688,6 @@ namespace DiscImageChef.Core
catch(NotImplementedException) { }
if(image.ImageInfo.Heads == dfiImage.ImageInfo.Heads)
{
if(dfiImage.ImageInfo.Cylinders >= image.ImageInfo.Cylinders)
{
List<BlockTrackType> dfiBlockTrackTypes = new List<BlockTrackType>();
@@ -756,18 +731,13 @@ 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

View File

@@ -106,7 +106,6 @@ namespace DiscImageChef.Core
OsStats old = null;
foreach(OsStats nvs in AllStats.OperatingSystems)
{
if(nvs.name == Interop.DetectOS.GetRealPlatformID().ToString() &&
nvs.version == Interop.DetectOS.GetVersion())
{
@@ -114,7 +113,6 @@ namespace DiscImageChef.Core
old = nvs;
break;
}
}
if(old != null) AllStats.OperatingSystems.Remove(old);
@@ -134,14 +132,12 @@ namespace DiscImageChef.Core
NameValueStats old = null;
foreach(NameValueStats nvs in AllStats.Versions)
{
if(nvs.name == Version.GetVersion())
{
count = nvs.Value + 1;
old = nvs;
break;
}
}
if(old != null) AllStats.Versions.Remove(old);
@@ -182,7 +178,6 @@ namespace DiscImageChef.Core
SearchOption.TopDirectoryOnly);
foreach(string statsFile in statsFiles)
{
try
{
if(!File.Exists(statsFile)) continue;
@@ -237,7 +232,6 @@ namespace DiscImageChef.Core
continue;
#endif
}
}
submitStatsLock = false;
});
@@ -343,13 +337,11 @@ namespace DiscImageChef.Core
NameValueStats old = null;
foreach(NameValueStats nvs in AllStats.Filesystems)
{
if(nvs.name == filesystem)
{
old = nvs;
break;
}
}
NameValueStats nw = new NameValueStats();
if(old != null)
@@ -367,13 +359,11 @@ namespace DiscImageChef.Core
old = null;
foreach(NameValueStats nvs in CurrentStats.Filesystems)
{
if(nvs.name == filesystem)
{
old = nvs;
break;
}
}
nw = new NameValueStats();
if(old != null)
@@ -400,13 +390,11 @@ namespace DiscImageChef.Core
NameValueStats old = null;
foreach(NameValueStats nvs in AllStats.Partitions)
{
if(nvs.name == partition)
{
old = nvs;
break;
}
}
NameValueStats nw = new NameValueStats();
if(old != null)
@@ -424,13 +412,11 @@ namespace DiscImageChef.Core
old = null;
foreach(NameValueStats nvs in CurrentStats.Partitions)
{
if(nvs.name == partition)
{
old = nvs;
break;
}
}
nw = new NameValueStats();
if(old != null)
@@ -457,13 +443,11 @@ namespace DiscImageChef.Core
NameValueStats old = null;
foreach(NameValueStats nvs in AllStats.Filters)
{
if(nvs.name == format)
{
old = nvs;
break;
}
}
NameValueStats nw = new NameValueStats();
if(old != null)
@@ -481,13 +465,11 @@ namespace DiscImageChef.Core
old = null;
foreach(NameValueStats nvs in CurrentStats.Filters)
{
if(nvs.name == format)
{
old = nvs;
break;
}
}
nw = new NameValueStats();
if(old != null)
@@ -514,13 +496,11 @@ namespace DiscImageChef.Core
NameValueStats old = null;
foreach(NameValueStats nvs in AllStats.MediaImages)
{
if(nvs.name == format)
{
old = nvs;
break;
}
}
NameValueStats nw = new NameValueStats();
if(old != null)
@@ -538,13 +518,11 @@ namespace DiscImageChef.Core
old = null;
foreach(NameValueStats nvs in CurrentStats.MediaImages)
{
if(nvs.name == format)
{
old = nvs;
break;
}
}
nw = new NameValueStats();
if(old != null)
@@ -576,14 +554,12 @@ namespace DiscImageChef.Core
DeviceStats old = null;
foreach(DeviceStats ds in AllStats.Devices)
{
if(ds.Manufacturer == dev.Manufacturer && ds.Model == dev.Model && ds.Revision == dev.Revision &&
ds.Bus == deviceBus)
{
old = ds;
break;
}
}
if(old != null) AllStats.Devices.Remove(old);
@@ -597,14 +573,12 @@ namespace DiscImageChef.Core
old = null;
foreach(DeviceStats ds in CurrentStats.Devices)
{
if(ds.Manufacturer == dev.Manufacturer && ds.Model == dev.Model && ds.Revision == dev.Revision &&
ds.Bus == deviceBus)
{
old = ds;
break;
}
}
if(old != null) CurrentStats.Devices.Remove(old);
@@ -627,13 +601,11 @@ namespace DiscImageChef.Core
MediaStats old = null;
foreach(MediaStats ms in AllStats.Medias)
{
if(ms.real == real && ms.type == type.ToString())
{
old = ms;
break;
}
}
MediaStats nw = new MediaStats();
if(old != null)
@@ -653,13 +625,11 @@ namespace DiscImageChef.Core
old = null;
foreach(MediaStats ms in CurrentStats.Medias)
{
if(ms.real == real && ms.type == type.ToString())
{
old = ms;
break;
}
}
nw = new MediaStats();
if(old != null)
@@ -731,7 +701,6 @@ namespace DiscImageChef.Core
}
if(mediaVerified.HasValue)
{
if(mediaVerified.Value)
{
CurrentStats.Verify.MediaImages.Correct++;
@@ -742,7 +711,6 @@ namespace DiscImageChef.Core
CurrentStats.Verify.MediaImages.Failed++;
AllStats.Verify.MediaImages.Failed++;
}
}
CurrentStats.Verify.Sectors.Correct += correct;
CurrentStats.Verify.Sectors.Error += failed;