mirror of
https://github.com/aaru-dps/Aaru.Server.git
synced 2025-12-16 19:24:27 +00:00
REFACTOR: Reformat code.
This commit is contained in:
@@ -111,11 +111,12 @@ namespace DiscImageChef.Tests.Devices.ATA
|
||||
|
||||
static void ReadBuffer(string devPath, Device dev)
|
||||
{
|
||||
start:
|
||||
start:
|
||||
System.Console.Clear();
|
||||
bool sense = dev.ReadBuffer(out byte[] buffer, out AtaErrorRegistersLBA28 errorRegisters, dev.Timeout, out double duration);
|
||||
bool sense = dev.ReadBuffer(out byte[] buffer, out AtaErrorRegistersLBA28 errorRegisters, dev.Timeout,
|
||||
out double duration);
|
||||
|
||||
menu:
|
||||
menu:
|
||||
DicConsole.WriteLine("Device: {0}", devPath);
|
||||
DicConsole.WriteLine("Sending READ BUFFER to the device:");
|
||||
DicConsole.WriteLine("Command took {0} ms.", duration);
|
||||
@@ -148,8 +149,7 @@ namespace DiscImageChef.Tests.Devices.ATA
|
||||
System.Console.Clear();
|
||||
DicConsole.WriteLine("Device: {0}", devPath);
|
||||
DicConsole.WriteLine("READ BUFFER response:");
|
||||
if(buffer != null)
|
||||
PrintHex.PrintHexArray(buffer, 64);
|
||||
if(buffer != null) PrintHex.PrintHexArray(buffer, 64);
|
||||
DicConsole.WriteLine("Press any key to continue...");
|
||||
System.Console.ReadKey();
|
||||
System.Console.Clear();
|
||||
@@ -165,8 +165,7 @@ namespace DiscImageChef.Tests.Devices.ATA
|
||||
System.Console.Clear();
|
||||
DicConsole.WriteLine("Device: {0}", devPath);
|
||||
goto menu;
|
||||
case 3:
|
||||
goto start;
|
||||
case 3: goto start;
|
||||
default:
|
||||
DicConsole.WriteLine("Incorrect option. Press any key to continue...");
|
||||
System.Console.ReadKey();
|
||||
@@ -177,11 +176,12 @@ namespace DiscImageChef.Tests.Devices.ATA
|
||||
|
||||
static void ReadBufferDma(string devPath, Device dev)
|
||||
{
|
||||
start:
|
||||
start:
|
||||
System.Console.Clear();
|
||||
bool sense = dev.ReadBufferDma(out byte[] buffer, out AtaErrorRegistersLBA28 errorRegisters, dev.Timeout, out double duration);
|
||||
bool sense = dev.ReadBufferDma(out byte[] buffer, out AtaErrorRegistersLBA28 errorRegisters, dev.Timeout,
|
||||
out double duration);
|
||||
|
||||
menu:
|
||||
menu:
|
||||
DicConsole.WriteLine("Device: {0}", devPath);
|
||||
DicConsole.WriteLine("Sending READ BUFFER DMA to the device:");
|
||||
DicConsole.WriteLine("Command took {0} ms.", duration);
|
||||
@@ -214,8 +214,7 @@ namespace DiscImageChef.Tests.Devices.ATA
|
||||
System.Console.Clear();
|
||||
DicConsole.WriteLine("Device: {0}", devPath);
|
||||
DicConsole.WriteLine("READ BUFFER DMA response:");
|
||||
if(buffer != null)
|
||||
PrintHex.PrintHexArray(buffer, 64);
|
||||
if(buffer != null) PrintHex.PrintHexArray(buffer, 64);
|
||||
DicConsole.WriteLine("Press any key to continue...");
|
||||
System.Console.ReadKey();
|
||||
System.Console.Clear();
|
||||
@@ -231,8 +230,7 @@ namespace DiscImageChef.Tests.Devices.ATA
|
||||
System.Console.Clear();
|
||||
DicConsole.WriteLine("Device: {0}", devPath);
|
||||
goto menu;
|
||||
case 3:
|
||||
goto start;
|
||||
case 3: goto start;
|
||||
default:
|
||||
DicConsole.WriteLine("Incorrect option. Press any key to continue...");
|
||||
System.Console.ReadKey();
|
||||
@@ -248,7 +246,7 @@ namespace DiscImageChef.Tests.Devices.ATA
|
||||
string strDev;
|
||||
int item;
|
||||
|
||||
parameters:
|
||||
parameters:
|
||||
while(true)
|
||||
{
|
||||
System.Console.Clear();
|
||||
@@ -285,9 +283,12 @@ namespace DiscImageChef.Tests.Devices.ATA
|
||||
System.Console.ReadKey();
|
||||
continue;
|
||||
}
|
||||
|
||||
if(lba > 0xFFFFFFF)
|
||||
{
|
||||
DicConsole.WriteLine("Logical block address cannot be bigger than {0}. Setting it to {0}...", 0xFFFFFFF);
|
||||
DicConsole
|
||||
.WriteLine("Logical block address cannot be bigger than {0}. Setting it to {0}...",
|
||||
0xFFFFFFF);
|
||||
lba = 0xFFFFFFF;
|
||||
}
|
||||
DicConsole.Write("How many sectors?: ");
|
||||
@@ -299,17 +300,18 @@ namespace DiscImageChef.Tests.Devices.ATA
|
||||
System.Console.ReadKey();
|
||||
continue;
|
||||
}
|
||||
|
||||
break;
|
||||
case 2:
|
||||
goto start;
|
||||
case 2: goto start;
|
||||
}
|
||||
}
|
||||
|
||||
start:
|
||||
start:
|
||||
System.Console.Clear();
|
||||
bool sense = dev.ReadDma(out byte[] buffer, out AtaErrorRegistersLBA28 errorRegisters, retries, lba, count, dev.Timeout, out double duration);
|
||||
bool sense = dev.ReadDma(out byte[] buffer, out AtaErrorRegistersLBA28 errorRegisters, retries, lba, count,
|
||||
dev.Timeout, out double duration);
|
||||
|
||||
menu:
|
||||
menu:
|
||||
DicConsole.WriteLine("Device: {0}", devPath);
|
||||
DicConsole.WriteLine("Sending READ DMA {0}to the device:", retries ? "WITH RETRIES " : "");
|
||||
DicConsole.WriteLine("Command took {0} ms.", duration);
|
||||
@@ -343,8 +345,7 @@ namespace DiscImageChef.Tests.Devices.ATA
|
||||
System.Console.Clear();
|
||||
DicConsole.WriteLine("Device: {0}", devPath);
|
||||
DicConsole.WriteLine("READ DMA {0}response:", retries ? "WITH RETRIES " : "");
|
||||
if(buffer != null)
|
||||
PrintHex.PrintHexArray(buffer, 64);
|
||||
if(buffer != null) PrintHex.PrintHexArray(buffer, 64);
|
||||
DicConsole.WriteLine("Press any key to continue...");
|
||||
System.Console.ReadKey();
|
||||
System.Console.Clear();
|
||||
@@ -360,10 +361,8 @@ namespace DiscImageChef.Tests.Devices.ATA
|
||||
System.Console.Clear();
|
||||
DicConsole.WriteLine("Device: {0}", devPath);
|
||||
goto menu;
|
||||
case 3:
|
||||
goto start;
|
||||
case 4:
|
||||
goto parameters;
|
||||
case 3: goto start;
|
||||
case 4: goto parameters;
|
||||
default:
|
||||
DicConsole.WriteLine("Incorrect option. Press any key to continue...");
|
||||
System.Console.ReadKey();
|
||||
@@ -379,7 +378,7 @@ namespace DiscImageChef.Tests.Devices.ATA
|
||||
string strDev;
|
||||
int item;
|
||||
|
||||
parameters:
|
||||
parameters:
|
||||
while(true)
|
||||
{
|
||||
System.Console.Clear();
|
||||
@@ -416,22 +415,25 @@ namespace DiscImageChef.Tests.Devices.ATA
|
||||
System.Console.ReadKey();
|
||||
continue;
|
||||
}
|
||||
|
||||
if(lba > 0xFFFFFFF)
|
||||
{
|
||||
DicConsole.WriteLine("Logical block address cannot be bigger than {0}. Setting it to {0}...", 0xFFFFFFF);
|
||||
DicConsole
|
||||
.WriteLine("Logical block address cannot be bigger than {0}. Setting it to {0}...",
|
||||
0xFFFFFFF);
|
||||
lba = 0xFFFFFFF;
|
||||
}
|
||||
break;
|
||||
case 2:
|
||||
goto start;
|
||||
case 2: goto start;
|
||||
}
|
||||
}
|
||||
|
||||
start:
|
||||
start:
|
||||
System.Console.Clear();
|
||||
bool sense = dev.ReadLong(out byte[] buffer, out AtaErrorRegistersLBA28 errorRegisters, retries, lba, blockSize, dev.Timeout, out double duration);
|
||||
bool sense = dev.ReadLong(out byte[] buffer, out AtaErrorRegistersLBA28 errorRegisters, retries, lba,
|
||||
blockSize, dev.Timeout, out double duration);
|
||||
|
||||
menu:
|
||||
menu:
|
||||
DicConsole.WriteLine("Device: {0}", devPath);
|
||||
DicConsole.WriteLine("Sending READ LONG {0}to the device:", retries ? "WITH RETRIES " : "");
|
||||
DicConsole.WriteLine("Command took {0} ms.", duration);
|
||||
@@ -465,8 +467,7 @@ namespace DiscImageChef.Tests.Devices.ATA
|
||||
System.Console.Clear();
|
||||
DicConsole.WriteLine("Device: {0}", devPath);
|
||||
DicConsole.WriteLine("READ LONG {0}response:", retries ? "WITH RETRIES " : "");
|
||||
if(buffer != null)
|
||||
PrintHex.PrintHexArray(buffer, 64);
|
||||
if(buffer != null) PrintHex.PrintHexArray(buffer, 64);
|
||||
DicConsole.WriteLine("Press any key to continue...");
|
||||
System.Console.ReadKey();
|
||||
System.Console.Clear();
|
||||
@@ -482,10 +483,8 @@ namespace DiscImageChef.Tests.Devices.ATA
|
||||
System.Console.Clear();
|
||||
DicConsole.WriteLine("Device: {0}", devPath);
|
||||
goto menu;
|
||||
case 3:
|
||||
goto start;
|
||||
case 4:
|
||||
goto parameters;
|
||||
case 3: goto start;
|
||||
case 4: goto parameters;
|
||||
default:
|
||||
DicConsole.WriteLine("Incorrect option. Press any key to continue...");
|
||||
System.Console.ReadKey();
|
||||
@@ -501,7 +500,7 @@ namespace DiscImageChef.Tests.Devices.ATA
|
||||
string strDev;
|
||||
int item;
|
||||
|
||||
parameters:
|
||||
parameters:
|
||||
while(true)
|
||||
{
|
||||
System.Console.Clear();
|
||||
@@ -538,9 +537,12 @@ namespace DiscImageChef.Tests.Devices.ATA
|
||||
System.Console.ReadKey();
|
||||
continue;
|
||||
}
|
||||
|
||||
if(lba > 0xFFFFFFF)
|
||||
{
|
||||
DicConsole.WriteLine("Logical block address cannot be bigger than {0}. Setting it to {0}...", 0xFFFFFFF);
|
||||
DicConsole
|
||||
.WriteLine("Logical block address cannot be bigger than {0}. Setting it to {0}...",
|
||||
0xFFFFFFF);
|
||||
lba = 0xFFFFFFF;
|
||||
}
|
||||
DicConsole.Write("How many sectors?: ");
|
||||
@@ -552,17 +554,18 @@ namespace DiscImageChef.Tests.Devices.ATA
|
||||
System.Console.ReadKey();
|
||||
continue;
|
||||
}
|
||||
|
||||
break;
|
||||
case 2:
|
||||
goto start;
|
||||
case 2: goto start;
|
||||
}
|
||||
}
|
||||
|
||||
start:
|
||||
start:
|
||||
System.Console.Clear();
|
||||
bool sense = dev.ReadMultiple(out byte[] buffer, out AtaErrorRegistersLBA28 errorRegisters, lba, count, dev.Timeout, out double duration);
|
||||
bool sense = dev.ReadMultiple(out byte[] buffer, out AtaErrorRegistersLBA28 errorRegisters, lba, count,
|
||||
dev.Timeout, out double duration);
|
||||
|
||||
menu:
|
||||
menu:
|
||||
DicConsole.WriteLine("Device: {0}", devPath);
|
||||
DicConsole.WriteLine("Sending READ MULTIPLE to the device:");
|
||||
DicConsole.WriteLine("Command took {0} ms.", duration);
|
||||
@@ -596,8 +599,7 @@ namespace DiscImageChef.Tests.Devices.ATA
|
||||
System.Console.Clear();
|
||||
DicConsole.WriteLine("Device: {0}", devPath);
|
||||
DicConsole.WriteLine("READ MULTIPLE response:");
|
||||
if(buffer != null)
|
||||
PrintHex.PrintHexArray(buffer, 64);
|
||||
if(buffer != null) PrintHex.PrintHexArray(buffer, 64);
|
||||
DicConsole.WriteLine("Press any key to continue...");
|
||||
System.Console.ReadKey();
|
||||
System.Console.Clear();
|
||||
@@ -613,10 +615,8 @@ namespace DiscImageChef.Tests.Devices.ATA
|
||||
System.Console.Clear();
|
||||
DicConsole.WriteLine("Device: {0}", devPath);
|
||||
goto menu;
|
||||
case 3:
|
||||
goto start;
|
||||
case 4:
|
||||
goto parameters;
|
||||
case 3: goto start;
|
||||
case 4: goto parameters;
|
||||
default:
|
||||
DicConsole.WriteLine("Incorrect option. Press any key to continue...");
|
||||
System.Console.ReadKey();
|
||||
@@ -627,11 +627,12 @@ namespace DiscImageChef.Tests.Devices.ATA
|
||||
|
||||
static void ReadNativeMaxAddress(string devPath, Device dev)
|
||||
{
|
||||
start:
|
||||
start:
|
||||
System.Console.Clear();
|
||||
bool sense = dev.ReadNativeMaxAddress(out uint lba, out AtaErrorRegistersLBA28 errorRegisters, dev.Timeout, out double duration);
|
||||
bool sense = dev.ReadNativeMaxAddress(out uint lba, out AtaErrorRegistersLBA28 errorRegisters, dev.Timeout,
|
||||
out double duration);
|
||||
|
||||
menu:
|
||||
menu:
|
||||
DicConsole.WriteLine("Device: {0}", devPath);
|
||||
DicConsole.WriteLine("Sending READ NATIVE MAX ADDRESS to the device:");
|
||||
DicConsole.WriteLine("Command took {0} ms.", duration);
|
||||
@@ -668,8 +669,7 @@ namespace DiscImageChef.Tests.Devices.ATA
|
||||
System.Console.Clear();
|
||||
DicConsole.WriteLine("Device: {0}", devPath);
|
||||
goto menu;
|
||||
case 2:
|
||||
goto start;
|
||||
case 2: goto start;
|
||||
default:
|
||||
DicConsole.WriteLine("Incorrect option. Press any key to continue...");
|
||||
System.Console.ReadKey();
|
||||
@@ -685,7 +685,7 @@ namespace DiscImageChef.Tests.Devices.ATA
|
||||
string strDev;
|
||||
int item;
|
||||
|
||||
parameters:
|
||||
parameters:
|
||||
while(true)
|
||||
{
|
||||
System.Console.Clear();
|
||||
@@ -722,9 +722,12 @@ namespace DiscImageChef.Tests.Devices.ATA
|
||||
System.Console.ReadKey();
|
||||
continue;
|
||||
}
|
||||
|
||||
if(lba > 0xFFFFFFF)
|
||||
{
|
||||
DicConsole.WriteLine("Logical block address cannot be bigger than {0}. Setting it to {0}...", 0xFFFFFFF);
|
||||
DicConsole
|
||||
.WriteLine("Logical block address cannot be bigger than {0}. Setting it to {0}...",
|
||||
0xFFFFFFF);
|
||||
lba = 0xFFFFFFF;
|
||||
}
|
||||
DicConsole.Write("How many sectors?: ");
|
||||
@@ -736,17 +739,18 @@ namespace DiscImageChef.Tests.Devices.ATA
|
||||
System.Console.ReadKey();
|
||||
continue;
|
||||
}
|
||||
|
||||
break;
|
||||
case 2:
|
||||
goto start;
|
||||
case 2: goto start;
|
||||
}
|
||||
}
|
||||
|
||||
start:
|
||||
start:
|
||||
System.Console.Clear();
|
||||
bool sense = dev.Read(out byte[] buffer, out AtaErrorRegistersLBA28 errorRegisters, retries, lba, count, dev.Timeout, out double duration);
|
||||
bool sense = dev.Read(out byte[] buffer, out AtaErrorRegistersLBA28 errorRegisters, retries, lba, count,
|
||||
dev.Timeout, out double duration);
|
||||
|
||||
menu:
|
||||
menu:
|
||||
DicConsole.WriteLine("Device: {0}", devPath);
|
||||
DicConsole.WriteLine("Sending READ SECTORS {0}to the device:", retries ? "WITH RETRIES " : "");
|
||||
DicConsole.WriteLine("Command took {0} ms.", duration);
|
||||
@@ -780,8 +784,7 @@ namespace DiscImageChef.Tests.Devices.ATA
|
||||
System.Console.Clear();
|
||||
DicConsole.WriteLine("Device: {0}", devPath);
|
||||
DicConsole.WriteLine("READ SECTORS {0}response:", retries ? "WITH RETRIES " : "");
|
||||
if(buffer != null)
|
||||
PrintHex.PrintHexArray(buffer, 64);
|
||||
if(buffer != null) PrintHex.PrintHexArray(buffer, 64);
|
||||
DicConsole.WriteLine("Press any key to continue...");
|
||||
System.Console.ReadKey();
|
||||
System.Console.Clear();
|
||||
@@ -797,10 +800,8 @@ namespace DiscImageChef.Tests.Devices.ATA
|
||||
System.Console.Clear();
|
||||
DicConsole.WriteLine("Device: {0}", devPath);
|
||||
goto menu;
|
||||
case 3:
|
||||
goto start;
|
||||
case 4:
|
||||
goto parameters;
|
||||
case 3: goto start;
|
||||
case 4: goto parameters;
|
||||
default:
|
||||
DicConsole.WriteLine("Incorrect option. Press any key to continue...");
|
||||
System.Console.ReadKey();
|
||||
@@ -815,7 +816,7 @@ namespace DiscImageChef.Tests.Devices.ATA
|
||||
string strDev;
|
||||
int item;
|
||||
|
||||
parameters:
|
||||
parameters:
|
||||
while(true)
|
||||
{
|
||||
System.Console.Clear();
|
||||
@@ -851,22 +852,24 @@ namespace DiscImageChef.Tests.Devices.ATA
|
||||
System.Console.ReadKey();
|
||||
continue;
|
||||
}
|
||||
|
||||
if(lba > 0xFFFFFFF)
|
||||
{
|
||||
DicConsole.WriteLine("Logical block address cannot be bigger than {0}. Setting it to {0}...", 0xFFFFFFF);
|
||||
DicConsole
|
||||
.WriteLine("Logical block address cannot be bigger than {0}. Setting it to {0}...",
|
||||
0xFFFFFFF);
|
||||
lba = 0xFFFFFFF;
|
||||
}
|
||||
break;
|
||||
case 2:
|
||||
goto start;
|
||||
case 2: goto start;
|
||||
}
|
||||
}
|
||||
|
||||
start:
|
||||
start:
|
||||
System.Console.Clear();
|
||||
bool sense = dev.Seek(out AtaErrorRegistersLBA28 errorRegisters, lba, dev.Timeout, out double duration);
|
||||
|
||||
menu:
|
||||
menu:
|
||||
DicConsole.WriteLine("Device: {0}", devPath);
|
||||
DicConsole.WriteLine("Sending SEEK to the device:");
|
||||
DicConsole.WriteLine("Command took {0} ms.", duration);
|
||||
@@ -903,10 +906,8 @@ namespace DiscImageChef.Tests.Devices.ATA
|
||||
System.Console.Clear();
|
||||
DicConsole.WriteLine("Device: {0}", devPath);
|
||||
goto menu;
|
||||
case 2:
|
||||
goto start;
|
||||
case 3:
|
||||
goto parameters;
|
||||
case 2: goto start;
|
||||
case 3: goto parameters;
|
||||
default:
|
||||
DicConsole.WriteLine("Incorrect option. Press any key to continue...");
|
||||
System.Console.ReadKey();
|
||||
@@ -915,5 +916,4 @@ namespace DiscImageChef.Tests.Devices.ATA
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
@@ -95,11 +95,12 @@ namespace DiscImageChef.Tests.Devices.ATA
|
||||
|
||||
static void GetNativeMaxAddressExt(string devPath, Device dev)
|
||||
{
|
||||
start:
|
||||
start:
|
||||
System.Console.Clear();
|
||||
bool sense = dev.GetNativeMaxAddressExt(out ulong lba, out AtaErrorRegistersLBA48 errorRegisters, dev.Timeout, out double duration);
|
||||
bool sense = dev.GetNativeMaxAddressExt(out ulong lba, out AtaErrorRegistersLBA48 errorRegisters,
|
||||
dev.Timeout, out double duration);
|
||||
|
||||
menu:
|
||||
menu:
|
||||
DicConsole.WriteLine("Device: {0}", devPath);
|
||||
DicConsole.WriteLine("Sending GET NATIVE MAX ADDRESS EXT to the device:");
|
||||
DicConsole.WriteLine("Command took {0} ms.", duration);
|
||||
@@ -136,8 +137,7 @@ namespace DiscImageChef.Tests.Devices.ATA
|
||||
System.Console.Clear();
|
||||
DicConsole.WriteLine("Device: {0}", devPath);
|
||||
goto menu;
|
||||
case 2:
|
||||
goto start;
|
||||
case 2: goto start;
|
||||
default:
|
||||
DicConsole.WriteLine("Incorrect option. Press any key to continue...");
|
||||
System.Console.ReadKey();
|
||||
@@ -153,7 +153,7 @@ namespace DiscImageChef.Tests.Devices.ATA
|
||||
string strDev;
|
||||
int item;
|
||||
|
||||
parameters:
|
||||
parameters:
|
||||
while(true)
|
||||
{
|
||||
System.Console.Clear();
|
||||
@@ -190,9 +190,12 @@ namespace DiscImageChef.Tests.Devices.ATA
|
||||
System.Console.ReadKey();
|
||||
continue;
|
||||
}
|
||||
|
||||
if(lba > 0xFFFFFFFFFFFF)
|
||||
{
|
||||
DicConsole.WriteLine("Logical block address cannot be bigger than {0}. Setting it to {0}...", 0xFFFFFFFFFFFF);
|
||||
DicConsole
|
||||
.WriteLine("Logical block address cannot be bigger than {0}. Setting it to {0}...",
|
||||
0xFFFFFFFFFFFF);
|
||||
lba = 0xFFFFFFFFFFFF;
|
||||
}
|
||||
DicConsole.Write("How many sectors?: ");
|
||||
@@ -204,17 +207,18 @@ namespace DiscImageChef.Tests.Devices.ATA
|
||||
System.Console.ReadKey();
|
||||
continue;
|
||||
}
|
||||
|
||||
break;
|
||||
case 2:
|
||||
goto start;
|
||||
case 2: goto start;
|
||||
}
|
||||
}
|
||||
|
||||
start:
|
||||
start:
|
||||
System.Console.Clear();
|
||||
bool sense = dev.ReadDma(out byte[] buffer, out AtaErrorRegistersLBA48 errorRegisters, lba, count, dev.Timeout, out double duration);
|
||||
bool sense = dev.ReadDma(out byte[] buffer, out AtaErrorRegistersLBA48 errorRegisters, lba, count,
|
||||
dev.Timeout, out double duration);
|
||||
|
||||
menu:
|
||||
menu:
|
||||
DicConsole.WriteLine("Device: {0}", devPath);
|
||||
DicConsole.WriteLine("Sending READ DMA EXT to the device:");
|
||||
DicConsole.WriteLine("Command took {0} ms.", duration);
|
||||
@@ -248,8 +252,7 @@ namespace DiscImageChef.Tests.Devices.ATA
|
||||
System.Console.Clear();
|
||||
DicConsole.WriteLine("Device: {0}", devPath);
|
||||
DicConsole.WriteLine("READ DMA EXT response:");
|
||||
if(buffer != null)
|
||||
PrintHex.PrintHexArray(buffer, 64);
|
||||
if(buffer != null) PrintHex.PrintHexArray(buffer, 64);
|
||||
DicConsole.WriteLine("Press any key to continue...");
|
||||
System.Console.ReadKey();
|
||||
System.Console.Clear();
|
||||
@@ -265,10 +268,8 @@ namespace DiscImageChef.Tests.Devices.ATA
|
||||
System.Console.Clear();
|
||||
DicConsole.WriteLine("Device: {0}", devPath);
|
||||
goto menu;
|
||||
case 3:
|
||||
goto start;
|
||||
case 4:
|
||||
goto parameters;
|
||||
case 3: goto start;
|
||||
case 4: goto parameters;
|
||||
default:
|
||||
DicConsole.WriteLine("Incorrect option. Press any key to continue...");
|
||||
System.Console.ReadKey();
|
||||
@@ -285,7 +286,7 @@ namespace DiscImageChef.Tests.Devices.ATA
|
||||
string strDev;
|
||||
int item;
|
||||
|
||||
parameters:
|
||||
parameters:
|
||||
while(true)
|
||||
{
|
||||
System.Console.Clear();
|
||||
@@ -323,6 +324,7 @@ namespace DiscImageChef.Tests.Devices.ATA
|
||||
System.Console.ReadKey();
|
||||
continue;
|
||||
}
|
||||
|
||||
DicConsole.Write("What page number?: ");
|
||||
strDev = System.Console.ReadLine();
|
||||
if(!ushort.TryParse(strDev, out page))
|
||||
@@ -332,6 +334,7 @@ namespace DiscImageChef.Tests.Devices.ATA
|
||||
System.Console.ReadKey();
|
||||
continue;
|
||||
}
|
||||
|
||||
DicConsole.Write("How many sectors?: ");
|
||||
strDev = System.Console.ReadLine();
|
||||
if(!ushort.TryParse(strDev, out count))
|
||||
@@ -341,17 +344,18 @@ namespace DiscImageChef.Tests.Devices.ATA
|
||||
System.Console.ReadKey();
|
||||
continue;
|
||||
}
|
||||
|
||||
break;
|
||||
case 2:
|
||||
goto start;
|
||||
case 2: goto start;
|
||||
}
|
||||
}
|
||||
|
||||
start:
|
||||
start:
|
||||
System.Console.Clear();
|
||||
bool sense = dev.ReadLog(out byte[] buffer, out AtaErrorRegistersLBA48 errorRegisters, address, page, count, dev.Timeout, out double duration);
|
||||
bool sense = dev.ReadLog(out byte[] buffer, out AtaErrorRegistersLBA48 errorRegisters, address, page, count,
|
||||
dev.Timeout, out double duration);
|
||||
|
||||
menu:
|
||||
menu:
|
||||
DicConsole.WriteLine("Device: {0}", devPath);
|
||||
DicConsole.WriteLine("Sending READ LOG EXT to the device:");
|
||||
DicConsole.WriteLine("Command took {0} ms.", duration);
|
||||
@@ -385,8 +389,7 @@ namespace DiscImageChef.Tests.Devices.ATA
|
||||
System.Console.Clear();
|
||||
DicConsole.WriteLine("Device: {0}", devPath);
|
||||
DicConsole.WriteLine("READ LOG EXT response:");
|
||||
if(buffer != null)
|
||||
PrintHex.PrintHexArray(buffer, 64);
|
||||
if(buffer != null) PrintHex.PrintHexArray(buffer, 64);
|
||||
DicConsole.WriteLine("Press any key to continue...");
|
||||
System.Console.ReadKey();
|
||||
System.Console.Clear();
|
||||
@@ -402,10 +405,8 @@ namespace DiscImageChef.Tests.Devices.ATA
|
||||
System.Console.Clear();
|
||||
DicConsole.WriteLine("Device: {0}", devPath);
|
||||
goto menu;
|
||||
case 3:
|
||||
goto start;
|
||||
case 4:
|
||||
goto parameters;
|
||||
case 3: goto start;
|
||||
case 4: goto parameters;
|
||||
default:
|
||||
DicConsole.WriteLine("Incorrect option. Press any key to continue...");
|
||||
System.Console.ReadKey();
|
||||
@@ -422,7 +423,7 @@ namespace DiscImageChef.Tests.Devices.ATA
|
||||
string strDev;
|
||||
int item;
|
||||
|
||||
parameters:
|
||||
parameters:
|
||||
while(true)
|
||||
{
|
||||
System.Console.Clear();
|
||||
@@ -460,6 +461,7 @@ namespace DiscImageChef.Tests.Devices.ATA
|
||||
System.Console.ReadKey();
|
||||
continue;
|
||||
}
|
||||
|
||||
DicConsole.Write("What page number?: ");
|
||||
strDev = System.Console.ReadLine();
|
||||
if(!ushort.TryParse(strDev, out page))
|
||||
@@ -469,6 +471,7 @@ namespace DiscImageChef.Tests.Devices.ATA
|
||||
System.Console.ReadKey();
|
||||
continue;
|
||||
}
|
||||
|
||||
DicConsole.Write("How many sectors?: ");
|
||||
strDev = System.Console.ReadLine();
|
||||
if(!ushort.TryParse(strDev, out count))
|
||||
@@ -478,17 +481,18 @@ namespace DiscImageChef.Tests.Devices.ATA
|
||||
System.Console.ReadKey();
|
||||
continue;
|
||||
}
|
||||
|
||||
break;
|
||||
case 2:
|
||||
goto start;
|
||||
case 2: goto start;
|
||||
}
|
||||
}
|
||||
|
||||
start:
|
||||
start:
|
||||
System.Console.Clear();
|
||||
bool sense = dev.ReadLogDma(out byte[] buffer, out AtaErrorRegistersLBA48 errorRegisters, address, page, count, dev.Timeout, out double duration);
|
||||
bool sense = dev.ReadLogDma(out byte[] buffer, out AtaErrorRegistersLBA48 errorRegisters, address, page,
|
||||
count, dev.Timeout, out double duration);
|
||||
|
||||
menu:
|
||||
menu:
|
||||
DicConsole.WriteLine("Device: {0}", devPath);
|
||||
DicConsole.WriteLine("Sending READ LOG DMA EXT to the device:");
|
||||
DicConsole.WriteLine("Command took {0} ms.", duration);
|
||||
@@ -522,8 +526,7 @@ namespace DiscImageChef.Tests.Devices.ATA
|
||||
System.Console.Clear();
|
||||
DicConsole.WriteLine("Device: {0}", devPath);
|
||||
DicConsole.WriteLine("READ LOG DMA EXT response:");
|
||||
if(buffer != null)
|
||||
PrintHex.PrintHexArray(buffer, 64);
|
||||
if(buffer != null) PrintHex.PrintHexArray(buffer, 64);
|
||||
DicConsole.WriteLine("Press any key to continue...");
|
||||
System.Console.ReadKey();
|
||||
System.Console.Clear();
|
||||
@@ -539,10 +542,8 @@ namespace DiscImageChef.Tests.Devices.ATA
|
||||
System.Console.Clear();
|
||||
DicConsole.WriteLine("Device: {0}", devPath);
|
||||
goto menu;
|
||||
case 3:
|
||||
goto start;
|
||||
case 4:
|
||||
goto parameters;
|
||||
case 3: goto start;
|
||||
case 4: goto parameters;
|
||||
default:
|
||||
DicConsole.WriteLine("Incorrect option. Press any key to continue...");
|
||||
System.Console.ReadKey();
|
||||
@@ -558,7 +559,7 @@ namespace DiscImageChef.Tests.Devices.ATA
|
||||
string strDev;
|
||||
int item;
|
||||
|
||||
parameters:
|
||||
parameters:
|
||||
while(true)
|
||||
{
|
||||
System.Console.Clear();
|
||||
@@ -595,9 +596,12 @@ namespace DiscImageChef.Tests.Devices.ATA
|
||||
System.Console.ReadKey();
|
||||
continue;
|
||||
}
|
||||
|
||||
if(lba > 0xFFFFFFFFFFFF)
|
||||
{
|
||||
DicConsole.WriteLine("Logical block address cannot be bigger than {0}. Setting it to {0}...", 0xFFFFFFFFFFFF);
|
||||
DicConsole
|
||||
.WriteLine("Logical block address cannot be bigger than {0}. Setting it to {0}...",
|
||||
0xFFFFFFFFFFFF);
|
||||
lba = 0xFFFFFFFFFFFF;
|
||||
}
|
||||
DicConsole.Write("How many sectors?: ");
|
||||
@@ -609,17 +613,18 @@ namespace DiscImageChef.Tests.Devices.ATA
|
||||
System.Console.ReadKey();
|
||||
continue;
|
||||
}
|
||||
|
||||
break;
|
||||
case 2:
|
||||
goto start;
|
||||
case 2: goto start;
|
||||
}
|
||||
}
|
||||
|
||||
start:
|
||||
start:
|
||||
System.Console.Clear();
|
||||
bool sense = dev.ReadMultiple(out byte[] buffer, out AtaErrorRegistersLBA48 errorRegisters, lba, count, dev.Timeout, out double duration);
|
||||
bool sense = dev.ReadMultiple(out byte[] buffer, out AtaErrorRegistersLBA48 errorRegisters, lba, count,
|
||||
dev.Timeout, out double duration);
|
||||
|
||||
menu:
|
||||
menu:
|
||||
DicConsole.WriteLine("Device: {0}", devPath);
|
||||
DicConsole.WriteLine("Sending READ MULTIPLE EXT to the device:");
|
||||
DicConsole.WriteLine("Command took {0} ms.", duration);
|
||||
@@ -653,8 +658,7 @@ namespace DiscImageChef.Tests.Devices.ATA
|
||||
System.Console.Clear();
|
||||
DicConsole.WriteLine("Device: {0}", devPath);
|
||||
DicConsole.WriteLine("READ MULTIPLE EXT response:");
|
||||
if(buffer != null)
|
||||
PrintHex.PrintHexArray(buffer, 64);
|
||||
if(buffer != null) PrintHex.PrintHexArray(buffer, 64);
|
||||
DicConsole.WriteLine("Press any key to continue...");
|
||||
System.Console.ReadKey();
|
||||
System.Console.Clear();
|
||||
@@ -670,10 +674,8 @@ namespace DiscImageChef.Tests.Devices.ATA
|
||||
System.Console.Clear();
|
||||
DicConsole.WriteLine("Device: {0}", devPath);
|
||||
goto menu;
|
||||
case 3:
|
||||
goto start;
|
||||
case 4:
|
||||
goto parameters;
|
||||
case 3: goto start;
|
||||
case 4: goto parameters;
|
||||
default:
|
||||
DicConsole.WriteLine("Incorrect option. Press any key to continue...");
|
||||
System.Console.ReadKey();
|
||||
@@ -684,11 +686,12 @@ namespace DiscImageChef.Tests.Devices.ATA
|
||||
|
||||
static void ReadNativeMaxAddressExt(string devPath, Device dev)
|
||||
{
|
||||
start:
|
||||
start:
|
||||
System.Console.Clear();
|
||||
bool sense = dev.ReadNativeMaxAddress(out ulong lba, out AtaErrorRegistersLBA48 errorRegisters, dev.Timeout, out double duration);
|
||||
bool sense = dev.ReadNativeMaxAddress(out ulong lba, out AtaErrorRegistersLBA48 errorRegisters, dev.Timeout,
|
||||
out double duration);
|
||||
|
||||
menu:
|
||||
menu:
|
||||
DicConsole.WriteLine("Device: {0}", devPath);
|
||||
DicConsole.WriteLine("Sending READ NATIVE MAX ADDRESS EXT to the device:");
|
||||
DicConsole.WriteLine("Command took {0} ms.", duration);
|
||||
@@ -725,8 +728,7 @@ namespace DiscImageChef.Tests.Devices.ATA
|
||||
System.Console.Clear();
|
||||
DicConsole.WriteLine("Device: {0}", devPath);
|
||||
goto menu;
|
||||
case 2:
|
||||
goto start;
|
||||
case 2: goto start;
|
||||
default:
|
||||
DicConsole.WriteLine("Incorrect option. Press any key to continue...");
|
||||
System.Console.ReadKey();
|
||||
@@ -742,7 +744,7 @@ namespace DiscImageChef.Tests.Devices.ATA
|
||||
string strDev;
|
||||
int item;
|
||||
|
||||
parameters:
|
||||
parameters:
|
||||
while(true)
|
||||
{
|
||||
System.Console.Clear();
|
||||
@@ -779,9 +781,12 @@ namespace DiscImageChef.Tests.Devices.ATA
|
||||
System.Console.ReadKey();
|
||||
continue;
|
||||
}
|
||||
|
||||
if(lba > 0xFFFFFFFFFFFF)
|
||||
{
|
||||
DicConsole.WriteLine("Logical block address cannot be bigger than {0}. Setting it to {0}...", 0xFFFFFFFFFFFF);
|
||||
DicConsole
|
||||
.WriteLine("Logical block address cannot be bigger than {0}. Setting it to {0}...",
|
||||
0xFFFFFFFFFFFF);
|
||||
lba = 0xFFFFFFFFFFFF;
|
||||
}
|
||||
DicConsole.Write("How many sectors?: ");
|
||||
@@ -793,17 +798,18 @@ namespace DiscImageChef.Tests.Devices.ATA
|
||||
System.Console.ReadKey();
|
||||
continue;
|
||||
}
|
||||
|
||||
break;
|
||||
case 2:
|
||||
goto start;
|
||||
case 2: goto start;
|
||||
}
|
||||
}
|
||||
|
||||
start:
|
||||
start:
|
||||
System.Console.Clear();
|
||||
bool sense = dev.Read(out byte[] buffer, out AtaErrorRegistersLBA48 errorRegisters, lba, count, dev.Timeout, out double duration);
|
||||
bool sense = dev.Read(out byte[] buffer, out AtaErrorRegistersLBA48 errorRegisters, lba, count, dev.Timeout,
|
||||
out double duration);
|
||||
|
||||
menu:
|
||||
menu:
|
||||
DicConsole.WriteLine("Device: {0}", devPath);
|
||||
DicConsole.WriteLine("Sending READ SECTORS EXT to the device:");
|
||||
DicConsole.WriteLine("Command took {0} ms.", duration);
|
||||
@@ -837,8 +843,7 @@ namespace DiscImageChef.Tests.Devices.ATA
|
||||
System.Console.Clear();
|
||||
DicConsole.WriteLine("Device: {0}", devPath);
|
||||
DicConsole.WriteLine("READ SECTORS EXT response:");
|
||||
if(buffer != null)
|
||||
PrintHex.PrintHexArray(buffer, 64);
|
||||
if(buffer != null) PrintHex.PrintHexArray(buffer, 64);
|
||||
DicConsole.WriteLine("Press any key to continue...");
|
||||
System.Console.ReadKey();
|
||||
System.Console.Clear();
|
||||
@@ -854,10 +859,8 @@ namespace DiscImageChef.Tests.Devices.ATA
|
||||
System.Console.Clear();
|
||||
DicConsole.WriteLine("Device: {0}", devPath);
|
||||
goto menu;
|
||||
case 3:
|
||||
goto start;
|
||||
case 4:
|
||||
goto parameters;
|
||||
case 3: goto start;
|
||||
case 4: goto parameters;
|
||||
default:
|
||||
DicConsole.WriteLine("Incorrect option. Press any key to continue...");
|
||||
System.Console.ReadKey();
|
||||
@@ -866,5 +869,4 @@ namespace DiscImageChef.Tests.Devices.ATA
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
@@ -103,11 +103,12 @@ namespace DiscImageChef.Tests.Devices.ATA
|
||||
|
||||
static void Identify(string devPath, Device dev)
|
||||
{
|
||||
start:
|
||||
start:
|
||||
System.Console.Clear();
|
||||
bool sense = dev.AtaIdentify(out byte[] buffer, out AtaErrorRegistersCHS errorRegisters, out double duration);
|
||||
bool sense = dev.AtaIdentify(out byte[] buffer, out AtaErrorRegistersCHS errorRegisters,
|
||||
out double duration);
|
||||
|
||||
menu:
|
||||
menu:
|
||||
DicConsole.WriteLine("Device: {0}", devPath);
|
||||
DicConsole.WriteLine("Sending IDENTIFY DEVICE to the device:");
|
||||
DicConsole.WriteLine("Command took {0} ms.", duration);
|
||||
@@ -141,8 +142,7 @@ namespace DiscImageChef.Tests.Devices.ATA
|
||||
System.Console.Clear();
|
||||
DicConsole.WriteLine("Device: {0}", devPath);
|
||||
DicConsole.WriteLine("IDENTIFY DEVICE response:");
|
||||
if(buffer != null)
|
||||
PrintHex.PrintHexArray(buffer, 64);
|
||||
if(buffer != null) PrintHex.PrintHexArray(buffer, 64);
|
||||
DicConsole.WriteLine("Press any key to continue...");
|
||||
System.Console.ReadKey();
|
||||
System.Console.Clear();
|
||||
@@ -152,8 +152,7 @@ namespace DiscImageChef.Tests.Devices.ATA
|
||||
System.Console.Clear();
|
||||
DicConsole.WriteLine("Device: {0}", devPath);
|
||||
DicConsole.WriteLine("IDENTIFY DEVICE decoded response:");
|
||||
if(buffer != null)
|
||||
DicConsole.WriteLine("{0}", Decoders.ATA.Identify.Prettify(buffer));
|
||||
if(buffer != null) DicConsole.WriteLine("{0}", Decoders.ATA.Identify.Prettify(buffer));
|
||||
DicConsole.WriteLine("Press any key to continue...");
|
||||
System.Console.ReadKey();
|
||||
System.Console.Clear();
|
||||
@@ -169,8 +168,7 @@ namespace DiscImageChef.Tests.Devices.ATA
|
||||
System.Console.Clear();
|
||||
DicConsole.WriteLine("Device: {0}", devPath);
|
||||
goto menu;
|
||||
case 4:
|
||||
goto start;
|
||||
case 4: goto start;
|
||||
default:
|
||||
DicConsole.WriteLine("Incorrect option. Press any key to continue...");
|
||||
System.Console.ReadKey();
|
||||
@@ -188,7 +186,7 @@ namespace DiscImageChef.Tests.Devices.ATA
|
||||
string strDev;
|
||||
int item;
|
||||
|
||||
parameters:
|
||||
parameters:
|
||||
while(true)
|
||||
{
|
||||
System.Console.Clear();
|
||||
@@ -227,6 +225,7 @@ namespace DiscImageChef.Tests.Devices.ATA
|
||||
System.Console.ReadKey();
|
||||
continue;
|
||||
}
|
||||
|
||||
DicConsole.Write("What head?: ");
|
||||
strDev = System.Console.ReadLine();
|
||||
if(!byte.TryParse(strDev, out head))
|
||||
@@ -236,6 +235,7 @@ namespace DiscImageChef.Tests.Devices.ATA
|
||||
System.Console.ReadKey();
|
||||
continue;
|
||||
}
|
||||
|
||||
if(head > 15)
|
||||
{
|
||||
DicConsole.WriteLine("Head cannot be bigger than 15. Setting it to 15...");
|
||||
@@ -250,6 +250,7 @@ namespace DiscImageChef.Tests.Devices.ATA
|
||||
System.Console.ReadKey();
|
||||
continue;
|
||||
}
|
||||
|
||||
DicConsole.Write("How many sectors?: ");
|
||||
strDev = System.Console.ReadLine();
|
||||
if(!byte.TryParse(strDev, out count))
|
||||
@@ -259,17 +260,18 @@ namespace DiscImageChef.Tests.Devices.ATA
|
||||
System.Console.ReadKey();
|
||||
continue;
|
||||
}
|
||||
|
||||
break;
|
||||
case 2:
|
||||
goto start;
|
||||
case 2: goto start;
|
||||
}
|
||||
}
|
||||
|
||||
start:
|
||||
start:
|
||||
System.Console.Clear();
|
||||
bool sense = dev.ReadDma(out byte[] buffer, out AtaErrorRegistersCHS errorRegisters, retries, cylinder, head, sector, count, dev.Timeout, out double duration);
|
||||
bool sense = dev.ReadDma(out byte[] buffer, out AtaErrorRegistersCHS errorRegisters, retries, cylinder,
|
||||
head, sector, count, dev.Timeout, out double duration);
|
||||
|
||||
menu:
|
||||
menu:
|
||||
DicConsole.WriteLine("Device: {0}", devPath);
|
||||
DicConsole.WriteLine("Sending READ DMA {0}to the device:", retries ? "WITH RETRIES " : "");
|
||||
DicConsole.WriteLine("Command took {0} ms.", duration);
|
||||
@@ -303,8 +305,7 @@ namespace DiscImageChef.Tests.Devices.ATA
|
||||
System.Console.Clear();
|
||||
DicConsole.WriteLine("Device: {0}", devPath);
|
||||
DicConsole.WriteLine("READ DMA {0}response:", retries ? "WITH RETRIES " : "");
|
||||
if(buffer != null)
|
||||
PrintHex.PrintHexArray(buffer, 64);
|
||||
if(buffer != null) PrintHex.PrintHexArray(buffer, 64);
|
||||
DicConsole.WriteLine("Press any key to continue...");
|
||||
System.Console.ReadKey();
|
||||
System.Console.Clear();
|
||||
@@ -320,10 +321,8 @@ namespace DiscImageChef.Tests.Devices.ATA
|
||||
System.Console.Clear();
|
||||
DicConsole.WriteLine("Device: {0}", devPath);
|
||||
goto menu;
|
||||
case 3:
|
||||
goto start;
|
||||
case 4:
|
||||
goto parameters;
|
||||
case 3: goto start;
|
||||
case 4: goto parameters;
|
||||
default:
|
||||
DicConsole.WriteLine("Incorrect option. Press any key to continue...");
|
||||
System.Console.ReadKey();
|
||||
@@ -341,7 +340,7 @@ namespace DiscImageChef.Tests.Devices.ATA
|
||||
string strDev;
|
||||
int item;
|
||||
|
||||
parameters:
|
||||
parameters:
|
||||
while(true)
|
||||
{
|
||||
System.Console.Clear();
|
||||
@@ -380,6 +379,7 @@ namespace DiscImageChef.Tests.Devices.ATA
|
||||
System.Console.ReadKey();
|
||||
continue;
|
||||
}
|
||||
|
||||
DicConsole.Write("What head?: ");
|
||||
strDev = System.Console.ReadLine();
|
||||
if(!byte.TryParse(strDev, out head))
|
||||
@@ -389,6 +389,7 @@ namespace DiscImageChef.Tests.Devices.ATA
|
||||
System.Console.ReadKey();
|
||||
continue;
|
||||
}
|
||||
|
||||
if(head > 15)
|
||||
{
|
||||
DicConsole.WriteLine("Head cannot be bigger than 15. Setting it to 15...");
|
||||
@@ -403,6 +404,7 @@ namespace DiscImageChef.Tests.Devices.ATA
|
||||
System.Console.ReadKey();
|
||||
continue;
|
||||
}
|
||||
|
||||
DicConsole.Write("How many bytes to expect?: ");
|
||||
strDev = System.Console.ReadLine();
|
||||
if(!uint.TryParse(strDev, out blockSize))
|
||||
@@ -412,17 +414,18 @@ namespace DiscImageChef.Tests.Devices.ATA
|
||||
System.Console.ReadKey();
|
||||
continue;
|
||||
}
|
||||
|
||||
break;
|
||||
case 2:
|
||||
goto start;
|
||||
case 2: goto start;
|
||||
}
|
||||
}
|
||||
|
||||
start:
|
||||
start:
|
||||
System.Console.Clear();
|
||||
bool sense = dev.ReadLong(out byte[] buffer, out AtaErrorRegistersCHS errorRegisters, retries, cylinder, head, sector, blockSize, dev.Timeout, out double duration);
|
||||
bool sense = dev.ReadLong(out byte[] buffer, out AtaErrorRegistersCHS errorRegisters, retries, cylinder,
|
||||
head, sector, blockSize, dev.Timeout, out double duration);
|
||||
|
||||
menu:
|
||||
menu:
|
||||
DicConsole.WriteLine("Device: {0}", devPath);
|
||||
DicConsole.WriteLine("Sending READ LONG {0}to the device:", retries ? "WITH RETRIES " : "");
|
||||
DicConsole.WriteLine("Command took {0} ms.", duration);
|
||||
@@ -456,8 +459,7 @@ namespace DiscImageChef.Tests.Devices.ATA
|
||||
System.Console.Clear();
|
||||
DicConsole.WriteLine("Device: {0}", devPath);
|
||||
DicConsole.WriteLine("READ LONG {0}response:", retries ? "WITH RETRIES " : "");
|
||||
if(buffer != null)
|
||||
PrintHex.PrintHexArray(buffer, 64);
|
||||
if(buffer != null) PrintHex.PrintHexArray(buffer, 64);
|
||||
DicConsole.WriteLine("Press any key to continue...");
|
||||
System.Console.ReadKey();
|
||||
System.Console.Clear();
|
||||
@@ -473,10 +475,8 @@ namespace DiscImageChef.Tests.Devices.ATA
|
||||
System.Console.Clear();
|
||||
DicConsole.WriteLine("Device: {0}", devPath);
|
||||
goto menu;
|
||||
case 3:
|
||||
goto start;
|
||||
case 4:
|
||||
goto parameters;
|
||||
case 3: goto start;
|
||||
case 4: goto parameters;
|
||||
default:
|
||||
DicConsole.WriteLine("Incorrect option. Press any key to continue...");
|
||||
System.Console.ReadKey();
|
||||
@@ -494,7 +494,7 @@ namespace DiscImageChef.Tests.Devices.ATA
|
||||
string strDev;
|
||||
int item;
|
||||
|
||||
parameters:
|
||||
parameters:
|
||||
while(true)
|
||||
{
|
||||
System.Console.Clear();
|
||||
@@ -533,6 +533,7 @@ namespace DiscImageChef.Tests.Devices.ATA
|
||||
System.Console.ReadKey();
|
||||
continue;
|
||||
}
|
||||
|
||||
DicConsole.Write("What head?: ");
|
||||
strDev = System.Console.ReadLine();
|
||||
if(!byte.TryParse(strDev, out head))
|
||||
@@ -542,6 +543,7 @@ namespace DiscImageChef.Tests.Devices.ATA
|
||||
System.Console.ReadKey();
|
||||
continue;
|
||||
}
|
||||
|
||||
if(head > 15)
|
||||
{
|
||||
DicConsole.WriteLine("Head cannot be bigger than 15. Setting it to 15...");
|
||||
@@ -556,6 +558,7 @@ namespace DiscImageChef.Tests.Devices.ATA
|
||||
System.Console.ReadKey();
|
||||
continue;
|
||||
}
|
||||
|
||||
DicConsole.Write("How many sectors?: ");
|
||||
strDev = System.Console.ReadLine();
|
||||
if(!byte.TryParse(strDev, out count))
|
||||
@@ -565,17 +568,18 @@ namespace DiscImageChef.Tests.Devices.ATA
|
||||
System.Console.ReadKey();
|
||||
continue;
|
||||
}
|
||||
|
||||
break;
|
||||
case 2:
|
||||
goto start;
|
||||
case 2: goto start;
|
||||
}
|
||||
}
|
||||
|
||||
start:
|
||||
start:
|
||||
System.Console.Clear();
|
||||
bool sense = dev.ReadMultiple(out byte[] buffer, out AtaErrorRegistersCHS errorRegisters, cylinder, head, sector, count, dev.Timeout, out double duration);
|
||||
bool sense = dev.ReadMultiple(out byte[] buffer, out AtaErrorRegistersCHS errorRegisters, cylinder, head,
|
||||
sector, count, dev.Timeout, out double duration);
|
||||
|
||||
menu:
|
||||
menu:
|
||||
DicConsole.WriteLine("Device: {0}", devPath);
|
||||
DicConsole.WriteLine("Sending READ MULTIPLE to the device:");
|
||||
DicConsole.WriteLine("Command took {0} ms.", duration);
|
||||
@@ -609,8 +613,7 @@ namespace DiscImageChef.Tests.Devices.ATA
|
||||
System.Console.Clear();
|
||||
DicConsole.WriteLine("Device: {0}", devPath);
|
||||
DicConsole.WriteLine("READ MULTIPLE response:");
|
||||
if(buffer != null)
|
||||
PrintHex.PrintHexArray(buffer, 64);
|
||||
if(buffer != null) PrintHex.PrintHexArray(buffer, 64);
|
||||
DicConsole.WriteLine("Press any key to continue...");
|
||||
System.Console.ReadKey();
|
||||
System.Console.Clear();
|
||||
@@ -626,10 +629,8 @@ namespace DiscImageChef.Tests.Devices.ATA
|
||||
System.Console.Clear();
|
||||
DicConsole.WriteLine("Device: {0}", devPath);
|
||||
goto menu;
|
||||
case 3:
|
||||
goto start;
|
||||
case 4:
|
||||
goto parameters;
|
||||
case 3: goto start;
|
||||
case 4: goto parameters;
|
||||
default:
|
||||
DicConsole.WriteLine("Incorrect option. Press any key to continue...");
|
||||
System.Console.ReadKey();
|
||||
@@ -647,7 +648,7 @@ namespace DiscImageChef.Tests.Devices.ATA
|
||||
string strDev;
|
||||
int item;
|
||||
|
||||
parameters:
|
||||
parameters:
|
||||
while(true)
|
||||
{
|
||||
System.Console.Clear();
|
||||
@@ -686,6 +687,7 @@ namespace DiscImageChef.Tests.Devices.ATA
|
||||
System.Console.ReadKey();
|
||||
continue;
|
||||
}
|
||||
|
||||
DicConsole.Write("What head?: ");
|
||||
strDev = System.Console.ReadLine();
|
||||
if(!byte.TryParse(strDev, out head))
|
||||
@@ -695,6 +697,7 @@ namespace DiscImageChef.Tests.Devices.ATA
|
||||
System.Console.ReadKey();
|
||||
continue;
|
||||
}
|
||||
|
||||
if(head > 15)
|
||||
{
|
||||
DicConsole.WriteLine("Head cannot be bigger than 15. Setting it to 15...");
|
||||
@@ -709,6 +712,7 @@ namespace DiscImageChef.Tests.Devices.ATA
|
||||
System.Console.ReadKey();
|
||||
continue;
|
||||
}
|
||||
|
||||
DicConsole.Write("How many sectors?: ");
|
||||
strDev = System.Console.ReadLine();
|
||||
if(!byte.TryParse(strDev, out count))
|
||||
@@ -718,17 +722,18 @@ namespace DiscImageChef.Tests.Devices.ATA
|
||||
System.Console.ReadKey();
|
||||
continue;
|
||||
}
|
||||
|
||||
break;
|
||||
case 2:
|
||||
goto start;
|
||||
case 2: goto start;
|
||||
}
|
||||
}
|
||||
|
||||
start:
|
||||
start:
|
||||
System.Console.Clear();
|
||||
bool sense = dev.Read(out byte[] buffer, out AtaErrorRegistersCHS errorRegisters, retries, cylinder, head, sector, count, dev.Timeout, out double duration);
|
||||
bool sense = dev.Read(out byte[] buffer, out AtaErrorRegistersCHS errorRegisters, retries, cylinder, head,
|
||||
sector, count, dev.Timeout, out double duration);
|
||||
|
||||
menu:
|
||||
menu:
|
||||
DicConsole.WriteLine("Device: {0}", devPath);
|
||||
DicConsole.WriteLine("Sending READ SECTORS {0}to the device:", retries ? "WITH RETRIES " : "");
|
||||
DicConsole.WriteLine("Command took {0} ms.", duration);
|
||||
@@ -762,8 +767,7 @@ namespace DiscImageChef.Tests.Devices.ATA
|
||||
System.Console.Clear();
|
||||
DicConsole.WriteLine("Device: {0}", devPath);
|
||||
DicConsole.WriteLine("READ SECTORS {0}response:", retries ? "WITH RETRIES " : "");
|
||||
if(buffer != null)
|
||||
PrintHex.PrintHexArray(buffer, 64);
|
||||
if(buffer != null) PrintHex.PrintHexArray(buffer, 64);
|
||||
DicConsole.WriteLine("Press any key to continue...");
|
||||
System.Console.ReadKey();
|
||||
System.Console.Clear();
|
||||
@@ -779,10 +783,8 @@ namespace DiscImageChef.Tests.Devices.ATA
|
||||
System.Console.Clear();
|
||||
DicConsole.WriteLine("Device: {0}", devPath);
|
||||
goto menu;
|
||||
case 3:
|
||||
goto start;
|
||||
case 4:
|
||||
goto parameters;
|
||||
case 3: goto start;
|
||||
case 4: goto parameters;
|
||||
default:
|
||||
DicConsole.WriteLine("Incorrect option. Press any key to continue...");
|
||||
System.Console.ReadKey();
|
||||
@@ -799,7 +801,7 @@ namespace DiscImageChef.Tests.Devices.ATA
|
||||
string strDev;
|
||||
int item;
|
||||
|
||||
parameters:
|
||||
parameters:
|
||||
while(true)
|
||||
{
|
||||
System.Console.Clear();
|
||||
@@ -837,6 +839,7 @@ namespace DiscImageChef.Tests.Devices.ATA
|
||||
System.Console.ReadKey();
|
||||
continue;
|
||||
}
|
||||
|
||||
DicConsole.Write("What head?: ");
|
||||
strDev = System.Console.ReadLine();
|
||||
if(!byte.TryParse(strDev, out head))
|
||||
@@ -846,6 +849,7 @@ namespace DiscImageChef.Tests.Devices.ATA
|
||||
System.Console.ReadKey();
|
||||
continue;
|
||||
}
|
||||
|
||||
if(head > 15)
|
||||
{
|
||||
DicConsole.WriteLine("Head cannot be bigger than 15. Setting it to 15...");
|
||||
@@ -860,17 +864,18 @@ namespace DiscImageChef.Tests.Devices.ATA
|
||||
System.Console.ReadKey();
|
||||
continue;
|
||||
}
|
||||
|
||||
break;
|
||||
case 2:
|
||||
goto start;
|
||||
case 2: goto start;
|
||||
}
|
||||
}
|
||||
|
||||
start:
|
||||
start:
|
||||
System.Console.Clear();
|
||||
bool sense = dev.Seek(out AtaErrorRegistersCHS errorRegisters, cylinder, head, sector, dev.Timeout, out double duration);
|
||||
bool sense = dev.Seek(out AtaErrorRegistersCHS errorRegisters, cylinder, head, sector, dev.Timeout,
|
||||
out double duration);
|
||||
|
||||
menu:
|
||||
menu:
|
||||
DicConsole.WriteLine("Device: {0}", devPath);
|
||||
DicConsole.WriteLine("Sending SEEK to the device:");
|
||||
DicConsole.WriteLine("Command took {0} ms.", duration);
|
||||
@@ -907,10 +912,8 @@ namespace DiscImageChef.Tests.Devices.ATA
|
||||
System.Console.Clear();
|
||||
DicConsole.WriteLine("Device: {0}", devPath);
|
||||
goto menu;
|
||||
case 2:
|
||||
goto start;
|
||||
case 3:
|
||||
goto parameters;
|
||||
case 2: goto start;
|
||||
case 3: goto parameters;
|
||||
default:
|
||||
DicConsole.WriteLine("Incorrect option. Press any key to continue...");
|
||||
System.Console.ReadKey();
|
||||
@@ -919,5 +922,4 @@ namespace DiscImageChef.Tests.Devices.ATA
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
@@ -73,7 +73,8 @@ namespace DiscImageChef.Tests.Devices.ATA
|
||||
{
|
||||
start:
|
||||
System.Console.Clear();
|
||||
bool sense = dev.AtapiIdentify(out byte[] buffer, out AtaErrorRegistersCHS errorRegisters, out double duration);
|
||||
bool sense = dev.AtapiIdentify(out byte[] buffer, out AtaErrorRegistersCHS errorRegisters,
|
||||
out double duration);
|
||||
|
||||
menu:
|
||||
DicConsole.WriteLine("Device: {0}", devPath);
|
||||
@@ -109,8 +110,7 @@ namespace DiscImageChef.Tests.Devices.ATA
|
||||
System.Console.Clear();
|
||||
DicConsole.WriteLine("Device: {0}", devPath);
|
||||
DicConsole.WriteLine("IDENTIFY PACKET DEVICE response:");
|
||||
if(buffer != null)
|
||||
PrintHex.PrintHexArray(buffer, 64);
|
||||
if(buffer != null) PrintHex.PrintHexArray(buffer, 64);
|
||||
DicConsole.WriteLine("Press any key to continue...");
|
||||
System.Console.ReadKey();
|
||||
System.Console.Clear();
|
||||
@@ -120,8 +120,7 @@ namespace DiscImageChef.Tests.Devices.ATA
|
||||
System.Console.Clear();
|
||||
DicConsole.WriteLine("Device: {0}", devPath);
|
||||
DicConsole.WriteLine("IDENTIFY PACKET DEVICE decoded response:");
|
||||
if(buffer != null)
|
||||
DicConsole.WriteLine("{0}", Decoders.ATA.Identify.Prettify(buffer));
|
||||
if(buffer != null) DicConsole.WriteLine("{0}", Decoders.ATA.Identify.Prettify(buffer));
|
||||
DicConsole.WriteLine("Press any key to continue...");
|
||||
System.Console.ReadKey();
|
||||
System.Console.Clear();
|
||||
@@ -137,16 +136,13 @@ namespace DiscImageChef.Tests.Devices.ATA
|
||||
System.Console.Clear();
|
||||
DicConsole.WriteLine("Device: {0}", devPath);
|
||||
goto menu;
|
||||
case 4:
|
||||
goto start;
|
||||
case 4: goto start;
|
||||
default:
|
||||
DicConsole.WriteLine("Incorrect option. Press any key to continue...");
|
||||
System.Console.ReadKey();
|
||||
System.Console.Clear();
|
||||
goto menu;
|
||||
}
|
||||
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
@@ -79,11 +79,12 @@ namespace DiscImageChef.Tests.Devices.ATA
|
||||
|
||||
static void RequestExtendedErrorCode(string devPath, Device dev)
|
||||
{
|
||||
start:
|
||||
start:
|
||||
System.Console.Clear();
|
||||
bool sense = dev.RequestExtendedErrorCode(out byte errorCode, out AtaErrorRegistersLBA28 errorRegisters, dev.Timeout, out double duration);
|
||||
bool sense = dev.RequestExtendedErrorCode(out byte errorCode, out AtaErrorRegistersLBA28 errorRegisters,
|
||||
dev.Timeout, out double duration);
|
||||
|
||||
menu:
|
||||
menu:
|
||||
DicConsole.WriteLine("Device: {0}", devPath);
|
||||
DicConsole.WriteLine("Sending REQUEST EXTENDED ERROR CODE to the device:");
|
||||
DicConsole.WriteLine("Command took {0} ms.", duration);
|
||||
@@ -120,8 +121,7 @@ namespace DiscImageChef.Tests.Devices.ATA
|
||||
System.Console.Clear();
|
||||
DicConsole.WriteLine("Device: {0}", devPath);
|
||||
goto menu;
|
||||
case 2:
|
||||
goto start;
|
||||
case 2: goto start;
|
||||
default:
|
||||
DicConsole.WriteLine("Incorrect option. Press any key to continue...");
|
||||
System.Console.ReadKey();
|
||||
@@ -138,7 +138,7 @@ namespace DiscImageChef.Tests.Devices.ATA
|
||||
string strDev;
|
||||
int item;
|
||||
|
||||
parameters:
|
||||
parameters:
|
||||
while(true)
|
||||
{
|
||||
System.Console.Clear();
|
||||
@@ -176,6 +176,7 @@ namespace DiscImageChef.Tests.Devices.ATA
|
||||
System.Console.ReadKey();
|
||||
continue;
|
||||
}
|
||||
|
||||
DicConsole.Write("What head?: ");
|
||||
strDev = System.Console.ReadLine();
|
||||
if(!byte.TryParse(strDev, out head))
|
||||
@@ -185,6 +186,7 @@ namespace DiscImageChef.Tests.Devices.ATA
|
||||
System.Console.ReadKey();
|
||||
continue;
|
||||
}
|
||||
|
||||
if(head > 15)
|
||||
{
|
||||
DicConsole.WriteLine("Head cannot be bigger than 15. Setting it to 15...");
|
||||
@@ -199,17 +201,18 @@ namespace DiscImageChef.Tests.Devices.ATA
|
||||
System.Console.ReadKey();
|
||||
continue;
|
||||
}
|
||||
|
||||
break;
|
||||
case 2:
|
||||
goto start;
|
||||
case 2: goto start;
|
||||
}
|
||||
}
|
||||
|
||||
start:
|
||||
start:
|
||||
System.Console.Clear();
|
||||
bool sense = dev.TranslateSector(out byte[] buffer, out AtaErrorRegistersCHS errorRegisters, cylinder, head, sector, dev.Timeout, out double duration);
|
||||
bool sense = dev.TranslateSector(out byte[] buffer, out AtaErrorRegistersCHS errorRegisters, cylinder, head,
|
||||
sector, dev.Timeout, out double duration);
|
||||
|
||||
menu:
|
||||
menu:
|
||||
DicConsole.WriteLine("Device: {0}", devPath);
|
||||
DicConsole.WriteLine("Sending TRANSLATE SECTOR to the device:");
|
||||
DicConsole.WriteLine("Command took {0} ms.", duration);
|
||||
@@ -243,8 +246,7 @@ namespace DiscImageChef.Tests.Devices.ATA
|
||||
System.Console.Clear();
|
||||
DicConsole.WriteLine("Device: {0}", devPath);
|
||||
DicConsole.WriteLine("TRANSLATE SECTOR response:");
|
||||
if(buffer != null)
|
||||
PrintHex.PrintHexArray(buffer, 64);
|
||||
if(buffer != null) PrintHex.PrintHexArray(buffer, 64);
|
||||
DicConsole.WriteLine("Press any key to continue...");
|
||||
System.Console.ReadKey();
|
||||
System.Console.Clear();
|
||||
@@ -260,10 +262,8 @@ namespace DiscImageChef.Tests.Devices.ATA
|
||||
System.Console.Clear();
|
||||
DicConsole.WriteLine("Device: {0}", devPath);
|
||||
goto menu;
|
||||
case 3:
|
||||
goto start;
|
||||
case 4:
|
||||
goto parameters;
|
||||
case 3: goto start;
|
||||
case 4: goto parameters;
|
||||
default:
|
||||
DicConsole.WriteLine("Incorrect option. Press any key to continue...");
|
||||
System.Console.ReadKey();
|
||||
@@ -278,7 +278,7 @@ namespace DiscImageChef.Tests.Devices.ATA
|
||||
string strDev;
|
||||
int item;
|
||||
|
||||
parameters:
|
||||
parameters:
|
||||
while(true)
|
||||
{
|
||||
System.Console.Clear();
|
||||
@@ -314,22 +314,25 @@ namespace DiscImageChef.Tests.Devices.ATA
|
||||
System.Console.ReadKey();
|
||||
continue;
|
||||
}
|
||||
|
||||
if(lba > 0xFFFFFFF)
|
||||
{
|
||||
DicConsole.WriteLine("Logical block address cannot be bigger than {0}. Setting it to {0}...", 0xFFFFFFF);
|
||||
DicConsole
|
||||
.WriteLine("Logical block address cannot be bigger than {0}. Setting it to {0}...",
|
||||
0xFFFFFFF);
|
||||
lba = 0xFFFFFFF;
|
||||
}
|
||||
break;
|
||||
case 2:
|
||||
goto start;
|
||||
case 2: goto start;
|
||||
}
|
||||
}
|
||||
|
||||
start:
|
||||
start:
|
||||
System.Console.Clear();
|
||||
bool sense = dev.TranslateSector(out byte[] buffer, out AtaErrorRegistersLBA28 errorRegisters, lba, dev.Timeout, out double duration);
|
||||
bool sense = dev.TranslateSector(out byte[] buffer, out AtaErrorRegistersLBA28 errorRegisters, lba,
|
||||
dev.Timeout, out double duration);
|
||||
|
||||
menu:
|
||||
menu:
|
||||
DicConsole.WriteLine("Device: {0}", devPath);
|
||||
DicConsole.WriteLine("Sending TRANSLATE SECTOR to the device:");
|
||||
DicConsole.WriteLine("Command took {0} ms.", duration);
|
||||
@@ -363,8 +366,7 @@ namespace DiscImageChef.Tests.Devices.ATA
|
||||
System.Console.Clear();
|
||||
DicConsole.WriteLine("Device: {0}", devPath);
|
||||
DicConsole.WriteLine("TRANSLATE SECTOR response:");
|
||||
if(buffer != null)
|
||||
PrintHex.PrintHexArray(buffer, 64);
|
||||
if(buffer != null) PrintHex.PrintHexArray(buffer, 64);
|
||||
DicConsole.WriteLine("Press any key to continue...");
|
||||
System.Console.ReadKey();
|
||||
System.Console.Clear();
|
||||
@@ -380,10 +382,8 @@ namespace DiscImageChef.Tests.Devices.ATA
|
||||
System.Console.Clear();
|
||||
DicConsole.WriteLine("Device: {0}", devPath);
|
||||
goto menu;
|
||||
case 3:
|
||||
goto start;
|
||||
case 4:
|
||||
goto parameters;
|
||||
case 3: goto start;
|
||||
case 4: goto parameters;
|
||||
default:
|
||||
DicConsole.WriteLine("Incorrect option. Press any key to continue...");
|
||||
System.Console.ReadKey();
|
||||
|
||||
@@ -75,7 +75,7 @@ namespace DiscImageChef.Tests.Devices.ATA
|
||||
string strDev;
|
||||
int item;
|
||||
|
||||
parameters:
|
||||
parameters:
|
||||
while(true)
|
||||
{
|
||||
System.Console.Clear();
|
||||
@@ -111,17 +111,18 @@ namespace DiscImageChef.Tests.Devices.ATA
|
||||
System.Console.ReadKey();
|
||||
continue;
|
||||
}
|
||||
|
||||
break;
|
||||
case 2:
|
||||
goto start;
|
||||
case 2: goto start;
|
||||
}
|
||||
}
|
||||
|
||||
start:
|
||||
start:
|
||||
System.Console.Clear();
|
||||
bool sense = dev.CheckMediaCardType(feature, out AtaErrorRegistersCHS errorRegisters, dev.Timeout, out double duration);
|
||||
bool sense = dev.CheckMediaCardType(feature, out AtaErrorRegistersCHS errorRegisters, dev.Timeout,
|
||||
out double duration);
|
||||
|
||||
menu:
|
||||
menu:
|
||||
DicConsole.WriteLine("Device: {0}", devPath);
|
||||
DicConsole.WriteLine("Sending CHECK MEDIA CARD TYPE to the device:");
|
||||
DicConsole.WriteLine("Command took {0} ms.", duration);
|
||||
@@ -149,10 +150,8 @@ namespace DiscImageChef.Tests.Devices.ATA
|
||||
case 0:
|
||||
DicConsole.WriteLine("Returning to Media Card Pass Through commands menu...");
|
||||
return;
|
||||
case 1:
|
||||
goto start;
|
||||
case 2:
|
||||
goto parameters;
|
||||
case 1: goto start;
|
||||
case 2: goto parameters;
|
||||
default:
|
||||
DicConsole.WriteLine("Incorrect option. Press any key to continue...");
|
||||
System.Console.ReadKey();
|
||||
@@ -161,5 +160,4 @@ namespace DiscImageChef.Tests.Devices.ATA
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
@@ -99,11 +99,13 @@ namespace DiscImageChef.Tests.Devices.ATA
|
||||
|
||||
static void DisableAttributeAutosave(string devPath, Device dev)
|
||||
{
|
||||
start:
|
||||
start:
|
||||
System.Console.Clear();
|
||||
bool sense = dev.SmartDisableAttributeAutosave(out AtaErrorRegistersLBA28 errorRegisters, dev.Timeout, out double duration);
|
||||
bool sense =
|
||||
dev.SmartDisableAttributeAutosave(out AtaErrorRegistersLBA28 errorRegisters, dev.Timeout,
|
||||
out double duration);
|
||||
|
||||
menu:
|
||||
menu:
|
||||
DicConsole.WriteLine("Device: {0}", devPath);
|
||||
DicConsole.WriteLine("Sending DISABLE ATTRIBUTE AUTOSAVE to the device:");
|
||||
DicConsole.WriteLine("Command took {0} ms.", duration);
|
||||
@@ -130,8 +132,7 @@ namespace DiscImageChef.Tests.Devices.ATA
|
||||
case 0:
|
||||
DicConsole.WriteLine("Returning to S.M.A.R.T. commands menu...");
|
||||
return;
|
||||
case 1:
|
||||
goto start;
|
||||
case 1: goto start;
|
||||
default:
|
||||
DicConsole.WriteLine("Incorrect option. Press any key to continue...");
|
||||
System.Console.ReadKey();
|
||||
@@ -142,11 +143,11 @@ namespace DiscImageChef.Tests.Devices.ATA
|
||||
|
||||
static void DisableOperations(string devPath, Device dev)
|
||||
{
|
||||
start:
|
||||
start:
|
||||
System.Console.Clear();
|
||||
bool sense = dev.SmartDisable(out AtaErrorRegistersLBA28 errorRegisters, dev.Timeout, out double duration);
|
||||
|
||||
menu:
|
||||
menu:
|
||||
DicConsole.WriteLine("Device: {0}", devPath);
|
||||
DicConsole.WriteLine("Sending DISABLE OPERATIONS to the device:");
|
||||
DicConsole.WriteLine("Command took {0} ms.", duration);
|
||||
@@ -173,8 +174,7 @@ namespace DiscImageChef.Tests.Devices.ATA
|
||||
case 0:
|
||||
DicConsole.WriteLine("Returning to S.M.A.R.T. commands menu...");
|
||||
return;
|
||||
case 1:
|
||||
goto start;
|
||||
case 1: goto start;
|
||||
default:
|
||||
DicConsole.WriteLine("Incorrect option. Press any key to continue...");
|
||||
System.Console.ReadKey();
|
||||
@@ -185,11 +185,13 @@ namespace DiscImageChef.Tests.Devices.ATA
|
||||
|
||||
static void EnableAttributeAutosave(string devPath, Device dev)
|
||||
{
|
||||
start:
|
||||
start:
|
||||
System.Console.Clear();
|
||||
bool sense = dev.SmartEnableAttributeAutosave(out AtaErrorRegistersLBA28 errorRegisters, dev.Timeout, out double duration);
|
||||
bool sense =
|
||||
dev.SmartEnableAttributeAutosave(out AtaErrorRegistersLBA28 errorRegisters, dev.Timeout,
|
||||
out double duration);
|
||||
|
||||
menu:
|
||||
menu:
|
||||
DicConsole.WriteLine("Device: {0}", devPath);
|
||||
DicConsole.WriteLine("Sending ENABLE ATTRIBUTE AUTOSAVE to the device:");
|
||||
DicConsole.WriteLine("Command took {0} ms.", duration);
|
||||
@@ -216,8 +218,7 @@ namespace DiscImageChef.Tests.Devices.ATA
|
||||
case 0:
|
||||
DicConsole.WriteLine("Returning to S.M.A.R.T. commands menu...");
|
||||
return;
|
||||
case 1:
|
||||
goto start;
|
||||
case 1: goto start;
|
||||
default:
|
||||
DicConsole.WriteLine("Incorrect option. Press any key to continue...");
|
||||
System.Console.ReadKey();
|
||||
@@ -228,11 +229,11 @@ namespace DiscImageChef.Tests.Devices.ATA
|
||||
|
||||
static void EnableOperations(string devPath, Device dev)
|
||||
{
|
||||
start:
|
||||
start:
|
||||
System.Console.Clear();
|
||||
bool sense = dev.SmartEnable(out AtaErrorRegistersLBA28 errorRegisters, dev.Timeout, out double duration);
|
||||
|
||||
menu:
|
||||
menu:
|
||||
DicConsole.WriteLine("Device: {0}", devPath);
|
||||
DicConsole.WriteLine("Sending ENABLE OPERATIONS to the device:");
|
||||
DicConsole.WriteLine("Command took {0} ms.", duration);
|
||||
@@ -259,8 +260,7 @@ namespace DiscImageChef.Tests.Devices.ATA
|
||||
case 0:
|
||||
DicConsole.WriteLine("Returning to S.M.A.R.T. commands menu...");
|
||||
return;
|
||||
case 1:
|
||||
goto start;
|
||||
case 1: goto start;
|
||||
default:
|
||||
DicConsole.WriteLine("Incorrect option. Press any key to continue...");
|
||||
System.Console.ReadKey();
|
||||
@@ -275,7 +275,7 @@ namespace DiscImageChef.Tests.Devices.ATA
|
||||
string strDev;
|
||||
int item;
|
||||
|
||||
parameters:
|
||||
parameters:
|
||||
while(true)
|
||||
{
|
||||
System.Console.Clear();
|
||||
@@ -311,17 +311,18 @@ namespace DiscImageChef.Tests.Devices.ATA
|
||||
System.Console.ReadKey();
|
||||
continue;
|
||||
}
|
||||
|
||||
break;
|
||||
case 2:
|
||||
goto start;
|
||||
case 2: goto start;
|
||||
}
|
||||
}
|
||||
|
||||
start:
|
||||
start:
|
||||
System.Console.Clear();
|
||||
bool sense = dev.SmartExecuteOffLineImmediate(out AtaErrorRegistersLBA28 errorRegisters, subcommand, dev.Timeout, out double duration);
|
||||
bool sense = dev.SmartExecuteOffLineImmediate(out AtaErrorRegistersLBA28 errorRegisters, subcommand,
|
||||
dev.Timeout, out double duration);
|
||||
|
||||
menu:
|
||||
menu:
|
||||
DicConsole.WriteLine("Device: {0}", devPath);
|
||||
DicConsole.WriteLine("Sending EXECUTE OFF-LINE IMMEDIATE to the device:");
|
||||
DicConsole.WriteLine("Command took {0} ms.", duration);
|
||||
@@ -349,10 +350,8 @@ namespace DiscImageChef.Tests.Devices.ATA
|
||||
case 0:
|
||||
DicConsole.WriteLine("Returning to S.M.A.R.T. commands menu...");
|
||||
return;
|
||||
case 1:
|
||||
goto start;
|
||||
case 2:
|
||||
goto parameters;
|
||||
case 1: goto start;
|
||||
case 2: goto parameters;
|
||||
default:
|
||||
DicConsole.WriteLine("Incorrect option. Press any key to continue...");
|
||||
System.Console.ReadKey();
|
||||
@@ -363,11 +362,12 @@ namespace DiscImageChef.Tests.Devices.ATA
|
||||
|
||||
static void ReadData(string devPath, Device dev)
|
||||
{
|
||||
start:
|
||||
start:
|
||||
System.Console.Clear();
|
||||
bool sense = dev.SmartReadData(out byte[] buffer, out AtaErrorRegistersLBA28 errorRegisters, dev.Timeout, out double duration);
|
||||
bool sense = dev.SmartReadData(out byte[] buffer, out AtaErrorRegistersLBA28 errorRegisters, dev.Timeout,
|
||||
out double duration);
|
||||
|
||||
menu:
|
||||
menu:
|
||||
DicConsole.WriteLine("Device: {0}", devPath);
|
||||
DicConsole.WriteLine("Sending READ DATA to the device:");
|
||||
DicConsole.WriteLine("Command took {0} ms.", duration);
|
||||
@@ -400,8 +400,7 @@ namespace DiscImageChef.Tests.Devices.ATA
|
||||
System.Console.Clear();
|
||||
DicConsole.WriteLine("Device: {0}", devPath);
|
||||
DicConsole.WriteLine("READ DATA response:");
|
||||
if(buffer != null)
|
||||
PrintHex.PrintHexArray(buffer, 64);
|
||||
if(buffer != null) PrintHex.PrintHexArray(buffer, 64);
|
||||
DicConsole.WriteLine("Press any key to continue...");
|
||||
System.Console.ReadKey();
|
||||
System.Console.Clear();
|
||||
@@ -417,8 +416,7 @@ namespace DiscImageChef.Tests.Devices.ATA
|
||||
System.Console.Clear();
|
||||
DicConsole.WriteLine("Device: {0}", devPath);
|
||||
goto menu;
|
||||
case 4:
|
||||
goto start;
|
||||
case 4: goto start;
|
||||
default:
|
||||
DicConsole.WriteLine("Incorrect option. Press any key to continue...");
|
||||
System.Console.ReadKey();
|
||||
@@ -433,7 +431,7 @@ namespace DiscImageChef.Tests.Devices.ATA
|
||||
string strDev;
|
||||
int item;
|
||||
|
||||
parameters:
|
||||
parameters:
|
||||
while(true)
|
||||
{
|
||||
System.Console.Clear();
|
||||
@@ -471,17 +469,18 @@ namespace DiscImageChef.Tests.Devices.ATA
|
||||
System.Console.ReadKey();
|
||||
continue;
|
||||
}
|
||||
|
||||
break;
|
||||
case 2:
|
||||
goto start;
|
||||
case 2: goto start;
|
||||
}
|
||||
}
|
||||
|
||||
start:
|
||||
start:
|
||||
System.Console.Clear();
|
||||
bool sense = dev.SmartReadLog(out byte[] buffer, out AtaErrorRegistersLBA28 errorRegisters, address, dev.Timeout, out double duration);
|
||||
bool sense = dev.SmartReadLog(out byte[] buffer, out AtaErrorRegistersLBA28 errorRegisters, address,
|
||||
dev.Timeout, out double duration);
|
||||
|
||||
menu:
|
||||
menu:
|
||||
DicConsole.WriteLine("Device: {0}", devPath);
|
||||
DicConsole.WriteLine("Sending READ LOG to the device:");
|
||||
DicConsole.WriteLine("Command took {0} ms.", duration);
|
||||
@@ -515,8 +514,7 @@ namespace DiscImageChef.Tests.Devices.ATA
|
||||
System.Console.Clear();
|
||||
DicConsole.WriteLine("Device: {0}", devPath);
|
||||
DicConsole.WriteLine("READ LOG response:");
|
||||
if(buffer != null)
|
||||
PrintHex.PrintHexArray(buffer, 64);
|
||||
if(buffer != null) PrintHex.PrintHexArray(buffer, 64);
|
||||
DicConsole.WriteLine("Press any key to continue...");
|
||||
System.Console.ReadKey();
|
||||
System.Console.Clear();
|
||||
@@ -532,10 +530,8 @@ namespace DiscImageChef.Tests.Devices.ATA
|
||||
System.Console.Clear();
|
||||
DicConsole.WriteLine("Device: {0}", devPath);
|
||||
goto menu;
|
||||
case 3:
|
||||
goto start;
|
||||
case 4:
|
||||
goto parameters;
|
||||
case 3: goto start;
|
||||
case 4: goto parameters;
|
||||
default:
|
||||
DicConsole.WriteLine("Incorrect option. Press any key to continue...");
|
||||
System.Console.ReadKey();
|
||||
@@ -546,11 +542,12 @@ namespace DiscImageChef.Tests.Devices.ATA
|
||||
|
||||
static void ReturnStatus(string devPath, Device dev)
|
||||
{
|
||||
start:
|
||||
start:
|
||||
System.Console.Clear();
|
||||
bool sense = dev.SmartReturnStatus(out AtaErrorRegistersLBA28 errorRegisters, dev.Timeout, out double duration);
|
||||
bool sense = dev.SmartReturnStatus(out AtaErrorRegistersLBA28 errorRegisters, dev.Timeout,
|
||||
out double duration);
|
||||
|
||||
menu:
|
||||
menu:
|
||||
DicConsole.WriteLine("Device: {0}", devPath);
|
||||
DicConsole.WriteLine("Sending RETURN STATUS to the device:");
|
||||
DicConsole.WriteLine("Command took {0} ms.", duration);
|
||||
@@ -577,8 +574,7 @@ namespace DiscImageChef.Tests.Devices.ATA
|
||||
case 0:
|
||||
DicConsole.WriteLine("Returning to S.M.A.R.T. commands menu...");
|
||||
return;
|
||||
case 1:
|
||||
goto start;
|
||||
case 1: goto start;
|
||||
default:
|
||||
DicConsole.WriteLine("Incorrect option. Press any key to continue...");
|
||||
System.Console.ReadKey();
|
||||
@@ -587,5 +583,4 @@ namespace DiscImageChef.Tests.Devices.ATA
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
Reference in New Issue
Block a user