Code cleanup.

This commit is contained in:
2018-06-22 08:08:38 +01:00
parent 82f474c7e3
commit 88da8fc019
581 changed files with 22423 additions and 20839 deletions

View File

@@ -50,8 +50,9 @@ namespace DiscImageChef.Server.App_Start
/// <param name="ataOneValue">List to put values on</param>
/// <param name="ataTwoValue">List to put key=value pairs on</param>
/// <param name="testedMedia">List of tested media</param>
public static void Report(ataType ataReport, bool cfa, bool atapi, ref bool removable,
ref List<string> ataOneValue, ref Dictionary<string, string> ataTwoValue,
public static void Report(ataType ataReport, bool cfa, bool atapi,
ref bool removable,
ref List<string> ataOneValue, ref Dictionary<string, string> ataTwoValue,
ref testedMediaType[] testedMedia)
{
uint logicalsectorsize = 0;
@@ -70,7 +71,7 @@ namespace DiscImageChef.Server.App_Start
ata5 = false,
ata6 = false,
ata7 = false,
acs = false,
acs = false,
acs2 = false,
acs3 = false,
acs4 = false;
@@ -105,82 +106,93 @@ namespace DiscImageChef.Server.App_Start
ata5 |= ataReport.MajorVersion.HasFlag(MajorVersionBit.AtaAtapi5);
ata6 |= ataReport.MajorVersion.HasFlag(MajorVersionBit.AtaAtapi6);
ata7 |= ataReport.MajorVersion.HasFlag(MajorVersionBit.AtaAtapi7);
acs |= ataReport.MajorVersion.HasFlag(MajorVersionBit.Ata8ACS);
acs |= ataReport.MajorVersion.HasFlag(MajorVersionBit.Ata8ACS);
acs2 |= ataReport.MajorVersion.HasFlag(MajorVersionBit.ACS2);
acs3 |= ataReport.MajorVersion.HasFlag(MajorVersionBit.ACS3);
acs4 |= ataReport.MajorVersion.HasFlag(MajorVersionBit.ACS4);
}
}
int maxatalevel = 0;
int minatalevel = 255;
string tmpString = "";
int maxatalevel = 0;
int minatalevel = 255;
string tmpString = "";
if(ata1)
{
tmpString += "ATA-1 ";
maxatalevel = 1;
tmpString += "ATA-1 ";
maxatalevel = 1;
if(minatalevel > 1) minatalevel = 1;
}
if(ata2)
{
tmpString += "ATA-2 ";
maxatalevel = 2;
tmpString += "ATA-2 ";
maxatalevel = 2;
if(minatalevel > 2) minatalevel = 2;
}
if(ata3)
{
tmpString += "ATA-3 ";
maxatalevel = 3;
tmpString += "ATA-3 ";
maxatalevel = 3;
if(minatalevel > 3) minatalevel = 3;
}
if(ata4)
{
tmpString += "ATA/ATAPI-4 ";
maxatalevel = 4;
tmpString += "ATA/ATAPI-4 ";
maxatalevel = 4;
if(minatalevel > 4) minatalevel = 4;
}
if(ata5)
{
tmpString += "ATA/ATAPI-5 ";
maxatalevel = 5;
tmpString += "ATA/ATAPI-5 ";
maxatalevel = 5;
if(minatalevel > 5) minatalevel = 5;
}
if(ata6)
{
tmpString += "ATA/ATAPI-6 ";
maxatalevel = 6;
tmpString += "ATA/ATAPI-6 ";
maxatalevel = 6;
if(minatalevel > 6) minatalevel = 6;
}
if(ata7)
{
tmpString += "ATA/ATAPI-7 ";
maxatalevel = 7;
tmpString += "ATA/ATAPI-7 ";
maxatalevel = 7;
if(minatalevel > 7) minatalevel = 7;
}
if(acs)
{
tmpString += "ATA8-ACS ";
maxatalevel = 8;
tmpString += "ATA8-ACS ";
maxatalevel = 8;
if(minatalevel > 8) minatalevel = 8;
}
if(acs2)
{
tmpString += "ATA8-ACS2 ";
maxatalevel = 9;
tmpString += "ATA8-ACS2 ";
maxatalevel = 9;
if(minatalevel > 9) minatalevel = 9;
}
if(acs3)
{
tmpString += "ATA8-ACS3 ";
maxatalevel = 10;
tmpString += "ATA8-ACS3 ";
maxatalevel = 10;
if(minatalevel > 10) minatalevel = 10;
}
if(acs4)
{
tmpString += "ATA8-ACS4 ";
maxatalevel = 11;
tmpString += "ATA8-ACS4 ";
maxatalevel = 11;
if(minatalevel > 11) minatalevel = 11;
}
if(tmpString != "") ataTwoValue.Add("Supported ATA versions", tmpString);
if(maxatalevel >= 3 && ataReport.MinorVersionSpecified)
@@ -437,7 +449,7 @@ namespace DiscImageChef.Server.App_Start
break;
default:
ataOneValue
.Add($"ATAPI Unknown device type field value 0x{((ushort)ataReport.GeneralConfiguration & 0x1F00) >> 8:X2}");
.Add($"ATAPI Unknown device type field value 0x{((ushort)ataReport.GeneralConfiguration & 0x1F00) >> 8:X2}");
break;
}
@@ -455,7 +467,7 @@ namespace DiscImageChef.Server.App_Start
break;
default:
ataOneValue
.Add($"Unknown ATAPI DRQ behaviour code {((ushort)ataReport.GeneralConfiguration & 0x60) >> 5}");
.Add($"Unknown ATAPI DRQ behaviour code {((ushort)ataReport.GeneralConfiguration & 0x60) >> 5}");
break;
}
@@ -470,7 +482,7 @@ namespace DiscImageChef.Server.App_Start
break;
default:
ataOneValue
.Add($"Unknown ATAPI packet size code {(ushort)ataReport.GeneralConfiguration & 0x03}");
.Add($"Unknown ATAPI packet size code {(ushort)ataReport.GeneralConfiguration & 0x03}");
break;
}
}
@@ -519,51 +531,52 @@ namespace DiscImageChef.Server.App_Start
}
if(ataReport.SpecificConfigurationSpecified && (ushort)ataReport.SpecificConfiguration != 0x0000 &&
(ushort)ataReport.SpecificConfiguration != 0xFFFF)
(ushort)ataReport.SpecificConfiguration != 0xFFFF)
switch(ataReport.SpecificConfiguration)
{
case SpecificConfigurationEnum.RequiresSetIncompleteResponse:
ataOneValue
.Add("Device requires SET FEATURES to spin up and IDENTIFY DEVICE response is incomplete.");
.Add("Device requires SET FEATURES to spin up and IDENTIFY DEVICE response is incomplete.");
break;
case SpecificConfigurationEnum.RequiresSetCompleteResponse:
ataOneValue
.Add("Device requires SET FEATURES to spin up and IDENTIFY DEVICE response is complete.");
.Add("Device requires SET FEATURES to spin up and IDENTIFY DEVICE response is complete.");
break;
case SpecificConfigurationEnum.NotRequiresSetIncompleteResponse:
ataOneValue
.Add("Device does not require SET FEATURES to spin up and IDENTIFY DEVICE response is incomplete.");
.Add("Device does not require SET FEATURES to spin up and IDENTIFY DEVICE response is incomplete.");
break;
case SpecificConfigurationEnum.NotRequiresSetCompleteResponse:
ataOneValue
.Add("Device does not require SET FEATURES to spin up and IDENTIFY DEVICE response is complete.");
.Add("Device does not require SET FEATURES to spin up and IDENTIFY DEVICE response is complete.");
break;
default:
ataOneValue
.Add($"Unknown device specific configuration 0x{(ushort)ataReport.SpecificConfiguration:X4}");
.Add($"Unknown device specific configuration 0x{(ushort)ataReport.SpecificConfiguration:X4}");
break;
}
// Obsolete since ATA-2, however, it is yet used in ATA-8 devices
if(ataReport.BufferSizeSpecified && ataReport.BufferTypeSpecified && ataReport.BufferSize != 0x0000 &&
ataReport.BufferSize != 0xFFFF && ataReport.BufferType != 0x0000 && ataReport.BufferType != 0xFFFF)
ataReport.BufferSize != 0xFFFF &&
ataReport.BufferType != 0x0000 && ataReport.BufferType != 0xFFFF)
switch(ataReport.BufferType)
{
case 1:
ataOneValue
.Add($"{ataReport.BufferSize * logicalsectorsize / 1024} KiB of single ported single sector buffer");
.Add($"{ataReport.BufferSize * logicalsectorsize / 1024} KiB of single ported single sector buffer");
break;
case 2:
ataOneValue
.Add($"{ataReport.BufferSize * logicalsectorsize / 1024} KiB of dual ported multi sector buffer");
.Add($"{ataReport.BufferSize * logicalsectorsize / 1024} KiB of dual ported multi sector buffer");
break;
case 3:
ataOneValue
.Add($"{ataReport.BufferSize * logicalsectorsize / 1024} KiB of dual ported multi sector buffer with read caching");
.Add($"{ataReport.BufferSize * logicalsectorsize / 1024} KiB of dual ported multi sector buffer with read caching");
break;
default:
ataOneValue
.Add($"{ataReport.BufferSize * logicalsectorsize / 1024} KiB of unknown type {ataReport.BufferType} buffer");
.Add($"{ataReport.BufferSize * logicalsectorsize / 1024} KiB of unknown type {ataReport.BufferType} buffer");
break;
}
@@ -603,7 +616,7 @@ namespace DiscImageChef.Server.App_Start
if(ataReport.Capabilities3.HasFlag(CapabilitiesBit3.MultipleValid))
{
ataOneValue
.Add($"A maximum of {ataReport.MultipleSectorNumber} sectors can be transferred per interrupt on READ/WRITE MULTIPLE");
.Add($"A maximum of {ataReport.MultipleSectorNumber} sectors can be transferred per interrupt on READ/WRITE MULTIPLE");
ataOneValue.Add($"Device supports setting a maximum of {ataReport.MultipleMaxSectors} sectors");
}
@@ -644,48 +657,56 @@ namespace DiscImageChef.Server.App_Start
if(ataReport.DMAActive.HasFlag(TransferMode.Mode0) && ataReport.DMAActiveSpecified)
tmpString += "(active) ";
}
if(ataReport.DMASupported.HasFlag(TransferMode.Mode1))
{
tmpString += "DMA1 ";
if(ataReport.DMAActive.HasFlag(TransferMode.Mode1) && ataReport.DMAActiveSpecified)
tmpString += "(active) ";
}
if(ataReport.DMASupported.HasFlag(TransferMode.Mode2))
{
tmpString += "DMA2 ";
if(ataReport.DMAActive.HasFlag(TransferMode.Mode2) && ataReport.DMAActiveSpecified)
tmpString += "(active) ";
}
if(ataReport.DMASupported.HasFlag(TransferMode.Mode3))
{
tmpString += "DMA3 ";
if(ataReport.DMAActive.HasFlag(TransferMode.Mode3) && ataReport.DMAActiveSpecified)
tmpString += "(active) ";
}
if(ataReport.DMASupported.HasFlag(TransferMode.Mode4))
{
tmpString += "DMA4 ";
if(ataReport.DMAActive.HasFlag(TransferMode.Mode4) && ataReport.DMAActiveSpecified)
tmpString += "(active) ";
}
if(ataReport.DMASupported.HasFlag(TransferMode.Mode5))
{
tmpString += "DMA5 ";
if(ataReport.DMAActive.HasFlag(TransferMode.Mode5) && ataReport.DMAActiveSpecified)
tmpString += "(active) ";
}
if(ataReport.DMASupported.HasFlag(TransferMode.Mode6))
{
tmpString += "DMA6 ";
if(ataReport.DMAActive.HasFlag(TransferMode.Mode6) && ataReport.DMAActiveSpecified)
tmpString += "(active) ";
}
if(ataReport.DMASupported.HasFlag(TransferMode.Mode7))
{
tmpString += "DMA7 ";
if(ataReport.DMAActive.HasFlag(TransferMode.Mode7) && ataReport.DMAActiveSpecified)
tmpString += "(active) ";
}
ataTwoValue.Add("Single-word DMA", tmpString);
}
@@ -698,48 +719,56 @@ namespace DiscImageChef.Server.App_Start
if(ataReport.MDMAActive.HasFlag(TransferMode.Mode0) && ataReport.MDMAActiveSpecified)
tmpString += "(active) ";
}
if(ataReport.MDMASupported.HasFlag(TransferMode.Mode1))
{
tmpString += "MDMA1 ";
if(ataReport.MDMAActive.HasFlag(TransferMode.Mode1) && ataReport.MDMAActiveSpecified)
tmpString += "(active) ";
}
if(ataReport.MDMASupported.HasFlag(TransferMode.Mode2))
{
tmpString += "MDMA2 ";
if(ataReport.MDMAActive.HasFlag(TransferMode.Mode2) && ataReport.MDMAActiveSpecified)
tmpString += "(active) ";
}
if(ataReport.MDMASupported.HasFlag(TransferMode.Mode3))
{
tmpString += "MDMA3 ";
if(ataReport.MDMAActive.HasFlag(TransferMode.Mode3) && ataReport.MDMAActiveSpecified)
tmpString += "(active) ";
}
if(ataReport.MDMASupported.HasFlag(TransferMode.Mode4))
{
tmpString += "MDMA4 ";
if(ataReport.MDMAActive.HasFlag(TransferMode.Mode4) && ataReport.MDMAActiveSpecified)
tmpString += "(active) ";
}
if(ataReport.MDMASupported.HasFlag(TransferMode.Mode5))
{
tmpString += "MDMA5 ";
if(ataReport.MDMAActive.HasFlag(TransferMode.Mode5) && ataReport.MDMAActiveSpecified)
tmpString += "(active) ";
}
if(ataReport.MDMASupported.HasFlag(TransferMode.Mode6))
{
tmpString += "MDMA6 ";
if(ataReport.MDMAActive.HasFlag(TransferMode.Mode6) && ataReport.MDMAActiveSpecified)
tmpString += "(active) ";
}
if(ataReport.MDMASupported.HasFlag(TransferMode.Mode7))
{
tmpString += "MDMA7 ";
if(ataReport.MDMAActive.HasFlag(TransferMode.Mode7) && ataReport.MDMAActiveSpecified)
tmpString += "(active) ";
}
ataTwoValue.Add("Multi-word DMA", tmpString);
}
@@ -752,48 +781,56 @@ namespace DiscImageChef.Server.App_Start
if(ataReport.UDMAActive.HasFlag(TransferMode.Mode0) && ataReport.UDMAActiveSpecified)
tmpString += "(active) ";
}
if(ataReport.UDMASupported.HasFlag(TransferMode.Mode1))
{
tmpString += "UDMA1 ";
if(ataReport.UDMAActive.HasFlag(TransferMode.Mode1) && ataReport.UDMAActiveSpecified)
tmpString += "(active) ";
}
if(ataReport.UDMASupported.HasFlag(TransferMode.Mode2))
{
tmpString += "UDMA2 ";
if(ataReport.UDMAActive.HasFlag(TransferMode.Mode2) && ataReport.UDMAActiveSpecified)
tmpString += "(active) ";
}
if(ataReport.UDMASupported.HasFlag(TransferMode.Mode3))
{
tmpString += "UDMA3 ";
if(ataReport.UDMAActive.HasFlag(TransferMode.Mode3) && ataReport.UDMAActiveSpecified)
tmpString += "(active) ";
}
if(ataReport.UDMASupported.HasFlag(TransferMode.Mode4))
{
tmpString += "UDMA4 ";
if(ataReport.UDMAActive.HasFlag(TransferMode.Mode4) && ataReport.UDMAActiveSpecified)
tmpString += "(active) ";
}
if(ataReport.UDMASupported.HasFlag(TransferMode.Mode5))
{
tmpString += "UDMA5 ";
if(ataReport.UDMAActive.HasFlag(TransferMode.Mode5) && ataReport.UDMAActiveSpecified)
tmpString += "(active) ";
}
if(ataReport.UDMASupported.HasFlag(TransferMode.Mode6))
{
tmpString += "UDMA6 ";
if(ataReport.UDMAActive.HasFlag(TransferMode.Mode6) && ataReport.UDMAActiveSpecified)
tmpString += "(active) ";
}
if(ataReport.UDMASupported.HasFlag(TransferMode.Mode7))
{
tmpString += "UDMA7 ";
if(ataReport.UDMAActive.HasFlag(TransferMode.Mode7) && ataReport.UDMAActiveSpecified)
tmpString += "(active) ";
}
ataTwoValue.Add("Ultra DMA", tmpString);
}
@@ -815,7 +852,7 @@ namespace DiscImageChef.Server.App_Start
ataOneValue.Add($"{ataReport.PacketBusRelease} ns. typical to release bus from receipt of PACKET");
if(ataReport.ServiceBusyClear != 0)
ataOneValue
.Add($"{ataReport.ServiceBusyClear} ns. typical to clear BSY bit from receipt of SERVICE");
.Add($"{ataReport.ServiceBusyClear} ns. typical to clear BSY bit from receipt of SERVICE");
}
if(ataReport.TransportMajorVersionSpecified && ((ataReport.TransportMajorVersion & 0xF000) >> 12 == 0x1 ||
@@ -851,7 +888,7 @@ namespace DiscImageChef.Server.App_Start
if(ataReport.SATACapabilities2Specified &&
!ataReport.SATACapabilities2.HasFlag(SATACapabilitiesBit2.Clear))
{
if(ataReport.SATACapabilitiesSpecified &&
if(ataReport.SATACapabilitiesSpecified &&
!ataReport.SATACapabilities.HasFlag(SATACapabilitiesBit.Clear) &&
ataReport.SATACapabilities.HasFlag(SATACapabilitiesBit.NCQ))
{
@@ -913,7 +950,7 @@ namespace DiscImageChef.Server.App_Start
ataOneValue.Add($"CompactFlash device uses a maximum of {ataReport.CFAPowerMode & 0x0FFF} mA");
}
if(ataReport.CommandSetSpecified || ataReport.CommandSet2Specified || ataReport.CommandSet3Specified ||
if(ataReport.CommandSetSpecified || ataReport.CommandSet2Specified || ataReport.CommandSet3Specified ||
ataReport.CommandSet4Specified ||
ataReport.CommandSet5Specified) ataOneValue.Add("<i>Command set and features:</i>");
if(ataReport.CommandSetSpecified)
@@ -921,59 +958,79 @@ namespace DiscImageChef.Server.App_Start
if(ataReport.CommandSet.HasFlag(CommandSetBit.Nop))
if(ataReport.EnabledCommandSet.HasFlag(CommandSetBit.Nop) && ataReport.EnabledCommandSetSpecified)
ataOneValue.Add("NOP is supported and enabled");
else ataOneValue.Add("NOP is supported");
else
ataOneValue.Add("NOP is supported");
if(ataReport.CommandSet.HasFlag(CommandSetBit.ReadBuffer))
if(ataReport.EnabledCommandSet.HasFlag(CommandSetBit.ReadBuffer) &&
ataReport.EnabledCommandSetSpecified) ataOneValue.Add("READ BUFFER is supported and enabled");
else ataOneValue.Add("READ BUFFER is supported");
ataReport.EnabledCommandSetSpecified)
ataOneValue.Add("READ BUFFER is supported and enabled");
else
ataOneValue.Add("READ BUFFER is supported");
if(ataReport.CommandSet.HasFlag(CommandSetBit.WriteBuffer))
if(ataReport.EnabledCommandSet.HasFlag(CommandSetBit.WriteBuffer) &&
ataReport.EnabledCommandSetSpecified) ataOneValue.Add("WRITE BUFFER is supported and enabled");
else ataOneValue.Add("WRITE BUFFER is supported");
ataReport.EnabledCommandSetSpecified)
ataOneValue.Add("WRITE BUFFER is supported and enabled");
else
ataOneValue.Add("WRITE BUFFER is supported");
if(ataReport.CommandSet.HasFlag(CommandSetBit.HPA))
if(ataReport.EnabledCommandSet.HasFlag(CommandSetBit.HPA) && ataReport.EnabledCommandSetSpecified)
ataOneValue.Add("Host Protected Area is supported and enabled");
else ataOneValue.Add("Host Protected Area is supported");
else
ataOneValue.Add("Host Protected Area is supported");
if(ataReport.CommandSet.HasFlag(CommandSetBit.DeviceReset))
if(ataReport.EnabledCommandSet.HasFlag(CommandSetBit.DeviceReset) &&
ataReport.EnabledCommandSetSpecified) ataOneValue.Add("DEVICE RESET is supported and enabled");
else ataOneValue.Add("DEVICE RESET is supported");
ataReport.EnabledCommandSetSpecified)
ataOneValue.Add("DEVICE RESET is supported and enabled");
else
ataOneValue.Add("DEVICE RESET is supported");
if(ataReport.CommandSet.HasFlag(CommandSetBit.Service))
if(ataReport.EnabledCommandSet.HasFlag(CommandSetBit.Service) &&
ataReport.EnabledCommandSetSpecified)
ataOneValue.Add("SERVICE interrupt is supported and enabled");
else ataOneValue.Add("SERVICE interrupt is supported");
else
ataOneValue.Add("SERVICE interrupt is supported");
if(ataReport.CommandSet.HasFlag(CommandSetBit.Release))
if(ataReport.EnabledCommandSet.HasFlag(CommandSetBit.Release) &&
ataReport.EnabledCommandSetSpecified) ataOneValue.Add("Release is supported and enabled");
else ataOneValue.Add("Release is supported");
ataReport.EnabledCommandSetSpecified)
ataOneValue.Add("Release is supported and enabled");
else
ataOneValue.Add("Release is supported");
if(ataReport.CommandSet.HasFlag(CommandSetBit.LookAhead))
if(ataReport.EnabledCommandSet.HasFlag(CommandSetBit.LookAhead) &&
ataReport.EnabledCommandSetSpecified)
ataOneValue.Add("Look-ahead read is supported and enabled");
else ataOneValue.Add("Look-ahead read is supported");
else
ataOneValue.Add("Look-ahead read is supported");
if(ataReport.CommandSet.HasFlag(CommandSetBit.WriteCache))
if(ataReport.EnabledCommandSet.HasFlag(CommandSetBit.WriteCache) &&
ataReport.EnabledCommandSetSpecified) ataOneValue.Add("Write cache is supported and enabled");
else ataOneValue.Add("Write cache is supported");
ataReport.EnabledCommandSetSpecified)
ataOneValue.Add("Write cache is supported and enabled");
else
ataOneValue.Add("Write cache is supported");
if(ataReport.CommandSet.HasFlag(CommandSetBit.Packet))
if(ataReport.EnabledCommandSet.HasFlag(CommandSetBit.Packet) && ataReport.EnabledCommandSetSpecified
) ataOneValue.Add("PACKET is supported and enabled");
else ataOneValue.Add("PACKET is supported");
if(ataReport.EnabledCommandSet.HasFlag(CommandSetBit.Packet) &&
ataReport.EnabledCommandSetSpecified)
ataOneValue.Add("PACKET is supported and enabled");
else
ataOneValue.Add("PACKET is supported");
if(ataReport.CommandSet.HasFlag(CommandSetBit.PowerManagement))
if(ataReport.EnabledCommandSet.HasFlag(CommandSetBit.PowerManagement) &&
ataReport.EnabledCommandSetSpecified)
ataOneValue.Add("Power management is supported and enabled");
else ataOneValue.Add("Power management is supported");
else
ataOneValue.Add("Power management is supported");
if(ataReport.CommandSet.HasFlag(CommandSetBit.RemovableMedia))
if(ataReport.EnabledCommandSet.HasFlag(CommandSetBit.RemovableMedia) &&
ataReport.EnabledCommandSetSpecified)
ataOneValue.Add("Removable media feature set is supported and enabled");
else ataOneValue.Add("Removable media feature set is supported");
else
ataOneValue.Add("Removable media feature set is supported");
if(ataReport.CommandSet.HasFlag(CommandSetBit.SecurityMode))
if(ataReport.EnabledCommandSet.HasFlag(CommandSetBit.SecurityMode) &&
ataReport.EnabledCommandSetSpecified) ataOneValue.Add("Security mode is supported and enabled");
else ataOneValue.Add("Security mode is supported");
ataReport.EnabledCommandSetSpecified)
ataOneValue.Add("Security mode is supported and enabled");
else
ataOneValue.Add("Security mode is supported");
if(ataReport.Capabilities.HasFlag(CapabilitiesBit.LBASupport))
ataOneValue.Add("28-bit LBA is supported");
}
@@ -983,76 +1040,93 @@ namespace DiscImageChef.Server.App_Start
{
if(ataReport.CommandSet2.HasFlag(CommandSetBit2.LBA48))
if(ataReport.EnabledCommandSet2.HasFlag(CommandSetBit2.LBA48) &&
ataReport.EnabledCommandSet2Specified) ataOneValue.Add("48-bit LBA is supported and enabled");
else ataOneValue.Add("48-bit LBA is supported");
ataReport.EnabledCommandSet2Specified)
ataOneValue.Add("48-bit LBA is supported and enabled");
else
ataOneValue.Add("48-bit LBA is supported");
if(ataReport.CommandSet2.HasFlag(CommandSetBit2.FlushCache))
if(ataReport.EnabledCommandSet2.HasFlag(CommandSetBit2.FlushCache) &&
ataReport.EnabledCommandSet2Specified) ataOneValue.Add("FLUSH CACHE is supported and enabled");
else ataOneValue.Add("FLUSH CACHE is supported");
ataReport.EnabledCommandSet2Specified)
ataOneValue.Add("FLUSH CACHE is supported and enabled");
else
ataOneValue.Add("FLUSH CACHE is supported");
if(ataReport.CommandSet2.HasFlag(CommandSetBit2.FlushCacheExt))
if(ataReport.EnabledCommandSet2.HasFlag(CommandSetBit2.FlushCacheExt) &&
ataReport.EnabledCommandSet2Specified)
ataOneValue.Add("FLUSH CACHE EXT is supported and enabled");
else ataOneValue.Add("FLUSH CACHE EXT is supported");
else
ataOneValue.Add("FLUSH CACHE EXT is supported");
if(ataReport.CommandSet2.HasFlag(CommandSetBit2.DCO))
if(ataReport.EnabledCommandSet2.HasFlag(CommandSetBit2.DCO) && ataReport.EnabledCommandSet2Specified
) ataOneValue.Add("Device Configuration Overlay feature set is supported and enabled");
else ataOneValue.Add("Device Configuration Overlay feature set is supported");
if(ataReport.EnabledCommandSet2.HasFlag(CommandSetBit2.DCO) &&
ataReport.EnabledCommandSet2Specified)
ataOneValue.Add("Device Configuration Overlay feature set is supported and enabled");
else
ataOneValue.Add("Device Configuration Overlay feature set is supported");
if(ataReport.CommandSet2.HasFlag(CommandSetBit2.AAM))
if(ataReport.EnabledCommandSet2.HasFlag(CommandSetBit2.AAM) && ataReport.EnabledCommandSet2Specified
)
if(ataReport.EnabledCommandSet2.HasFlag(CommandSetBit2.AAM) &&
ataReport.EnabledCommandSet2Specified)
ataOneValue
.Add($"Automatic Acoustic Management is supported and enabled with value {ataReport.CurrentAAM} (vendor recommends {ataReport.RecommendedAAM}");
else ataOneValue.Add("Automatic Acoustic Management is supported");
.Add($"Automatic Acoustic Management is supported and enabled with value {ataReport.CurrentAAM} (vendor recommends {ataReport.RecommendedAAM}");
else
ataOneValue.Add("Automatic Acoustic Management is supported");
if(ataReport.CommandSet2.HasFlag(CommandSetBit2.SetMax))
if(ataReport.EnabledCommandSet2.HasFlag(CommandSetBit2.SetMax) &&
ataReport.EnabledCommandSet2Specified)
ataOneValue.Add("SET MAX security extension is supported and enabled");
else ataOneValue.Add("SET MAX security extension is supported");
else
ataOneValue.Add("SET MAX security extension is supported");
if(ataReport.CommandSet2.HasFlag(CommandSetBit2.AddressOffsetReservedAreaBoot))
if(ataReport.EnabledCommandSet2.HasFlag(CommandSetBit2.AddressOffsetReservedAreaBoot) &&
ataReport.EnabledCommandSet2Specified)
ataOneValue.Add("Address Offset Reserved Area Boot is supported and enabled");
else ataOneValue.Add("Address Offset Reserved Area Boot is supported");
else
ataOneValue.Add("Address Offset Reserved Area Boot is supported");
if(ataReport.CommandSet2.HasFlag(CommandSetBit2.SetFeaturesRequired))
ataOneValue.Add("SET FEATURES is required before spin-up");
if(ataReport.CommandSet2.HasFlag(CommandSetBit2.PowerUpInStandby))
if(ataReport.EnabledCommandSet2.HasFlag(CommandSetBit2.PowerUpInStandby) &&
ataReport.EnabledCommandSet2Specified)
ataOneValue.Add("Power-up in standby is supported and enabled");
else ataOneValue.Add("Power-up in standby is supported");
else
ataOneValue.Add("Power-up in standby is supported");
if(ataReport.CommandSet2.HasFlag(CommandSetBit2.RemovableNotification))
if(ataReport.EnabledCommandSet2.HasFlag(CommandSetBit2.RemovableNotification) &&
ataReport.EnabledCommandSet2Specified)
ataOneValue.Add("Removable Media Status Notification is supported and enabled");
else ataOneValue.Add("Removable Media Status Notification is supported");
else
ataOneValue.Add("Removable Media Status Notification is supported");
if(ataReport.CommandSet2.HasFlag(CommandSetBit2.APM))
if(ataReport.EnabledCommandSet2.HasFlag(CommandSetBit2.APM) && ataReport.EnabledCommandSet2Specified
)
if(ataReport.EnabledCommandSet2.HasFlag(CommandSetBit2.APM) &&
ataReport.EnabledCommandSet2Specified)
ataOneValue
.Add($"Advanced Power Management is supported and enabled with value {ataReport.CurrentAPM}");
else ataOneValue.Add("Advanced Power Management is supported");
.Add($"Advanced Power Management is supported and enabled with value {ataReport.CurrentAPM}");
else
ataOneValue.Add("Advanced Power Management is supported");
if(ataReport.CommandSet2.HasFlag(CommandSetBit2.CompactFlash))
if(ataReport.EnabledCommandSet2.HasFlag(CommandSetBit2.CompactFlash) &&
ataReport.EnabledCommandSet2Specified)
ataOneValue.Add("CompactFlash feature set is supported and enabled");
else ataOneValue.Add("CompactFlash feature set is supported");
else
ataOneValue.Add("CompactFlash feature set is supported");
if(ataReport.CommandSet2.HasFlag(CommandSetBit2.RWQueuedDMA))
if(ataReport.EnabledCommandSet2.HasFlag(CommandSetBit2.RWQueuedDMA) &&
ataReport.EnabledCommandSet2Specified)
ataOneValue.Add("READ DMA QUEUED and WRITE DMA QUEUED are supported and enabled");
else ataOneValue.Add("READ DMA QUEUED and WRITE DMA QUEUED are supported");
else
ataOneValue.Add("READ DMA QUEUED and WRITE DMA QUEUED are supported");
if(ataReport.CommandSet2.HasFlag(CommandSetBit2.DownloadMicrocode))
if(ataReport.EnabledCommandSet2.HasFlag(CommandSetBit2.DownloadMicrocode) &&
ataReport.EnabledCommandSet2Specified)
ataOneValue.Add("DOWNLOAD MICROCODE is supported and enabled");
else ataOneValue.Add("DOWNLOAD MICROCODE is supported");
else
ataOneValue.Add("DOWNLOAD MICROCODE is supported");
}
if(ataReport.CommandSet.HasFlag(CommandSetBit.SMART) && ataReport.CommandSetSpecified)
if(ataReport.EnabledCommandSet.HasFlag(CommandSetBit.SMART) && ataReport.EnabledCommandSetSpecified)
ataOneValue.Add("S.M.A.R.T. is supported and enabled");
else ataOneValue.Add("S.M.A.R.T. is supported");
else
ataOneValue.Add("S.M.A.R.T. is supported");
if(ataReport.SCTCommandTransport.HasFlag(SCTCommandTransportBit.Supported) &&
ataReport.SCTCommandTransportSpecified) ataOneValue.Add("S.M.A.R.T. Command Transport is supported");
@@ -1064,17 +1138,20 @@ namespace DiscImageChef.Server.App_Start
if(ataReport.EnabledCommandSet3.HasFlag(CommandSetBit3.SMARTSelfTest) &&
ataReport.EnabledCommandSet3Specified)
ataOneValue.Add("S.M.A.R.T. self-testing is supported and enabled");
else ataOneValue.Add("S.M.A.R.T. self-testing is supported");
else
ataOneValue.Add("S.M.A.R.T. self-testing is supported");
if(ataReport.CommandSet3.HasFlag(CommandSetBit3.SMARTLog))
if(ataReport.EnabledCommandSet3.HasFlag(CommandSetBit3.SMARTLog) &&
ataReport.EnabledCommandSet3Specified)
ataOneValue.Add("S.M.A.R.T. error logging is supported and enabled");
else ataOneValue.Add("S.M.A.R.T. error logging is supported");
else
ataOneValue.Add("S.M.A.R.T. error logging is supported");
if(ataReport.CommandSet3.HasFlag(CommandSetBit3.IdleImmediate))
if(ataReport.EnabledCommandSet3.HasFlag(CommandSetBit3.IdleImmediate) &&
ataReport.EnabledCommandSet3Specified)
ataOneValue.Add("IDLE IMMEDIATE with UNLOAD FEATURE is supported and enabled");
else ataOneValue.Add("IDLE IMMEDIATE with UNLOAD FEATURE is supported");
else
ataOneValue.Add("IDLE IMMEDIATE with UNLOAD FEATURE is supported");
if(ataReport.CommandSet3.HasFlag(CommandSetBit3.WriteURG))
ataOneValue.Add("URG bit is supported in WRITE STREAM DMA EXT and WRITE STREAM EXT");
if(ataReport.CommandSet3.HasFlag(CommandSetBit3.ReadURG))
@@ -1084,21 +1161,26 @@ namespace DiscImageChef.Server.App_Start
if(ataReport.EnabledCommandSet3.HasFlag(CommandSetBit3.FUAWriteQ) &&
ataReport.EnabledCommandSet3Specified)
ataOneValue.Add("WRITE DMA QUEUED FUA EXT is supported and enabled");
else ataOneValue.Add("WRITE DMA QUEUED FUA EXT is supported");
else
ataOneValue.Add("WRITE DMA QUEUED FUA EXT is supported");
if(ataReport.CommandSet3.HasFlag(CommandSetBit3.FUAWrite))
if(ataReport.EnabledCommandSet3.HasFlag(CommandSetBit3.FUAWrite) &&
ataReport.EnabledCommandSet3Specified)
ataOneValue.Add("WRITE DMA FUA EXT and WRITE MULTIPLE FUA EXT are supported and enabled");
else ataOneValue.Add("WRITE DMA FUA EXT and WRITE MULTIPLE FUA EXT are supported");
else
ataOneValue.Add("WRITE DMA FUA EXT and WRITE MULTIPLE FUA EXT are supported");
if(ataReport.CommandSet3.HasFlag(CommandSetBit3.GPL))
if(ataReport.EnabledCommandSet3.HasFlag(CommandSetBit3.GPL) && ataReport.EnabledCommandSet3Specified
) ataOneValue.Add("General Purpose Logging is supported and enabled");
else ataOneValue.Add("General Purpose Logging is supported");
if(ataReport.EnabledCommandSet3.HasFlag(CommandSetBit3.GPL) &&
ataReport.EnabledCommandSet3Specified)
ataOneValue.Add("General Purpose Logging is supported and enabled");
else
ataOneValue.Add("General Purpose Logging is supported");
if(ataReport.CommandSet3.HasFlag(CommandSetBit3.Streaming))
if(ataReport.EnabledCommandSet3.HasFlag(CommandSetBit3.Streaming) &&
ataReport.EnabledCommandSet3Specified)
ataOneValue.Add("Streaming feature set is supported and enabled");
else ataOneValue.Add("Streaming feature set is supported");
else
ataOneValue.Add("Streaming feature set is supported");
if(ataReport.CommandSet3.HasFlag(CommandSetBit3.MCPT) && ataReport.EnabledCommandSet3Specified)
ataOneValue.Add(ataReport.EnabledCommandSet3.HasFlag(CommandSetBit3.MCPT)
? "Media Card Pass Through command set is supported and enabled"
@@ -1113,44 +1195,53 @@ namespace DiscImageChef.Server.App_Start
!ataReport.CommandSet4.HasFlag(CommandSetBit4.MustBeClear))
{
if(ataReport.CommandSet4.HasFlag(CommandSetBit4.DSN))
if(ataReport.EnabledCommandSet4.HasFlag(CommandSetBit4.DSN) && ataReport.EnabledCommandSet4Specified
) ataOneValue.Add("DSN feature set is supported and enabled");
else ataOneValue.Add("DSN feature set is supported");
if(ataReport.EnabledCommandSet4.HasFlag(CommandSetBit4.DSN) &&
ataReport.EnabledCommandSet4Specified)
ataOneValue.Add("DSN feature set is supported and enabled");
else
ataOneValue.Add("DSN feature set is supported");
if(ataReport.CommandSet4.HasFlag(CommandSetBit4.AMAC))
if(ataReport.EnabledCommandSet4.HasFlag(CommandSetBit4.AMAC) &&
ataReport.EnabledCommandSet4Specified)
ataOneValue.Add("Accessible Max Address Configuration is supported and enabled");
else ataOneValue.Add("Accessible Max Address Configuration is supported");
else
ataOneValue.Add("Accessible Max Address Configuration is supported");
if(ataReport.CommandSet4.HasFlag(CommandSetBit4.ExtPowerCond))
if(ataReport.EnabledCommandSet4.HasFlag(CommandSetBit4.ExtPowerCond) &&
ataReport.EnabledCommandSet4Specified)
ataOneValue.Add("Extended Power Conditions are supported and enabled");
else ataOneValue.Add("Extended Power Conditions are supported");
else
ataOneValue.Add("Extended Power Conditions are supported");
if(ataReport.CommandSet4.HasFlag(CommandSetBit4.ExtStatusReport))
if(ataReport.EnabledCommandSet4.HasFlag(CommandSetBit4.ExtStatusReport) &&
ataReport.EnabledCommandSet4Specified)
ataOneValue.Add("Extended Status Reporting is supported and enabled");
else ataOneValue.Add("Extended Status Reporting is supported");
else
ataOneValue.Add("Extended Status Reporting is supported");
if(ataReport.CommandSet4.HasFlag(CommandSetBit4.FreeFallControl))
if(ataReport.EnabledCommandSet4.HasFlag(CommandSetBit4.FreeFallControl) &&
ataReport.EnabledCommandSet4Specified)
ataOneValue.Add("Free-fall control feature set is supported and enabled");
else ataOneValue.Add("Free-fall control feature set is supported");
else
ataOneValue.Add("Free-fall control feature set is supported");
if(ataReport.CommandSet4.HasFlag(CommandSetBit4.SegmentedDownloadMicrocode))
if(ataReport.EnabledCommandSet4.HasFlag(CommandSetBit4.SegmentedDownloadMicrocode) &&
ataReport.EnabledCommandSet4Specified)
ataOneValue.Add("Segmented feature in DOWNLOAD MICROCODE is supported and enabled");
else ataOneValue.Add("Segmented feature in DOWNLOAD MICROCODE is supported");
else
ataOneValue.Add("Segmented feature in DOWNLOAD MICROCODE is supported");
if(ataReport.CommandSet4.HasFlag(CommandSetBit4.RWDMAExtGpl))
if(ataReport.EnabledCommandSet4.HasFlag(CommandSetBit4.RWDMAExtGpl) &&
ataReport.EnabledCommandSet4Specified)
ataOneValue.Add("READ/WRITE DMA EXT GPL are supported and enabled");
else ataOneValue.Add("READ/WRITE DMA EXT GPL are supported");
else
ataOneValue.Add("READ/WRITE DMA EXT GPL are supported");
if(ataReport.CommandSet4.HasFlag(CommandSetBit4.WriteUnc))
if(ataReport.EnabledCommandSet4.HasFlag(CommandSetBit4.WriteUnc) &&
ataReport.EnabledCommandSet4Specified)
ataOneValue.Add("WRITE UNCORRECTABLE is supported and enabled");
else ataOneValue.Add("WRITE UNCORRECTABLE is supported");
else
ataOneValue.Add("WRITE UNCORRECTABLE is supported");
if(ataReport.CommandSet4.HasFlag(CommandSetBit4.WRV))
{
if(ataReport.EnabledCommandSet4.HasFlag(CommandSetBit4.WRV) && ataReport.EnabledCommandSet4Specified
@@ -1161,10 +1252,13 @@ namespace DiscImageChef.Server.App_Start
if(ataReport.EnabledCommandSet4.HasFlag(CommandSetBit4.WRV) && ataReport.EnabledCommandSet4Specified
) ataOneValue.Add($"Current Write/Read/Verify mode: {ataReport.WRVMode}");
}
if(ataReport.CommandSet4.HasFlag(CommandSetBit4.DT1825))
if(ataReport.EnabledCommandSet4.HasFlag(CommandSetBit4.DT1825) &&
ataReport.EnabledCommandSet4Specified) ataOneValue.Add("DT1825 is supported and enabled");
else ataOneValue.Add("DT1825 is supported");
ataReport.EnabledCommandSet4Specified)
ataOneValue.Add("DT1825 is supported and enabled");
else
ataOneValue.Add("DT1825 is supported");
}
if(ataReport.Capabilities3Specified)
@@ -1202,6 +1296,7 @@ namespace DiscImageChef.Server.App_Start
if(ataReport.CommandSet5.HasFlag(CommandSetBit5.ReadZeroTrim))
ataOneValue.Add("Read after TRIM returns empty data");
}
if(ataReport.CommandSet5.HasFlag(CommandSetBit5.LongPhysSectorAligError))
ataOneValue.Add("Device supports Long Physical Sector Alignment Error Reporting Control");
if(ataReport.CommandSet5.HasFlag(CommandSetBit5.Encrypted))
@@ -1225,7 +1320,7 @@ namespace DiscImageChef.Server.App_Start
}
if(!ata1 && maxatalevel >= 8 && ataReport.TrustedComputingSpecified)
if(ataReport.TrustedComputing.HasFlag(TrustedComputingBit.Set) &&
if(ataReport.TrustedComputing.HasFlag(TrustedComputingBit.Set) &&
!ataReport.TrustedComputing.HasFlag(TrustedComputingBit.Clear) &&
ataReport.TrustedComputing.HasFlag(TrustedComputingBit.TrustedComputing))
ataOneValue.Add("Trusted Computing feature set is supported");
@@ -1250,46 +1345,54 @@ namespace DiscImageChef.Server.App_Start
if(ataReport.EnabledSATAFeatures.HasFlag(SATAFeaturesBit.NonZeroBufferOffset) &&
ataReport.EnabledSATAFeaturesSpecified)
ataOneValue.Add("Non-zero buffer offsets are supported and enabled");
else ataOneValue.Add("Non-zero buffer offsets are supported");
else
ataOneValue.Add("Non-zero buffer offsets are supported");
if(ataReport.SATAFeatures.HasFlag(SATAFeaturesBit.DMASetup))
if(ataReport.EnabledSATAFeatures.HasFlag(SATAFeaturesBit.DMASetup) &&
ataReport.EnabledSATAFeaturesSpecified)
ataOneValue.Add("DMA Setup auto-activation is supported and enabled");
else ataOneValue.Add("DMA Setup auto-activation is supported");
else
ataOneValue.Add("DMA Setup auto-activation is supported");
if(ataReport.SATAFeatures.HasFlag(SATAFeaturesBit.InitPowerMgmt))
if(ataReport.EnabledSATAFeatures.HasFlag(SATAFeaturesBit.InitPowerMgmt) &&
ataReport.EnabledSATAFeaturesSpecified)
ataOneValue.Add("Device-initiated power management is supported and enabled");
else ataOneValue.Add("Device-initiated power management is supported");
else
ataOneValue.Add("Device-initiated power management is supported");
if(ataReport.SATAFeatures.HasFlag(SATAFeaturesBit.InOrderData))
if(ataReport.EnabledSATAFeatures.HasFlag(SATAFeaturesBit.InOrderData) &&
ataReport.EnabledSATAFeaturesSpecified)
ataOneValue.Add("In-order data delivery is supported and enabled");
else ataOneValue.Add("In-order data delivery is supported");
else
ataOneValue.Add("In-order data delivery is supported");
if(!atapi)
if(ataReport.SATAFeatures.HasFlag(SATAFeaturesBit.HardwareFeatureControl))
if(ataReport.EnabledSATAFeatures.HasFlag(SATAFeaturesBit.HardwareFeatureControl) &&
ataReport.EnabledSATAFeaturesSpecified)
ataOneValue.Add("Hardware Feature Control is supported and enabled");
else ataOneValue.Add("Hardware Feature Control is supported");
else
ataOneValue.Add("Hardware Feature Control is supported");
if(atapi)
if(ataReport.SATAFeatures.HasFlag(SATAFeaturesBit.AsyncNotification) &&
ataReport.EnabledSATAFeaturesSpecified)
if(ataReport.EnabledSATAFeatures.HasFlag(SATAFeaturesBit.AsyncNotification) &&
ataReport.EnabledSATAFeaturesSpecified)
ataOneValue.Add("Asynchronous notification is supported");
else ataOneValue.Add("Asynchronous notification is supported");
else
ataOneValue.Add("Asynchronous notification is supported");
if(ataReport.SATAFeatures.HasFlag(SATAFeaturesBit.SettingsPreserve))
if(ataReport.EnabledSATAFeatures.HasFlag(SATAFeaturesBit.SettingsPreserve) &&
ataReport.EnabledSATAFeaturesSpecified)
ataOneValue.Add("Software Settings Preservation is supported");
else ataOneValue.Add("Software Settings Preservation is supported");
else
ataOneValue.Add("Software Settings Preservation is supported");
if(ataReport.SATAFeatures.HasFlag(SATAFeaturesBit.NCQAutoSense))
ataOneValue.Add("NCQ Autosense is supported");
if(ataReport.EnabledSATAFeatures.HasFlag(SATAFeaturesBit.EnabledSlumber))
ataOneValue.Add("Automatic Partial to Slumber transitions are enabled");
}
}
if((ataReport.RemovableStatusSet & 0x03) > 0)
ataOneValue.Add("Removable Media Status Notification feature set is supported");
@@ -1331,12 +1434,13 @@ namespace DiscImageChef.Server.App_Start
ataOneValue.Add($"{ataReport.SecurityEraseTime * 2} minutes to complete secure erase");
if(ataReport.SecurityStatus.HasFlag(SecurityStatusBit.Enhanced))
ataOneValue
.Add($"{ataReport.EnhancedSecurityEraseTime * 2} minutes to complete enhanced secure erase");
.Add($"{ataReport.EnhancedSecurityEraseTime * 2} minutes to complete enhanced secure erase");
ataOneValue.Add($"Master password revision code: {ataReport.MasterPasswordRevisionCode}");
}
if(ataReport.CommandSet3Specified && ataReport.CommandSet3.HasFlag(CommandSetBit3.MustBeSet) &&
if(ataReport.CommandSet3Specified &&
ataReport.CommandSet3.HasFlag(CommandSetBit3.MustBeSet) &&
!ataReport.CommandSet3.HasFlag(CommandSetBit3.MustBeClear) &&
ataReport.CommandSet3.HasFlag(CommandSetBit3.Streaming))
{
@@ -1376,6 +1480,7 @@ namespace DiscImageChef.Server.App_Start
ataOneValue.Add($"Version {(ataReport.NVCacheCaps & 0x0F00) >> 8}");
}
ataOneValue.Add($"Non-Volatile Cache is {ataReport.NVCacheSize * logicalsectorsize} bytes");
}
@@ -1384,7 +1489,7 @@ namespace DiscImageChef.Server.App_Start
removable = false;
ataOneValue.Add("");
if(ataReport.ReadCapabilities.NominalRotationRateSpecified &&
if(ataReport.ReadCapabilities.NominalRotationRateSpecified &&
ataReport.ReadCapabilities.NominalRotationRate != 0x0000 &&
ataReport.ReadCapabilities.NominalRotationRate != 0xFFFF)
ataOneValue.Add(ataReport.ReadCapabilities.NominalRotationRate == 0x0001
@@ -1398,24 +1503,29 @@ namespace DiscImageChef.Server.App_Start
ataTwoValue.Add("Logical sector size", $"{ataReport.ReadCapabilities.BlockSize} bytes");
logicalsectorsize = ataReport.ReadCapabilities.BlockSize;
}
if(ataReport.ReadCapabilities.PhysicalBlockSizeSpecified)
ataTwoValue.Add("Physical sector size",
$"{ataReport.ReadCapabilities.PhysicalBlockSize} bytes");
if(ataReport.ReadCapabilities.LongBlockSizeSpecified)
ataTwoValue.Add("READ LONG sector size", $"{ataReport.ReadCapabilities.LongBlockSize} bytes");
if(ataReport.ReadCapabilities.BlockSizeSpecified &&
ataReport.ReadCapabilities.PhysicalBlockSizeSpecified &&
ataReport.ReadCapabilities.BlockSize != ataReport.ReadCapabilities.PhysicalBlockSize &&
(ataReport.ReadCapabilities.LogicalAlignment & 0x8000) == 0x0000 &&
if(ataReport.ReadCapabilities
.BlockSizeSpecified &&
ataReport.ReadCapabilities
.PhysicalBlockSizeSpecified &&
ataReport.ReadCapabilities.BlockSize !=
ataReport.ReadCapabilities.PhysicalBlockSize &&
(ataReport.ReadCapabilities.LogicalAlignment & 0x8000) ==
0x0000 &&
(ataReport.ReadCapabilities.LogicalAlignment & 0x4000) == 0x4000)
ataOneValue
.Add($"Logical sector starts at offset {ataReport.ReadCapabilities.LogicalAlignment & 0x3FFF} from physical sector");
.Add($"Logical sector starts at offset {ataReport.ReadCapabilities.LogicalAlignment & 0x3FFF} from physical sector");
if(ataReport.ReadCapabilities.CHS != null && ataReport.ReadCapabilities.CurrentCHS != null)
{
int currentSectors = ataReport.ReadCapabilities.CurrentCHS.Cylinders *
ataReport.ReadCapabilities.CurrentCHS.Heads *
ataReport.ReadCapabilities.CurrentCHS.Heads *
ataReport.ReadCapabilities.CurrentCHS.Sectors;
ataTwoValue.Add("Cylinders",
$"{ataReport.ReadCapabilities.CHS.Cylinders} max., {ataReport.ReadCapabilities.CurrentCHS.Cylinders} current");
@@ -1431,11 +1541,12 @@ namespace DiscImageChef.Server.App_Start
else if(ataReport.ReadCapabilities.CHS != null)
{
int currentSectors = ataReport.ReadCapabilities.CHS.Cylinders *
ataReport.ReadCapabilities.CHS.Heads *
ataReport.ReadCapabilities.CHS.Heads *
ataReport.ReadCapabilities.CHS.Sectors;
ataTwoValue.Add("Cylinders", $"{ataReport.ReadCapabilities.CHS.Cylinders}");
ataTwoValue.Add("Heads", $"{ataReport.ReadCapabilities.CHS.Heads}");
ataTwoValue.Add("Sectors per track", $"{ataReport.ReadCapabilities.CHS.Sectors}");
ataTwoValue.Add("Cylinders",
$"{ataReport.ReadCapabilities.CHS.Cylinders}");
ataTwoValue.Add("Heads", $"{ataReport.ReadCapabilities.CHS.Heads}");
ataTwoValue.Add("Sectors per track", $"{ataReport.ReadCapabilities.CHS.Sectors}");
ataTwoValue.Add("Sectors addressable in CHS mode", $"{currentSectors}");
ataTwoValue.Add("Device size in CHS mode",
$"{(ulong)currentSectors * logicalsectorsize} bytes, {(ulong)currentSectors * logicalsectorsize / 1000 / 1000} Mb, {(double)((ulong)currentSectors * logicalsectorsize) / 1024 / 1024:F2} MiB");

View File

@@ -51,23 +51,27 @@ namespace DiscImageChef.Server.App_Start
{
string decoded;
if(evpd.page >= 0x01 && evpd.page <= 0x7F) decoded = EVPD.DecodeASCIIPage(evpd.value);
else if(evpd.page == 0x81) decoded = EVPD.PrettifyPage_81(evpd.value);
else if(evpd.page == 0x82) decoded = EVPD.DecodePage82(evpd.value);
else if(evpd.page == 0x83) decoded = EVPD.PrettifyPage_83(evpd.value);
else if(evpd.page == 0x84) decoded = EVPD.PrettifyPage_84(evpd.value);
else if(evpd.page == 0x85) decoded = EVPD.PrettifyPage_85(evpd.value);
else if(evpd.page == 0x86) decoded = EVPD.PrettifyPage_86(evpd.value);
else if(evpd.page == 0x89) decoded = EVPD.PrettifyPage_89(evpd.value);
else if(evpd.page == 0xB0) decoded = EVPD.PrettifyPage_B0(evpd.value);
else if(evpd.page == 0x81) decoded = EVPD.PrettifyPage_81(evpd.value);
else if(evpd.page == 0x82) decoded = EVPD.DecodePage82(evpd.value);
else if(evpd.page == 0x83) decoded = EVPD.PrettifyPage_83(evpd.value);
else if(evpd.page == 0x84) decoded = EVPD.PrettifyPage_84(evpd.value);
else if(evpd.page == 0x85) decoded = EVPD.PrettifyPage_85(evpd.value);
else if(evpd.page == 0x86) decoded = EVPD.PrettifyPage_86(evpd.value);
else if(evpd.page == 0x89) decoded = EVPD.PrettifyPage_89(evpd.value);
else if(evpd.page == 0xB0) decoded = EVPD.PrettifyPage_B0(evpd.value);
else if(evpd.page == 0xB2)
decoded = $"TapeAlert Supported Flags Bitmap: 0x{EVPD.DecodePageB2(evpd.value):X16}<br/>";
decoded =
$"TapeAlert Supported Flags Bitmap: 0x{EVPD.DecodePageB2(evpd.value):X16}<br/>";
else if(evpd.page == 0xB4) decoded = EVPD.DecodePageB4(evpd.value);
else if(evpd.page == 0xC0 && vendor.Trim() == "quantum")
decoded = EVPD.PrettifyPage_C0_Quantum(evpd.value);
else if(evpd.page == 0xC0 && vendor.Trim() == "seagate")
decoded = EVPD.PrettifyPage_C0_Seagate(evpd.value);
else if(evpd.page == 0xC0 && vendor.Trim() == "ibm") decoded = EVPD.PrettifyPage_C0_IBM(evpd.value);
else if(evpd.page == 0xC1 && vendor.Trim() == "ibm") decoded = EVPD.PrettifyPage_C1_IBM(evpd.value);
decoded =
EVPD.PrettifyPage_C0_Seagate(evpd.value);
else if(evpd.page == 0xC0 && vendor.Trim() == "ibm")
decoded = EVPD.PrettifyPage_C0_IBM(evpd.value);
else if(evpd.page == 0xC1 && vendor.Trim() == "ibm")
decoded = EVPD.PrettifyPage_C1_IBM(evpd.value);
else if((evpd.page == 0xC0 || evpd.page == 0xC1) && vendor.Trim() == "certance")
decoded = EVPD.PrettifyPage_C0_C1_Certance(evpd.value);
else if((evpd.page == 0xC2 || evpd.page == 0xC3 || evpd.page == 0xC4 || evpd.page == 0xC5 ||
@@ -77,7 +81,7 @@ namespace DiscImageChef.Server.App_Start
evpd.page == 0xC4 || evpd.page == 0xC5) &&
vendor.Trim() == "hp") decoded = EVPD.PrettifyPage_C0_to_C5_HP(evpd.value);
else if(evpd.page == 0xDF && vendor.Trim() == "certance")
decoded = EVPD.PrettifyPage_DF_Certance(evpd.value);
decoded = EVPD.PrettifyPage_DF_Certance(evpd.value);
else decoded = "Undecoded";
if(!string.IsNullOrEmpty(decoded)) decoded = decoded.Replace("\n", "<br/>");

View File

@@ -168,7 +168,7 @@ namespace DiscImageChef.Server.App_Start
break;
default:
scsiOneValue
.Add($"Device claims to comply with unknown SCSI ANSI standard value 0x{inquiry.ANSIVersion:X2})");
.Add($"Device claims to comply with unknown SCSI ANSI standard value 0x{inquiry.ANSIVersion:X2})");
break;
}
@@ -182,7 +182,7 @@ namespace DiscImageChef.Server.App_Start
break;
default:
scsiOneValue
.Add($"Device claims to comply with unknown SCSI ECMA standard value 0x{inquiry.ECMAVersion:X2})");
.Add($"Device claims to comply with unknown SCSI ECMA standard value 0x{inquiry.ECMAVersion:X2})");
break;
}
@@ -196,7 +196,7 @@ namespace DiscImageChef.Server.App_Start
break;
default:
scsiOneValue
.Add($"Device claims to comply with unknown SCSI ISO/IEC standard value 0x{inquiry.ISOVersion:X2})");
.Add($"Device claims to comply with unknown SCSI ISO/IEC standard value 0x{inquiry.ISOVersion:X2})");
break;
}
@@ -401,11 +401,11 @@ namespace DiscImageChef.Server.App_Start
break;
case 0x01DD:
scsiOneValue
.Add("Device complies with SES T10/1212 revision 08b w/ Amendment ANSI INCITS.305/AM1-2000");
.Add("Device complies with SES T10/1212 revision 08b w/ Amendment ANSI INCITS.305/AM1-2000");
break;
case 0x01DE:
scsiOneValue
.Add("Device complies with SES ANSI INCITS 305-1998 w/ Amendment ANSI INCITS.305/AM1-2000");
.Add("Device complies with SES ANSI INCITS 305-1998 w/ Amendment ANSI INCITS.305/AM1-2000");
break;
case 0x01E0:
scsiOneValue.Add("Device complies with SCC-2 (no version claimed)");
@@ -742,7 +742,7 @@ namespace DiscImageChef.Server.App_Start
break;
case 0x04E7:
scsiOneValue
.Add("Device complies with MMC-6 ANSI INCITS 468-2010 + MMC-6/AM1 ANSI INCITS 468-2010/AM 1");
.Add("Device complies with MMC-6 ANSI INCITS 468-2010 + MMC-6/AM1 ANSI INCITS 468-2010/AM 1");
break;
case 0x0500:
scsiOneValue.Add("Device complies with ADC-3 (no version claimed)");
@@ -1031,7 +1031,7 @@ namespace DiscImageChef.Server.App_Start
break;
case 0x0ABC:
scsiOneValue
.Add("Device complies with SPI ANSI INCITS 253-1995 with SPI Amnd ANSI INCITS 253/AM1-1998");
.Add("Device complies with SPI ANSI INCITS 253-1995 with SPI Amnd ANSI INCITS 253/AM1-1998");
break;
case 0x0AC0:
scsiOneValue.Add("Device complies with Fast-20 (no version claimed)");
@@ -1173,7 +1173,7 @@ namespace DiscImageChef.Server.App_Start
break;
case 0x0C4F:
scsiOneValue
.Add("Device complies with SAS-2.1 ANSI INCITS 478-2011 w/ Amnd 1 ANSI INCITS 478/AM1-2014");
.Add("Device complies with SAS-2.1 ANSI INCITS 478-2011 w/ Amnd 1 ANSI INCITS 478/AM1-2014");
break;
case 0x0C52:
scsiOneValue.Add("Device complies with SAS-2.1 ISO/IEC 14776-153");
@@ -1201,7 +1201,7 @@ namespace DiscImageChef.Server.App_Start
break;
case 0x0D3C:
scsiOneValue
.Add("Device complies with FC-PH ANSI INCITS 230-1994 with Amnd 1 ANSI INCITS 230/AM1-1996");
.Add("Device complies with FC-PH ANSI INCITS 230-1994 with Amnd 1 ANSI INCITS 230/AM1-1996");
break;
case 0x0D40:
scsiOneValue.Add("Device complies with FC-AL (no version claimed)");
@@ -1274,7 +1274,7 @@ namespace DiscImageChef.Server.App_Start
break;
case 0x0E03:
scsiOneValue
.Add("Device complies with FC-FS-2 ANSI INCITS 242-2007 with AM1 ANSI INCITS 242/AM1-2007");
.Add("Device complies with FC-FS-2 ANSI INCITS 242-2007 with AM1 ANSI INCITS 242/AM1-2007");
break;
case 0x0E20:
scsiOneValue.Add("Device complies with FC-LS (no version claimed)");
@@ -1332,7 +1332,7 @@ namespace DiscImageChef.Server.App_Start
break;
case 0x0EA6:
scsiOneValue
.Add("Device complies with FC 10GFC ANSI INCITS 364-2003 with AM1 ANSI INCITS 364/AM1-2007");
.Add("Device complies with FC 10GFC ANSI INCITS 364-2003 with AM1 ANSI INCITS 364/AM1-2007");
break;
case 0x0EC0:
scsiOneValue.Add("Device complies with FC-SP-2 (no version claimed)");
@@ -1513,22 +1513,22 @@ namespace DiscImageChef.Server.App_Start
break;
case 0x1621:
scsiOneValue
.Add("Device complies with ATA/ATAPI-8 ATA8-APT Parallel Transport (no version claimed)");
.Add("Device complies with ATA/ATAPI-8 ATA8-APT Parallel Transport (no version claimed)");
break;
case 0x1622:
scsiOneValue
.Add("Device complies with ATA/ATAPI-8 ATA8-AST Serial Transport (no version claimed)");
.Add("Device complies with ATA/ATAPI-8 ATA8-AST Serial Transport (no version claimed)");
break;
case 0x1623:
scsiOneValue
.Add("Device complies with ATA/ATAPI-8 ATA8-ACS ATA/ATAPI Command Set (no version claimed)");
.Add("Device complies with ATA/ATAPI-8 ATA8-ACS ATA/ATAPI Command Set (no version claimed)");
break;
case 0x1628:
scsiOneValue.Add("Device complies with ATA/ATAPI-8 ATA8-AAM ANSI INCITS 451-2008");
break;
case 0x162A:
scsiOneValue
.Add("Device complies with ATA/ATAPI-8 ATA8-ACS ANSI INCITS 452-2009 w/ Amendment 1");
.Add("Device complies with ATA/ATAPI-8 ATA8-ACS ANSI INCITS 452-2009 w/ Amendment 1");
break;
case 0x1728:
scsiOneValue.Add("Device complies with Universal Serial Bus Specification, Revision 1.1");
@@ -1538,7 +1538,7 @@ namespace DiscImageChef.Server.App_Start
break;
case 0x1730:
scsiOneValue
.Add("Device complies with USB Mass Storage Class Bulk-Only Transport, Revision 1.0");
.Add("Device complies with USB Mass Storage Class Bulk-Only Transport, Revision 1.0");
break;
case 0x1740:
scsiOneValue.Add("Device complies with UAS (no version claimed)");

View File

@@ -56,6 +56,7 @@ namespace DiscImageChef.Server.App_Start
if(ftr.BindingNonceBlocksSpecified)
mmcOneValue.Add($"{ftr.BindingNonceBlocks} media blocks are required for the binding nonce");
}
if(ftr.BlocksPerReadableUnit > 1)
mmcOneValue.Add($"{ftr.BlocksPerReadableUnit} logical blocks per media writable unit");
if(ftr.BufferUnderrunFreeInDVD) mmcOneValue.Add("Drive supports zero loss linking writing DVDs");
@@ -176,9 +177,10 @@ namespace DiscImageChef.Server.App_Start
if(ftr.CanWriteBusEncryptedBlocks) mmcOneValue.Add("Drive supports writing with bus encryption");
if(ftr.CanWriteCDRW) mmcOneValue.Add("Drive can write CD-RW");
if(ftr.CanWriteCDRWCAV) mmcOneValue.Add("Drive can write High-Speed CD-RW");
if(ftr.CanWriteCDSAO && !ftr.CanWriteRaw) mmcOneValue.Add("Drive can write CDs in Session at Once Mode:");
if(ftr.CanWriteCDSAO && !ftr.CanWriteRaw)
mmcOneValue.Add("Drive can write CDs in Session at Once Mode:");
else if(!ftr.CanWriteCDSAO && ftr.CanWriteRaw) mmcOneValue.Add("Drive can write CDs in raw Mode:");
else if(ftr.CanWriteCDSAO && ftr.CanWriteRaw)
else if(ftr.CanWriteCDSAO && ftr.CanWriteRaw)
mmcOneValue.Add("Drive can write CDs in Session at Once and in Raw Modes:");
if(ftr.CanWriteCDTAO) mmcOneValue.Add("Drive can write CDs in Track at Once Mode:");
if(ftr.CanWriteCSSManagedDVD) mmcOneValue.Add("Drive can write CSS managed DVDs");
@@ -211,6 +213,7 @@ namespace DiscImageChef.Server.App_Start
if(ftr.CanWritePackedSubchannelInTAO)
mmcOneValue.Add("Drive accepts Packed R-W subchannel data in Track at Once Mode");
}
if(ftr.CanWriteRWSubchannelInSAO)
mmcOneValue.Add("Drive can write user provided data in the R-W subchannels in Session at Once Mode");
if(ftr.CanWriteRaw && ftr.CanWriteRawMultiSession)
@@ -225,6 +228,7 @@ namespace DiscImageChef.Server.App_Start
mmcOneValue.Add($"Drive has {ftr.ChangerSlots + 1} slots");
}
if(ftr.SupportsCSS && ftr.CSSVersionSpecified)
mmcOneValue.Add($"Drive supports DVD CSS/CPPM version {ftr.CSSVersion}");
else if(ftr.SupportsCSS) mmcOneValue.Add("Drive supports DVD CSS/CPRM");

View File

@@ -95,6 +95,7 @@ namespace DiscImageChef.Server.App_Start
mmcOneValue.Add(mode.LockStatus
? "Drive is locked, media cannot be ejected, but if empty, can be inserted"
: "Drive is not locked, media can be ejected and inserted");
if(mode.CanEject) mmcOneValue.Add("Drive can eject media");
if(mode.SeparateChannelMute) mmcOneValue.Add("Each channel can be muted independently");
@@ -134,10 +135,10 @@ namespace DiscImageChef.Server.App_Start
{
if(mode.RotationControlSelected == 0)
mmcOneValue
.Add($"Drive's current writing speed is {mode.CurrentWriteSpeedSelected} Kbyte/sec. in CLV mode");
.Add($"Drive's current writing speed is {mode.CurrentWriteSpeedSelected} Kbyte/sec. in CLV mode");
else if(mode.RotationControlSelected == 1)
mmcOneValue
.Add($"Drive's current writing speed is {mode.CurrentWriteSpeedSelected} Kbyte/sec. in pure CAV mode");
.Add($"Drive's current writing speed is {mode.CurrentWriteSpeedSelected} Kbyte/sec. in pure CAV mode");
}
else
{
@@ -154,7 +155,7 @@ namespace DiscImageChef.Server.App_Start
mmcOneValue.Add($"Drive supports writing at {descriptor.WriteSpeed} Kbyte/sec. in CLV mode");
else if(descriptor.RotationControl == 1)
mmcOneValue
.Add($"Drive supports writing at is {descriptor.WriteSpeed} Kbyte/sec. in pure CAV mode");
.Add($"Drive supports writing at is {descriptor.WriteSpeed} Kbyte/sec. in pure CAV mode");
if(mode.TestWrite) mmcOneValue.Add("Drive supports test writing");

View File

@@ -47,8 +47,9 @@ namespace DiscImageChef.Server.App_Start
/// <param name="deviceType">SCSI peripheral device type</param>
/// <param name="scsiOneValue">List to put values on</param>
/// <param name="modePages">List to put key=value pairs on</param>
public static void Report(modeType modeSense, string vendor, PeripheralDeviceTypes deviceType,
ref List<string> scsiOneValue, ref Dictionary<string, string> modePages)
public static void Report(modeType modeSense, string vendor,
PeripheralDeviceTypes deviceType,
ref List<string> scsiOneValue, ref Dictionary<string, string> modePages)
{
if(modeSense.MediumTypeSpecified) scsiOneValue.Add($"Medium type is {modeSense.MediumType:X2}h");
if(modeSense.WriteProtected) scsiOneValue.Add("Device is write protected.");
@@ -56,8 +57,9 @@ namespace DiscImageChef.Server.App_Start
foreach(blockDescriptorType descriptor in modeSense.BlockDescriptors)
if(descriptor.BlocksSpecified && descriptor.BlockLengthSpecified)
scsiOneValue
.Add($"Density code {descriptor.Density:X2}h has {descriptor.Blocks} blocks of {descriptor.BlockLength} bytes each");
else scsiOneValue.Add($"Density code {descriptor.Density:X2}h");
.Add($"Density code {descriptor.Density:X2}h has {descriptor.Blocks} blocks of {descriptor.BlockLength} bytes each");
else
scsiOneValue.Add($"Density code {descriptor.Density:X2}h");
if(modeSense.DPOandFUA) scsiOneValue.Add("Drive supports DPO and FUA bits");
if(modeSense.BlankCheckEnabled) scsiOneValue.Add("Blank checking during write is enabled");
@@ -89,8 +91,8 @@ namespace DiscImageChef.Server.App_Start
modePages.Add($"MODE page {page.page:X2}h", Modes.PrettifyModePage_00_SFF(page.value));
else
modePages
.Add(page.subpage != 0 ? $"MODE page {page.page:X2}h subpage {page.subpage:X2}h" : $"MODE page {page.page:X2}h",
"Unknown vendor mode page");
.Add(page.subpage != 0 ? $"MODE page {page.page:X2}h subpage {page.subpage:X2}h" : $"MODE page {page.page:X2}h",
"Unknown vendor mode page");
break;
}
case 0x01:
@@ -367,8 +369,10 @@ namespace DiscImageChef.Server.App_Start
Dictionary<string, string> newModePages = new Dictionary<string, string>();
foreach(KeyValuePair<string, string> kvp in modePages)
if(string.IsNullOrWhiteSpace(kvp.Value)) newModePages.Add(kvp.Key, "Undecoded");
else newModePages.Add(kvp.Key, kvp.Value.Replace("\n", "<br/>"));
if(string.IsNullOrWhiteSpace(kvp.Value))
newModePages.Add(kvp.Key, "Undecoded");
else
newModePages.Add(kvp.Key, kvp.Value.Replace("\n", "<br/>"));
modePages = newModePages;
}

View File

@@ -80,13 +80,13 @@ namespace DiscImageChef.Server.App_Start
if(testedMedia.Blocks * testedMedia.BlockSize / 1024 / 1024 > 1000000)
mediaOneValue
.Add($"Medium size: {testedMedia.Blocks * testedMedia.BlockSize} bytes, {testedMedia.Blocks * testedMedia.BlockSize / 1000 / 1000 / 1000 / 1000} Tb, {(double)(testedMedia.Blocks * testedMedia.BlockSize) / 1024 / 1024 / 1024 / 1024:F2} TiB");
.Add($"Medium size: {testedMedia.Blocks * testedMedia.BlockSize} bytes, {testedMedia.Blocks * testedMedia.BlockSize / 1000 / 1000 / 1000 / 1000} Tb, {(double)(testedMedia.Blocks * testedMedia.BlockSize) / 1024 / 1024 / 1024 / 1024:F2} TiB");
else if(testedMedia.Blocks * testedMedia.BlockSize / 1024 / 1024 > 1000)
mediaOneValue
.Add($"Medium size: {testedMedia.Blocks * testedMedia.BlockSize} bytes, {testedMedia.Blocks * testedMedia.BlockSize / 1000 / 1000 / 1000} Gb, {(double)(testedMedia.Blocks * testedMedia.BlockSize) / 1024 / 1024 / 1024:F2} GiB");
.Add($"Medium size: {testedMedia.Blocks * testedMedia.BlockSize} bytes, {testedMedia.Blocks * testedMedia.BlockSize / 1000 / 1000 / 1000} Gb, {(double)(testedMedia.Blocks * testedMedia.BlockSize) / 1024 / 1024 / 1024:F2} GiB");
else
mediaOneValue
.Add($"Medium size: {testedMedia.Blocks * testedMedia.BlockSize} bytes, {testedMedia.Blocks * testedMedia.BlockSize / 1000 / 1000} Mb, {(double)(testedMedia.Blocks * testedMedia.BlockSize) / 1024 / 1024:F2} MiB");
.Add($"Medium size: {testedMedia.Blocks * testedMedia.BlockSize} bytes, {testedMedia.Blocks * testedMedia.BlockSize / 1000 / 1000} Mb, {(double)(testedMedia.Blocks * testedMedia.BlockSize) / 1024 / 1024:F2} MiB");
}
if(testedMedia.CHS != null && testedMedia.CurrentCHS != null)
@@ -94,14 +94,14 @@ namespace DiscImageChef.Server.App_Start
int currentSectors = testedMedia.CurrentCHS.Cylinders * testedMedia.CurrentCHS.Heads *
testedMedia.CurrentCHS.Sectors;
mediaOneValue
.Add($"Cylinders: {testedMedia.CHS.Cylinders} max., {testedMedia.CurrentCHS.Cylinders} current");
.Add($"Cylinders: {testedMedia.CHS.Cylinders} max., {testedMedia.CurrentCHS.Cylinders} current");
mediaOneValue.Add($"Heads: {testedMedia.CHS.Heads} max., {testedMedia.CurrentCHS.Heads} current");
mediaOneValue
.Add($"Sectors per track: {testedMedia.CHS.Sectors} max., {testedMedia.CurrentCHS.Sectors} current");
.Add($"Sectors per track: {testedMedia.CHS.Sectors} max., {testedMedia.CurrentCHS.Sectors} current");
mediaOneValue
.Add($"Sectors addressable in CHS mode: {testedMedia.CHS.Cylinders * testedMedia.CHS.Heads * testedMedia.CHS.Sectors} max., {currentSectors} current");
.Add($"Sectors addressable in CHS mode: {testedMedia.CHS.Cylinders * testedMedia.CHS.Heads * testedMedia.CHS.Sectors} max., {currentSectors} current");
mediaOneValue
.Add($"Medium size in CHS mode: {(ulong)currentSectors * testedMedia.BlockSize} bytes, {(ulong)currentSectors * testedMedia.BlockSize / 1000 / 1000} Mb, {(double)((ulong)currentSectors * testedMedia.BlockSize) / 1024 / 1024:F2} MiB");
.Add($"Medium size in CHS mode: {(ulong)currentSectors * testedMedia.BlockSize} bytes, {(ulong)currentSectors * testedMedia.BlockSize / 1000 / 1000} Mb, {(double)((ulong)currentSectors * testedMedia.BlockSize) / 1024 / 1024:F2} MiB");
}
else if(testedMedia.CHS != null)
{
@@ -111,7 +111,7 @@ namespace DiscImageChef.Server.App_Start
mediaOneValue.Add($"Sectors per track: {testedMedia.CHS.Sectors}");
mediaOneValue.Add($"Sectors addressable in CHS mode: {currentSectors}");
mediaOneValue
.Add($"Medium size in CHS mode: {(ulong)currentSectors * testedMedia.BlockSize} bytes, {(ulong)currentSectors * testedMedia.BlockSize / 1000 / 1000} Mb, {(double)((ulong)currentSectors * testedMedia.BlockSize) / 1024 / 1024:F2} MiB");
.Add($"Medium size in CHS mode: {(ulong)currentSectors * testedMedia.BlockSize} bytes, {(ulong)currentSectors * testedMedia.BlockSize / 1000 / 1000} Mb, {(double)((ulong)currentSectors * testedMedia.BlockSize) / 1024 / 1024:F2} MiB");
}
if(testedMedia.LBASectorsSpecified)
@@ -120,13 +120,13 @@ namespace DiscImageChef.Server.App_Start
if((ulong)testedMedia.LBASectors * testedMedia.BlockSize / 1024 / 1024 > 1000000)
mediaOneValue
.Add($"Medium size in 28-bit LBA mode: {(ulong)testedMedia.LBASectors * testedMedia.BlockSize} bytes, {(ulong)testedMedia.LBASectors * testedMedia.BlockSize / 1000 / 1000 / 1000 / 1000} Tb, {(double)((ulong)testedMedia.LBASectors * testedMedia.BlockSize) / 1024 / 1024 / 1024 / 1024:F2} TiB");
.Add($"Medium size in 28-bit LBA mode: {(ulong)testedMedia.LBASectors * testedMedia.BlockSize} bytes, {(ulong)testedMedia.LBASectors * testedMedia.BlockSize / 1000 / 1000 / 1000 / 1000} Tb, {(double)((ulong)testedMedia.LBASectors * testedMedia.BlockSize) / 1024 / 1024 / 1024 / 1024:F2} TiB");
else if((ulong)testedMedia.LBASectors * testedMedia.BlockSize / 1024 / 1024 > 1000)
mediaOneValue
.Add($"Medium size in 28-bit LBA mode: {(ulong)testedMedia.LBASectors * testedMedia.BlockSize} bytes, {(ulong)testedMedia.LBASectors * testedMedia.BlockSize / 1000 / 1000 / 1000} Gb, {(double)((ulong)testedMedia.LBASectors * testedMedia.BlockSize) / 1024 / 1024 / 1024:F2} GiB");
.Add($"Medium size in 28-bit LBA mode: {(ulong)testedMedia.LBASectors * testedMedia.BlockSize} bytes, {(ulong)testedMedia.LBASectors * testedMedia.BlockSize / 1000 / 1000 / 1000} Gb, {(double)((ulong)testedMedia.LBASectors * testedMedia.BlockSize) / 1024 / 1024 / 1024:F2} GiB");
else
mediaOneValue
.Add($"Medium size in 28-bit LBA mode: {(ulong)testedMedia.LBASectors * testedMedia.BlockSize} bytes, {(ulong)testedMedia.LBASectors * testedMedia.BlockSize / 1000 / 1000} Mb, {(double)((ulong)testedMedia.LBASectors * testedMedia.BlockSize) / 1024 / 1024:F2} MiB");
.Add($"Medium size in 28-bit LBA mode: {(ulong)testedMedia.LBASectors * testedMedia.BlockSize} bytes, {(ulong)testedMedia.LBASectors * testedMedia.BlockSize / 1000 / 1000} Mb, {(double)((ulong)testedMedia.LBASectors * testedMedia.BlockSize) / 1024 / 1024:F2} MiB");
}
if(testedMedia.LBA48SectorsSpecified)
@@ -135,27 +135,28 @@ namespace DiscImageChef.Server.App_Start
if(testedMedia.LBA48Sectors * testedMedia.BlockSize / 1024 / 1024 > 1000000)
mediaOneValue
.Add($"Medium size in 48-bit LBA mode: {testedMedia.LBA48Sectors * testedMedia.BlockSize} bytes, {testedMedia.LBA48Sectors * testedMedia.BlockSize / 1000 / 1000 / 1000 / 1000} Tb, {(double)(testedMedia.LBA48Sectors * testedMedia.BlockSize) / 1024 / 1024 / 1024 / 1024:F2} TiB");
.Add($"Medium size in 48-bit LBA mode: {testedMedia.LBA48Sectors * testedMedia.BlockSize} bytes, {testedMedia.LBA48Sectors * testedMedia.BlockSize / 1000 / 1000 / 1000 / 1000} Tb, {(double)(testedMedia.LBA48Sectors * testedMedia.BlockSize) / 1024 / 1024 / 1024 / 1024:F2} TiB");
else if(testedMedia.LBA48Sectors * testedMedia.BlockSize / 1024 / 1024 > 1000)
mediaOneValue
.Add($"Medium size in 48-bit LBA mode: {testedMedia.LBA48Sectors * testedMedia.BlockSize} bytes, {testedMedia.LBA48Sectors * testedMedia.BlockSize / 1000 / 1000 / 1000} Gb, {(double)(testedMedia.LBA48Sectors * testedMedia.BlockSize) / 1024 / 1024 / 1024:F2} GiB");
.Add($"Medium size in 48-bit LBA mode: {testedMedia.LBA48Sectors * testedMedia.BlockSize} bytes, {testedMedia.LBA48Sectors * testedMedia.BlockSize / 1000 / 1000 / 1000} Gb, {(double)(testedMedia.LBA48Sectors * testedMedia.BlockSize) / 1024 / 1024 / 1024:F2} GiB");
else
mediaOneValue
.Add($"Medium size in 48-bit LBA mode: {testedMedia.LBA48Sectors * testedMedia.BlockSize} bytes, {testedMedia.LBA48Sectors * testedMedia.BlockSize / 1000 / 1000} Mb, {(double)(testedMedia.LBA48Sectors * testedMedia.BlockSize) / 1024 / 1024:F2} MiB");
.Add($"Medium size in 48-bit LBA mode: {testedMedia.LBA48Sectors * testedMedia.BlockSize} bytes, {testedMedia.LBA48Sectors * testedMedia.BlockSize / 1000 / 1000} Mb, {(double)(testedMedia.LBA48Sectors * testedMedia.BlockSize) / 1024 / 1024:F2} MiB");
}
if(testedMedia.NominalRotationRateSpecified && testedMedia.NominalRotationRate != 0x0000 &&
testedMedia.NominalRotationRate != 0xFFFF)
testedMedia.NominalRotationRate != 0xFFFF)
mediaOneValue.Add(testedMedia.NominalRotationRate == 0x0001
? "Medium does not rotate."
: $"Medium rotates at {testedMedia.NominalRotationRate} rpm");
if(testedMedia.BlockSizeSpecified && testedMedia.PhysicalBlockSizeSpecified &&
testedMedia.BlockSize != testedMedia.PhysicalBlockSize &&
(testedMedia.LogicalAlignment & 0x8000) == 0x0000 &&
if(testedMedia.BlockSizeSpecified &&
testedMedia.PhysicalBlockSizeSpecified &&
testedMedia.BlockSize != testedMedia.PhysicalBlockSize &&
(testedMedia.LogicalAlignment & 0x8000) == 0x0000 &&
(testedMedia.LogicalAlignment & 0x4000) == 0x4000)
mediaOneValue
.Add($"Logical sector starts at offset {testedMedia.LogicalAlignment & 0x3FFF} from physical sector");
.Add($"Logical sector starts at offset {testedMedia.LogicalAlignment & 0x3FFF} from physical sector");
if(testedMedia.SupportsRead && ata)
mediaOneValue.Add("Device can use the READ SECTOR(S) command in CHS mode with this medium");
@@ -174,7 +175,7 @@ namespace DiscImageChef.Server.App_Start
mediaOneValue.Add("Device can use the READ SECTOR(S) command in 28-bit LBA mode with this medium");
if(testedMedia.SupportsReadRetryLba)
mediaOneValue
.Add("Device can use the READ SECTOR(S) RETRY command in 28-bit LBA mode with this medium");
.Add("Device can use the READ SECTOR(S) RETRY command in 28-bit LBA mode with this medium");
if(testedMedia.SupportsReadDmaLba)
mediaOneValue.Add("Device can use the READ DMA command in 28-bit LBA mode with this medium");
if(testedMedia.SupportsReadDmaRetryLba)
@@ -217,10 +218,10 @@ namespace DiscImageChef.Server.App_Start
mediaOneValue.Add("Device can use the READ CD command with MM:SS:FF addressing with this medium");
if(testedMedia.SupportsReadCdRaw)
mediaOneValue
.Add("Device can use the READ CD command with LBA addressing with this medium to read raw sector");
.Add("Device can use the READ CD command with LBA addressing with this medium to read raw sector");
if(testedMedia.SupportsReadCdMsfRaw)
mediaOneValue
.Add("Device can use the READ CD command with MM:SS:FF addressing with this medium read raw sector");
.Add("Device can use the READ CD command with MM:SS:FF addressing with this medium read raw sector");
if(testedMedia.SupportsHLDTSTReadRawDVD)
mediaOneValue.Add("Device can use the HL-DT-ST vendor READ DVD (RAW) command with this medium");
@@ -250,7 +251,7 @@ namespace DiscImageChef.Server.App_Start
mediaOneValue.Add("Device can correct subchannels when reading from this medium");
if(testedMedia.CanReadCorrectedSubchannelWithC2)
mediaOneValue
.Add("Device can correct subchannels and report the C2 pointers when reading from this medium");
.Add("Device can correct subchannels and report the C2 pointers when reading from this medium");
if(testedMedia.CanReadDCB)
mediaOneValue.Add("Device can read the Disc Control Blocks from this medium");
if(testedMedia.CanReadDDS)
@@ -279,14 +280,14 @@ namespace DiscImageChef.Server.App_Start
mediaOneValue.Add("Device can read the P to Q subchannels from this medium");
if(testedMedia.CanReadPQSubchannelWithC2)
mediaOneValue
.Add("Device can read the P to Q subchannels from this medium reporting the C2 pointers");
.Add("Device can read the P to Q subchannels from this medium reporting the C2 pointers");
if(testedMedia.CanReadPRI)
mediaOneValue.Add("Device can read the Pre-Recorded Information from this medium");
if(testedMedia.CanReadRWSubchannel)
mediaOneValue.Add("Device can read the R to W subchannels from this medium");
if(testedMedia.CanReadRWSubchannelWithC2)
mediaOneValue
.Add("Device can read the R to W subchannels from this medium reporting the C2 pointers");
.Add("Device can read the R to W subchannels from this medium reporting the C2 pointers");
if(testedMedia.CanReadRecordablePFI)
mediaOneValue.Add("Device can read the Physical Format Information from Lead-In from this medium");
if(testedMedia.CanReadSpareAreaInformation)

View File

@@ -37,10 +37,13 @@
<html>
<meta charset="UTF-8">
<head runat="server">
<link href="dos.css" rel="stylesheet" type="text/css"/>
<link href="dos.css"
rel="stylesheet"
type="text/css" />
<title>DiscImageChef's TODO</title>
<!-- Global site tag (gtag.js) - Google Analytics -->
<script async src="https://www.googletagmanager.com/gtag/js?id=UA-111466173-1"></script>
<script async
src="https://www.googletagmanager.com/gtag/js?id=UA-111466173-1"></script>
<script>
window.dataLayer = window.dataLayer || [];
@@ -51,13 +54,16 @@
gtag('config', 'UA-111466173-1');
</script>
</head>
<body id="body" runat="server">
<body id="body"
runat="server">
<p>
<a href="Default.aspx">Return to main page.</a><br/>
<a href="Default.aspx">Return to main page.</a><br />
DiscImageChef list of changes:
</p>
<div>
<velyo:MarkdownContent ID="todo" Path="~/docs/Changelog.md" runat="server"/>
<velyo:MarkdownContent ID="todo"
Path="~/docs/Changelog.md"
runat="server" />
</div>
</body>
</html>

View File

@@ -58,7 +58,7 @@ namespace DiscImageChef.Server.Controllers
try
{
DeviceReport newReport = new DeviceReport();
HttpRequest request = HttpContext.Current.Request;
HttpRequest request = HttpContext.Current.Request;
XmlSerializer xs = new XmlSerializer(newReport.GetType());
newReport = (DeviceReport)xs.Deserialize(request.InputStream);
@@ -69,7 +69,7 @@ namespace DiscImageChef.Server.Controllers
return response;
}
Random rng = new Random();
Random rng = new Random();
string filename = $"NewReport_{DateTime.UtcNow:yyyyMMddHHmmssfff}_{rng.Next()}.xml";
while(File.Exists(Path.Combine(HostingEnvironment.MapPath("~") ?? throw new InvalidOperationException(),
"Upload", filename)))
@@ -88,9 +88,9 @@ namespace DiscImageChef.Server.Controllers
// ReSharper disable once RedundantCatchClause
catch
{
#if DEBUG
#if DEBUG
throw;
#else
#else
response.Content = new StringContent("error", System.Text.Encoding.UTF8, "text/plain");
return response;
#endif

View File

@@ -60,8 +60,8 @@ namespace DiscImageChef.Server.Controllers
try
{
Stats newStats = new Stats();
HttpRequest request = HttpContext.Current.Request;
Stats newStats = new Stats();
HttpRequest request = HttpContext.Current.Request;
XmlSerializer xs = new XmlSerializer(newStats.GetType());
newStats = (Stats)xs.Deserialize(request.InputStream);
@@ -83,52 +83,55 @@ namespace DiscImageChef.Server.Controllers
}
Stats oldStats = new Stats();
xs = new XmlSerializer(oldStats.GetType());
xs = new XmlSerializer(oldStats.GetType());
oldStats = (Stats)xs.Deserialize(fs);
if(newStats.Commands != null)
if(oldStats.Commands == null) oldStats.Commands = newStats.Commands;
if(oldStats.Commands == null)
oldStats.Commands = newStats.Commands;
else
{
oldStats.Commands.Analyze += newStats.Commands.Analyze;
oldStats.Commands.Benchmark += newStats.Commands.Benchmark;
oldStats.Commands.Checksum += newStats.Commands.Checksum;
oldStats.Commands.Compare += newStats.Commands.Compare;
oldStats.Commands.Analyze += newStats.Commands.Analyze;
oldStats.Commands.Benchmark += newStats.Commands.Benchmark;
oldStats.Commands.Checksum += newStats.Commands.Checksum;
oldStats.Commands.Compare += newStats.Commands.Compare;
oldStats.Commands.CreateSidecar += newStats.Commands.CreateSidecar;
oldStats.Commands.Decode += newStats.Commands.Decode;
oldStats.Commands.DeviceInfo += newStats.Commands.DeviceInfo;
oldStats.Commands.DeviceReport += newStats.Commands.DeviceReport;
oldStats.Commands.DumpMedia += newStats.Commands.DumpMedia;
oldStats.Commands.Entropy += newStats.Commands.Entropy;
oldStats.Commands.Formats += newStats.Commands.Formats;
oldStats.Commands.MediaInfo += newStats.Commands.MediaInfo;
oldStats.Commands.MediaScan += newStats.Commands.MediaScan;
oldStats.Commands.PrintHex += newStats.Commands.PrintHex;
oldStats.Commands.Verify += newStats.Commands.Verify;
oldStats.Commands.Ls += newStats.Commands.Ls;
oldStats.Commands.ExtractFiles += newStats.Commands.ExtractFiles;
oldStats.Commands.ListDevices += newStats.Commands.ListDevices;
oldStats.Commands.Decode += newStats.Commands.Decode;
oldStats.Commands.DeviceInfo += newStats.Commands.DeviceInfo;
oldStats.Commands.DeviceReport += newStats.Commands.DeviceReport;
oldStats.Commands.DumpMedia += newStats.Commands.DumpMedia;
oldStats.Commands.Entropy += newStats.Commands.Entropy;
oldStats.Commands.Formats += newStats.Commands.Formats;
oldStats.Commands.MediaInfo += newStats.Commands.MediaInfo;
oldStats.Commands.MediaScan += newStats.Commands.MediaScan;
oldStats.Commands.PrintHex += newStats.Commands.PrintHex;
oldStats.Commands.Verify += newStats.Commands.Verify;
oldStats.Commands.Ls += newStats.Commands.Ls;
oldStats.Commands.ExtractFiles += newStats.Commands.ExtractFiles;
oldStats.Commands.ListDevices += newStats.Commands.ListDevices;
oldStats.Commands.ListEncodings += newStats.Commands.ListEncodings;
oldStats.Commands.ConvertImage += newStats.Commands.ConvertImage;
oldStats.Commands.ImageInfo += newStats.Commands.ImageInfo;
oldStats.Commands.ConvertImage += newStats.Commands.ConvertImage;
oldStats.Commands.ImageInfo += newStats.Commands.ImageInfo;
}
if(newStats.OperatingSystems != null)
if(oldStats.OperatingSystems == null) oldStats.OperatingSystems = newStats.OperatingSystems;
if(oldStats.OperatingSystems == null)
oldStats.OperatingSystems = newStats.OperatingSystems;
else
foreach(OsStats newNvs in newStats.OperatingSystems)
{
OsStats removeNvs = null;
OsStats addNvs = null;
OsStats addNvs = null;
foreach(OsStats oldNvs in
oldStats.OperatingSystems.Where(oldNvs => oldNvs.name == newNvs.name &&
oldNvs.version == newNvs.version))
foreach(OsStats oldNvs in oldStats.OperatingSystems.Where(oldNvs =>
oldNvs.name == newNvs.name &&
oldNvs.version ==
newNvs.version))
{
addNvs = new OsStats
{
name = oldNvs.name,
Value = oldNvs.Value + newNvs.Value,
name = oldNvs.name,
Value = oldNvs.Value + newNvs.Value,
version = oldNvs.version
};
removeNvs = oldNvs;
@@ -149,14 +152,14 @@ namespace DiscImageChef.Server.Controllers
else
{
OsStats removeNvs = null;
OsStats addNvs = null;
OsStats addNvs = null;
foreach(OsStats oldNvs in oldStats.OperatingSystems.Where(oldNvs => oldNvs.name == "Linux"))
{
addNvs = new OsStats
{
name = oldNvs.name,
Value = oldNvs.Value + 1,
name = oldNvs.name,
Value = oldNvs.Value + 1,
version = oldNvs.version
};
removeNvs = oldNvs;
@@ -173,17 +176,22 @@ namespace DiscImageChef.Server.Controllers
}
if(newStats.Versions != null)
if(oldStats.Versions == null) oldStats.Versions = newStats.Versions;
if(oldStats.Versions == null)
oldStats.Versions = newStats.Versions;
else
foreach(NameValueStats newNvs in newStats.Versions)
{
NameValueStats removeNvs = null;
NameValueStats addNvs = null;
NameValueStats addNvs = null;
foreach(NameValueStats oldNvs in
oldStats.Versions.Where(oldNvs => oldNvs.name == newNvs.name))
{
addNvs = new NameValueStats {name = oldNvs.name, Value = oldNvs.Value + newNvs.Value};
addNvs = new NameValueStats
{
name = oldNvs.name,
Value = oldNvs.Value + newNvs.Value
};
removeNvs = oldNvs;
break;
}
@@ -203,11 +211,11 @@ namespace DiscImageChef.Server.Controllers
else
{
NameValueStats removeNvs = null;
NameValueStats addNvs = null;
NameValueStats addNvs = null;
foreach(NameValueStats oldNvs in oldStats.Versions.Where(oldNvs => oldNvs.name == "previous"))
{
addNvs = new NameValueStats {name = oldNvs.name, Value = oldNvs.Value + 1};
addNvs = new NameValueStats {name = oldNvs.name, Value = oldNvs.Value + 1};
removeNvs = oldNvs;
break;
}
@@ -222,17 +230,22 @@ namespace DiscImageChef.Server.Controllers
}
if(newStats.Filesystems != null)
if(oldStats.Filesystems == null) oldStats.Filesystems = newStats.Filesystems;
if(oldStats.Filesystems == null)
oldStats.Filesystems = newStats.Filesystems;
else
foreach(NameValueStats newNvs in newStats.Filesystems)
{
NameValueStats removeNvs = null;
NameValueStats addNvs = null;
NameValueStats addNvs = null;
foreach(NameValueStats oldNvs in
oldStats.Filesystems.Where(oldNvs => oldNvs.name == newNvs.name))
{
addNvs = new NameValueStats {name = oldNvs.name, Value = oldNvs.Value + newNvs.Value};
addNvs = new NameValueStats
{
name = oldNvs.name,
Value = oldNvs.Value + newNvs.Value
};
removeNvs = oldNvs;
break;
}
@@ -246,17 +259,22 @@ namespace DiscImageChef.Server.Controllers
}
if(newStats.Partitions != null)
if(oldStats.Partitions == null) oldStats.Partitions = newStats.Partitions;
if(oldStats.Partitions == null)
oldStats.Partitions = newStats.Partitions;
else
foreach(NameValueStats newNvs in newStats.Partitions)
{
NameValueStats removeNvs = null;
NameValueStats addNvs = null;
NameValueStats addNvs = null;
foreach(NameValueStats oldNvs in
oldStats.Partitions.Where(oldNvs => oldNvs.name == newNvs.name))
{
addNvs = new NameValueStats {name = oldNvs.name, Value = oldNvs.Value + newNvs.Value};
addNvs = new NameValueStats
{
name = oldNvs.name,
Value = oldNvs.Value + newNvs.Value
};
removeNvs = oldNvs;
break;
}
@@ -270,17 +288,22 @@ namespace DiscImageChef.Server.Controllers
}
if(newStats.MediaImages != null)
if(oldStats.MediaImages == null) oldStats.MediaImages = newStats.MediaImages;
if(oldStats.MediaImages == null)
oldStats.MediaImages = newStats.MediaImages;
else
foreach(NameValueStats newNvs in newStats.MediaImages)
{
NameValueStats removeNvs = null;
NameValueStats addNvs = null;
NameValueStats addNvs = null;
foreach(NameValueStats oldNvs in
oldStats.MediaImages.Where(oldNvs => oldNvs.name == newNvs.name))
{
addNvs = new NameValueStats {name = oldNvs.name, Value = oldNvs.Value + newNvs.Value};
addNvs = new NameValueStats
{
name = oldNvs.name,
Value = oldNvs.Value + newNvs.Value
};
removeNvs = oldNvs;
break;
}
@@ -294,17 +317,22 @@ namespace DiscImageChef.Server.Controllers
}
if(newStats.Filters != null)
if(oldStats.Filters == null) oldStats.Filters = newStats.Filters;
if(oldStats.Filters == null)
oldStats.Filters = newStats.Filters;
else
foreach(NameValueStats newNvs in newStats.Filters)
{
NameValueStats removeNvs = null;
NameValueStats addNvs = null;
NameValueStats addNvs = null;
foreach(NameValueStats oldNvs in
oldStats.Filters.Where(oldNvs => oldNvs.name == newNvs.name))
{
addNvs = new NameValueStats {name = oldNvs.name, Value = oldNvs.Value + newNvs.Value};
addNvs = new NameValueStats
{
name = oldNvs.name,
Value = oldNvs.Value + newNvs.Value
};
removeNvs = oldNvs;
break;
}
@@ -318,35 +346,38 @@ namespace DiscImageChef.Server.Controllers
}
if(newStats.Devices != null)
if(oldStats.Devices == null) oldStats.Devices = newStats.Devices;
if(oldStats.Devices == null)
oldStats.Devices = newStats.Devices;
else
foreach(DeviceStats newDev in from newDev in newStats.Devices
let found =
oldStats.Devices.Any(oldDev =>
oldDev.Manufacturer ==
newDev.Manufacturer &&
oldDev.Model == newDev.Model &&
newDev.Manufacturer &&
oldDev.Model == newDev.Model &&
oldDev.Revision == newDev.Revision &&
oldDev.Bus == newDev.Bus)
oldDev.Bus == newDev.Bus)
where !found
select newDev) oldStats.Devices.Add(newDev);
select newDev)
oldStats.Devices.Add(newDev);
if(newStats.Medias != null)
if(oldStats.Medias == null) oldStats.Medias = newStats.Medias;
if(oldStats.Medias == null)
oldStats.Medias = newStats.Medias;
else
foreach(MediaStats newMstat in newStats.Medias)
{
MediaStats removeMstat = null;
MediaStats addMstat = null;
MediaStats addMstat = null;
foreach(MediaStats oldMstat in
oldStats.Medias.Where(oldMstat => oldMstat.real == newMstat.real &&
oldMstat.type == newMstat.type))
foreach(MediaStats oldMstat in oldStats.Medias.Where(oldMstat =>
oldMstat.real == newMstat.real &&
oldMstat.type == newMstat.type))
{
addMstat = new MediaStats
{
real = oldMstat.real,
type = oldMstat.type,
real = oldMstat.real,
type = oldMstat.type,
Value = oldMstat.Value + newMstat.Value
};
removeMstat = oldMstat;
@@ -362,40 +393,42 @@ namespace DiscImageChef.Server.Controllers
}
if(newStats.MediaScan != null)
if(oldStats.MediaScan == null) oldStats.MediaScan = newStats.MediaScan;
if(oldStats.MediaScan == null)
oldStats.MediaScan = newStats.MediaScan;
else
{
if(oldStats.MediaScan.Sectors == null) oldStats.MediaScan.Sectors = newStats.MediaScan.Sectors;
else
{
oldStats.MediaScan.Sectors.Correct = newStats.MediaScan.Sectors.Correct;
oldStats.MediaScan.Sectors.Error = newStats.MediaScan.Sectors.Error;
oldStats.MediaScan.Sectors.Total = newStats.MediaScan.Sectors.Total;
oldStats.MediaScan.Sectors.Correct = newStats.MediaScan.Sectors.Correct;
oldStats.MediaScan.Sectors.Error = newStats.MediaScan.Sectors.Error;
oldStats.MediaScan.Sectors.Total = newStats.MediaScan.Sectors.Total;
oldStats.MediaScan.Sectors.Unverifiable = newStats.MediaScan.Sectors.Unverifiable;
}
if(oldStats.MediaScan.Times == null) oldStats.MediaScan.Times = newStats.MediaScan.Times;
else
{
oldStats.MediaScan.Times.LessThan10ms = newStats.MediaScan.Times.LessThan10ms;
oldStats.MediaScan.Times.LessThan10ms = newStats.MediaScan.Times.LessThan10ms;
oldStats.MediaScan.Times.LessThan150ms = newStats.MediaScan.Times.LessThan150ms;
oldStats.MediaScan.Times.LessThan3ms = newStats.MediaScan.Times.LessThan3ms;
oldStats.MediaScan.Times.LessThan3ms = newStats.MediaScan.Times.LessThan3ms;
oldStats.MediaScan.Times.LessThan500ms = newStats.MediaScan.Times.LessThan500ms;
oldStats.MediaScan.Times.LessThan50ms = newStats.MediaScan.Times.LessThan50ms;
oldStats.MediaScan.Times.LessThan50ms = newStats.MediaScan.Times.LessThan50ms;
oldStats.MediaScan.Times.MoreThan500ms = newStats.MediaScan.Times.MoreThan500ms;
}
}
if(newStats.Verify != null)
if(oldStats.Verify == null) oldStats.Verify = newStats.Verify;
if(oldStats.Verify == null)
oldStats.Verify = newStats.Verify;
else
{
if(oldStats.Verify.Sectors == null) oldStats.Verify.Sectors = newStats.Verify.Sectors;
else
{
oldStats.Verify.Sectors.Correct = newStats.Verify.Sectors.Correct;
oldStats.Verify.Sectors.Error = newStats.Verify.Sectors.Error;
oldStats.Verify.Sectors.Total = newStats.Verify.Sectors.Total;
oldStats.Verify.Sectors.Correct = newStats.Verify.Sectors.Correct;
oldStats.Verify.Sectors.Error = newStats.Verify.Sectors.Error;
oldStats.Verify.Sectors.Total = newStats.Verify.Sectors.Total;
oldStats.Verify.Sectors.Unverifiable = newStats.Verify.Sectors.Unverifiable;
}
@@ -404,7 +437,7 @@ namespace DiscImageChef.Server.Controllers
else
{
oldStats.Verify.MediaImages.Correct = newStats.Verify.MediaImages.Correct;
oldStats.Verify.MediaImages.Failed = newStats.Verify.MediaImages.Failed;
oldStats.Verify.MediaImages.Failed = newStats.Verify.MediaImages.Failed;
}
}
@@ -413,7 +446,7 @@ namespace DiscImageChef.Server.Controllers
.ThenBy(device => device.Model).ThenBy(device => device.Revision)
.ThenBy(device => device.Bus).ToList();
Random rng = new Random();
Random rng = new Random();
string filename = $"BackupStats_{DateTime.UtcNow:yyyyMMddHHmmssfff}_{rng.Next()}.xml";
while(File.Exists(Path.Combine(HostingEnvironment.MapPath("~"), "Statistics", filename)))
filename = $"BackupStats_{DateTime.UtcNow:yyyyMMddHHmmssfff}_{rng.Next()}.xml";
@@ -435,10 +468,10 @@ namespace DiscImageChef.Server.Controllers
}
catch(Exception ex)
{
#if DEBUG
#if DEBUG
System.Console.WriteLine("{0} {1}", ex.Message, ex.InnerException);
throw;
#else
#else
response.Content = new StringContent("error", System.Text.Encoding.UTF8, "text/plain");
return response;
#endif

View File

@@ -37,10 +37,13 @@
<html>
<meta charset="UTF-8">
<head runat="server">
<link href="dos.css" rel="stylesheet" type="text/css"/>
<link href="dos.css"
rel="stylesheet"
type="text/css" />
<title>DiscImageChef's TODO</title>
<!-- Global site tag (gtag.js) - Google Analytics -->
<script async src="https://www.googletagmanager.com/gtag/js?id=UA-111466173-1"></script>
<script async
src="https://www.googletagmanager.com/gtag/js?id=UA-111466173-1"></script>
<script>
window.dataLayer = window.dataLayer || [];
@@ -51,13 +54,16 @@
gtag('config', 'UA-111466173-1');
</script>
</head>
<body id="body" runat="server">
<body id="body"
runat="server">
<p>
<a href="Default.aspx">Return to main page.</a><br/>
<a href="Default.aspx">Return to main page.</a><br />
DiscImageChef list of things to be donated:
</p>
<div>
<velyo:MarkdownContent ID="todo" Path="~/docs/DONATING.md" runat="server"/>
<velyo:MarkdownContent ID="todo"
Path="~/docs/DONATING.md"
runat="server" />
</div>
</body>
</html>

View File

@@ -36,10 +36,13 @@
<html>
<meta charset="UTF-8">
<head runat="server">
<link href="dos.css" rel="stylesheet" type="text/css"/>
<link href="dos.css"
rel="stylesheet"
type="text/css" />
<title>DiscImageChef</title>
<!-- Global site tag (gtag.js) - Google Analytics -->
<script async src="https://www.googletagmanager.com/gtag/js?id=UA-111466173-1"></script>
<script async
src="https://www.googletagmanager.com/gtag/js?id=UA-111466173-1"></script>
<script>
window.dataLayer = window.dataLayer || [];
@@ -50,11 +53,18 @@
gtag('config', 'UA-111466173-1');
</script>
</head>
<body id="body" runat="server">
<body id="body"
runat="server">
<h1 align="center">
Welcome to <i>
<a href="http://github.com/claunia/discimagechef" target="_blank">DiscImageChef</a>
</i> Server version <asp:Label id="lblVersion" runat="server"/>
Welcome to
<i>
<a href="http://github.com/claunia/discimagechef"
target="_blank">
DiscImageChef
</a>
</i> Server version
<asp:Label id="lblVersion"
runat="server" />
</h1>
</body>
</html>

View File

@@ -36,10 +36,13 @@
<html>
<meta charset="UTF-8">
<head runat="server">
<link href="dos.css" rel="stylesheet" type="text/css"/>
<link href="dos.css"
rel="stylesheet"
type="text/css" />
<title>DiscImageChef Statistics</title>
<!-- Global site tag (gtag.js) - Google Analytics -->
<script async src="https://www.googletagmanager.com/gtag/js?id=UA-111466173-1"></script>
<script async
src="https://www.googletagmanager.com/gtag/js?id=UA-111466173-1"></script>
<script>
window.dataLayer = window.dataLayer || [];
@@ -50,212 +53,306 @@
gtag('config', 'UA-111466173-1');
</script>
</head>
<body id="body" runat="server">
<body id="body"
runat="server">
<h1 align="center">
Welcome to
<i>
<a href="http://github.com/claunia/discimagechef" target="_blank">DiscImageChef</a>
</i> Server version <asp:Label id="lblVersion" runat="server"/>
<a href="http://github.com/claunia/discimagechef"
target="_blank">
DiscImageChef
</a>
</i> Server version
<asp:Label id="lblVersion"
runat="server" />
</h1>
<br/>
<div id="content" runat="server">
<div id="divOperatingSystems" runat="server">
<br />
<div id="content"
runat="server">
<div id="divOperatingSystems"
runat="server">
<table>
<asp:Repeater id="repOperatingSystems" runat="server">
<asp:Repeater id="repOperatingSystems"
runat="server">
<ItemTemplate>
<tr>
<td>
DiscImageChef has run on
<i>
<asp:Label runat="server" Text='<%# Eval("name") %>'/>
</i> <asp:Label runat="server" Text='<%# Eval("Value") %>'/> times.
<asp:Label runat="server"
Text='<%# Eval("name") %>' />
</i>
<asp:Label runat="server"
Text='<%# Eval("Value") %>' /> times.
</td>
</tr>
</ItemTemplate>
</asp:Repeater>
</table>
<br/>
<br />
</div>
<div id="divVersions" runat="server">
<div id="divVersions"
runat="server">
<table>
<asp:Repeater id="repVersions" runat="server">
<asp:Repeater id="repVersions"
runat="server">
<ItemTemplate>
<tr>
<td>
DiscImageChef version
<i>
<asp:Label runat="server" Text='<%# Eval("name") %>'/>
</i> has been used <asp:Label runat="server" Text='<%# Eval("Value") %>'/> times.
<asp:Label runat="server"
Text='<%# Eval("name") %>' />
</i> has been used
<asp:Label runat="server"
Text='<%# Eval("Value") %>' /> times.
</td>
</tr>
</ItemTemplate>
</asp:Repeater>
</table>
<br/>
<br />
</div>
<div id="divCommands" runat="server">
<div id="divCommands"
runat="server">
<h4>Commands run:</h4>
<p>
<i>analyze</i> command has been run <asp:Label id="lblAnalyze" runat="server"/> times<br/>
<i>benchmark</i> command has been run <asp:Label id="lblBenchmark" runat="server"/> times<br/>
<i>checksum</i> command has been run <asp:Label id="lblChecksum" runat="server"/> times<br/>
<i>compare</i> command has been run <asp:Label id="lblCompare" runat="server"/> times<br/>
<i>convert-image</i> command has been run <asp:Label id="lblConvertImage" runat="server"/> times<br/>
<i>create-sidecar</i> command has been run <asp:Label id="lblCreateSidecar" runat="server"/> times<br/>
<i>decode</i> command has been run <asp:Label id="lblDecode" runat="server"/> times<br/>
<i>device-info</i> command has been run <asp:Label id="lblDeviceInfo" runat="server"/> times<br/>
<i>device-report</i> command has been run <asp:Label id="lblDeviceReport" runat="server"/> times<br/>
<i>dump-media</i> command has been run <asp:Label id="lblDumpMedia" runat="server"/> times<br/>
<i>entropy</i> command has been run <asp:Label id="lblEntropy" runat="server"/> times<br/>
<i>extract-files</i> command has been run <asp:Label id="lblExtractFiles" runat="server"/> times<br/>
<i>formats</i> command has been run <asp:Label id="lblFormats" runat="server"/> times<br/>
<i>image-info</i> command has been run <asp:Label id="lblImageInfo" runat="server"/> times<br/>
<i>list-devices</i> command has been run <asp:Label id="lblListDevices" runat="server"/> times<br/>
<i>list-encodings</i> command has been run <asp:Label id="lblListEncodings" runat="server"/> times<br/>
<i>ls</i> command has been run <asp:Label id="lblLs" runat="server"/> times<br/>
<i>media-info</i> command has been run <asp:Label id="lblMediaInfo" runat="server"/> times<br/>
<i>media-scan</i> command has been run <asp:Label id="lblMediaScan" runat="server"/> times<br/>
<i>printhex</i> command has been run <asp:Label id="lblPrintHex" runat="server"/> times<br/>
<i>verify</i> command has been run <asp:Label id="lblVerify" runat="server"/> times
<i>analyze</i> command has been run
<asp:Label id="lblAnalyze"
runat="server" /> times<br />
<i>benchmark</i> command has been run
<asp:Label id="lblBenchmark"
runat="server" /> times<br />
<i>checksum</i> command has been run
<asp:Label id="lblChecksum"
runat="server" /> times<br />
<i>compare</i> command has been run
<asp:Label id="lblCompare"
runat="server" /> times<br />
<i>convert-image</i> command has been run
<asp:Label id="lblConvertImage"
runat="server" /> times<br />
<i>create-sidecar</i> command has been run
<asp:Label id="lblCreateSidecar"
runat="server" /> times<br />
<i>decode</i> command has been run
<asp:Label id="lblDecode"
runat="server" /> times<br />
<i>device-info</i> command has been run
<asp:Label id="lblDeviceInfo"
runat="server" /> times<br />
<i>device-report</i> command has been run
<asp:Label id="lblDeviceReport"
runat="server" /> times<br />
<i>dump-media</i> command has been run
<asp:Label id="lblDumpMedia"
runat="server" /> times<br />
<i>entropy</i> command has been run
<asp:Label id="lblEntropy"
runat="server" /> times<br />
<i>extract-files</i> command has been run
<asp:Label id="lblExtractFiles"
runat="server" /> times<br />
<i>formats</i> command has been run
<asp:Label id="lblFormats"
runat="server" /> times<br />
<i>image-info</i> command has been run
<asp:Label id="lblImageInfo"
runat="server" /> times<br />
<i>list-devices</i> command has been run
<asp:Label id="lblListDevices"
runat="server" /> times<br />
<i>list-encodings</i> command has been run
<asp:Label id="lblListEncodings"
runat="server" /> times<br />
<i>ls</i> command has been run
<asp:Label id="lblLs"
runat="server" /> times<br />
<i>media-info</i> command has been run
<asp:Label id="lblMediaInfo"
runat="server" /> times<br />
<i>media-scan</i> command has been run
<asp:Label id="lblMediaScan"
runat="server" /> times<br />
<i>printhex</i> command has been run
<asp:Label id="lblPrintHex"
runat="server" /> times<br />
<i>verify</i> command has been run
<asp:Label id="lblVerify"
runat="server" /> times
</p>
</div>
<div id="divFilters" runat="server">
<div id="divFilters"
runat="server">
<h3>Filters found:</h3>
<table align="center" border="1">
<table align="center"
border="1">
<tr>
<th>Filter</th>
<th>Times</th>
</tr>
<asp:Repeater ID="repFilters" runat="server">
<asp:Repeater ID="repFilters"
runat="server">
<ItemTemplate>
<tr>
<td>
<asp:Label runat="server" Text='<%# Eval("name") %>'/>
<asp:Label runat="server"
Text='<%# Eval("name") %>' />
</td>
<td>
<asp:Label runat="server" Text='<%# string.Format("{0}", Eval("Value")) %>'/>
<asp:Label runat="server"
Text='<%# string.Format("{0}", Eval("Value")) %>' />
</td>
</tr>
</ItemTemplate>
</asp:Repeater>
</table>
</div>
<div id="divMediaImages" runat="server">
<div id="divMediaImages"
runat="server">
<h3>Media image formats found:</h3>
<table align="center" border="1">
<table align="center"
border="1">
<tr>
<th>Media image format</th>
<th>Times</th>
</tr>
<asp:Repeater ID="repMediaImages" runat="server">
<asp:Repeater ID="repMediaImages"
runat="server">
<ItemTemplate>
<tr>
<td>
<asp:Label runat="server" Text='<%# Eval("name") %>'/>
<asp:Label runat="server"
Text='<%# Eval("name") %>' />
</td>
<td>
<asp:Label runat="server" Text='<%# string.Format("{0}", Eval("value")) %>'/>
<asp:Label runat="server"
Text='<%# string.Format("{0}", Eval("value")) %>' />
</td>
</tr>
</ItemTemplate>
</asp:Repeater>
</table>
</div>
<div id="divPartitions" runat="server">
<div id="divPartitions"
runat="server">
<h3>Partition schemes found:</h3>
<table align="center" border="1">
<table align="center"
border="1">
<tr>
<th>Partition scheme</th>
<th>Times</th>
</tr>
<asp:Repeater ID="repPartitions" runat="server">
<asp:Repeater ID="repPartitions"
runat="server">
<ItemTemplate>
<tr>
<td>
<asp:Label runat="server" Text='<%# Eval("name") %>'/>
<asp:Label runat="server"
Text='<%# Eval("name") %>' />
</td>
<td>
<asp:Label runat="server" Text='<%# string.Format("{0}", Eval("value")) %>'/>
<asp:Label runat="server"
Text='<%# string.Format("{0}", Eval("value")) %>' />
</td>
</tr>
</ItemTemplate>
</asp:Repeater>
</table>
</div>
<div id="divFilesystems" runat="server">
<div id="divFilesystems"
runat="server">
<h3>Filesystems found:</h3>
<table align="center" border="1">
<table align="center"
border="1">
<tr>
<th>Filesystem name</th>
<th>Times</th>
</tr>
<asp:Repeater ID="repFilesystems" runat="server">
<asp:Repeater ID="repFilesystems"
runat="server">
<ItemTemplate>
<tr>
<td>
<asp:Label runat="server" Text='<%# Eval("name") %>'/>
<asp:Label runat="server"
Text='<%# Eval("name") %>' />
</td>
<td>
<asp:Label runat="server" Text='<%# string.Format("{0}", Eval("value")) %>'/>
<asp:Label runat="server"
Text='<%# string.Format("{0}", Eval("value")) %>' />
</td>
</tr>
</ItemTemplate>
</asp:Repeater>
</table>
</div>
<div id="divVirtualMedia" runat="server">
<div id="divVirtualMedia"
runat="server">
<h3>Media types found in images:</h3>
<table align="center" border="1">
<table align="center"
border="1">
<tr>
<th>Physical type</th>
<th>Logical type</th>
<th>Times</th>
</tr>
<asp:Repeater ID="repVirtualMedia" runat="server">
<asp:Repeater ID="repVirtualMedia"
runat="server">
<ItemTemplate>
<tr>
<td>
<asp:Label runat="server" Text='<%# Eval("Type") %>'/>
<asp:Label runat="server"
Text='<%# Eval("Type") %>' />
</td>
<td>
<asp:Label runat="server" Text='<%# Eval("SubType") %>'/>
<asp:Label runat="server"
Text='<%# Eval("SubType") %>' />
</td>
<td>
<asp:Label runat="server" Text='<%# string.Format("{0}", Eval("Count")) %>'/>
<asp:Label runat="server"
Text='<%# string.Format("{0}", Eval("Count")) %>' />
</td>
</tr>
</ItemTemplate>
</asp:Repeater>
</table>
</div>
<div id="divRealMedia" runat="server">
<div id="divRealMedia"
runat="server">
<h3>Media types found in devices:</h3>
<table align="center" border="1">
<table align="center"
border="1">
<tr>
<th>Physical type</th>
<th>Logical type</th>
<th>Times</th>
</tr>
<asp:Repeater ID="repRealMedia" runat="server">
<asp:Repeater ID="repRealMedia"
runat="server">
<ItemTemplate>
<tr>
<td>
<asp:Label runat="server" Text='<%# Eval("Type") %>'/>
<asp:Label runat="server"
Text='<%# Eval("Type") %>' />
</td>
<td>
<asp:Label runat="server" Text='<%# Eval("SubType") %>'/>
<asp:Label runat="server"
Text='<%# Eval("SubType") %>' />
</td>
<td>
<asp:Label runat="server" Text='<%# string.Format("{0}", Eval("Count")) %>'/>
<asp:Label runat="server"
Text='<%# string.Format("{0}", Eval("Count")) %>' />
</td>
</tr>
</ItemTemplate>
</asp:Repeater>
</table>
</div>
<div id="divDevices" runat="server">
<div id="divDevices"
runat="server">
<h3>Found devices:</h3>
<table align="center" border="1">
<table align="center"
border="1">
<tr>
<th>Manufacturer</th>
<th>Model</th>
@@ -263,23 +360,29 @@
<th>Bus</th>
<th>Report</th>
</tr>
<asp:Repeater ID="repDevices" runat="server">
<asp:Repeater ID="repDevices"
runat="server">
<ItemTemplate>
<tr>
<td>
<asp:Label runat="server" Text='<%# Eval("Manufacturer") %>'/>
<asp:Label runat="server"
Text='<%# Eval("Manufacturer") %>' />
</td>
<td>
<asp:Label runat="server" Text='<%# Eval("Model") %>'/>
<asp:Label runat="server"
Text='<%# Eval("Model") %>' />
</td>
<td>
<asp:Label runat="server" Text='<%# Eval("Revision") %>'/>
<asp:Label runat="server"
Text='<%# Eval("Revision") %>' />
</td>
<td>
<asp:Label runat="server" Text='<%# Eval("Bus") %>'/>
<asp:Label runat="server"
Text='<%# Eval("Bus") %>' />
</td>
<td>
<asp:Label runat="server" Text='<%# Eval("ReportLink") %>'/>
<asp:Label runat="server"
Text='<%# Eval("ReportLink") %>' />
</td>
</tr>
</ItemTemplate>
@@ -287,11 +390,23 @@
</table>
</div>
</div>
<hr/>
<hr />
<footer>
© 2011-2018 <a href="http://www.claunia.com" target="_blank">Claunia.com</a><br/>
Fonts are © 2015-2016 <a href="http://int10h.org" target="_blank">VileR</a><br/>
CSS © 2017 <a href="http://www.freedos.org" target="_blank">The FreeDOS Project</a>
© 2011-2018
<a href="http://www.claunia.com"
target="_blank">
Claunia.com
</a><br />
Fonts are © 2015-2016
<a href="http://int10h.org"
target="_blank">
VileR
</a><br />
CSS © 2017
<a href="http://www.freedos.org"
target="_blank">
The FreeDOS Project
</a>
</footer>
</body>
</html>

View File

@@ -80,7 +80,7 @@ namespace DiscImageChef.Server
statistics = new Stats();
XmlSerializer xs = new XmlSerializer(statistics.GetType());
FileStream fs =
FileStream fs =
WaitForFile(Path.Combine(HostingEnvironment.MapPath("~") ?? throw new InvalidOperationException(), "Statistics", "Statistics.xml"),
FileMode.Open, FileAccess.Read, FileShare.Read);
statistics = (Stats)xs.Deserialize(fs);
@@ -217,20 +217,20 @@ namespace DiscImageChef.Server
!string.IsNullOrWhiteSpace(device.Revision))
{
xmlFile = device.Manufacturer + "_" + device.Model + "_" + device.Revision + ".xml";
url =
url =
$"ViewReport.aspx?manufacturer={HttpUtility.UrlPathEncode(device.Manufacturer)}&model={HttpUtility.UrlPathEncode(device.Model)}&revision={HttpUtility.UrlPathEncode(device.Revision)}";
}
else if(!string.IsNullOrWhiteSpace(device.Manufacturer) &&
!string.IsNullOrWhiteSpace(device.Model))
{
xmlFile = device.Manufacturer + "_" + device.Model + ".xml";
url =
url =
$"ViewReport.aspx?manufacturer={HttpUtility.UrlPathEncode(device.Manufacturer)}&model={HttpUtility.UrlPathEncode(device.Model)}";
}
else if(!string.IsNullOrWhiteSpace(device.Model) && !string.IsNullOrWhiteSpace(device.Revision))
{
xmlFile = device.Model + "_" + device.Revision + ".xml";
url =
url =
$"ViewReport.aspx?model={HttpUtility.UrlPathEncode(device.Model)}&revision={HttpUtility.UrlPathEncode(device.Revision)}";
}
else

View File

@@ -37,10 +37,13 @@
<html>
<meta charset="UTF-8">
<head runat="server">
<link href="dos.css" rel="stylesheet" type="text/css"/>
<link href="dos.css"
rel="stylesheet"
type="text/css" />
<title>DiscImageChef's TODO</title>
<!-- Global site tag (gtag.js) - Google Analytics -->
<script async src="https://www.googletagmanager.com/gtag/js?id=UA-111466173-1"></script>
<script async
src="https://www.googletagmanager.com/gtag/js?id=UA-111466173-1"></script>
<script>
window.dataLayer = window.dataLayer || [];
@@ -51,13 +54,16 @@
gtag('config', 'UA-111466173-1');
</script>
</head>
<body id="body" runat="server">
<body id="body"
runat="server">
<p>
<a href="Default.aspx">Return to main page.</a><br/>
<a href="Default.aspx">Return to main page.</a><br />
DiscImageChef list of things to do:
</p>
<div>
<velyo:MarkdownContent ID="todo" Path="~/docs/TODO.md" runat="server"/>
<velyo:MarkdownContent ID="todo"
Path="~/docs/TODO.md"
runat="server" />
</div>
</body>
</html>

View File

@@ -36,10 +36,13 @@
<html>
<meta charset="UTF-8">
<head runat="server">
<link href="dos.css" rel="stylesheet" type="text/css"/>
<link href="dos.css"
rel="stylesheet"
type="text/css" />
<title>DiscImageChef Device Report</title>
<!-- Global site tag (gtag.js) - Google Analytics -->
<script async src="https://www.googletagmanager.com/gtag/js?id=UA-111466173-1"></script>
<script async
src="https://www.googletagmanager.com/gtag/js?id=UA-111466173-1"></script>
<script>
window.dataLayer = window.dataLayer || [];
@@ -50,181 +53,315 @@
gtag('config', 'UA-111466173-1');
</script>
</head>
<body id="content" runat="server">
DiscImageChef Report for <asp:Label id="lblManufacturer" runat="server"/> <asp:Label id="lblModel" runat="server"/> <asp:Label id="lblRevision" runat="server"/>
<div id="divUsb" runat="server">
<br/>
<b>USB characteristics:</b><br/>
<i>Manufacturer:</i> <asp:Label id="lblUsbManufacturer" runat="server"/><br/>
<i>Product:</i> <asp:Label id="lblUsbProduct" runat="server"/><br/>
<i>Vendor ID:</i> <asp:Label id="lblUsbVendor" runat="server"/> <asp:Label id="lblUsbVendorDescription" runat="server"/><br/>
<i>Product ID:</i> <asp:Label id="lblUsbProductId" runat="server"/> <asp:Label id="lblUsbProductDescription" runat="server"/>
<body id="content"
runat="server">
DiscImageChef Report for
<asp:Label id="lblManufacturer"
runat="server" />
<asp:Label id="lblModel"
runat="server" />
<asp:Label id="lblRevision"
runat="server" />
<div id="divUsb"
runat="server">
<br />
<b>USB characteristics:</b><br />
<i>Manufacturer:</i>
<asp:Label id="lblUsbManufacturer"
runat="server" /><br />
<i>Product:</i>
<asp:Label id="lblUsbProduct"
runat="server" /><br />
<i>Vendor ID:</i>
<asp:Label id="lblUsbVendor"
runat="server" />
<asp:Label id="lblUsbVendorDescription"
runat="server" /><br />
<i>Product ID:</i>
<asp:Label id="lblUsbProductId"
runat="server" />
<asp:Label id="lblUsbProductDescription"
runat="server" />
</div>
<div id="divFirewire" runat="server">
<br/>
<b>FireWire characteristics:</b><br/>
<i>Manufacturer:</i> <asp:Label id="lblFirewireManufacturer" runat="server"/><br/>
<i>Product:</i> <asp:Label id="lblFirewireProduct" runat="server"/><br/>
<i>Vendor ID:</i> <asp:Label id="lblFirewireVendor" runat="server"/><br/>
<i>Product ID:</i> <asp:Label id="lblFirewireProductId" runat="server"/>
<div id="divFirewire"
runat="server">
<br />
<b>FireWire characteristics:</b><br />
<i>Manufacturer:</i>
<asp:Label id="lblFirewireManufacturer"
runat="server" /><br />
<i>Product:</i>
<asp:Label id="lblFirewireProduct"
runat="server" /><br />
<i>Vendor ID:</i>
<asp:Label id="lblFirewireVendor"
runat="server" /><br />
<i>Product ID:</i>
<asp:Label id="lblFirewireProductId"
runat="server" />
</div>
<div id="divPcmcia" runat="server">
<br/>
<b>PCMCIA characteristics:</b><br/>
<i>Manufacturer:</i> <asp:Label id="lblPcmciaManufacturer" runat="server"/><br/>
<i>Product:</i> <asp:Label id="lblPcmciaProduct" runat="server"/><br/>
<i>Manufacturer code:</i> <asp:Label id="lblPcmciaManufacturerCode" runat="server"/><br/>
<i>Card code:</i> <asp:Label id="lblPcmciaCardCode" runat="server"/><br/>
<i>Compliance:</i> <asp:Label id="lblPcmciaCompliance" runat="server"/>
<asp:Repeater ID="repPcmciaTuples" runat="server">
<div id="divPcmcia"
runat="server">
<br />
<b>PCMCIA characteristics:</b><br />
<i>Manufacturer:</i>
<asp:Label id="lblPcmciaManufacturer"
runat="server" /><br />
<i>Product:</i>
<asp:Label id="lblPcmciaProduct"
runat="server" /><br />
<i>Manufacturer code:</i>
<asp:Label id="lblPcmciaManufacturerCode"
runat="server" /><br />
<i>Card code:</i>
<asp:Label id="lblPcmciaCardCode"
runat="server" /><br />
<i>Compliance:</i>
<asp:Label id="lblPcmciaCompliance"
runat="server" />
<asp:Repeater ID="repPcmciaTuples"
runat="server">
<ItemTemplate>
<i>
<asp:Label runat="server" Text='<%# Eval("key") %>'/>
</i>: <asp:Label runat="server" Text='<%# Eval("value") %>'/><br/>
<asp:Label runat="server"
Text='<%# Eval("key") %>' />
</i>:
<asp:Label runat="server"
Text='<%# Eval("value") %>' /><br />
</ItemTemplate>
</asp:Repeater>
</div>
<div id="divAta" runat="server">
<br/>
<b>ATA<asp:Label id="lblAtapi" runat="server"/> characteristics:</b><br/>
<asp:Label id="lblAtaDeviceType" runat="server"/><br/>
<asp:Repeater ID="repAtaTwo" runat="server">
<div id="divAta"
runat="server">
<br />
<b>
ATA
<asp:Label id="lblAtapi"
runat="server" /> characteristics:
</b><br />
<asp:Label id="lblAtaDeviceType"
runat="server" /><br />
<asp:Repeater ID="repAtaTwo"
runat="server">
<ItemTemplate>
<i>
<asp:Label runat="server" Text='<%# Eval("key") %>'/>
</i>: <asp:Label runat="server" Text='<%# Eval("value") %>'/><br/>
<asp:Label runat="server"
Text='<%# Eval("key") %>' />
</i>:
<asp:Label runat="server"
Text='<%# Eval("value") %>' /><br />
</ItemTemplate>
</asp:Repeater>
<br/>
<asp:Repeater ID="repAtaOne" runat="server">
<br />
<asp:Repeater ID="repAtaOne"
runat="server">
<ItemTemplate>
<%# Container.DataItem?.ToString() ?? string.Empty %><br/>
<%# Container.DataItem?.ToString() ?? string.Empty %><br />
</ItemTemplate>
</asp:Repeater>
</div>
<div id="divScsi" runat="server">
<br/>
<b>SCSI characteristics:</b><br/>
<i>Vendor:</i> <asp:Label id="lblScsiVendor" runat="server"/><br/>
<i>Product:</i> <asp:Label id="lblScsiProduct" runat="server"/><br/>
<i>Revision:</i> <asp:Label id="lblScsiRevision" runat="server"/><br/>
<asp:Repeater ID="repScsi" runat="server">
<div id="divScsi"
runat="server">
<br />
<b>SCSI characteristics:</b><br />
<i>Vendor:</i>
<asp:Label id="lblScsiVendor"
runat="server" /><br />
<i>Product:</i>
<asp:Label id="lblScsiProduct"
runat="server" /><br />
<i>Revision:</i>
<asp:Label id="lblScsiRevision"
runat="server" /><br />
<asp:Repeater ID="repScsi"
runat="server">
<ItemTemplate>
<%# Container.DataItem?.ToString() ?? string.Empty %><br/>
<%# Container.DataItem?.ToString() ?? string.Empty %><br />
</ItemTemplate>
</asp:Repeater>
<div id="divScsiModeSense" runat="server">
<br/><i>SCSI mode sense pages:</i>
<div id="divScsiModeSense"
runat="server">
<br /><i>SCSI mode sense pages:</i>
<table border="1">
<tr>
<th>Mode</th>
<th>Contents</th>
</tr>
<asp:Repeater ID="repModeSense" runat="server">
<asp:Repeater ID="repModeSense"
runat="server">
<ItemTemplate>
<tr>
<td>
<asp:Label runat="server" Text='<%# Eval("key") %>'/>
<asp:Label runat="server"
Text='<%# Eval("key") %>' />
</td>
<td>
<asp:Label runat="server" Text='<%# Eval("value") %>'/>
<asp:Label runat="server"
Text='<%# Eval("value") %>' />
</td>
</tr>
</ItemTemplate>
</asp:Repeater>
</table>
</div>
<div id="divScsiEvpd" runat="server">
<br/><i>SCSI extended vital product data pages:</i>
<div id="divScsiEvpd"
runat="server">
<br /><i>SCSI extended vital product data pages:</i>
<table border="1">
<tr>
<th>EVPD</th>
<th>Contents</th>
</tr>
<asp:Repeater ID="repEvpd" runat="server">
<asp:Repeater ID="repEvpd"
runat="server">
<ItemTemplate>
<tr>
<td>
<asp:Label runat="server" Text='<%# Eval("key") %>'/>
<asp:Label runat="server"
Text='<%# Eval("key") %>' />
</td>
<td>
<asp:Label runat="server" Text='<%# Eval("value") %>'/>
<asp:Label runat="server"
Text='<%# Eval("value") %>' />
</td>
</tr>
</ItemTemplate>
</asp:Repeater>
</table>
</div>
<div id="divScsiMmcMode" runat="server">
<br/><b>SCSI CD-ROM capabilities:</b><br/>
<asp:Repeater ID="repScsiMmcMode" runat="server">
<div id="divScsiMmcMode"
runat="server">
<br /><b>SCSI CD-ROM capabilities:</b><br />
<asp:Repeater ID="repScsiMmcMode"
runat="server">
<ItemTemplate>
<%# Container.DataItem?.ToString() ?? string.Empty %><br/>
<%# Container.DataItem?.ToString() ?? string.Empty %><br />
</ItemTemplate>
</asp:Repeater>
</div>
<div id="divScsiMmcFeatures" runat="server">
<br/><b>SCSI MMC features:</b><br/>
<asp:Repeater ID="repScsiMmcFeatures" runat="server">
<div id="divScsiMmcFeatures"
runat="server">
<br /><b>SCSI MMC features:</b><br />
<asp:Repeater ID="repScsiMmcFeatures"
runat="server">
<ItemTemplate>
<%# Container.DataItem?.ToString() ?? string.Empty %><br/>
<%# Container.DataItem?.ToString() ?? string.Empty %><br />
</ItemTemplate>
</asp:Repeater>
</div>
<div id="divScsiSsc" runat="server">
<br/><b>SCSI Streaming device capabilities:</b><br/>
Block size granularity: <asp:Label id="lblScsiSscGranularity" runat="server"/><br/>
Maximum block length: <asp:Label id="lblScsiSscMaxBlock" runat="server"/> bytes<br/>
Minimum block length: <asp:Label id="lblScsiSscMinBlock" runat="server"/> bytes<br/>
<asp:Repeater ID="repScsiSscDensities" runat="server">
<div id="divScsiSsc"
runat="server">
<br /><b>SCSI Streaming device capabilities:</b><br />
Block size granularity:
<asp:Label id="lblScsiSscGranularity"
runat="server" /><br />
Maximum block length:
<asp:Label id="lblScsiSscMaxBlock"
runat="server" /> bytes<br />
Minimum block length:
<asp:Label id="lblScsiSscMinBlock"
runat="server" /> bytes<br />
<asp:Repeater ID="repScsiSscDensities"
runat="server">
<ItemTemplate>
<br/><b>Information for supported density with primary code <asp:Label runat="server" Text='<%# string.Format("{0:X2}h", Eval("PrimaryCode")) %>'/> and secondary code <asp:Label runat="server" Text='<%# string.Format("{0:X2}h", Eval("SecondaryCode")) %>'/></b><br/>
Drive can write this density: <asp:Label runat="server" Text='<%# string.Format("{0}", Eval("Writable")) %>'/><br/>
Duplicate density: <asp:Label runat="server" Text='<%# string.Format("{0}", Eval("Duplicate")) %>'/><br/>
Default density: <asp:Label runat="server" Text='<%# string.Format("{0}", Eval("DefaultDensity")) %>'/><br/>
Density has <asp:Label runat="server" Text='<%# Eval("BitsPerMm") %>'/> bits per mm, with <asp:Label runat="server" Text='<%# Eval("Tracks") %>'/> tracks in a <asp:Label runat="server" Text='<%# Eval("Width") %>'/> mm width tape
Name: <asp:Label runat="server" Text='<%# Eval("Name") %>'/><br/>
Organization: <asp:Label runat="server" Text='<%# Eval("Organization") %>'/><br/>
Description: <asp:Label runat="server" Text='<%# Eval("Description") %>'/><br/>
Maximum capacity: <asp:Label runat="server" Text='<%# Eval("Capacity") %>'/> megabytes<br/>
<br />
<b>
Information for supported density with primary code
<asp:Label runat="server"
Text='<%# string.Format("{0:X2}h", Eval("PrimaryCode")) %>' /> and secondary code
<asp:Label runat="server"
Text='<%# string.Format("{0:X2}h", Eval("SecondaryCode")) %>' />
</b><br />
Drive can write this density:
<asp:Label runat="server"
Text='<%# string.Format("{0}", Eval("Writable")) %>' /><br />
Duplicate density:
<asp:Label runat="server"
Text='<%# string.Format("{0}", Eval("Duplicate")) %>' /><br />
Default density:
<asp:Label runat="server"
Text='<%# string.Format("{0}", Eval("DefaultDensity")) %>' /><br />
Density has
<asp:Label runat="server"
Text='<%# Eval("BitsPerMm") %>' /> bits per mm, with
<asp:Label runat="server"
Text='<%# Eval("Tracks") %>' /> tracks in a
<asp:Label runat="server"
Text='<%# Eval("Width") %>' /> mm width tape
Name:
<asp:Label runat="server"
Text='<%# Eval("Name") %>' /><br />
Organization:
<asp:Label runat="server"
Text='<%# Eval("Organization") %>' /><br />
Description:
<asp:Label runat="server"
Text='<%# Eval("Description") %>' /><br />
Maximum capacity:
<asp:Label runat="server"
Text='<%# Eval("Capacity") %>' /> megabytes<br />
</ItemTemplate>
</asp:Repeater>
<asp:Repeater ID="repScsiSscMedias" runat="server">
<asp:Repeater ID="repScsiSscMedias"
runat="server">
<ItemTemplate>
<br/><b>Information for supported media with type code <asp:Label runat="server" Text='<%# string.Format("{0:X2}h", Eval("MediumType")) %>'/></b><br/>
Drive can write this density: <asp:Label runat="server" Text='<%# string.Format("{0}", Eval("Writable")) %>'/><br/>
Media is <asp:Label runat="server" Text='<%# Eval("Length") %>'/> meters long in a <asp:Label runat="server" Text='<%# Eval("Width") %>'/> mm width tape
Name: <asp:Label runat="server" Text='<%# Eval("Name") %>'/><br/>
Organization: <asp:Label runat="server" Text='<%# Eval("Organization") %>'/><br/>
Description: <asp:Label runat="server" Text='<%# Eval("Description") %>'/><br/>
<br />
<b>
Information for supported media with type code
<asp:Label runat="server"
Text='<%# string.Format("{0:X2}h", Eval("MediumType")) %>' />
</b><br />
Drive can write this density:
<asp:Label runat="server"
Text='<%# string.Format("{0}", Eval("Writable")) %>' /><br />
Media is
<asp:Label runat="server"
Text='<%# Eval("Length") %>' /> meters long in a
<asp:Label runat="server"
Text='<%# Eval("Width") %>' /> mm width tape
Name:
<asp:Label runat="server"
Text='<%# Eval("Name") %>' /><br />
Organization:
<asp:Label runat="server"
Text='<%# Eval("Organization") %>' /><br />
Description:
<asp:Label runat="server"
Text='<%# Eval("Description") %>' /><br />
</ItemTemplate>
</asp:Repeater>
</div>
</div>
<div id="divTestedMedia" runat="server">
<br/><b>Tested media:</b><br/>
<asp:Repeater ID="repTestedMedia" runat="server">
<div id="divTestedMedia"
runat="server">
<br /><b>Tested media:</b><br />
<asp:Repeater ID="repTestedMedia"
runat="server">
<ItemTemplate>
<%# Container.DataItem?.ToString() ?? string.Empty %><br/>
<%# Container.DataItem?.ToString() ?? string.Empty %><br />
</ItemTemplate>
</asp:Repeater>
</div>
<div id="divMMC" runat="server">
<br/>
<b>MultiMediaCard device:</b><br/>
<asp:Repeater ID="repMMC" runat="server">
<div id="divMMC"
runat="server">
<br />
<b>MultiMediaCard device:</b><br />
<asp:Repeater ID="repMMC"
runat="server">
<ItemTemplate>
<%# Container.DataItem?.ToString() ?? string.Empty %><br/>
<%# Container.DataItem?.ToString() ?? string.Empty %><br />
</ItemTemplate>
</asp:Repeater>
</div>
<div id="divSD" runat="server">
<br/>
<b>SecureDigital device:</b><br/>
<asp:Repeater ID="repSD" runat="server">
<div id="divSD"
runat="server">
<br />
<b>SecureDigital device:</b><br />
<asp:Repeater ID="repSD"
runat="server">
<ItemTemplate>
<%# Container.DataItem?.ToString() ?? string.Empty %><br/>
<%# Container.DataItem?.ToString() ?? string.Empty %><br />
</ItemTemplate>
</asp:Repeater>
</div>

View File

@@ -56,24 +56,25 @@ namespace DiscImageChef.Server
try
{
string manufacturer = Request.QueryString["manufacturer"];
string model = Request.QueryString["model"];
string revision = Request.QueryString["revision"];
string model = Request.QueryString["model"];
string revision = Request.QueryString["revision"];
// Strip non-ascii, strip slashes and question marks
if(manufacturer != null)
manufacturer = Encoding
.ASCII.GetString(Encoding.Convert(Encoding.UTF8, Encoding.ASCII,
Encoding.UTF8.GetBytes(manufacturer))).Replace('/', '_')
.Replace('\\', '_').Replace('?', '_');
.ASCII.GetString(Encoding.Convert(Encoding.UTF8, Encoding.ASCII,
Encoding.UTF8.GetBytes(manufacturer)))
.Replace('/', '_').Replace('\\', '_').Replace('?', '_');
if(model != null)
model = Encoding
.ASCII.GetString(Encoding.Convert(Encoding.UTF8, Encoding.ASCII, Encoding.UTF8.GetBytes(model)))
.Replace('/', '_').Replace('\\', '_').Replace('?', '_');
.ASCII.GetString(Encoding.Convert(Encoding.UTF8, Encoding.ASCII,
Encoding.UTF8.GetBytes(model))).Replace('/', '_')
.Replace('\\', '_').Replace('?', '_');
if(revision != null)
revision = Encoding
.ASCII.GetString(Encoding.Convert(Encoding.UTF8, Encoding.ASCII,
Encoding.UTF8.GetBytes(revision))).Replace('/', '_')
.Replace('\\', '_').Replace('?', '_');
.ASCII.GetString(Encoding.Convert(Encoding.UTF8, Encoding.ASCII,
Encoding.UTF8.GetBytes(revision))).Replace('/', '_')
.Replace('\\', '_').Replace('?', '_');
string xmlFile = null;
if(!string.IsNullOrWhiteSpace(manufacturer) && !string.IsNullOrWhiteSpace(model) &&
@@ -81,8 +82,8 @@ namespace DiscImageChef.Server
else if(!string.IsNullOrWhiteSpace(manufacturer) && !string.IsNullOrWhiteSpace(model))
xmlFile = manufacturer + "_" + model + ".xml";
else if(!string.IsNullOrWhiteSpace(model) && !string.IsNullOrWhiteSpace(revision))
xmlFile = model + "_" + revision + ".xml";
else if(!string.IsNullOrWhiteSpace(model)) xmlFile = model + ".xml";
xmlFile = model + "_" + revision + ".xml";
else if(!string.IsNullOrWhiteSpace(model)) xmlFile = model + ".xml";
if(xmlFile == null ||
!File.Exists(Path.Combine(HostingEnvironment.MapPath("~") ?? throw new InvalidOperationException(),
@@ -93,11 +94,11 @@ namespace DiscImageChef.Server
}
lblManufacturer.Text = Request.QueryString["manufacturer"];
lblModel.Text = Request.QueryString["model"];
lblRevision.Text = Request.QueryString["revision"];
lblModel.Text = Request.QueryString["model"];
lblRevision.Text = Request.QueryString["revision"];
DeviceReport report = new DeviceReport();
XmlSerializer xs = new XmlSerializer(report.GetType());
DeviceReport report = new DeviceReport();
XmlSerializer xs = new XmlSerializer(report.GetType());
StreamReader sr =
new
StreamReader(Path.Combine(HostingEnvironment.MapPath("~") ?? throw new InvalidOperationException(),
@@ -111,8 +112,8 @@ namespace DiscImageChef.Server
out string usbProductDescription);
lblUsbManufacturer.Text = HttpUtility.HtmlEncode(report.USB.Manufacturer);
lblUsbProduct.Text = HttpUtility.HtmlEncode(report.USB.Product);
lblUsbVendor.Text = $"0x{report.USB.VendorID:x4}";
lblUsbProduct.Text = HttpUtility.HtmlEncode(report.USB.Product);
lblUsbVendor.Text = $"0x{report.USB.VendorID:x4}";
if(usbVendorDescription != null)
lblUsbVendorDescription.Text = $"({HttpUtility.HtmlEncode(usbVendorDescription)})";
lblUsbProductId.Text = $"0x{report.USB.ProductID:x4}";
@@ -124,19 +125,19 @@ namespace DiscImageChef.Server
if(report.FireWire != null)
{
lblFirewireManufacturer.Text = HttpUtility.HtmlEncode(report.FireWire.Manufacturer);
lblFirewireProduct.Text = HttpUtility.HtmlEncode(report.FireWire.Product);
lblFirewireVendor.Text = $"0x{report.FireWire.VendorID:x8}";
lblFirewireProductId.Text = $"0x{report.FireWire.ProductID:x8}";
lblFirewireProduct.Text = HttpUtility.HtmlEncode(report.FireWire.Product);
lblFirewireVendor.Text = $"0x{report.FireWire.VendorID:x8}";
lblFirewireProductId.Text = $"0x{report.FireWire.ProductID:x8}";
}
else divFirewire.Visible = false;
if(report.PCMCIA != null)
{
lblPcmciaManufacturer.Text = HttpUtility.HtmlEncode(report.PCMCIA.Manufacturer);
lblPcmciaProduct.Text = HttpUtility.HtmlEncode(report.PCMCIA.ProductName);
lblPcmciaManufacturer.Text = HttpUtility.HtmlEncode(report.PCMCIA.Manufacturer);
lblPcmciaProduct.Text = HttpUtility.HtmlEncode(report.PCMCIA.ProductName);
lblPcmciaManufacturerCode.Text = $"0x{report.PCMCIA.ManufacturerCode:x4}";
lblPcmciaCardCode.Text = $"0x{report.PCMCIA.CardCode:x4}";
lblPcmciaCompliance.Text = HttpUtility.HtmlEncode(report.PCMCIA.Compliance);
lblPcmciaCardCode.Text = $"0x{report.PCMCIA.CardCode:x4}";
lblPcmciaCompliance.Text = HttpUtility.HtmlEncode(report.PCMCIA.Compliance);
Tuple[] tuples = CIS.GetTuples(report.PCMCIA.CIS);
if(tuples != null)
{
@@ -219,32 +220,32 @@ namespace DiscImageChef.Server
}
else divPcmcia.Visible = false;
bool removable = true;
bool removable = true;
testedMediaType[] testedMedia = null;
bool ata = false;
bool atapi = false;
bool sscMedia = false;
bool ata = false;
bool atapi = false;
bool sscMedia = false;
if(report.ATA != null || report.ATAPI != null)
{
ata = true;
List<string> ataOneValue = new List<string>();
List<string> ataOneValue = new List<string>();
Dictionary<string, string> ataTwoValue = new Dictionary<string, string>();
ataType ataReport;
ataType ataReport;
if(report.ATAPI != null)
{
lblAtapi.Text = "PI";
ataReport = report.ATAPI;
atapi = true;
ataReport = report.ATAPI;
atapi = true;
}
else ataReport = report.ATA;
bool cfa = report.CompactFlashSpecified && report.CompactFlash;
if(atapi && !cfa) lblAtaDeviceType.Text = "ATAPI device";
else if(!atapi && cfa) lblAtaDeviceType.Text = "CompactFlash device";
else lblAtaDeviceType.Text = "ATA device";
if(atapi && !cfa) lblAtaDeviceType.Text = "ATAPI device";
else if(!atapi && cfa) lblAtaDeviceType.Text = "CompactFlash device";
else lblAtaDeviceType.Text = "ATA device";
Ata.Report(ataReport, cfa, atapi, ref removable, ref ataOneValue, ref ataTwoValue, ref testedMedia);
@@ -257,16 +258,16 @@ namespace DiscImageChef.Server
if(report.SCSI != null)
{
List<string> scsiOneValue = new List<string>();
Dictionary<string, string> modePages = new Dictionary<string, string>();
Dictionary<string, string> evpdPages = new Dictionary<string, string>();
List<string> scsiOneValue = new List<string>();
Dictionary<string, string> modePages = new Dictionary<string, string>();
Dictionary<string, string> evpdPages = new Dictionary<string, string>();
lblScsiVendor.Text =
VendorString.Prettify(report.SCSI.Inquiry.VendorIdentification) !=
report.SCSI.Inquiry.VendorIdentification
? $"{report.SCSI.Inquiry.VendorIdentification} ({VendorString.Prettify(report.SCSI.Inquiry.VendorIdentification)})"
: report.SCSI.Inquiry.VendorIdentification;
lblScsiProduct.Text = report.SCSI.Inquiry.ProductIdentification;
lblScsiProduct.Text = report.SCSI.Inquiry.ProductIdentification;
lblScsiRevision.Text = report.SCSI.Inquiry.ProductRevisionLevel;
scsiOneValue.AddRange(ScsiInquiry.Report(report.SCSI.Inquiry));
@@ -296,9 +297,9 @@ namespace DiscImageChef.Server
}
else divScsiEvpd.Visible = false;
divScsiMmcMode.Visible = false;
divScsiMmcMode.Visible = false;
divScsiMmcFeatures.Visible = false;
divScsiSsc.Visible = false;
divScsiSsc.Visible = false;
if(report.SCSI.MultiMediaDevice != null)
{
@@ -310,7 +311,7 @@ namespace DiscImageChef.Server
ScsiMmcMode.Report(report.SCSI.MultiMediaDevice.ModeSense2A, ref mmcModeOneValue);
if(mmcModeOneValue.Count > 0)
{
divScsiMmcMode.Visible = true;
divScsiMmcMode.Visible = true;
repScsiMmcMode.DataSource = mmcModeOneValue;
repScsiMmcMode.DataBind();
}
@@ -322,7 +323,7 @@ namespace DiscImageChef.Server
ScsiMmcFeatures.Report(report.SCSI.MultiMediaDevice.Features, ref mmcFeaturesOneValue);
if(mmcFeaturesOneValue.Count > 0)
{
divScsiMmcFeatures.Visible = true;
divScsiMmcFeatures.Visible = true;
repScsiMmcFeatures.DataSource = mmcFeaturesOneValue;
repScsiMmcFeatures.DataBind();
}
@@ -364,7 +365,7 @@ namespace DiscImageChef.Server
SscTestedMedia.Report(report.SCSI.SequentialDevice.TestedMedia, ref mediaOneValue);
if(mediaOneValue.Count > 0)
{
sscMedia = true;
sscMedia = true;
repTestedMedia.DataSource = mediaOneValue;
repTestedMedia.DataBind();
}
@@ -381,19 +382,20 @@ namespace DiscImageChef.Server
report.SCSI.ReadCapabilities.BlockSizeSpecified)
{
scsiOneValue
.Add($"Device has {report.SCSI.ReadCapabilities.Blocks} blocks of {report.SCSI.ReadCapabilities.BlockSize} bytes each");
.Add($"Device has {report.SCSI.ReadCapabilities.Blocks} blocks of {report.SCSI.ReadCapabilities.BlockSize} bytes each");
if(report.SCSI.ReadCapabilities.Blocks * report.SCSI.ReadCapabilities.BlockSize / 1024 /
1024 > 1000000)
scsiOneValue
.Add($"Device size: {report.SCSI.ReadCapabilities.Blocks * report.SCSI.ReadCapabilities.BlockSize} bytes, {report.SCSI.ReadCapabilities.Blocks * report.SCSI.ReadCapabilities.BlockSize / 1000 / 1000 / 1000 / 1000} Tb, {(double)(report.SCSI.ReadCapabilities.Blocks * report.SCSI.ReadCapabilities.BlockSize) / 1024 / 1024 / 1024 / 1024:F2} TiB");
.Add($"Device size: {report.SCSI.ReadCapabilities.Blocks * report.SCSI.ReadCapabilities.BlockSize} bytes, {report.SCSI.ReadCapabilities.Blocks * report.SCSI.ReadCapabilities.BlockSize / 1000 / 1000 / 1000 / 1000} Tb, {(double)(report.SCSI.ReadCapabilities.Blocks * report.SCSI.ReadCapabilities.BlockSize) / 1024 / 1024 / 1024 / 1024:F2} TiB");
else if(report.SCSI.ReadCapabilities.Blocks * report.SCSI.ReadCapabilities.BlockSize /
1024 / 1024 > 1000)
1024 /
1024 > 1000)
scsiOneValue
.Add($"Device size: {report.SCSI.ReadCapabilities.Blocks * report.SCSI.ReadCapabilities.BlockSize} bytes, {report.SCSI.ReadCapabilities.Blocks * report.SCSI.ReadCapabilities.BlockSize / 1000 / 1000 / 1000} Gb, {(double)(report.SCSI.ReadCapabilities.Blocks * report.SCSI.ReadCapabilities.BlockSize) / 1024 / 1024 / 1024:F2} GiB");
.Add($"Device size: {report.SCSI.ReadCapabilities.Blocks * report.SCSI.ReadCapabilities.BlockSize} bytes, {report.SCSI.ReadCapabilities.Blocks * report.SCSI.ReadCapabilities.BlockSize / 1000 / 1000 / 1000} Gb, {(double)(report.SCSI.ReadCapabilities.Blocks * report.SCSI.ReadCapabilities.BlockSize) / 1024 / 1024 / 1024:F2} GiB");
else
scsiOneValue
.Add($"Device size: {report.SCSI.ReadCapabilities.Blocks * report.SCSI.ReadCapabilities.BlockSize} bytes, {report.SCSI.ReadCapabilities.Blocks * report.SCSI.ReadCapabilities.BlockSize / 1000 / 1000} Mb, {(double)(report.SCSI.ReadCapabilities.Blocks * report.SCSI.ReadCapabilities.BlockSize) / 1024 / 1024:F2} MiB");
.Add($"Device size: {report.SCSI.ReadCapabilities.Blocks * report.SCSI.ReadCapabilities.BlockSize} bytes, {report.SCSI.ReadCapabilities.Blocks * report.SCSI.ReadCapabilities.BlockSize / 1000 / 1000} Mb, {(double)(report.SCSI.ReadCapabilities.Blocks * report.SCSI.ReadCapabilities.BlockSize) / 1024 / 1024:F2} MiB");
}
if(report.SCSI.ReadCapabilities.MediumTypeSpecified)
@@ -508,7 +510,7 @@ namespace DiscImageChef.Server
TestedMedia.Report(testedMedia, ata, ref mediaOneValue);
if(mediaOneValue.Count > 0)
{
divTestedMedia.Visible = true;
divTestedMedia.Visible = true;
repTestedMedia.DataSource = mediaOneValue;
repTestedMedia.DataBind();
}
@@ -519,16 +521,16 @@ namespace DiscImageChef.Server
catch(Exception)
{
content.InnerHtml = "<b>Could not load device report</b>";
#if DEBUG
#if DEBUG
throw;
#endif
#endif
}
}
static void GetUsbDescriptions(ushort vendor, ushort product, out string vendorDescription,
static void GetUsbDescriptions(ushort vendor, ushort product, out string vendorDescription,
out string productDescription)
{
vendorDescription = null;
vendorDescription = null;
productDescription = null;
if(!File.Exists(Path.Combine(HostingEnvironment.MapPath("~") ?? throw new InvalidOperationException(),
@@ -560,6 +562,7 @@ namespace DiscImageChef.Server
productDescription = line.Substring(7);
return;
}
// Skip products
if(line[0] == '\t') continue;
@@ -569,7 +572,7 @@ namespace DiscImageChef.Server
if(number != vendor) continue;
vendorDescription = line.Substring(6);
inManufacturer = true;
inManufacturer = true;
}
}
}