mirror of
https://github.com/aaru-dps/Aaru.git
synced 2025-12-16 19:24:25 +00:00
Code styling.
This commit is contained in:
@@ -47,13 +47,17 @@ namespace DiscImageChef.CommonTypes.Metadata
|
||||
[XmlRoot("DicResume", Namespace = "", IsNullable = false)]
|
||||
public class Resume
|
||||
{
|
||||
[XmlElement(DataType = "dateTime")] public DateTime CreationDate;
|
||||
[XmlElement(DataType = "dateTime")] public DateTime LastWriteDate;
|
||||
[XmlElement(DataType = "dateTime")]
|
||||
public DateTime CreationDate;
|
||||
[XmlElement(DataType = "dateTime")]
|
||||
public DateTime LastWriteDate;
|
||||
public bool Removable;
|
||||
public ulong LastBlock;
|
||||
public ulong NextBlock;
|
||||
|
||||
[XmlArrayItem("DumpTry")] public List<DumpHardwareType> Tries;
|
||||
[XmlArrayItem("Block")] public List<ulong> BadBlocks;
|
||||
[XmlArrayItem("DumpTry")]
|
||||
public List<DumpHardwareType> Tries;
|
||||
[XmlArrayItem("Block")]
|
||||
public List<ulong> BadBlocks;
|
||||
}
|
||||
}
|
||||
@@ -142,14 +142,17 @@ namespace DiscImageChef.CommonTypes.Metadata
|
||||
|
||||
public class ChecksumStats
|
||||
{
|
||||
[XmlAttribute] public string algorithm;
|
||||
[XmlText] public double Value;
|
||||
[XmlAttribute]
|
||||
public string algorithm;
|
||||
[XmlText]
|
||||
public double Value;
|
||||
}
|
||||
|
||||
public class BenchmarkStats
|
||||
{
|
||||
public double All;
|
||||
[XmlElement("Checksum")] public List<ChecksumStats> Checksum;
|
||||
[XmlElement("Checksum")]
|
||||
public List<ChecksumStats> Checksum;
|
||||
public double Entropy;
|
||||
public long MaxMemory;
|
||||
public long MinMemory;
|
||||
@@ -158,14 +161,18 @@ namespace DiscImageChef.CommonTypes.Metadata
|
||||
|
||||
public class MediaStats
|
||||
{
|
||||
[XmlAttribute] public bool real;
|
||||
[XmlAttribute] public string type;
|
||||
[XmlText] public long Value;
|
||||
[XmlAttribute]
|
||||
public bool real;
|
||||
[XmlAttribute]
|
||||
public string type;
|
||||
[XmlText]
|
||||
public long Value;
|
||||
}
|
||||
|
||||
public class DeviceStats
|
||||
{
|
||||
[XmlIgnore] public bool ManufacturerSpecified;
|
||||
[XmlIgnore]
|
||||
public bool ManufacturerSpecified;
|
||||
public string Manufacturer { get; set; }
|
||||
public string Model { get; set; }
|
||||
public string Revision { get; set; }
|
||||
|
||||
@@ -247,13 +247,19 @@ namespace DiscImageChef.CommonTypes.Structs
|
||||
[StructLayout(LayoutKind.Explicit)]
|
||||
public struct FileSystemId
|
||||
{
|
||||
[FieldOffset(0)] public bool IsInt;
|
||||
[FieldOffset(1)] public bool IsLong;
|
||||
[FieldOffset(2)] public bool IsGuid;
|
||||
[FieldOffset(0)]
|
||||
public bool IsInt;
|
||||
[FieldOffset(1)]
|
||||
public bool IsLong;
|
||||
[FieldOffset(2)]
|
||||
public bool IsGuid;
|
||||
|
||||
[FieldOffset(3)] public uint Serial32;
|
||||
[FieldOffset(3)] public ulong Serial64;
|
||||
[FieldOffset(3)] public Guid uuid;
|
||||
[FieldOffset(3)]
|
||||
public uint Serial32;
|
||||
[FieldOffset(3)]
|
||||
public ulong Serial64;
|
||||
[FieldOffset(3)]
|
||||
public Guid uuid;
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
|
||||
@@ -812,7 +812,6 @@ namespace DiscImageChef.Core
|
||||
#endif
|
||||
}
|
||||
|
||||
|
||||
IEnumerable<string> statsFiles =
|
||||
Directory.EnumerateFiles(Settings.Settings.StatsPath, "PartialStats_*.xml",
|
||||
SearchOption.TopDirectoryOnly);
|
||||
|
||||
@@ -3473,7 +3473,8 @@ namespace DiscImageChef.Devices
|
||||
/// Reads data stream from device, starting at given address, until a <see cref="StopTransmission" /> follows (ADTC,
|
||||
/// R1)
|
||||
/// </summary>
|
||||
[Obsolete] ReadDatUntilStop = 11,
|
||||
[Obsolete]
|
||||
ReadDatUntilStop = 11,
|
||||
/// <summary>
|
||||
/// Terminates a read/write stream/multiple block operation (AC, R1 / R1b)
|
||||
/// </summary>
|
||||
@@ -3521,7 +3522,8 @@ namespace DiscImageChef.Devices
|
||||
/// <summary>
|
||||
/// Writes data stream from host until a <see cref="StopTransmission" /> follows (ADTC, R1)
|
||||
/// </summary>
|
||||
[Obsolete] WriteDatUntilStop = 20,
|
||||
[Obsolete]
|
||||
WriteDatUntilStop = 20,
|
||||
#endregion Class 3 MMC Commands (Stream write)
|
||||
|
||||
#region Class 4 MMC Commands (Block-oriented write)
|
||||
|
||||
@@ -140,10 +140,14 @@ namespace DiscImageChef.Devices.FreeBSD
|
||||
[SuppressMessage("ReSharper", "MemberCanBePrivate.Global")]
|
||||
struct CamqEntry
|
||||
{
|
||||
[FieldOffset(0)] public ListEntry le;
|
||||
[FieldOffset(0)] public SlistEntry sle;
|
||||
[FieldOffset(0)] public TailqEntry tqe;
|
||||
[FieldOffset(0)] public StailqEntry stqe;
|
||||
[FieldOffset(0)]
|
||||
public ListEntry le;
|
||||
[FieldOffset(0)]
|
||||
public SlistEntry sle;
|
||||
[FieldOffset(0)]
|
||||
public TailqEntry tqe;
|
||||
[FieldOffset(0)]
|
||||
public StailqEntry stqe;
|
||||
}
|
||||
|
||||
[StructLayout(LayoutKind.Sequential)]
|
||||
@@ -540,8 +544,10 @@ namespace DiscImageChef.Devices.FreeBSD
|
||||
[SuppressMessage("ReSharper", "MemberCanBePrivate.Global")]
|
||||
struct DeviceMatchPatternData
|
||||
{
|
||||
[FieldOffset(0)] public ScsiStaticInquiryPattern inq_pat;
|
||||
[FieldOffset(0)] public DeviceIdMatchPattern devid_pat;
|
||||
[FieldOffset(0)]
|
||||
public ScsiStaticInquiryPattern inq_pat;
|
||||
[FieldOffset(0)]
|
||||
public DeviceIdMatchPattern devid_pat;
|
||||
}
|
||||
|
||||
[StructLayout(LayoutKind.Sequential)]
|
||||
@@ -573,9 +579,12 @@ namespace DiscImageChef.Devices.FreeBSD
|
||||
[SuppressMessage("ReSharper", "MemberCanBePrivate.Global")]
|
||||
struct MatchPattern
|
||||
{
|
||||
[FieldOffset(0)] public PeriphMatchPattern periph_pattern;
|
||||
[FieldOffset(0)] public DeviceMatchPattern device_pattern;
|
||||
[FieldOffset(0)] public BusMatchPattern bus_pattern;
|
||||
[FieldOffset(0)]
|
||||
public PeriphMatchPattern periph_pattern;
|
||||
[FieldOffset(0)]
|
||||
public DeviceMatchPattern device_pattern;
|
||||
[FieldOffset(0)]
|
||||
public BusMatchPattern bus_pattern;
|
||||
}
|
||||
|
||||
[StructLayout(LayoutKind.Sequential)]
|
||||
@@ -695,9 +704,12 @@ namespace DiscImageChef.Devices.FreeBSD
|
||||
[SuppressMessage("ReSharper", "MemberCanBePrivate.Global")]
|
||||
struct MatchResult
|
||||
{
|
||||
[FieldOffset(0)] public PeriphMatchResult periph_result;
|
||||
[FieldOffset(0)] public DeviceMatchResult device_result;
|
||||
[FieldOffset(0)] public BusMatchResult bus_result;
|
||||
[FieldOffset(0)]
|
||||
public PeriphMatchResult periph_result;
|
||||
[FieldOffset(0)]
|
||||
public DeviceMatchResult device_result;
|
||||
[FieldOffset(0)]
|
||||
public BusMatchResult bus_result;
|
||||
}
|
||||
|
||||
[StructLayout(LayoutKind.Sequential)]
|
||||
|
||||
@@ -48,7 +48,8 @@ namespace DiscImageChef.Devices.Windows
|
||||
public byte Lun;
|
||||
public byte CdbLength;
|
||||
public byte SenseInfoLength;
|
||||
[MarshalAs(UnmanagedType.U1)] public ScsiIoctlDirection DataIn;
|
||||
[MarshalAs(UnmanagedType.U1)]
|
||||
public ScsiIoctlDirection DataIn;
|
||||
public uint DataTransferLength;
|
||||
public uint TimeOutValue;
|
||||
public IntPtr DataBuffer;
|
||||
@@ -76,7 +77,8 @@ namespace DiscImageChef.Devices.Windows
|
||||
/// <summary>
|
||||
/// Indicates transfer direction and kind of operation
|
||||
/// </summary>
|
||||
[MarshalAs(UnmanagedType.U2)] public AtaFlags AtaFlags;
|
||||
[MarshalAs(UnmanagedType.U2)]
|
||||
public AtaFlags AtaFlags;
|
||||
/// <summary>
|
||||
/// Indicates IDE port or bus, set by driver
|
||||
/// </summary>
|
||||
@@ -134,27 +136,39 @@ namespace DiscImageChef.Devices.Windows
|
||||
struct AtaTaskFile
|
||||
{
|
||||
// Fields for commands sent
|
||||
[FieldOffset(0)] public byte Features;
|
||||
[FieldOffset(6)] public byte Command;
|
||||
[FieldOffset(0)]
|
||||
public byte Features;
|
||||
[FieldOffset(6)]
|
||||
public byte Command;
|
||||
|
||||
// Fields on command return
|
||||
[FieldOffset(0)] public byte Error;
|
||||
[FieldOffset(6)] public byte Status;
|
||||
[FieldOffset(0)]
|
||||
public byte Error;
|
||||
[FieldOffset(6)]
|
||||
public byte Status;
|
||||
|
||||
// Common fields
|
||||
[FieldOffset(1)] public byte SectorCount;
|
||||
[FieldOffset(2)] public byte SectorNumber;
|
||||
[FieldOffset(3)] public byte CylinderLow;
|
||||
[FieldOffset(4)] public byte CylinderHigh;
|
||||
[FieldOffset(5)] public byte DeviceHead;
|
||||
[FieldOffset(7)] public byte Reserved;
|
||||
[FieldOffset(1)]
|
||||
public byte SectorCount;
|
||||
[FieldOffset(2)]
|
||||
public byte SectorNumber;
|
||||
[FieldOffset(3)]
|
||||
public byte CylinderLow;
|
||||
[FieldOffset(4)]
|
||||
public byte CylinderHigh;
|
||||
[FieldOffset(5)]
|
||||
public byte DeviceHead;
|
||||
[FieldOffset(7)]
|
||||
public byte Reserved;
|
||||
}
|
||||
|
||||
[StructLayout(LayoutKind.Sequential)]
|
||||
struct StoragePropertyQuery
|
||||
{
|
||||
[MarshalAs(UnmanagedType.U4)] public StoragePropertyId PropertyId;
|
||||
[MarshalAs(UnmanagedType.U4)] public StorageQueryType QueryType;
|
||||
[MarshalAs(UnmanagedType.U4)]
|
||||
public StoragePropertyId PropertyId;
|
||||
[MarshalAs(UnmanagedType.U4)]
|
||||
public StorageQueryType QueryType;
|
||||
[MarshalAs(UnmanagedType.ByValArray, SizeConst = 1)]
|
||||
public byte[] AdditionalParameters;
|
||||
}
|
||||
@@ -174,8 +188,10 @@ namespace DiscImageChef.Devices.Windows
|
||||
public uint Size;
|
||||
public byte DeviceType;
|
||||
public byte DeviceTypeModifier;
|
||||
[MarshalAs(UnmanagedType.U1)] public bool RemovableMedia;
|
||||
[MarshalAs(UnmanagedType.U1)] public bool CommandQueueing;
|
||||
[MarshalAs(UnmanagedType.U1)]
|
||||
public bool RemovableMedia;
|
||||
[MarshalAs(UnmanagedType.U1)]
|
||||
public bool CommandQueueing;
|
||||
public int VendorIdOffset;
|
||||
public int ProductIdOffset;
|
||||
public int ProductRevisionOffset;
|
||||
|
||||
@@ -41,16 +41,18 @@ namespace DiscImageChef.Filesystems.ISO9660
|
||||
{
|
||||
DecodedVolumeDescriptor decodedVD = new DecodedVolumeDescriptor
|
||||
{
|
||||
SystemIdentifier = Encoding.BigEndianUnicode.GetString(jolietvd.system_id).Replace('\u0000', ' ').TrimEnd(),
|
||||
VolumeIdentifier = Encoding.BigEndianUnicode.GetString(jolietvd.volume_id).Replace('\u0000', ' ').TrimEnd(),
|
||||
SystemIdentifier =
|
||||
Encoding.BigEndianUnicode.GetString(jolietvd.system_id).Replace('\u0000', ' ').TrimEnd(),
|
||||
VolumeIdentifier =
|
||||
Encoding.BigEndianUnicode.GetString(jolietvd.volume_id).Replace('\u0000', ' ').TrimEnd(),
|
||||
VolumeSetIdentifier =
|
||||
Encoding.BigEndianUnicode.GetString(jolietvd.volume_set_id).Replace('\u0000', ' ').TrimEnd(),
|
||||
PublisherIdentifier =
|
||||
Encoding.BigEndianUnicode.GetString(jolietvd.publisher_id).Replace('\u0000', ' ').TrimEnd(),
|
||||
DataPreparerIdentifier =
|
||||
Encoding.BigEndianUnicode.GetString(jolietvd.preparer_id).Replace('\u0000', ' ').TrimEnd(),
|
||||
ApplicationIdentifier =
|
||||
Encoding.BigEndianUnicode.GetString(jolietvd.application_id).Replace('\u0000', ' ').TrimEnd()
|
||||
ApplicationIdentifier = Encoding.BigEndianUnicode.GetString(jolietvd.application_id)
|
||||
.Replace('\u0000', ' ').TrimEnd()
|
||||
};
|
||||
|
||||
if(jolietvd.creation_date[0] < 0x31 || jolietvd.creation_date[0] > 0x39)
|
||||
|
||||
@@ -126,8 +126,7 @@ namespace DiscImageChef.Filters
|
||||
dataStream.Read(tmp, 0, 8);
|
||||
decompressedSize = BitConverter.ToInt64(tmp, 0);
|
||||
dataStream.Seek(0, SeekOrigin.Begin);
|
||||
innerStream =
|
||||
new ForcedSeekStream<LZipStream>(decompressedSize, dataStream, CompressionMode.Decompress);
|
||||
innerStream = new ForcedSeekStream<LZipStream>(decompressedSize, dataStream, CompressionMode.Decompress);
|
||||
opened = true;
|
||||
}
|
||||
|
||||
@@ -144,8 +143,7 @@ namespace DiscImageChef.Filters
|
||||
dataStream.Read(tmp, 0, 8);
|
||||
decompressedSize = BitConverter.ToInt64(tmp, 0);
|
||||
dataStream.Seek(0, SeekOrigin.Begin);
|
||||
innerStream =
|
||||
new ForcedSeekStream<LZipStream>(decompressedSize, dataStream, CompressionMode.Decompress);
|
||||
innerStream = new ForcedSeekStream<LZipStream>(decompressedSize, dataStream, CompressionMode.Decompress);
|
||||
opened = true;
|
||||
}
|
||||
|
||||
|
||||
@@ -33,6 +33,7 @@
|
||||
using System;
|
||||
using System.IO;
|
||||
using Microsoft.Win32.SafeHandles;
|
||||
|
||||
#if !NETSTANDARD2_0
|
||||
using System.Security.AccessControl;
|
||||
#endif
|
||||
|
||||
@@ -152,10 +152,7 @@ namespace DiscImageChef.Commands
|
||||
}
|
||||
}
|
||||
|
||||
if(!wholeDisc)
|
||||
{
|
||||
return (int)ErrorNumber.NoError;
|
||||
}
|
||||
if(!wholeDisc) return (int)ErrorNumber.NoError;
|
||||
|
||||
EntropyResults entropy = entropyCalculator.CalculateMediaEntropy(duplicatedSectors);
|
||||
|
||||
|
||||
Reference in New Issue
Block a user