mirror of
https://github.com/aaru-dps/Aaru.git
synced 2025-12-16 19:24:25 +00:00
Refactor rename "Revision" to "FirmwareRevision".
This commit is contained in:
@@ -117,7 +117,7 @@ namespace DiscImageChef.Core.Devices.Dumping
|
||||
|
||||
// Search for device in master database
|
||||
_dbDev = _ctx.Devices.FirstOrDefault(d => d.Manufacturer == _dev.Manufacturer && d.Model == _dev.Model &&
|
||||
d.Revision == _dev.Revision);
|
||||
d.Revision == _dev.FirmwareRevision);
|
||||
|
||||
if(_dbDev is null)
|
||||
{
|
||||
|
||||
@@ -47,7 +47,7 @@ namespace DiscImageChef.Core.Devices.Info
|
||||
Type = dev.Type;
|
||||
Manufacturer = dev.Manufacturer;
|
||||
Model = dev.Model;
|
||||
Revision = dev.Revision;
|
||||
FirmwareRevision = dev.FirmwareRevision;
|
||||
Serial = dev.Serial;
|
||||
ScsiType = dev.ScsiType;
|
||||
IsRemovable = dev.IsRemovable;
|
||||
@@ -77,23 +77,31 @@ namespace DiscImageChef.Core.Devices.Info
|
||||
if(sense)
|
||||
{
|
||||
DicConsole.DebugWriteLine("Device-Info command", "STATUS = 0x{0:X2}", errorRegisters.Status);
|
||||
DicConsole.DebugWriteLine("Device-Info command", "ERROR = 0x{0:X2}", errorRegisters.Error);
|
||||
DicConsole.DebugWriteLine("Device-Info command", "ERROR = 0x{0:X2}", errorRegisters.Error);
|
||||
|
||||
DicConsole.DebugWriteLine("Device-Info command", "NSECTOR = 0x{0:X2}",
|
||||
errorRegisters.SectorCount);
|
||||
|
||||
DicConsole.DebugWriteLine("Device-Info command", "SECTOR = 0x{0:X2}", errorRegisters.Sector);
|
||||
|
||||
DicConsole.DebugWriteLine("Device-Info command", "CYLHIGH = 0x{0:X2}",
|
||||
errorRegisters.CylinderHigh);
|
||||
|
||||
DicConsole.DebugWriteLine("Device-Info command", "CYLLOW = 0x{0:X2}",
|
||||
errorRegisters.CylinderLow);
|
||||
|
||||
DicConsole.DebugWriteLine("Device-Info command", "DEVICE = 0x{0:X2}",
|
||||
errorRegisters.DeviceHead);
|
||||
|
||||
DicConsole.DebugWriteLine("Device-Info command", "Error code = {0}", dev.LastError);
|
||||
|
||||
break;
|
||||
}
|
||||
|
||||
if(dev.Error)
|
||||
{
|
||||
DicConsole.ErrorWriteLine("Error {0} querying ATA IDENTIFY", dev.LastError);
|
||||
|
||||
break;
|
||||
}
|
||||
|
||||
@@ -101,7 +109,8 @@ namespace DiscImageChef.Core.Devices.Info
|
||||
|
||||
dev.EnableMediaCardPassThrough(out errorRegisters, dev.Timeout, out _);
|
||||
|
||||
if(errorRegisters.Sector == 0xAA && errorRegisters.SectorCount == 0x55)
|
||||
if(errorRegisters.Sector == 0xAA &&
|
||||
errorRegisters.SectorCount == 0x55)
|
||||
AtaMcptError = errorRegisters;
|
||||
|
||||
break;
|
||||
@@ -114,22 +123,31 @@ namespace DiscImageChef.Core.Devices.Info
|
||||
if(sense)
|
||||
{
|
||||
DicConsole.DebugWriteLine("Device-Info command", "STATUS = 0x{0:X2}", errorRegisters.Status);
|
||||
DicConsole.DebugWriteLine("Device-Info command", "ERROR = 0x{0:X2}", errorRegisters.Error);
|
||||
DicConsole.DebugWriteLine("Device-Info command", "ERROR = 0x{0:X2}", errorRegisters.Error);
|
||||
|
||||
DicConsole.DebugWriteLine("Device-Info command", "NSECTOR = 0x{0:X2}",
|
||||
errorRegisters.SectorCount);
|
||||
|
||||
DicConsole.DebugWriteLine("Device-Info command", "SECTOR = 0x{0:X2}", errorRegisters.Sector);
|
||||
|
||||
DicConsole.DebugWriteLine("Device-Info command", "CYLHIGH = 0x{0:X2}",
|
||||
errorRegisters.CylinderHigh);
|
||||
|
||||
DicConsole.DebugWriteLine("Device-Info command", "CYLLOW = 0x{0:X2}",
|
||||
errorRegisters.CylinderLow);
|
||||
|
||||
DicConsole.DebugWriteLine("Device-Info command", "DEVICE = 0x{0:X2}",
|
||||
errorRegisters.DeviceHead);
|
||||
|
||||
DicConsole.DebugWriteLine("Device-Info command", "Error code = {0}", dev.LastError);
|
||||
|
||||
break;
|
||||
}
|
||||
|
||||
if(!dev.Error) AtapiIdentify = ataBuf;
|
||||
else DicConsole.ErrorWriteLine("Error {0} querying ATA PACKET IDENTIFY", dev.LastError);
|
||||
if(!dev.Error)
|
||||
AtapiIdentify = ataBuf;
|
||||
else
|
||||
DicConsole.ErrorWriteLine("Error {0} querying ATA PACKET IDENTIFY", dev.LastError);
|
||||
|
||||
// ATAPI devices are also SCSI devices
|
||||
goto case DeviceType.SCSI;
|
||||
@@ -142,6 +160,7 @@ namespace DiscImageChef.Core.Devices.Info
|
||||
if(sense)
|
||||
{
|
||||
DicConsole.ErrorWriteLine("SCSI error:\n{0}", Sense.PrettifySense(senseBuf));
|
||||
|
||||
break;
|
||||
}
|
||||
|
||||
@@ -160,50 +179,69 @@ namespace DiscImageChef.Core.Devices.Info
|
||||
foreach(byte page in pages)
|
||||
{
|
||||
sense = dev.ScsiInquiry(out inqBuf, out senseBuf, page);
|
||||
if(sense) continue;
|
||||
|
||||
if(sense)
|
||||
continue;
|
||||
|
||||
ScsiEvpdPages.Add(page, inqBuf);
|
||||
}
|
||||
}
|
||||
|
||||
PeripheralDeviceTypes devType = (PeripheralDeviceTypes)ScsiInquiry.Value.PeripheralDeviceType;
|
||||
var devType = (PeripheralDeviceTypes)ScsiInquiry.Value.PeripheralDeviceType;
|
||||
|
||||
sense = dev.ModeSense10(out byte[] modeBuf, out senseBuf, false, true,
|
||||
ScsiModeSensePageControl.Current, 0x3F, 0xFF, 5, out _);
|
||||
|
||||
if(!sense && !dev.Error) ScsiModeSense10 = modeBuf;
|
||||
if(!sense &&
|
||||
!dev.Error)
|
||||
ScsiModeSense10 = modeBuf;
|
||||
|
||||
if(sense || dev.Error)
|
||||
{
|
||||
sense = dev.ModeSense10(out modeBuf, out senseBuf, false, true,
|
||||
ScsiModeSensePageControl.Current, 0x3F, 0x00, 5, out _);
|
||||
if(!sense && !dev.Error) ScsiModeSense10 = modeBuf;
|
||||
|
||||
if(!sense &&
|
||||
!dev.Error)
|
||||
ScsiModeSense10 = modeBuf;
|
||||
}
|
||||
|
||||
if(!sense && !dev.Error) ScsiMode = Modes.DecodeMode10(modeBuf, devType);
|
||||
if(!sense &&
|
||||
!dev.Error)
|
||||
ScsiMode = Modes.DecodeMode10(modeBuf, devType);
|
||||
|
||||
bool useMode10 = !(sense || dev.Error || !ScsiMode.HasValue);
|
||||
|
||||
sense = dev.ModeSense6(out modeBuf, out senseBuf, false, ScsiModeSensePageControl.Current, 0x3F,
|
||||
0xFF, 5, out _);
|
||||
|
||||
if(!sense && !dev.Error) ScsiModeSense6 = modeBuf;
|
||||
if(!sense &&
|
||||
!dev.Error)
|
||||
ScsiModeSense6 = modeBuf;
|
||||
|
||||
if(sense || dev.Error)
|
||||
{
|
||||
sense = dev.ModeSense6(out modeBuf, out senseBuf, false, ScsiModeSensePageControl.Current, 0x3F,
|
||||
0x00, 5, out _);
|
||||
|
||||
if(!sense && !dev.Error) ScsiModeSense6 = modeBuf;
|
||||
if(!sense &&
|
||||
!dev.Error)
|
||||
ScsiModeSense6 = modeBuf;
|
||||
}
|
||||
|
||||
if(sense || dev.Error)
|
||||
{
|
||||
sense = dev.ModeSense(out modeBuf, out senseBuf, 5, out _);
|
||||
if(!sense && !dev.Error) ScsiModeSense6 = modeBuf;
|
||||
|
||||
if(!sense &&
|
||||
!dev.Error)
|
||||
ScsiModeSense6 = modeBuf;
|
||||
}
|
||||
|
||||
if(!sense && !dev.Error && !useMode10) ScsiMode = Modes.DecodeMode6(modeBuf, devType);
|
||||
if(!sense &&
|
||||
!dev.Error &&
|
||||
!useMode10)
|
||||
ScsiMode = Modes.DecodeMode6(modeBuf, devType);
|
||||
|
||||
switch(devType)
|
||||
{
|
||||
@@ -211,7 +249,8 @@ namespace DiscImageChef.Core.Devices.Info
|
||||
{
|
||||
sense = dev.GetConfiguration(out byte[] confBuf, out senseBuf, dev.Timeout, out _);
|
||||
|
||||
if(!sense) MmcConfiguration = confBuf;
|
||||
if(!sense)
|
||||
MmcConfiguration = confBuf;
|
||||
|
||||
// TODO: DVD drives respond correctly to BD status.
|
||||
// While specification says if no medium is present
|
||||
@@ -267,31 +306,37 @@ namespace DiscImageChef.Core.Devices.Info
|
||||
|
||||
switch(dev.Model)
|
||||
{
|
||||
case "DVDR PX-708A":
|
||||
case "DVDR PX-708A2":
|
||||
case "DVDR PX-712A":
|
||||
case"DVDR PX-708A":
|
||||
case"DVDR PX-708A2":
|
||||
case"DVDR PX-712A":
|
||||
plxtDvd = true;
|
||||
|
||||
plxtSense = dev.PlextorReadEeprom(out plxtBuf, out senseBuf, dev.Timeout,
|
||||
out _);
|
||||
|
||||
break;
|
||||
case "DVDR PX-714A":
|
||||
case "DVDR PX-716A":
|
||||
case "DVDR PX-716AL":
|
||||
case "DVDR PX-755A":
|
||||
case "DVDR PX-760A":
|
||||
case"DVDR PX-714A":
|
||||
case"DVDR PX-716A":
|
||||
case"DVDR PX-716AL":
|
||||
case"DVDR PX-755A":
|
||||
case"DVDR PX-760A":
|
||||
{
|
||||
plxtBuf = new byte[256 * 4];
|
||||
|
||||
for(byte i = 0; i < 4; i++)
|
||||
{
|
||||
plxtSense = dev.PlextorReadEepromBlock(out byte[] plxtBufSmall,
|
||||
out senseBuf, i, 256, dev.Timeout,
|
||||
out _);
|
||||
if(plxtSense) break;
|
||||
|
||||
if(plxtSense)
|
||||
break;
|
||||
|
||||
Array.Copy(plxtBufSmall, 0, plxtBuf, i * 256, 256);
|
||||
}
|
||||
|
||||
plxtDvd = true;
|
||||
|
||||
break;
|
||||
}
|
||||
|
||||
@@ -300,11 +345,15 @@ namespace DiscImageChef.Core.Devices.Info
|
||||
if(dev.Model.StartsWith("CD-R ", StringComparison.Ordinal))
|
||||
plxtSense = dev.PlextorReadEepromCdr(out plxtBuf, out senseBuf, dev.Timeout,
|
||||
out _);
|
||||
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
PlextorFeatures = new Plextor {IsDvd = plxtDvd};
|
||||
PlextorFeatures = new Plextor
|
||||
{
|
||||
IsDvd = plxtDvd
|
||||
};
|
||||
|
||||
if(!plxtSense)
|
||||
{
|
||||
@@ -328,6 +377,7 @@ namespace DiscImageChef.Core.Devices.Info
|
||||
|
||||
plxtSense = dev.PlextorGetPoweRec(out senseBuf, out bool plxtPwrRecEnabled,
|
||||
out ushort plxtPwrRecSpeed, dev.Timeout, out _);
|
||||
|
||||
if(!plxtSense)
|
||||
{
|
||||
PlextorFeatures.PoweRec = true;
|
||||
@@ -352,6 +402,7 @@ namespace DiscImageChef.Core.Devices.Info
|
||||
|
||||
// TODO: Check it with a drive
|
||||
plxtSense = dev.PlextorGetSilentMode(out plxtBuf, out senseBuf, dev.Timeout, out _);
|
||||
|
||||
if(!plxtSense)
|
||||
if(plxtBuf[0] == 1)
|
||||
{
|
||||
@@ -374,44 +425,68 @@ namespace DiscImageChef.Core.Devices.Info
|
||||
}
|
||||
|
||||
plxtSense = dev.PlextorGetGigaRec(out plxtBuf, out senseBuf, dev.Timeout, out _);
|
||||
if(!plxtSense) PlextorFeatures.GigaRec = true;
|
||||
|
||||
if(!plxtSense)
|
||||
PlextorFeatures.GigaRec = true;
|
||||
|
||||
plxtSense = dev.PlextorGetSecuRec(out plxtBuf, out senseBuf, dev.Timeout, out _);
|
||||
if(!plxtSense) PlextorFeatures.SecuRec = true;
|
||||
|
||||
if(!plxtSense)
|
||||
PlextorFeatures.SecuRec = true;
|
||||
|
||||
plxtSense = dev.PlextorGetSpeedRead(out plxtBuf, out senseBuf, dev.Timeout, out _);
|
||||
|
||||
if(!plxtSense)
|
||||
{
|
||||
PlextorFeatures.SpeedRead = true;
|
||||
if((plxtBuf[2] & 0x01) == 0x01) PlextorFeatures.SpeedReadEnabled = true;
|
||||
|
||||
if((plxtBuf[2] & 0x01) == 0x01)
|
||||
PlextorFeatures.SpeedReadEnabled = true;
|
||||
}
|
||||
|
||||
plxtSense = dev.PlextorGetHiding(out plxtBuf, out senseBuf, dev.Timeout, out _);
|
||||
|
||||
if(!plxtSense)
|
||||
{
|
||||
PlextorFeatures.Hiding = true;
|
||||
if((plxtBuf[2] & 0x02) == 0x02) PlextorFeatures.HidesRecordables = true;
|
||||
if((plxtBuf[2] & 0x01) == 0x01) PlextorFeatures.HidesSessions = true;
|
||||
|
||||
if((plxtBuf[2] & 0x02) == 0x02)
|
||||
PlextorFeatures.HidesRecordables = true;
|
||||
|
||||
if((plxtBuf[2] & 0x01) == 0x01)
|
||||
PlextorFeatures.HidesSessions = true;
|
||||
}
|
||||
|
||||
plxtSense = dev.PlextorGetVariRec(out plxtBuf, out senseBuf, false, dev.Timeout, out _);
|
||||
if(!plxtSense) PlextorFeatures.VariRec = true;
|
||||
|
||||
if(!plxtSense)
|
||||
PlextorFeatures.VariRec = true;
|
||||
|
||||
if(plxtDvd)
|
||||
{
|
||||
plxtSense = dev.PlextorGetVariRec(out plxtBuf, out senseBuf, true, dev.Timeout,
|
||||
out _);
|
||||
if(!plxtSense) PlextorFeatures.VariRecDvd = true;
|
||||
|
||||
if(!plxtSense)
|
||||
PlextorFeatures.VariRecDvd = true;
|
||||
|
||||
plxtSense = dev.PlextorGetBitsetting(out plxtBuf, out senseBuf, false, dev.Timeout,
|
||||
out _);
|
||||
if(!plxtSense) PlextorFeatures.BitSetting = true;
|
||||
|
||||
if(!plxtSense)
|
||||
PlextorFeatures.BitSetting = true;
|
||||
|
||||
plxtSense = dev.PlextorGetBitsetting(out plxtBuf, out senseBuf, true, dev.Timeout,
|
||||
out _);
|
||||
if(!plxtSense) PlextorFeatures.BitSettingDl = true;
|
||||
|
||||
if(!plxtSense)
|
||||
PlextorFeatures.BitSettingDl = true;
|
||||
|
||||
plxtSense = dev.PlextorGetTestWriteDvdPlus(out plxtBuf, out senseBuf, dev.Timeout,
|
||||
out _);
|
||||
if(!plxtSense) PlextorFeatures.DvdPlusWriteTest = true;
|
||||
|
||||
if(!plxtSense)
|
||||
PlextorFeatures.DvdPlusWriteTest = true;
|
||||
}
|
||||
}
|
||||
#endregion Plextor
|
||||
@@ -420,17 +495,21 @@ namespace DiscImageChef.Core.Devices.Info
|
||||
if(!dev.KreonGetFeatureList(out senseBuf, out KreonFeatures krFeatures, dev.Timeout,
|
||||
out _))
|
||||
KreonFeatures = krFeatures;
|
||||
|
||||
break;
|
||||
}
|
||||
|
||||
case PeripheralDeviceTypes.SequentialAccess:
|
||||
{
|
||||
sense = dev.ReadBlockLimits(out byte[] seqBuf, out senseBuf, dev.Timeout, out _);
|
||||
|
||||
if(sense)
|
||||
DicConsole.ErrorWriteLine("READ BLOCK LIMITS:\n{0}", Sense.PrettifySense(senseBuf));
|
||||
else BlockLimits = seqBuf;
|
||||
else
|
||||
BlockLimits = seqBuf;
|
||||
|
||||
sense = dev.ReportDensitySupport(out seqBuf, out senseBuf, dev.Timeout, out _);
|
||||
|
||||
if(sense)
|
||||
DicConsole.ErrorWriteLine("REPORT DENSITY SUPPORT:\n{0}",
|
||||
Sense.PrettifySense(senseBuf));
|
||||
@@ -441,6 +520,7 @@ namespace DiscImageChef.Core.Devices.Info
|
||||
}
|
||||
|
||||
sense = dev.ReportDensitySupport(out seqBuf, out senseBuf, true, false, dev.Timeout, out _);
|
||||
|
||||
if(sense)
|
||||
DicConsole.ErrorWriteLine("REPORT DENSITY SUPPORT (MEDIUM):\n{0}",
|
||||
Sense.PrettifySense(senseBuf));
|
||||
@@ -459,36 +539,55 @@ namespace DiscImageChef.Core.Devices.Info
|
||||
|
||||
case DeviceType.MMC:
|
||||
{
|
||||
bool sense = dev.ReadCid(out byte[] mmcBuf, out _, dev.Timeout, out _);
|
||||
if(!sense) CID = mmcBuf;
|
||||
bool sense = dev.ReadCid(out byte[] mmcBuf, out _, dev.Timeout, out _);
|
||||
|
||||
if(!sense)
|
||||
CID = mmcBuf;
|
||||
|
||||
sense = dev.ReadCsd(out mmcBuf, out _, dev.Timeout, out _);
|
||||
if(!sense) CSD = mmcBuf;
|
||||
|
||||
if(!sense)
|
||||
CSD = mmcBuf;
|
||||
|
||||
sense = dev.ReadOcr(out mmcBuf, out _, dev.Timeout, out _);
|
||||
if(!sense) OCR = mmcBuf;
|
||||
|
||||
if(!sense)
|
||||
OCR = mmcBuf;
|
||||
|
||||
sense = dev.ReadExtendedCsd(out mmcBuf, out _, dev.Timeout, out _);
|
||||
if(!sense) ExtendedCSD = mmcBuf;
|
||||
|
||||
if(!sense)
|
||||
ExtendedCSD = mmcBuf;
|
||||
}
|
||||
|
||||
break;
|
||||
case DeviceType.SecureDigital:
|
||||
{
|
||||
bool sense = dev.ReadCid(out byte[] sdBuf, out _, dev.Timeout, out _);
|
||||
if(!sense) CID = sdBuf;
|
||||
bool sense = dev.ReadCid(out byte[] sdBuf, out _, dev.Timeout, out _);
|
||||
|
||||
if(!sense)
|
||||
CID = sdBuf;
|
||||
|
||||
sense = dev.ReadCsd(out sdBuf, out _, dev.Timeout, out _);
|
||||
if(!sense) CSD = sdBuf;
|
||||
|
||||
if(!sense)
|
||||
CSD = sdBuf;
|
||||
|
||||
sense = dev.ReadSdocr(out sdBuf, out _, dev.Timeout, out _);
|
||||
if(!sense) OCR = sdBuf;
|
||||
|
||||
if(!sense)
|
||||
OCR = sdBuf;
|
||||
|
||||
sense = dev.ReadScr(out sdBuf, out _, dev.Timeout, out _);
|
||||
if(!sense) SCR = sdBuf;
|
||||
|
||||
if(!sense)
|
||||
SCR = sdBuf;
|
||||
}
|
||||
|
||||
break;
|
||||
default:
|
||||
DicConsole.ErrorWriteLine("Unknown device type {0}, cannot get information.", dev.Type);
|
||||
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
@@ -66,7 +66,7 @@ namespace DiscImageChef.Core.Devices.Info
|
||||
public DeviceType Type { get; }
|
||||
public string Manufacturer { get; }
|
||||
public string Model { get; }
|
||||
public string Revision { get; }
|
||||
public string FirmwareRevision { get; }
|
||||
public string Serial { get; }
|
||||
public PeripheralDeviceTypes ScsiType { get; }
|
||||
public bool IsRemovable { get; }
|
||||
|
||||
@@ -36,61 +36,67 @@ using System.Reflection;
|
||||
using System.Runtime.InteropServices;
|
||||
using DiscImageChef.CommonTypes.Interop;
|
||||
using DiscImageChef.Devices;
|
||||
using PlatformID = DiscImageChef.CommonTypes.Interop.PlatformID;
|
||||
using Version = DiscImageChef.CommonTypes.Interop.Version;
|
||||
|
||||
namespace DiscImageChef.Core.Logging
|
||||
{
|
||||
/// <summary>
|
||||
/// Creates a dump log
|
||||
/// </summary>
|
||||
/// <summary>Creates a dump log</summary>
|
||||
public class DumpLog
|
||||
{
|
||||
private readonly StreamWriter logSw;
|
||||
readonly StreamWriter logSw;
|
||||
|
||||
/// <summary>
|
||||
/// Initializes the dump log
|
||||
/// </summary>
|
||||
/// <summary>Initializes the dump log</summary>
|
||||
/// <param name="outputFile">Output log file</param>
|
||||
/// <param name="dev">Device</param>
|
||||
public DumpLog(string outputFile, Device dev)
|
||||
{
|
||||
if (string.IsNullOrEmpty(outputFile)) return;
|
||||
if(string.IsNullOrEmpty(outputFile))
|
||||
return;
|
||||
|
||||
logSw = new StreamWriter(outputFile, true);
|
||||
|
||||
logSw.WriteLine("Start logging at {0}", DateTime.Now);
|
||||
|
||||
var platId = DetectOS.GetRealPlatformID();
|
||||
var platVer = DetectOS.GetVersion();
|
||||
PlatformID platId = DetectOS.GetRealPlatformID();
|
||||
string platVer = DetectOS.GetVersion();
|
||||
|
||||
var assemblyVersion =
|
||||
Attribute.GetCustomAttribute(typeof(DumpLog).Assembly, typeof(AssemblyInformationalVersionAttribute)) as
|
||||
AssemblyInformationalVersionAttribute;
|
||||
|
||||
logSw.WriteLine("################# System information #################");
|
||||
|
||||
logSw.WriteLine("{0} {1} ({2}-bit)", DetectOS.GetPlatformName(platId, platVer), platVer,
|
||||
Environment.Is64BitOperatingSystem ? 64 : 32);
|
||||
if (DetectOS.IsMono) logSw.WriteLine("Mono {0}", Version.GetMonoVersion());
|
||||
else if (DetectOS.IsNetCore) logSw.WriteLine(".NET Core {0}", Version.GetNetCoreVersion());
|
||||
else logSw.WriteLine(RuntimeInformation.FrameworkDescription);
|
||||
Environment.Is64BitOperatingSystem ? 64 : 32);
|
||||
|
||||
if(DetectOS.IsMono)
|
||||
logSw.WriteLine("Mono {0}", Version.GetMonoVersion());
|
||||
else if(DetectOS.IsNetCore)
|
||||
logSw.WriteLine(".NET Core {0}", Version.GetNetCoreVersion());
|
||||
else
|
||||
logSw.WriteLine(RuntimeInformation.FrameworkDescription);
|
||||
|
||||
logSw.WriteLine();
|
||||
|
||||
logSw.WriteLine("################# Program information ################");
|
||||
logSw.WriteLine("DiscImageChef {0}", assemblyVersion?.InformationalVersion);
|
||||
logSw.WriteLine("Running in {0}-bit", Environment.Is64BitProcess ? 64 : 32);
|
||||
#if DEBUG
|
||||
#if DEBUG
|
||||
logSw.WriteLine("DEBUG version");
|
||||
#endif
|
||||
#endif
|
||||
logSw.WriteLine("Command line: {0}", Environment.CommandLine);
|
||||
logSw.WriteLine();
|
||||
|
||||
if (dev.IsRemote)
|
||||
if(dev.IsRemote)
|
||||
{
|
||||
logSw.WriteLine("################# Remote information #################");
|
||||
logSw.WriteLine("Server: {0}", dev.RemoteApplication);
|
||||
logSw.WriteLine("Version: {0}", dev.RemoteVersion);
|
||||
|
||||
logSw.WriteLine("Operating system: {0} {1}", dev.RemoteOperatingSystem,
|
||||
dev.RemoteOperatingSystemVersion);
|
||||
dev.RemoteOperatingSystemVersion);
|
||||
|
||||
logSw.WriteLine("Architecture: {0}", dev.RemoteArchitecture);
|
||||
logSw.WriteLine("Protocol version: {0}", dev.RemoteProtocolVersion);
|
||||
logSw.WriteLine("######################################################");
|
||||
@@ -99,14 +105,15 @@ namespace DiscImageChef.Core.Logging
|
||||
logSw.WriteLine("################# Device information #################");
|
||||
logSw.WriteLine("Manufacturer: {0}", dev.Manufacturer);
|
||||
logSw.WriteLine("Model: {0}", dev.Model);
|
||||
logSw.WriteLine("Firmware revision: {0}", dev.Revision);
|
||||
logSw.WriteLine("Firmware revision: {0}", dev.FirmwareRevision);
|
||||
logSw.WriteLine("Serial number: {0}", dev.Serial);
|
||||
logSw.WriteLine("Removable device: {0}", dev.IsRemovable);
|
||||
logSw.WriteLine("Device type: {0}", dev.Type);
|
||||
logSw.WriteLine("CompactFlash device: {0}", dev.IsCompactFlash);
|
||||
logSw.WriteLine("PCMCIA device: {0}", dev.IsPcmcia);
|
||||
logSw.WriteLine("USB device: {0}", dev.IsUsb);
|
||||
if (dev.IsUsb)
|
||||
|
||||
if(dev.IsUsb)
|
||||
{
|
||||
logSw.WriteLine("USB manufacturer: {0}", dev.UsbManufacturerString);
|
||||
logSw.WriteLine("USB product: {0}", dev.UsbProductString);
|
||||
@@ -116,7 +123,8 @@ namespace DiscImageChef.Core.Logging
|
||||
}
|
||||
|
||||
logSw.WriteLine("FireWire device: {0}", dev.IsFireWire);
|
||||
if (dev.IsFireWire)
|
||||
|
||||
if(dev.IsFireWire)
|
||||
{
|
||||
logSw.WriteLine("FireWire vendor: {0}", dev.FireWireVendorName);
|
||||
logSw.WriteLine("FireWire model: {0}", dev.FireWireModelName);
|
||||
@@ -132,23 +140,20 @@ namespace DiscImageChef.Core.Logging
|
||||
logSw.Flush();
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Adds a new line to the dump log
|
||||
/// </summary>
|
||||
/// <summary>Adds a new line to the dump log</summary>
|
||||
/// <param name="format">Format string</param>
|
||||
/// <param name="args">Arguments</param>
|
||||
public void WriteLine(string format, params object[] args)
|
||||
{
|
||||
if (logSw == null) return;
|
||||
if(logSw == null)
|
||||
return;
|
||||
|
||||
var text = string.Format(format, args);
|
||||
string text = string.Format(format, args);
|
||||
logSw.WriteLine("{0:s} {1}", DateTime.Now, text);
|
||||
logSw.Flush();
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Finishes and closes the dump log
|
||||
/// </summary>
|
||||
/// <summary>Finishes and closes the dump log</summary>
|
||||
public void Close()
|
||||
{
|
||||
logSw?.WriteLine("######################################################");
|
||||
|
||||
@@ -38,33 +38,30 @@ using DiscImageChef.Devices;
|
||||
|
||||
namespace DiscImageChef.Core.Logging
|
||||
{
|
||||
/// <summary>
|
||||
/// Implements a log in the format used by IMGBurn
|
||||
/// </summary>
|
||||
class IbgLog
|
||||
/// <summary>Implements a log in the format used by IMGBurn</summary>
|
||||
internal class IbgLog
|
||||
{
|
||||
readonly CultureInfo ibgCulture;
|
||||
DateTime ibgDatePoint;
|
||||
readonly double ibgDivider;
|
||||
readonly string ibgMediaType;
|
||||
readonly StringBuilder ibgSb;
|
||||
readonly string logFile;
|
||||
DateTime ibgDatePoint;
|
||||
ulong ibgIntSector;
|
||||
double ibgIntSpeed;
|
||||
double ibgMaxSpeed;
|
||||
readonly string ibgMediaType;
|
||||
int ibgSampleRate;
|
||||
readonly StringBuilder ibgSb;
|
||||
int ibgSnaps;
|
||||
bool ibgStartSet;
|
||||
double ibgStartSpeed;
|
||||
readonly string logFile;
|
||||
|
||||
/// <summary>
|
||||
/// Initializes the IMGBurn log
|
||||
/// </summary>
|
||||
/// <summary>Initializes the IMGBurn log</summary>
|
||||
/// <param name="outputFile">Log file</param>
|
||||
/// <param name="currentProfile">Profile as defined by SCSI MultiMedia Commands specification</param>
|
||||
internal IbgLog(string outputFile, ushort currentProfile)
|
||||
{
|
||||
if(string.IsNullOrEmpty(outputFile)) return;
|
||||
if(string.IsNullOrEmpty(outputFile))
|
||||
return;
|
||||
|
||||
logFile = outputFile;
|
||||
ibgSb = new StringBuilder();
|
||||
@@ -81,153 +78,186 @@ namespace DiscImageChef.Core.Logging
|
||||
case 0x0001:
|
||||
ibgMediaType = "HDD";
|
||||
ibgDivider = 1353;
|
||||
|
||||
break;
|
||||
case 0x0002:
|
||||
ibgMediaType = "PD-650";
|
||||
ibgDivider = 150;
|
||||
|
||||
break;
|
||||
case 0x0005:
|
||||
ibgMediaType = "CD-MO";
|
||||
ibgDivider = 150;
|
||||
|
||||
break;
|
||||
case 0x0008:
|
||||
ibgMediaType = "CD-ROM";
|
||||
ibgDivider = 150;
|
||||
|
||||
break;
|
||||
case 0x0009:
|
||||
ibgMediaType = "CD-R";
|
||||
ibgDivider = 150;
|
||||
|
||||
break;
|
||||
case 0x000A:
|
||||
ibgMediaType = "CD-RW";
|
||||
ibgDivider = 150;
|
||||
|
||||
break;
|
||||
case 0x0010:
|
||||
ibgMediaType = "DVD-ROM";
|
||||
ibgDivider = 1353;
|
||||
|
||||
break;
|
||||
case 0x0011:
|
||||
ibgMediaType = "DVD-R";
|
||||
ibgDivider = 1353;
|
||||
|
||||
break;
|
||||
case 0x0012:
|
||||
ibgMediaType = "DVD-RAM";
|
||||
ibgDivider = 1353;
|
||||
|
||||
break;
|
||||
case 0x0013:
|
||||
case 0x0014:
|
||||
ibgMediaType = "DVD-RW";
|
||||
ibgDivider = 1353;
|
||||
|
||||
break;
|
||||
case 0x0015:
|
||||
case 0x0016:
|
||||
ibgMediaType = "DVD-R DL";
|
||||
ibgDivider = 1353;
|
||||
|
||||
break;
|
||||
case 0x0017:
|
||||
ibgMediaType = "DVD-RW DL";
|
||||
ibgDivider = 1353;
|
||||
|
||||
break;
|
||||
case 0x0018:
|
||||
ibgMediaType = "DVD-Download";
|
||||
ibgDivider = 1353;
|
||||
|
||||
break;
|
||||
case 0x001A:
|
||||
ibgMediaType = "DVD+RW";
|
||||
ibgDivider = 1353;
|
||||
|
||||
break;
|
||||
case 0x001B:
|
||||
ibgMediaType = "DVD+R";
|
||||
ibgDivider = 1353;
|
||||
|
||||
break;
|
||||
case 0x0020:
|
||||
ibgMediaType = "DDCD-ROM";
|
||||
ibgDivider = 150;
|
||||
|
||||
break;
|
||||
case 0x0021:
|
||||
ibgMediaType = "DDCD-R";
|
||||
ibgDivider = 150;
|
||||
|
||||
break;
|
||||
case 0x0022:
|
||||
ibgMediaType = "DDCD-RW";
|
||||
ibgDivider = 150;
|
||||
|
||||
break;
|
||||
case 0x002A:
|
||||
ibgMediaType = "DVD+RW DL";
|
||||
ibgDivider = 1353;
|
||||
|
||||
break;
|
||||
case 0x002B:
|
||||
ibgMediaType = "DVD+R DL";
|
||||
ibgDivider = 1353;
|
||||
|
||||
break;
|
||||
case 0x0040:
|
||||
ibgMediaType = "BD-ROM";
|
||||
ibgDivider = 4500;
|
||||
|
||||
break;
|
||||
case 0x0041:
|
||||
case 0x0042:
|
||||
ibgMediaType = "BD-R";
|
||||
ibgDivider = 4500;
|
||||
|
||||
break;
|
||||
case 0x0043:
|
||||
ibgMediaType = "BD-RE";
|
||||
ibgDivider = 4500;
|
||||
|
||||
break;
|
||||
case 0x0050:
|
||||
ibgMediaType = "HD DVD-ROM";
|
||||
ibgDivider = 4500;
|
||||
|
||||
break;
|
||||
case 0x0051:
|
||||
ibgMediaType = "HD DVD-R";
|
||||
ibgDivider = 4500;
|
||||
|
||||
break;
|
||||
case 0x0052:
|
||||
ibgMediaType = "HD DVD-RAM";
|
||||
ibgDivider = 4500;
|
||||
|
||||
break;
|
||||
case 0x0053:
|
||||
ibgMediaType = "HD DVD-RW";
|
||||
ibgDivider = 4500;
|
||||
|
||||
break;
|
||||
case 0x0058:
|
||||
ibgMediaType = "HD DVD-R DL";
|
||||
ibgDivider = 4500;
|
||||
|
||||
break;
|
||||
case 0x005A:
|
||||
ibgMediaType = "HD DVD-RW DL";
|
||||
ibgDivider = 4500;
|
||||
|
||||
break;
|
||||
default:
|
||||
ibgMediaType = "Unknown";
|
||||
ibgDivider = 1353;
|
||||
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Adds a new speed snapshot to the log
|
||||
/// </summary>
|
||||
/// <summary>Adds a new speed snapshot to the log</summary>
|
||||
/// <param name="sector">Sector for the snapshot</param>
|
||||
/// <param name="currentSpeed">Current speed at the snapshot</param>
|
||||
internal void Write(ulong sector, double currentSpeed)
|
||||
{
|
||||
if(logFile == null) return;
|
||||
if(logFile == null)
|
||||
return;
|
||||
|
||||
ibgIntSpeed += currentSpeed;
|
||||
ibgSampleRate += (int)Math.Floor((DateTime.Now - ibgDatePoint).TotalMilliseconds);
|
||||
ibgSnaps++;
|
||||
|
||||
if(ibgSampleRate < 100) return;
|
||||
if(ibgSampleRate < 100)
|
||||
return;
|
||||
|
||||
if(ibgIntSpeed > 0 && !ibgStartSet)
|
||||
if(ibgIntSpeed > 0 &&
|
||||
!ibgStartSet)
|
||||
{
|
||||
ibgStartSpeed = ibgIntSpeed / ibgSnaps / ibgDivider;
|
||||
ibgStartSet = true;
|
||||
}
|
||||
|
||||
ibgSb.AppendFormat("{0:0.00},{1},{2:0},0", ibgIntSpeed / ibgSnaps / ibgDivider, ibgIntSector, ibgSampleRate)
|
||||
.AppendLine();
|
||||
if(ibgIntSpeed / ibgSnaps / ibgDivider > ibgMaxSpeed) ibgMaxSpeed = ibgIntSpeed / ibgDivider;
|
||||
ibgSb.AppendFormat("{0:0.00},{1},{2:0},0", ibgIntSpeed / ibgSnaps / ibgDivider, ibgIntSector,
|
||||
ibgSampleRate).AppendLine();
|
||||
|
||||
if(ibgIntSpeed / ibgSnaps / ibgDivider > ibgMaxSpeed)
|
||||
ibgMaxSpeed = ibgIntSpeed / ibgDivider;
|
||||
|
||||
ibgDatePoint = DateTime.Now;
|
||||
ibgIntSpeed = 0;
|
||||
@@ -236,9 +266,7 @@ namespace DiscImageChef.Core.Logging
|
||||
ibgIntSector = sector;
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Closes the IMGBurn log
|
||||
/// </summary>
|
||||
/// <summary>Closes the IMGBurn log</summary>
|
||||
/// <param name="dev">Device</param>
|
||||
/// <param name="blocks">Media blocks</param>
|
||||
/// <param name="blockSize">Bytes per block</param>
|
||||
@@ -246,19 +274,22 @@ namespace DiscImageChef.Core.Logging
|
||||
/// <param name="currentSpeed">Speed at the end</param>
|
||||
/// <param name="averageSpeed">Average speed</param>
|
||||
/// <param name="devicePath">Device path</param>
|
||||
internal void Close(Device dev, ulong blocks, ulong blockSize, double totalSeconds,
|
||||
double currentSpeed,
|
||||
internal void Close(Device dev, ulong blocks, ulong blockSize, double totalSeconds, double currentSpeed,
|
||||
double averageSpeed, string devicePath)
|
||||
{
|
||||
if(logFile == null) return;
|
||||
if(logFile == null)
|
||||
return;
|
||||
|
||||
FileStream ibgFs = new FileStream(logFile, FileMode.Create);
|
||||
StringBuilder ibgHeader = new StringBuilder();
|
||||
string ibgBusType;
|
||||
var ibgFs = new FileStream(logFile, FileMode.Create);
|
||||
var ibgHeader = new StringBuilder();
|
||||
string ibgBusType;
|
||||
|
||||
if(dev.IsUsb) ibgBusType = "USB";
|
||||
else if(dev.IsFireWire) ibgBusType = "FireWire";
|
||||
else ibgBusType = dev.Type.ToString();
|
||||
if(dev.IsUsb)
|
||||
ibgBusType = "USB";
|
||||
else if(dev.IsFireWire)
|
||||
ibgBusType = "FireWire";
|
||||
else
|
||||
ibgBusType = dev.Type.ToString();
|
||||
|
||||
ibgHeader.AppendLine("IBGD");
|
||||
ibgHeader.AppendLine();
|
||||
@@ -270,11 +301,13 @@ namespace DiscImageChef.Core.Logging
|
||||
ibgHeader.AppendFormat("SAMPLE_RATE={0}", 100).AppendLine();
|
||||
|
||||
ibgHeader.AppendLine();
|
||||
|
||||
ibgHeader.AppendFormat("DEVICE=[0:0:0] {0} {1} ({2}) ({3})", dev.Manufacturer, dev.Model, devicePath,
|
||||
ibgBusType).AppendLine();
|
||||
|
||||
ibgHeader.AppendLine("DEVICE_ADDRESS=0:0:0");
|
||||
ibgHeader.AppendFormat("DEVICE_MAKEMODEL={0} {1}", dev.Manufacturer, dev.Model).AppendLine();
|
||||
ibgHeader.AppendFormat("DEVICE_FIRMWAREVERSION={0}", dev.Revision).AppendLine();
|
||||
ibgHeader.AppendFormat("DEVICE_FIRMWAREVERSION={0}", dev.FirmwareRevision).AppendLine();
|
||||
ibgHeader.AppendFormat("DEVICE_DRIVELETTER={0}", devicePath).AppendLine();
|
||||
ibgHeader.AppendFormat("DEVICE_BUSTYPE={0}", ibgBusType).AppendLine();
|
||||
ibgHeader.AppendLine();
|
||||
@@ -307,7 +340,7 @@ namespace DiscImageChef.Core.Logging
|
||||
ibgHeader.AppendLine();
|
||||
ibgHeader.Replace("\r\n", "\n").Replace("\r", "\n").Replace("\n", "\r\n");
|
||||
|
||||
StreamWriter sr = new StreamWriter(ibgFs);
|
||||
var sr = new StreamWriter(ibgFs);
|
||||
sr.Write(ibgHeader);
|
||||
sr.Close();
|
||||
ibgFs.Close();
|
||||
|
||||
@@ -39,17 +39,13 @@ using DiscImageChef.Devices;
|
||||
|
||||
namespace DiscImageChef.Core.Logging
|
||||
{
|
||||
/// <summary>
|
||||
/// Implements a log in the format used by MHDD
|
||||
/// </summary>
|
||||
class MhddLog
|
||||
/// <summary>Implements a log in the format used by MHDD</summary>
|
||||
internal class MhddLog
|
||||
{
|
||||
string logFile;
|
||||
MemoryStream mhddFs;
|
||||
readonly string logFile;
|
||||
readonly MemoryStream mhddFs;
|
||||
|
||||
/// <summary>
|
||||
/// Initializes the MHDD log
|
||||
/// </summary>
|
||||
/// <summary>Initializes the MHDD log</summary>
|
||||
/// <param name="outputFile">Log file</param>
|
||||
/// <param name="dev">Device</param>
|
||||
/// <param name="blocks">Blocks in media</param>
|
||||
@@ -57,7 +53,9 @@ namespace DiscImageChef.Core.Logging
|
||||
/// <param name="blocksToRead">How many blocks read at once</param>
|
||||
internal MhddLog(string outputFile, Device dev, ulong blocks, ulong blockSize, ulong blocksToRead)
|
||||
{
|
||||
if(dev == null || string.IsNullOrEmpty(outputFile)) return;
|
||||
if(dev == null ||
|
||||
string.IsNullOrEmpty(outputFile))
|
||||
return;
|
||||
|
||||
mhddFs = new MemoryStream();
|
||||
logFile = outputFile;
|
||||
@@ -69,31 +67,39 @@ namespace DiscImageChef.Core.Logging
|
||||
case DeviceType.ATA:
|
||||
case DeviceType.ATAPI:
|
||||
mode = "MODE: IDE";
|
||||
|
||||
break;
|
||||
case DeviceType.SCSI:
|
||||
mode = "MODE: SCSI";
|
||||
|
||||
break;
|
||||
case DeviceType.MMC:
|
||||
mode = "MODE: MMC";
|
||||
|
||||
break;
|
||||
case DeviceType.NVMe:
|
||||
mode = "MODE: NVMe";
|
||||
|
||||
break;
|
||||
case DeviceType.SecureDigital:
|
||||
mode = "MODE: SD";
|
||||
|
||||
break;
|
||||
default:
|
||||
mode = "MODE: IDE";
|
||||
|
||||
break;
|
||||
}
|
||||
|
||||
string device = $"DEVICE: {dev.Manufacturer} {dev.Model}";
|
||||
string fw = $"F/W: {dev.Revision}";
|
||||
string fw = $"F/W: {dev.FirmwareRevision}";
|
||||
string sn = $"S/N: {dev.Serial}";
|
||||
string sectors = string.Format(new CultureInfo("en-US"), "SECTORS: {0:n0}", blocks);
|
||||
string sectors = string.Format(new CultureInfo("en-US"), "SECTORS: {0:n0}", blocks);
|
||||
string sectorsize = string.Format(new CultureInfo("en-US"), "SECTOR SIZE: {0:n0} bytes", blockSize);
|
||||
|
||||
string scanblocksize =
|
||||
string.Format(new CultureInfo("en-US"), "SCAN BLOCK SIZE: {0:n0} sectors", blocksToRead);
|
||||
|
||||
const string MHDD_VER = "VER:2 ";
|
||||
|
||||
byte[] deviceBytes = Encoding.ASCII.GetBytes(device);
|
||||
@@ -108,7 +114,7 @@ namespace DiscImageChef.Core.Logging
|
||||
uint pointer = (uint)(deviceBytes.Length + modeBytes.Length + fwBytes.Length +
|
||||
snBytes.Length +
|
||||
sectorsBytes.Length + sectorsizeBytes.Length + scanblocksizeBytes.Length +
|
||||
verBytes.Length + 2 * 9 + // New lines
|
||||
verBytes.Length + (2 * 9) + // New lines
|
||||
4); // Pointer
|
||||
|
||||
byte[] newLine = new byte[2];
|
||||
@@ -116,49 +122,47 @@ namespace DiscImageChef.Core.Logging
|
||||
newLine[1] = 0x0A;
|
||||
|
||||
mhddFs.Write(BitConverter.GetBytes(pointer), 0, 4);
|
||||
mhddFs.Write(newLine, 0, 2);
|
||||
mhddFs.Write(verBytes, 0, verBytes.Length);
|
||||
mhddFs.Write(newLine, 0, 2);
|
||||
mhddFs.Write(modeBytes, 0, modeBytes.Length);
|
||||
mhddFs.Write(newLine, 0, 2);
|
||||
mhddFs.Write(deviceBytes, 0, deviceBytes.Length);
|
||||
mhddFs.Write(newLine, 0, 2);
|
||||
mhddFs.Write(fwBytes, 0, fwBytes.Length);
|
||||
mhddFs.Write(newLine, 0, 2);
|
||||
mhddFs.Write(snBytes, 0, snBytes.Length);
|
||||
mhddFs.Write(newLine, 0, 2);
|
||||
mhddFs.Write(sectorsBytes, 0, sectorsBytes.Length);
|
||||
mhddFs.Write(newLine, 0, 2);
|
||||
mhddFs.Write(sectorsizeBytes, 0, sectorsizeBytes.Length);
|
||||
mhddFs.Write(newLine, 0, 2);
|
||||
mhddFs.Write(scanblocksizeBytes, 0, scanblocksizeBytes.Length);
|
||||
mhddFs.Write(newLine, 0, 2);
|
||||
mhddFs.Write(newLine, 0, 2);
|
||||
mhddFs.Write(verBytes, 0, verBytes.Length);
|
||||
mhddFs.Write(newLine, 0, 2);
|
||||
mhddFs.Write(modeBytes, 0, modeBytes.Length);
|
||||
mhddFs.Write(newLine, 0, 2);
|
||||
mhddFs.Write(deviceBytes, 0, deviceBytes.Length);
|
||||
mhddFs.Write(newLine, 0, 2);
|
||||
mhddFs.Write(fwBytes, 0, fwBytes.Length);
|
||||
mhddFs.Write(newLine, 0, 2);
|
||||
mhddFs.Write(snBytes, 0, snBytes.Length);
|
||||
mhddFs.Write(newLine, 0, 2);
|
||||
mhddFs.Write(sectorsBytes, 0, sectorsBytes.Length);
|
||||
mhddFs.Write(newLine, 0, 2);
|
||||
mhddFs.Write(sectorsizeBytes, 0, sectorsizeBytes.Length);
|
||||
mhddFs.Write(newLine, 0, 2);
|
||||
mhddFs.Write(scanblocksizeBytes, 0, scanblocksizeBytes.Length);
|
||||
mhddFs.Write(newLine, 0, 2);
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Logs a new read
|
||||
/// </summary>
|
||||
/// <summary>Logs a new read</summary>
|
||||
/// <param name="sector">Starting sector</param>
|
||||
/// <param name="duration">Duration in milliseconds</param>
|
||||
internal void Write(ulong sector, double duration)
|
||||
{
|
||||
if(logFile == null) return;
|
||||
if(logFile == null)
|
||||
return;
|
||||
|
||||
byte[] sectorBytes = BitConverter.GetBytes(sector);
|
||||
byte[] durationBytes = BitConverter.GetBytes((ulong)(duration * 1000));
|
||||
|
||||
mhddFs.Write(sectorBytes, 0, 8);
|
||||
mhddFs.Write(sectorBytes, 0, 8);
|
||||
mhddFs.Write(durationBytes, 0, 8);
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Closes and writes to file the MHDD log
|
||||
/// </summary>
|
||||
/// <summary>Closes and writes to file the MHDD log</summary>
|
||||
internal void Close()
|
||||
{
|
||||
if(logFile == null) return;
|
||||
if(logFile == null)
|
||||
return;
|
||||
|
||||
FileStream fs = new FileStream(logFile, FileMode.Create);
|
||||
var fs = new FileStream(logFile, FileMode.Create);
|
||||
mhddFs.WriteTo(fs);
|
||||
mhddFs.Close();
|
||||
fs.Close();
|
||||
|
||||
@@ -1272,7 +1272,8 @@ namespace DiscImageChef.Core
|
||||
|
||||
ctx.SeenDevices.Add(new DeviceStat
|
||||
{
|
||||
Bus = deviceBus, Manufacturer = dev.Manufacturer, Model = dev.Model, Revision = dev.Revision,
|
||||
Bus = deviceBus, Manufacturer = dev.Manufacturer, Model = dev.Model,
|
||||
Revision = dev.FirmwareRevision,
|
||||
Synchronized = false
|
||||
});
|
||||
|
||||
|
||||
Reference in New Issue
Block a user