* DiscImageChef.CommonTypes/DiskType.cs:

Added DVD-RW DL, DVD-Download, HD DVD-R DL and HD DVD-RW DL.

	* DiscImageChef.Decoders/CD/ATIP.cs:
	  ATIP not always contain S4.
	Corrected typo.

	* DiscImageChef.Decoders/CD/Session.cs:
	  Added missing newlines.

	* DiscImageChef.Decoders/CD/TOC.cs:
	  Added missing newlines.
	Recognize Lead-Out track.

	* DiscImageChef.Decoders/SCSI/MMC/DiscInformation.cs:
	  Added structures for Disc Informations 001b and 010b.

	* DiscImageChef.Devices/Device/ScsiCommands.cs:
	  On READ TOC/PMA/ATIP and READ DISC INFORMATION if trying
	  small buffer and then real-sized buffer, some drives send
	  garbage, so get a big enough buffer and return only the
	  applicable data size.

	* DiscImageChef/Commands/MediaInfo.cs:
	  Check current profile and prettify TOC, PMA, ATIP, Session
	  and CD-TEXT.
This commit is contained in:
2015-11-24 00:40:33 +00:00
parent f9090cf09c
commit 67eb49b66e
11 changed files with 287 additions and 54 deletions

View File

@@ -846,7 +846,7 @@ namespace DiscImageChef.Devices
{
senseBuffer = new byte[32];
byte[] cdb = new byte[10];
buffer = new byte[2];
byte[] tmpBuffer = new byte[804];
bool sense;
cdb[0] = (byte)ScsiCommands.ReadTocPmaAtip;
@@ -854,23 +854,15 @@ namespace DiscImageChef.Devices
cdb[1] = 0x02;
cdb[2] = (byte)(format & 0x0F);
cdb[6] = trackSessionNumber;
cdb[7] = (byte)((buffer.Length & 0xFF00) >> 8);
cdb[8] = (byte)(buffer.Length & 0xFF);
cdb[7] = (byte)((tmpBuffer.Length & 0xFF00) >> 8);
cdb[8] = (byte)(tmpBuffer.Length & 0xFF);
lastError = SendScsiCommand(cdb, ref buffer, out senseBuffer, timeout, ScsiDirection.In, out duration, out sense);
lastError = SendScsiCommand(cdb, ref tmpBuffer, out senseBuffer, timeout, ScsiDirection.In, out duration, out sense);
error = lastError != 0;
if (sense)
return true;
uint strctLength = (uint)(((int)buffer[0] << 8) + buffer[1] + 2);
cdb[7] = (byte)((buffer.Length & 0xFF00) >> 8);
cdb[8] = (byte)(buffer.Length & 0xFF);
uint strctLength = (uint)(((int)tmpBuffer[0] << 8) + tmpBuffer[1] + 2);
buffer = new byte[strctLength];
senseBuffer = new byte[32];
lastError = SendScsiCommand(cdb, ref buffer, out senseBuffer, timeout, ScsiDirection.In, out duration, out sense);
error = lastError != 0;
Array.Copy(tmpBuffer, 0, buffer, 0, buffer.Length);
DicConsole.DebugWriteLine("SCSI Device", "READ TOC/PMA/ATIP took {0} ms.", duration);
@@ -903,28 +895,20 @@ namespace DiscImageChef.Devices
{
senseBuffer = new byte[32];
byte[] cdb = new byte[10];
buffer = new byte[2];
byte[] tmpBuffer = new byte[804];
bool sense;
cdb[0] = (byte)ScsiCommands.ReadDiscInformation;
cdb[1] = (byte)dataType;
cdb[7] = (byte)((buffer.Length & 0xFF00) >> 8);
cdb[8] = (byte)(buffer.Length & 0xFF);
cdb[7] = (byte)((tmpBuffer.Length & 0xFF00) >> 8);
cdb[8] = (byte)(tmpBuffer.Length & 0xFF);
lastError = SendScsiCommand(cdb, ref buffer, out senseBuffer, timeout, ScsiDirection.In, out duration, out sense);
lastError = SendScsiCommand(cdb, ref tmpBuffer, out senseBuffer, timeout, ScsiDirection.In, out duration, out sense);
error = lastError != 0;
if (sense)
return true;
uint strctLength = (uint)(((int)buffer[0] << 8) + buffer[1] + 2);
cdb[7] = (byte)((buffer.Length & 0xFF00) >> 8);
cdb[8] = (byte)(buffer.Length & 0xFF);
uint strctLength = (uint)(((int)tmpBuffer[0] << 8) + tmpBuffer[1] + 2);
buffer = new byte[strctLength];
senseBuffer = new byte[32];
lastError = SendScsiCommand(cdb, ref buffer, out senseBuffer, timeout, ScsiDirection.In, out duration, out sense);
error = lastError != 0;
Array.Copy(tmpBuffer, 0, buffer, 0, buffer.Length);
DicConsole.DebugWriteLine("SCSI Device", "READ DISC INFORMATION took {0} ms.", duration);