mirror of
https://github.com/aaru-dps/Aaru.git
synced 2025-12-16 19:24:25 +00:00
* DiscImageChef.Core/Devices/Scanning/ATA.cs:
Correctly use LBA mode. Call FindReadCommand(). * DiscImageChef.Core/Devices/Dumping/ATA.cs: Call FindReadCommand().
This commit is contained in:
@@ -178,6 +178,11 @@ namespace DiscImageChef.Core.Devices.Dumping
|
|||||||
}
|
}
|
||||||
uint blockSize = ataReader.LogicalBlockSize;
|
uint blockSize = ataReader.LogicalBlockSize;
|
||||||
uint physicalsectorsize = ataReader.PhysicalBlockSize;
|
uint physicalsectorsize = ataReader.PhysicalBlockSize;
|
||||||
|
if(ataReader.FindReadCommand())
|
||||||
|
{
|
||||||
|
DicConsole.ErrorWriteLine(ataReader.ErrorMessage);
|
||||||
|
return;
|
||||||
|
}
|
||||||
// Check how many blocks to read, if error show and return
|
// Check how many blocks to read, if error show and return
|
||||||
if(ataReader.GetBlocksToRead())
|
if(ataReader.GetBlocksToRead())
|
||||||
{
|
{
|
||||||
|
|||||||
@@ -56,7 +56,6 @@ namespace DiscImageChef.Core.Devices.Scanning
|
|||||||
results.blocks = 0;
|
results.blocks = 0;
|
||||||
ushort currentProfile = 0x0001;
|
ushort currentProfile = 0x0001;
|
||||||
Decoders.ATA.AtaErrorRegistersCHS errorChs;
|
Decoders.ATA.AtaErrorRegistersCHS errorChs;
|
||||||
bool lbaMode = false;
|
|
||||||
uint timeout = 5;
|
uint timeout = 5;
|
||||||
double duration = 0;
|
double duration = 0;
|
||||||
|
|
||||||
@@ -69,6 +68,11 @@ namespace DiscImageChef.Core.Devices.Scanning
|
|||||||
Reader ataReader = new Reader(dev, timeout, cmdBuf);
|
Reader ataReader = new Reader(dev, timeout, cmdBuf);
|
||||||
// Fill reader blocks
|
// Fill reader blocks
|
||||||
results.blocks = ataReader.GetDeviceBlocks();
|
results.blocks = ataReader.GetDeviceBlocks();
|
||||||
|
if(ataReader.FindReadCommand())
|
||||||
|
{
|
||||||
|
DicConsole.ErrorWriteLine(ataReader.ErrorMessage);
|
||||||
|
return results;
|
||||||
|
}
|
||||||
// Check block sizes
|
// Check block sizes
|
||||||
if(ataReader.GetBlockSize())
|
if(ataReader.GetBlockSize())
|
||||||
{
|
{
|
||||||
@@ -77,7 +81,7 @@ namespace DiscImageChef.Core.Devices.Scanning
|
|||||||
}
|
}
|
||||||
uint blockSize = ataReader.LogicalBlockSize;
|
uint blockSize = ataReader.LogicalBlockSize;
|
||||||
// Check how many blocks to read, if error show and return
|
// Check how many blocks to read, if error show and return
|
||||||
if(ataReader.GetBlocksToRead(254))
|
if(ataReader.GetBlocksToRead(64))
|
||||||
{
|
{
|
||||||
DicConsole.ErrorWriteLine(ataReader.ErrorMessage);
|
DicConsole.ErrorWriteLine(ataReader.ErrorMessage);
|
||||||
return results;
|
return results;
|
||||||
@@ -121,7 +125,7 @@ namespace DiscImageChef.Core.Devices.Scanning
|
|||||||
e.Cancel = aborted = true;
|
e.Cancel = aborted = true;
|
||||||
};
|
};
|
||||||
|
|
||||||
if(lbaMode)
|
if(ataReader.IsLBA)
|
||||||
{
|
{
|
||||||
DicConsole.WriteLine("Reading {0} sectors at a time.", blocksToRead);
|
DicConsole.WriteLine("Reading {0} sectors at a time.", blocksToRead);
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user