From 0ff3296b1f994f99a487309ee8b4b5fee2792398 Mon Sep 17 00:00:00 2001 From: Natalia Portillo Date: Thu, 1 Feb 2018 01:20:41 +0000 Subject: [PATCH] =?UTF-8?q?=F0=9F=90=9BCorrect=20setting=20resume=20before?= =?UTF-8?q?=20closing=20image.?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../Devices/Dumping/CompactDisc.cs | 20 +++++++++---------- DiscImageChef.Core/Devices/Dumping/SBC.cs | 6 +++--- DiscImageChef.Core/Devices/Dumping/XGD.cs | 6 +++--- 3 files changed, 16 insertions(+), 16 deletions(-) diff --git a/DiscImageChef.Core/Devices/Dumping/CompactDisc.cs b/DiscImageChef.Core/Devices/Dumping/CompactDisc.cs index 741cb2d3..18d9c72e 100644 --- a/DiscImageChef.Core/Devices/Dumping/CompactDisc.cs +++ b/DiscImageChef.Core/Devices/Dumping/CompactDisc.cs @@ -482,6 +482,13 @@ namespace DiscImageChef.Core.Devices.Dumping } } + DumpHardwareType currentTry = null; + ExtentsULong extents = null; + ResumeSupport.Process(true, true, blocks, dev.Manufacturer, dev.Model, dev.Serial, dev.PlatformId, + ref resume, ref currentTry, ref extents); + if(currentTry == null || extents == null) + throw new InvalidOperationException("Could not process resume file, not continuing..."); + // Try to read the Lead-in if(dumpLeadIn) { @@ -574,13 +581,6 @@ namespace DiscImageChef.Core.Devices.Dumping DicConsole.WriteLine("SCSI device type: {0}.", dev.ScsiType); DicConsole.WriteLine("Media identified as {0}.", dskType); - DumpHardwareType currentTry = null; - ExtentsULong extents = null; - ResumeSupport.Process(true, true, blocks, dev.Manufacturer, dev.Model, dev.Serial, dev.PlatformId, - ref resume, ref currentTry, ref extents); - if(currentTry == null || extents == null) - throw new InvalidOperationException("Could not process resume file, not continuing..."); - MhddLog mhddLog = new MhddLog(outputPrefix + ".mhddlog.bin", dev, blocks, blockSize, blocksToRead); IbgLog ibgLog = new IbgLog(outputPrefix + ".ibg", 0x0008); bool ret = outputPlugin.Create(outputPath, dskType, formatOptions, blocks, SECTOR_SIZE); @@ -888,15 +888,15 @@ namespace DiscImageChef.Core.Devices.Dumping throw new ArgumentException(outputPlugin.ErrorMessage); } + resume.BadBlocks.Sort(); + currentTry.Extents = ExtentsConverter.ToMetadata(extents); + outputPlugin.SetDumpHardware(resume.Tries); if(preSidecar != null) outputPlugin.SetCicmMetadata(preSidecar); dumpLog.WriteLine("Closing output file."); DicConsole.WriteLine("Closing output file."); outputPlugin.Close(); - resume.BadBlocks.Sort(); - currentTry.Extents = ExtentsConverter.ToMetadata(extents); - if(aborted) { dumpLog.WriteLine("Aborted!"); diff --git a/DiscImageChef.Core/Devices/Dumping/SBC.cs b/DiscImageChef.Core/Devices/Dumping/SBC.cs index 905e5b76..c6bbbaf0 100644 --- a/DiscImageChef.Core/Devices/Dumping/SBC.cs +++ b/DiscImageChef.Core/Devices/Dumping/SBC.cs @@ -646,15 +646,15 @@ namespace DiscImageChef.Core.Devices.Dumping } } + resume.BadBlocks.Sort(); + currentTry.Extents = ExtentsConverter.ToMetadata(extents); + outputPlugin.SetDumpHardware(resume.Tries); if(preSidecar != null) outputPlugin.SetCicmMetadata(preSidecar); dumpLog.WriteLine("Closing output file."); DicConsole.WriteLine("Closing output file."); outputPlugin.Close(); - resume.BadBlocks.Sort(); - currentTry.Extents = ExtentsConverter.ToMetadata(extents); - if(aborted) { dumpLog.WriteLine("Aborted!"); diff --git a/DiscImageChef.Core/Devices/Dumping/XGD.cs b/DiscImageChef.Core/Devices/Dumping/XGD.cs index 8c2131d5..4846e550 100644 --- a/DiscImageChef.Core/Devices/Dumping/XGD.cs +++ b/DiscImageChef.Core/Devices/Dumping/XGD.cs @@ -771,15 +771,15 @@ namespace DiscImageChef.Core.Devices.Dumping throw new ArgumentException(outputPlugin.ErrorMessage); } + resume.BadBlocks.Sort(); + currentTry.Extents = ExtentsConverter.ToMetadata(extents); + outputPlugin.SetDumpHardware(resume.Tries); if(preSidecar != null) outputPlugin.SetCicmMetadata(preSidecar); dumpLog.WriteLine("Closing output file."); DicConsole.WriteLine("Closing output file."); outputPlugin.Close(); - resume.BadBlocks.Sort(); - currentTry.Extents = ExtentsConverter.ToMetadata(extents); - if(aborted) { dumpLog.WriteLine("Aborted!");