mirror of
https://github.com/aaru-dps/Aaru.Server.git
synced 2025-12-16 19:24:27 +00:00
Make sure that device partitions are handled if they're not
mapped by any scheme.
This commit is contained in:
@@ -134,6 +134,21 @@ namespace DiscImageChef.Core
|
||||
DicConsole.DebugWriteLine("Partitions", "Got {0} partitions", childPartitions.Count);
|
||||
}
|
||||
|
||||
// Be sure that device partitions are not excluded if not mapped by any scheme...
|
||||
if(image.ImageInfo.imageHasPartitions)
|
||||
{
|
||||
List<ulong> startLocations = new List<ulong>();
|
||||
|
||||
foreach(Partition detectedPartition in childPartitions)
|
||||
startLocations.Add(detectedPartition.Start);
|
||||
|
||||
foreach(Partition imagePartition in image.GetPartitions())
|
||||
{
|
||||
if(!startLocations.Contains(imagePartition.Start))
|
||||
childPartitions.Add(imagePartition);
|
||||
}
|
||||
}
|
||||
|
||||
Partition[] childArray = childPartitions.OrderBy(part => part.Start).ThenBy(part => part.Length).ThenBy(part => part.Scheme).ToArray();
|
||||
|
||||
for(long i = 0; i < childArray.LongLength; i++)
|
||||
|
||||
@@ -539,10 +539,6 @@ namespace DiscImageChef.Core
|
||||
xmlTrk.FileSystemInformation = new PartitionType[1];
|
||||
if(partitions.Count > 0)
|
||||
{
|
||||
partitions.Add(new Partition {
|
||||
Start = (ulong)xmlTrk.StartSector,
|
||||
Length = (ulong)((xmlTrk.EndSector - xmlTrk.StartSector) + 1)
|
||||
});
|
||||
xmlTrk.FileSystemInformation = new PartitionType[partitions.Count];
|
||||
for(int i = 0; i < partitions.Count; i++)
|
||||
{
|
||||
|
||||
Reference in New Issue
Block a user