Refactor, pass whole partition structure to filesystems.

This commit is contained in:
2017-07-19 16:31:08 +01:00
parent 68537136d8
commit 711d19fd04
154 changed files with 980 additions and 760 deletions

View File

@@ -1,4 +1,4 @@
// /***************************************************************************
// /***************************************************************************
// The Disc Image Chef
// ----------------------------------------------------------------------------
//
@@ -35,6 +35,7 @@ using System.Collections.Generic;
using System.Linq;
using System.Runtime.InteropServices;
using System.Text;
using DiscImageChef.CommonTypes;
namespace DiscImageChef.Filesystems
{
@@ -97,7 +98,7 @@ namespace DiscImageChef.Filesystems
CurrentEncoding = Encoding.GetEncoding("iso-8859-15");
}
public Reiser(ImagePlugins.ImagePlugin imagePlugin, ulong partitionStart, ulong partitionEnd, Encoding encoding)
public Reiser(ImagePlugins.ImagePlugin imagePlugin, Partition partition, Encoding encoding)
{
Name = "Reiser Filesystem Plugin";
PluginUUID = new Guid("1D8CD8B8-27E6-410F-9973-D16409225FBA");
@@ -105,7 +106,7 @@ namespace DiscImageChef.Filesystems
CurrentEncoding = Encoding.GetEncoding("iso-8859-15");
}
public override bool Identify(ImagePlugins.ImagePlugin imagePlugin, ulong partitionStart, ulong partitionEnd)
public override bool Identify(ImagePlugins.ImagePlugin imagePlugin, Partition partition)
{
if(imagePlugin.GetSectorSize() < 512)
return false;
@@ -120,7 +121,7 @@ namespace DiscImageChef.Filesystems
if(Marshal.SizeOf(reiserSb) % imagePlugin.GetSectorSize() != 0)
sbSize++;
byte[] sector = imagePlugin.ReadSectors(partitionStart + sbAddr, sbSize);
byte[] sector = imagePlugin.ReadSectors(partition.PartitionStartSector + sbAddr, sbSize);
if(sector.Length < Marshal.SizeOf(reiserSb))
return false;
@@ -134,7 +135,7 @@ namespace DiscImageChef.Filesystems
ReiserJr_Magic.SequenceEqual(reiserSb.magic);
}
public override void GetInformation(ImagePlugins.ImagePlugin imagePlugin, ulong partitionStart, ulong partitionEnd, out string information)
public override void GetInformation(ImagePlugins.ImagePlugin imagePlugin, Partition partition, out string information)
{
information = "";
if(imagePlugin.GetSectorSize() < 512)
@@ -150,7 +151,7 @@ namespace DiscImageChef.Filesystems
if(Marshal.SizeOf(reiserSb) % imagePlugin.GetSectorSize() != 0)
sbSize++;
byte[] sector = imagePlugin.ReadSectors(partitionStart + sbAddr, sbSize);
byte[] sector = imagePlugin.ReadSectors(partition.PartitionStartSector + sbAddr, sbSize);
if(sector.Length < Marshal.SizeOf(reiserSb))
return;