From 29343d41295bfdb605aafb93291592ffa944a825 Mon Sep 17 00:00:00 2001 From: Natalia Portillo Date: Thu, 5 Oct 2023 01:52:48 +0100 Subject: [PATCH] Fix naming. --- Aaru.CommonTypes | 2 +- Aaru.Core/Graphics/Spiral.cs | 6 +- Aaru.Decryption | 2 +- Aaru.Devices/Device/Constructor.cs | 2 +- Aaru.Devices/Device/Variables.cs | 38 +-- Aaru.Devices/Linux/Command.cs | 30 +- Aaru.Devices/Linux/Device.cs | 34 +-- Aaru.Devices/Remote/Command.cs | 26 +- Aaru.Devices/Remote/Device.cs | 20 +- Aaru.Devices/Windows/Command.cs | 28 +- Aaru.Devices/Windows/Device.cs | 30 +- Aaru.Devices/Windows/Usb.cs | 263 +++++++++--------- Aaru.Devices/Windows/UsbFunctions.cs | 2 +- Aaru.Filesystems/AppleDOS/Dir.cs | 16 +- Aaru.Filesystems/AppleDOS/File.cs | 6 +- Aaru.Filesystems/AppleDOS/Structs.cs | 6 +- Aaru.Filesystems/CPM/Dir.cs | 16 +- Aaru.Filesystems/CPM/File.cs | 6 +- Aaru.Filesystems/CPM/Structs.cs | 6 +- Aaru.Filesystems/FAT/Dir.cs | 36 +-- Aaru.Filesystems/FAT/File.cs | 14 +- Aaru.Filesystems/FAT/Structs.cs | 6 +- Aaru.Filesystems/FATX/Dir.cs | 32 +-- Aaru.Filesystems/FATX/File.cs | 14 +- Aaru.Filesystems/FATX/Structs.cs | 6 +- Aaru.Filesystems/ISO9660/Dir.cs | 58 ++-- Aaru.Filesystems/ISO9660/File.cs | 26 +- Aaru.Filesystems/ISO9660/ISO9660.cs | 2 +- Aaru.Filesystems/ISO9660/PathTable.cs | 4 +- Aaru.Filesystems/ISO9660/Structs/Internal.cs | 6 +- Aaru.Filesystems/ISO9660/Super.cs | 18 +- Aaru.Filesystems/LisaFS/Dir.cs | 16 +- Aaru.Filesystems/LisaFS/File.cs | 16 +- Aaru.Filesystems/LisaFS/Structs.cs | 6 +- Aaru.Filesystems/Opera/Dir.cs | 28 +- Aaru.Filesystems/Opera/File.cs | 22 +- Aaru.Filesystems/Opera/Structs.cs | 6 +- Aaru.Filesystems/UCSDPascal/Dir.cs | 16 +- Aaru.Filesystems/UCSDPascal/File.cs | 6 +- Aaru.Filesystems/UCSDPascal/Structs.cs | 6 +- .../ViewModels/Dialogs/PluginsViewModel.cs | 2 +- .../ViewModels/Panels/DeviceInfoViewModel.cs | 8 +- .../ViewModels/Panels/ImageInfoViewModel.cs | 8 +- .../ViewModels/Panels/MediaInfoViewModel.cs | 6 +- .../Tabs/CompactDiscInfoViewModel.cs | 2 +- Aaru.Gui/Views/Dialogs/PluginsDialog.xaml | 16 +- Aaru.Gui/Views/Panels/DeviceInfo.xaml | 8 +- Aaru.Gui/Views/Panels/ImageInfo.xaml | 8 +- Aaru.Gui/Views/Panels/MediaInfo.xaml | 6 +- Aaru.Gui/Views/Tabs/CompactDiscInfo.xaml | 2 +- Aaru.Images/A2R/A2R.cs | 10 +- Aaru.Images/A2R/Constants.cs | 4 +- Aaru.Images/A2R/Enums.cs | 4 +- Aaru.Images/A2R/Helpers.cs | 6 +- Aaru.Images/A2R/Identify.cs | 2 +- Aaru.Images/A2R/Read.cs | 114 ++++---- Aaru.Images/A2R/Structs.cs | 6 +- Aaru.Images/A2R/Write.cs | 40 +-- Aaru.Partitions/Acorn.cs | 2 +- Aaru.Partitions/AppleMap.cs | 2 +- Aaru.Partitions/Apricot.cs | 2 +- Aaru.Partitions/Atari.cs | 4 +- Aaru.Partitions/Authors.cs | 2 +- Aaru.Partitions/BSD.cs | 2 +- Aaru.Partitions/DEC.cs | 2 +- Aaru.Partitions/DragonFlyBSD.cs | 2 +- Aaru.Partitions/GPT.cs | 2 +- Aaru.Partitions/Human68k.cs | 2 +- Aaru.Partitions/MBR.cs | 2 +- Aaru.Partitions/NeXT.cs | 2 +- Aaru.Partitions/PC98.cs | 2 +- Aaru.Partitions/Plan9.cs | 2 +- Aaru.Partitions/RDB.cs | 2 +- Aaru.Partitions/RioKarma.cs | 2 +- Aaru.Partitions/SGI.cs | 2 +- Aaru.Partitions/Sun.cs | 2 +- Aaru.Partitions/UNIX.cs | 2 +- Aaru.Partitions/VTOC.cs | 2 +- Aaru.Partitions/XENIX.cs | 2 +- Aaru.Partitions/Xbox.cs | 2 +- Aaru/Commands/Image/Convert.cs | 2 +- 81 files changed, 590 insertions(+), 593 deletions(-) diff --git a/Aaru.CommonTypes b/Aaru.CommonTypes index cfb704e3e..b414db954 160000 --- a/Aaru.CommonTypes +++ b/Aaru.CommonTypes @@ -1 +1 @@ -Subproject commit cfb704e3effaae4111a35f51f0c02676971deb0f +Subproject commit b414db95417f5b084a816c34321612103c96dda9 diff --git a/Aaru.Core/Graphics/Spiral.cs b/Aaru.Core/Graphics/Spiral.cs index 93726a4ad..2ca7fd389 100644 --- a/Aaru.Core/Graphics/Spiral.cs +++ b/Aaru.Core/Graphics/Spiral.cs @@ -620,9 +620,9 @@ public sealed class Spiral : IMediaGraph /// Center of the spiral start /// Minimum radius before which the spiral must have no points /// Radius at which the spiral will end - /// TODO: Something trigonometry something something... + /// TODO: Something trigonometry something something... /// List of points to draw the specified spiral - static List GetSpiralPoints(SKPoint center, float minRadius, float maxRadius, float A) + static List GetSpiralPoints(SKPoint center, float minRadius, float maxRadius, float a) { // Get the points. List points = new(); @@ -631,7 +631,7 @@ public sealed class Spiral : IMediaGraph for(float theta = 0;; theta += dtheta) { // Calculate r. - float r = A * theta; + float r = a * theta; if(r < minRadius) continue; diff --git a/Aaru.Decryption b/Aaru.Decryption index a85f1ce49..39d11a44c 160000 --- a/Aaru.Decryption +++ b/Aaru.Decryption @@ -1 +1 @@ -Subproject commit a85f1ce494f35c23da7feba989c20ac1d45374de +Subproject commit 39d11a44ca956bbcd168d69bf9734c9e598d0224 diff --git a/Aaru.Devices/Device/Constructor.cs b/Aaru.Devices/Device/Constructor.cs index 66fd3d855..71166b6d9 100644 --- a/Aaru.Devices/Device/Constructor.cs +++ b/Aaru.Devices/Device/Constructor.cs @@ -204,7 +204,7 @@ public partial class Device dev.Model = dev.FireWireModelName; if(string.IsNullOrEmpty(dev.Serial)) - dev.Serial = $"{dev._firewireGuid:X16}"; + dev.Serial = $"{dev.FirewireGuid:X16}"; else { foreach(char c in dev.Serial.Where(c => !char.IsControl(c))) diff --git a/Aaru.Devices/Device/Variables.cs b/Aaru.Devices/Device/Variables.cs index 1054a8f9c..df76123f1 100644 --- a/Aaru.Devices/Device/Variables.cs +++ b/Aaru.Devices/Device/Variables.cs @@ -38,24 +38,24 @@ namespace Aaru.Devices; public partial class Device { - const string ATA_MODULE_NAME = "ATA Device"; - const string SCSI_MODULE_NAME = "SCSI Device"; - const string SD_MODULE_NAME = "SecureDigital Device"; - const string MMC_MODULE_NAME = "MultiMediaCard Device"; - private protected byte[] _cachedCid; + const string ATA_MODULE_NAME = "ATA Device"; + const string SCSI_MODULE_NAME = "SCSI Device"; + const string SD_MODULE_NAME = "SecureDigital Device"; + const string MMC_MODULE_NAME = "MultiMediaCard Device"; // MMC and SecureDigital, values that need to be get with card idle, something that may // not be possible to do but usually is already done by the SDHCI driver. - private protected byte[] _cachedCsd; - private protected byte[] _cachedOcr; - private protected byte[] _cachedScr; + private protected byte[] CachedCid; + private protected byte[] CachedCsd; + private protected byte[] CachedOcr; + private protected byte[] CachedScr; - private protected string _devicePath; - private protected ulong _firewireGuid; - private protected uint _firewireModel; - private protected uint _firewireVendor; - private protected ushort _usbProduct; - private protected ushort _usbVendor; + private protected string DevicePath; + private protected ulong FirewireGuid; + private protected uint FirewireModel; + private protected uint FirewireVendor; + private protected ushort UsbProduct; + private protected ushort UsbVendor; /// Gets the Platform ID for this device /// The Platform ID @@ -107,11 +107,11 @@ public partial class Device /// Gets the USB vendor ID. /// The USB vendor ID. - public ushort UsbVendorId => _usbVendor; + public ushort UsbVendorId => UsbVendor; /// Gets the USB product ID. /// The USB product ID. - public ushort UsbProductId => _usbProduct; + public ushort UsbProductId => UsbProduct; /// Gets the USB descriptors. /// The USB descriptors. @@ -135,11 +135,11 @@ public partial class Device /// Gets the FireWire GUID /// The FireWire GUID. - public ulong FireWireGuid => _firewireGuid; + public ulong FireWireGuid => FirewireGuid; /// Gets the FireWire model number /// The FireWire model. - public uint FireWireModel => _firewireModel; + public uint FireWireModel => FirewireModel; /// Gets the FireWire model name. /// The FireWire model name. @@ -147,7 +147,7 @@ public partial class Device /// Gets the FireWire vendor number. /// The FireWire vendor number. - public uint FireWireVendor => _firewireVendor; + public uint FireWireVendor => FirewireVendor; /// Gets the FireWire vendor name. /// The FireWire vendor name. diff --git a/Aaru.Devices/Linux/Command.cs b/Aaru.Devices/Linux/Command.cs index 187da79b8..58d4fc373 100644 --- a/Aaru.Devices/Linux/Command.cs +++ b/Aaru.Devices/Linux/Command.cs @@ -370,11 +370,11 @@ partial class Device switch(command) { - case MmcCommands.SendCid when _cachedCid != null: + case MmcCommands.SendCid when CachedCid != null: { cmdStopwatch.Restart(); - buffer = new byte[_cachedCid.Length]; - Array.Copy(_cachedCid, buffer, buffer.Length); + buffer = new byte[CachedCid.Length]; + Array.Copy(CachedCid, buffer, buffer.Length); response = new uint[4]; sense = false; cmdStopwatch.Stop(); @@ -382,11 +382,11 @@ partial class Device return 0; } - case MmcCommands.SendCsd when _cachedCid != null: + case MmcCommands.SendCsd when CachedCid != null: { cmdStopwatch.Restart(); - buffer = new byte[_cachedCsd.Length]; - Array.Copy(_cachedCsd, buffer, buffer.Length); + buffer = new byte[CachedCsd.Length]; + Array.Copy(CachedCsd, buffer, buffer.Length); response = new uint[4]; sense = false; cmdStopwatch.Stop(); @@ -394,11 +394,11 @@ partial class Device return 0; } - case (MmcCommands)SecureDigitalCommands.SendScr when _cachedScr != null: + case (MmcCommands)SecureDigitalCommands.SendScr when CachedScr != null: { cmdStopwatch.Restart(); - buffer = new byte[_cachedScr.Length]; - Array.Copy(_cachedScr, buffer, buffer.Length); + buffer = new byte[CachedScr.Length]; + Array.Copy(CachedScr, buffer, buffer.Length); response = new uint[4]; sense = false; cmdStopwatch.Stop(); @@ -406,12 +406,12 @@ partial class Device return 0; } - case (MmcCommands)SecureDigitalCommands.SendOperatingCondition when _cachedOcr != null: - case MmcCommands.SendOpCond when _cachedOcr != null: + case (MmcCommands)SecureDigitalCommands.SendOperatingCondition when CachedOcr != null: + case MmcCommands.SendOpCond when CachedOcr != null: { cmdStopwatch.Restart(); - buffer = new byte[_cachedOcr.Length]; - Array.Copy(_cachedOcr, buffer, buffer.Length); + buffer = new byte[CachedOcr.Length]; + Array.Copy(CachedOcr, buffer, buffer.Length); response = new uint[4]; sense = false; cmdStopwatch.Stop(); @@ -594,7 +594,7 @@ partial class Device return true; } - int newFd = Extern.open(_devicePath, FileFlags.ReadWrite | FileFlags.NonBlocking | FileFlags.CreateNew); + int newFd = Extern.open(DevicePath, FileFlags.ReadWrite | FileFlags.NonBlocking | FileFlags.CreateNew); if(newFd >= 0) { @@ -614,7 +614,7 @@ partial class Device return true; } - newFd = Extern.open(_devicePath, FileFlags.Readonly | FileFlags.NonBlocking); + newFd = Extern.open(DevicePath, FileFlags.Readonly | FileFlags.NonBlocking); if(newFd < 0) { diff --git a/Aaru.Devices/Linux/Device.cs b/Aaru.Devices/Linux/Device.cs index c310209b4..fa83d719d 100644 --- a/Aaru.Devices/Linux/Device.cs +++ b/Aaru.Devices/Linux/Device.cs @@ -126,49 +126,49 @@ partial class Device : Devices.Device if(File.Exists("/sys/block/" + devPath + "/device/csd")) { - int len = ConvertFromFileHexAscii("/sys/block/" + devPath + "/device/csd", out dev._cachedCsd); + int len = ConvertFromFileHexAscii("/sys/block/" + devPath + "/device/csd", out dev.CachedCsd); if(len == 0) - dev._cachedCsd = null; + dev.CachedCsd = null; } if(File.Exists("/sys/block/" + devPath + "/device/cid")) { - int len = ConvertFromFileHexAscii("/sys/block/" + devPath + "/device/cid", out dev._cachedCid); + int len = ConvertFromFileHexAscii("/sys/block/" + devPath + "/device/cid", out dev.CachedCid); if(len == 0) - dev._cachedCid = null; + dev.CachedCid = null; } if(File.Exists("/sys/block/" + devPath + "/device/scr")) { - int len = ConvertFromFileHexAscii("/sys/block/" + devPath + "/device/scr", out dev._cachedScr); + int len = ConvertFromFileHexAscii("/sys/block/" + devPath + "/device/scr", out dev.CachedScr); if(len == 0) - dev._cachedScr = null; + dev.CachedScr = null; } if(File.Exists("/sys/block/" + devPath + "/device/ocr")) { - int len = ConvertFromFileHexAscii("/sys/block/" + devPath + "/device/ocr", out dev._cachedOcr); + int len = ConvertFromFileHexAscii("/sys/block/" + devPath + "/device/ocr", out dev.CachedOcr); if(len == 0) - dev._cachedOcr = null; + dev.CachedOcr = null; } } } #region SecureDigital / MultiMediaCard - if(dev._cachedCid != null) + if(dev.CachedCid != null) { dev.ScsiType = PeripheralDeviceTypes.DirectAccess; dev.IsRemovable = false; - if(dev._cachedScr != null) + if(dev.CachedScr != null) { dev.Type = DeviceType.SecureDigital; - CID decoded = Decoders.SecureDigital.Decoders.DecodeCID(dev._cachedCid); + CID decoded = Decoders.SecureDigital.Decoders.DecodeCID(dev.CachedCid); dev.Manufacturer = VendorString.Prettify(decoded.Manufacturer); dev.Model = decoded.ProductName; @@ -180,7 +180,7 @@ partial class Device : Devices.Device else { dev.Type = DeviceType.MMC; - Decoders.MMC.CID decoded = Decoders.MMC.Decoders.DecodeCID(dev._cachedCid); + Decoders.MMC.CID decoded = Decoders.MMC.Decoders.DecodeCID(dev.CachedCid); dev.Manufacturer = VendorString.Prettify(decoded.Manufacturer); dev.Model = decoded.ProductName; @@ -234,7 +234,7 @@ partial class Device : Devices.Device string usbTemp = usbSr.ReadToEnd(); ushort.TryParse(usbTemp, NumberStyles.HexNumber, CultureInfo.InvariantCulture, - out dev._usbProduct); + out dev.UsbProduct); usbSr.Close(); @@ -242,7 +242,7 @@ partial class Device : Devices.Device usbTemp = usbSr.ReadToEnd(); ushort.TryParse(usbTemp, NumberStyles.HexNumber, CultureInfo.InvariantCulture, - out dev._usbVendor); + out dev.UsbVendor); usbSr.Close(); @@ -305,7 +305,7 @@ partial class Device : Devices.Device string fwTemp = fwSr.ReadToEnd(); uint.TryParse(fwTemp, NumberStyles.HexNumber, CultureInfo.InvariantCulture, - out dev._firewireModel); + out dev.FirewireModel); fwSr.Close(); @@ -313,7 +313,7 @@ partial class Device : Devices.Device fwTemp = fwSr.ReadToEnd(); uint.TryParse(fwTemp, NumberStyles.HexNumber, CultureInfo.InvariantCulture, - out dev._firewireVendor); + out dev.FirewireVendor); fwSr.Close(); @@ -321,7 +321,7 @@ partial class Device : Devices.Device fwTemp = fwSr.ReadToEnd(); ulong.TryParse(fwTemp, NumberStyles.HexNumber, CultureInfo.InvariantCulture, - out dev._firewireGuid); + out dev.FirewireGuid); fwSr.Close(); diff --git a/Aaru.Devices/Remote/Command.cs b/Aaru.Devices/Remote/Command.cs index 3ed3a192e..685676b56 100644 --- a/Aaru.Devices/Remote/Command.cs +++ b/Aaru.Devices/Remote/Command.cs @@ -103,11 +103,11 @@ public partial class Device switch(command) { - case MmcCommands.SendCid when _cachedCid != null: + case MmcCommands.SendCid when CachedCid != null: { cmdStopwatch.Restart(); - buffer = new byte[_cachedCid.Length]; - Array.Copy(_cachedCid, buffer, buffer.Length); + buffer = new byte[CachedCid.Length]; + Array.Copy(CachedCid, buffer, buffer.Length); response = new uint[4]; sense = false; cmdStopwatch.Stop(); @@ -115,11 +115,11 @@ public partial class Device return 0; } - case MmcCommands.SendCsd when _cachedCid != null: + case MmcCommands.SendCsd when CachedCid != null: { cmdStopwatch.Restart(); - buffer = new byte[_cachedCsd.Length]; - Array.Copy(_cachedCsd, buffer, buffer.Length); + buffer = new byte[CachedCsd.Length]; + Array.Copy(CachedCsd, buffer, buffer.Length); response = new uint[4]; sense = false; cmdStopwatch.Stop(); @@ -127,11 +127,11 @@ public partial class Device return 0; } - case (MmcCommands)SecureDigitalCommands.SendScr when _cachedScr != null: + case (MmcCommands)SecureDigitalCommands.SendScr when CachedScr != null: { cmdStopwatch.Restart(); - buffer = new byte[_cachedScr.Length]; - Array.Copy(_cachedScr, buffer, buffer.Length); + buffer = new byte[CachedScr.Length]; + Array.Copy(CachedScr, buffer, buffer.Length); response = new uint[4]; sense = false; cmdStopwatch.Stop(); @@ -139,12 +139,12 @@ public partial class Device return 0; } - case (MmcCommands)SecureDigitalCommands.SendOperatingCondition when _cachedOcr != null: - case MmcCommands.SendOpCond when _cachedOcr != null: + case (MmcCommands)SecureDigitalCommands.SendOperatingCondition when CachedOcr != null: + case MmcCommands.SendOpCond when CachedOcr != null: { cmdStopwatch.Restart(); - buffer = new byte[_cachedOcr.Length]; - Array.Copy(_cachedOcr, buffer, buffer.Length); + buffer = new byte[CachedOcr.Length]; + Array.Copy(CachedOcr, buffer, buffer.Length); response = new uint[4]; sense = false; cmdStopwatch.Stop(); diff --git a/Aaru.Devices/Remote/Device.cs b/Aaru.Devices/Remote/Device.cs index 6bc8c9dbf..100c0f47c 100644 --- a/Aaru.Devices/Remote/Device.cs +++ b/Aaru.Devices/Remote/Device.cs @@ -107,7 +107,7 @@ public sealed partial class Device : Devices.Device if(devicePath.StartsWith("dev", StringComparison.Ordinal)) devicePath = $"/{devicePath}"; - dev._devicePath = devicePath; + dev.DevicePath = devicePath; try { @@ -153,8 +153,8 @@ public sealed partial class Device : Devices.Device { case DeviceType.SecureDigital: case DeviceType.MMC: - if(!dev._remote.GetSdhciRegisters(out dev._cachedCsd, out dev._cachedCid, out dev._cachedOcr, - out dev._cachedScr)) + if(!dev._remote.GetSdhciRegisters(out dev.CachedCsd, out dev.CachedCid, out dev.CachedOcr, + out dev.CachedScr)) { dev.Type = DeviceType.SCSI; dev.ScsiType = PeripheralDeviceTypes.DirectAccess; @@ -165,15 +165,15 @@ public sealed partial class Device : Devices.Device #region SecureDigital / MultiMediaCard - if(dev._cachedCid != null) + if(dev.CachedCid != null) { dev.ScsiType = PeripheralDeviceTypes.DirectAccess; dev.IsRemovable = false; - if(dev._cachedScr != null) + if(dev.CachedScr != null) { dev.Type = DeviceType.SecureDigital; - CID decoded = Decoders.SecureDigital.Decoders.DecodeCID(dev._cachedCid); + CID decoded = Decoders.SecureDigital.Decoders.DecodeCID(dev.CachedCid); dev.Manufacturer = VendorString.Prettify(decoded.Manufacturer); dev.Model = decoded.ProductName; @@ -185,7 +185,7 @@ public sealed partial class Device : Devices.Device else { dev.Type = DeviceType.MMC; - Decoders.MMC.CID decoded = Decoders.MMC.Decoders.DecodeCID(dev._cachedCid); + Decoders.MMC.CID decoded = Decoders.MMC.Decoders.DecodeCID(dev.CachedCid); dev.Manufacturer = Decoders.MMC.VendorString.Prettify(decoded.Manufacturer); dev.Model = decoded.ProductName; @@ -208,8 +208,8 @@ public sealed partial class Device : Devices.Device { dev.IsUsb = true; dev.UsbDescriptors = remoteUsbDescriptors; - dev._usbVendor = remoteUsbVendor; - dev._usbProduct = remoteUsbProduct; + dev.UsbVendor = remoteUsbVendor; + dev.UsbProduct = remoteUsbProduct; dev.UsbManufacturerString = remoteUsbManufacturer; dev.UsbProductString = remoteUsbProductString; dev.UsbSerialString = remoteUsbSerial; @@ -219,7 +219,7 @@ public sealed partial class Device : Devices.Device #region FireWire - if(dev._remote.GetFireWireData(out dev._firewireVendor, out dev._firewireModel, out dev._firewireGuid, + if(dev._remote.GetFireWireData(out dev.FirewireVendor, out dev.FirewireModel, out dev.FirewireGuid, out string remoteFireWireVendorName, out string remoteFireWireModelName)) { dev.IsFireWire = true; diff --git a/Aaru.Devices/Windows/Command.cs b/Aaru.Devices/Windows/Command.cs index 381778121..481ff9fe5 100644 --- a/Aaru.Devices/Windows/Command.cs +++ b/Aaru.Devices/Windows/Command.cs @@ -456,11 +456,11 @@ partial class Device switch(command) { - case MmcCommands.SendCid when _cachedCid != null: + case MmcCommands.SendCid when CachedCid != null: { cmdStopwatch.Restart(); - buffer = new byte[_cachedCid.Length]; - Array.Copy(_cachedCid, buffer, buffer.Length); + buffer = new byte[CachedCid.Length]; + Array.Copy(CachedCid, buffer, buffer.Length); response = new uint[4]; sense = false; cmdStopwatch.Stop(); @@ -468,11 +468,11 @@ partial class Device return 0; } - case MmcCommands.SendCsd when _cachedCid != null: + case MmcCommands.SendCsd when CachedCid != null: { cmdStopwatch.Restart(); - buffer = new byte[_cachedCsd.Length]; - Array.Copy(_cachedCsd, buffer, buffer.Length); + buffer = new byte[CachedCsd.Length]; + Array.Copy(CachedCsd, buffer, buffer.Length); response = new uint[4]; sense = false; cmdStopwatch.Stop(); @@ -480,11 +480,11 @@ partial class Device return 0; } - case (MmcCommands)SecureDigitalCommands.SendScr when _cachedScr != null: + case (MmcCommands)SecureDigitalCommands.SendScr when CachedScr != null: { cmdStopwatch.Restart(); - buffer = new byte[_cachedScr.Length]; - Array.Copy(_cachedScr, buffer, buffer.Length); + buffer = new byte[CachedScr.Length]; + Array.Copy(CachedScr, buffer, buffer.Length); response = new uint[4]; sense = false; cmdStopwatch.Stop(); @@ -492,12 +492,12 @@ partial class Device return 0; } - case (MmcCommands)SecureDigitalCommands.SendOperatingCondition when _cachedOcr != null: - case MmcCommands.SendOpCond when _cachedOcr != null: + case (MmcCommands)SecureDigitalCommands.SendOperatingCondition when CachedOcr != null: + case MmcCommands.SendOpCond when CachedOcr != null: { cmdStopwatch.Restart(); - buffer = new byte[_cachedOcr.Length]; - Array.Copy(_cachedOcr, buffer, buffer.Length); + buffer = new byte[CachedOcr.Length]; + Array.Copy(CachedOcr, buffer, buffer.Length); response = new uint[4]; sense = false; cmdStopwatch.Stop(); @@ -621,7 +621,7 @@ partial class Device { Extern.CloseHandle(_fileHandle); - SafeFileHandle newFd = Extern.CreateFile(_devicePath, FileAccess.GenericRead | FileAccess.GenericWrite, + SafeFileHandle newFd = Extern.CreateFile(DevicePath, FileAccess.GenericRead | FileAccess.GenericWrite, FileShare.Read | FileShare.Write, IntPtr.Zero, FileMode.OpenExisting, FileAttributes.Normal, IntPtr.Zero); diff --git a/Aaru.Devices/Windows/Device.cs b/Aaru.Devices/Windows/Device.cs index 990c26a39..0dcd849ca 100644 --- a/Aaru.Devices/Windows/Device.cs +++ b/Aaru.Devices/Windows/Device.cs @@ -203,8 +203,8 @@ partial class Device : Devices.Device if(!sense) { - dev._cachedCsd = new byte[16]; - Array.Copy(sdBuffer, 0, dev._cachedCsd, 0, 16); + dev.CachedCsd = new byte[16]; + Array.Copy(sdBuffer, 0, dev.CachedCsd, 0, 16); } sdBuffer = new byte[16]; @@ -215,8 +215,8 @@ partial class Device : Devices.Device if(!sense) { - dev._cachedCid = new byte[16]; - Array.Copy(sdBuffer, 0, dev._cachedCid, 0, 16); + dev.CachedCid = new byte[16]; + Array.Copy(sdBuffer, 0, dev.CachedCid, 0, 16); } sdBuffer = new byte[8]; @@ -227,35 +227,35 @@ partial class Device : Devices.Device if(!sense) { - dev._cachedScr = new byte[8]; - Array.Copy(sdBuffer, 0, dev._cachedScr, 0, 8); + dev.CachedScr = new byte[8]; + Array.Copy(sdBuffer, 0, dev.CachedScr, 0, 8); } sdBuffer = new byte[4]; dev.LastError = - dev.SendMmcCommand(dev._cachedScr != null ? (MmcCommands)SecureDigitalCommands.SendOperatingCondition : MmcCommands.SendOpCond, + dev.SendMmcCommand(dev.CachedScr != null ? (MmcCommands)SecureDigitalCommands.SendOperatingCondition : MmcCommands.SendOpCond, false, true, MmcFlags.ResponseSpiR3 | MmcFlags.ResponseR3 | MmcFlags.CommandBcr, 0, 4, 1, ref sdBuffer, out _, out _, out sense); if(!sense) { - dev._cachedScr = new byte[4]; - Array.Copy(sdBuffer, 0, dev._cachedScr, 0, 4); + dev.CachedScr = new byte[4]; + Array.Copy(sdBuffer, 0, dev.CachedScr, 0, 4); } } #region SecureDigital / MultiMediaCard - if(dev._cachedCid != null) + if(dev.CachedCid != null) { dev.ScsiType = PeripheralDeviceTypes.DirectAccess; dev.IsRemovable = false; - if(dev._cachedScr != null) + if(dev.CachedScr != null) { dev.Type = DeviceType.SecureDigital; - CID decoded = Decoders.SecureDigital.Decoders.DecodeCID(dev._cachedCid); + CID decoded = Decoders.SecureDigital.Decoders.DecodeCID(dev.CachedCid); dev.Manufacturer = VendorString.Prettify(decoded.Manufacturer); dev.Model = decoded.ProductName; @@ -267,7 +267,7 @@ partial class Device : Devices.Device else { dev.Type = DeviceType.MMC; - Decoders.MMC.CID decoded = Decoders.MMC.Decoders.DecodeCID(dev._cachedCid); + Decoders.MMC.CID decoded = Decoders.MMC.Decoders.DecodeCID(dev.CachedCid); dev.Manufacturer = Decoders.MMC.VendorString.Prettify(decoded.Manufacturer); dev.Model = decoded.ProductName; @@ -302,8 +302,8 @@ partial class Device : Devices.Device if(usbDevice != null) { dev.UsbDescriptors = usbDevice.BinaryDescriptors; - dev._usbVendor = (ushort)usbDevice._deviceDescriptor.idVendor; - dev._usbProduct = (ushort)usbDevice._deviceDescriptor.idProduct; + dev.UsbVendor = (ushort)usbDevice.DeviceDescriptor.idVendor; + dev.UsbProduct = (ushort)usbDevice.DeviceDescriptor.idProduct; dev.UsbManufacturerString = usbDevice.Manufacturer; dev.UsbProductString = usbDevice.Product; diff --git a/Aaru.Devices/Windows/Usb.cs b/Aaru.Devices/Windows/Usb.cs index c8692b035..0e84ec189 100644 --- a/Aaru.Devices/Windows/Usb.cs +++ b/Aaru.Devices/Windows/Usb.cs @@ -69,7 +69,7 @@ static partial class Usb { var host = new UsbController { - _controllerIndex = i + ControllerIndex = i }; // create a Device Interface Data structure @@ -98,7 +98,7 @@ static partial class Usb if(SetupDiGetDeviceInterfaceDetail(h, ref dia, ref didd, BUFFER_SIZE, ref nRequiredSize, ref da)) { - host._controllerDevicePath = didd.DevicePath; + host.ControllerDevicePath = didd.DevicePath; // get the Device Description and DriverKeyName var requiredSize = 0; @@ -106,11 +106,11 @@ static partial class Usb if(SetupDiGetDeviceRegistryProperty(h, ref da, SPDRP_DEVICEDESC, ref regType, ptrBuf, BUFFER_SIZE, ref requiredSize)) - host._controllerDeviceDesc = Marshal.PtrToStringAuto(ptrBuf); + host.ControllerDeviceDesc = Marshal.PtrToStringAuto(ptrBuf); if(SetupDiGetDeviceRegistryProperty(h, ref da, SPDRP_DRIVER, ref regType, ptrBuf, BUFFER_SIZE, ref requiredSize)) - host._controllerDriverKeyName = Marshal.PtrToStringAuto(ptrBuf); + host.ControllerDriverKeyName = Marshal.PtrToStringAuto(ptrBuf); } hostList.Add(host); @@ -248,44 +248,44 @@ static partial class Usb /// Represents a USB Host Controller sealed class UsbController { - internal string _controllerDriverKeyName, _controllerDevicePath, _controllerDeviceDesc; - internal int _controllerIndex; + internal string ControllerDriverKeyName, ControllerDevicePath, ControllerDeviceDesc; + internal int ControllerIndex; /// A simple default constructor internal UsbController() { - _controllerIndex = 0; - _controllerDevicePath = ""; - _controllerDeviceDesc = ""; - _controllerDriverKeyName = ""; + ControllerIndex = 0; + ControllerDevicePath = ""; + ControllerDeviceDesc = ""; + ControllerDriverKeyName = ""; } /// Return the index of the instance - internal int Index => _controllerIndex; + internal int Index => ControllerIndex; /// /// Return the Device Path, such as "\\?\pci#ven_10de&dev_005a&subsys_815a1043&rev_a2#3&267a616a&0& /// 58#{3abf6f2d-71c4-462a-8a92-1e6861e6af27}" /// - internal string DevicePath => _controllerDevicePath; + internal string DevicePath => ControllerDevicePath; /// The DriverKeyName may be useful as a search key - internal string DriverKeyName => _controllerDriverKeyName; + internal string DriverKeyName => ControllerDriverKeyName; /// Return the Friendly Name, such as "VIA USB Enhanced Host Controller" - internal string Name => _controllerDeviceDesc; + internal string Name => ControllerDeviceDesc; /// Return Root Hub for this Controller internal UsbHub GetRootHub() { var root = new UsbHub { - _hubIsRootHub = true, - _hubDeviceDesc = "Root Hub" + HubIsRootHub = true, + HubDeviceDesc = "Root Hub" }; // Open a handle to the Host Controller - IntPtr h = CreateFile(_controllerDevicePath, GENERIC_WRITE, FILE_SHARE_WRITE, IntPtr.Zero, OPEN_EXISTING, 0, + IntPtr h = CreateFile(ControllerDevicePath, GENERIC_WRITE, FILE_SHARE_WRITE, IntPtr.Zero, OPEN_EXISTING, 0, IntPtr.Zero); if(h == _invalidHandleValue) @@ -302,12 +302,12 @@ static partial class Usb hubName = (UsbRootHubName)(Marshal.PtrToStructure(ptrHubName, typeof(UsbRootHubName)) ?? default(UsbRootHubName)); - root._hubDevicePath = @"\\.\" + hubName.RootHubName; + root.HubDevicePath = @"\\.\" + hubName.RootHubName; } // TODO: Get DriverKeyName for Root Hub // Now let's open the Hub (based upon the HubName we got above) - IntPtr h2 = CreateFile(root._hubDevicePath, GENERIC_WRITE, FILE_SHARE_WRITE, IntPtr.Zero, OPEN_EXISTING, 0, + IntPtr h2 = CreateFile(root.HubDevicePath, GENERIC_WRITE, FILE_SHARE_WRITE, IntPtr.Zero, OPEN_EXISTING, 0, IntPtr.Zero); if(h2 != _invalidHandleValue) @@ -328,8 +328,8 @@ static partial class Usb nodeInfo = (UsbNodeInformation)(Marshal.PtrToStructure(ptrNodeInfo, typeof(UsbNodeInformation)) ?? default(UsbNodeInformation)); - root._hubIsBusPowered = Convert.ToBoolean(nodeInfo.HubInformation.HubIsBusPowered); - root._hubPortCount = nodeInfo.HubInformation.HubDescriptor.bNumberOfPorts; + root.HubIsBusPowered = Convert.ToBoolean(nodeInfo.HubInformation.HubIsBusPowered); + root.HubPortCount = nodeInfo.HubInformation.HubDescriptor.bNumberOfPorts; } Marshal.FreeHGlobal(ptrNodeInfo); @@ -350,48 +350,48 @@ static partial class Usb /// Represents an USB device internal class UsbDevice { - internal byte[] _binaryDeviceDescriptors; - internal UsbDeviceDescriptor _deviceDescriptor; - internal string _deviceDriverKey, _deviceHubDevicePath, _deviceInstanceId, _deviceName; - internal string _deviceManufacturer, _deviceProduct, _deviceSerialNumber; - internal int _devicePortNumber; + internal byte[] BinaryDeviceDescriptors; + internal UsbDeviceDescriptor DeviceDescriptor; + internal string DeviceDriverKey, DeviceHubDevicePath, DeviceInstanceId, DeviceName; + internal string DeviceManufacturer, DeviceProduct, DeviceSerialNumber; + internal int DevicePortNumber; /// a simple default constructor internal UsbDevice() { - _devicePortNumber = 0; - _deviceHubDevicePath = ""; - _deviceDriverKey = ""; - _deviceManufacturer = ""; - _deviceProduct = "Unknown USB Device"; - _deviceSerialNumber = ""; - _deviceName = ""; - _deviceInstanceId = ""; - _binaryDeviceDescriptors = null; + DevicePortNumber = 0; + DeviceHubDevicePath = ""; + DeviceDriverKey = ""; + DeviceManufacturer = ""; + DeviceProduct = "Unknown USB Device"; + DeviceSerialNumber = ""; + DeviceName = ""; + DeviceInstanceId = ""; + BinaryDeviceDescriptors = null; } /// return Port Index of the Hub - internal int PortNumber => _devicePortNumber; + internal int PortNumber => DevicePortNumber; /// return the Device Path of the Hub (the parent device) - internal string HubDevicePath => _deviceHubDevicePath; + internal string HubDevicePath => DeviceHubDevicePath; /// useful as a search key - internal string DriverKey => _deviceDriverKey; + internal string DriverKey => DeviceDriverKey; /// the device path of this device - internal string InstanceId => _deviceInstanceId; + internal string InstanceId => DeviceInstanceId; /// the friendly name - internal string Name => _deviceName; + internal string Name => DeviceName; - internal string Manufacturer => _deviceManufacturer; + internal string Manufacturer => DeviceManufacturer; - internal string Product => _deviceProduct; + internal string Product => DeviceProduct; - internal string SerialNumber => _deviceSerialNumber; + internal string SerialNumber => DeviceSerialNumber; - internal byte[] BinaryDescriptors => _binaryDeviceDescriptors; + internal byte[] BinaryDescriptors => BinaryDeviceDescriptors; } #endregion @@ -401,55 +401,55 @@ static partial class Usb /// The Hub class internal class UsbHub { - internal string _hubDriverKey, _hubDevicePath, _hubDeviceDesc; - internal bool _hubIsBusPowered, _hubIsRootHub; - internal string _hubManufacturer, _hubProduct, _hubSerialNumber, _hubInstanceId; - internal int _hubPortCount; + internal string HubDriverKey, HubDevicePath, HubDeviceDesc; + internal bool HubIsBusPowered, HubIsRootHub; + internal string HubManufacturer, HubProduct, HubSerialNumber, HubInstanceId; + internal int HubPortCount; /// a simple default constructor internal UsbHub() { - _hubPortCount = 0; - _hubDevicePath = ""; - _hubDeviceDesc = ""; - _hubDriverKey = ""; - _hubIsBusPowered = false; - _hubIsRootHub = false; - _hubManufacturer = ""; - _hubProduct = ""; - _hubSerialNumber = ""; - _hubInstanceId = ""; + HubPortCount = 0; + HubDevicePath = ""; + HubDeviceDesc = ""; + HubDriverKey = ""; + HubIsBusPowered = false; + HubIsRootHub = false; + HubManufacturer = ""; + HubProduct = ""; + HubSerialNumber = ""; + HubInstanceId = ""; } /// return Port Count - internal int PortCount => _hubPortCount; + internal int PortCount => HubPortCount; /// /// return the Device Path, such as "\\?\pci#ven_10de&dev_005a&subsys_815a1043&rev_a2#3&267a616a&0& /// 58#{3abf6f2d-71c4-462a-8a92-1e6861e6af27}" /// - internal string DevicePath => _hubDevicePath; + internal string DevicePath => HubDevicePath; /// The DriverKey may be useful as a search key - internal string DriverKey => _hubDriverKey; + internal string DriverKey => HubDriverKey; /// return the Friendly Name, such as "VIA USB Enhanced Host Controller" - internal string Name => _hubDeviceDesc; + internal string Name => HubDeviceDesc; /// the device path of this device - internal string InstanceId => _hubInstanceId; + internal string InstanceId => HubInstanceId; /// is is this a self-powered hub? - internal bool IsBusPowered => _hubIsBusPowered; + internal bool IsBusPowered => HubIsBusPowered; /// is this a root hub? - internal bool IsRootHub => _hubIsRootHub; + internal bool IsRootHub => HubIsRootHub; - internal string Manufacturer => _hubManufacturer; + internal string Manufacturer => HubManufacturer; - internal string Product => _hubProduct; + internal string Product => HubProduct; - internal string SerialNumber => _hubSerialNumber; + internal string SerialNumber => HubSerialNumber; /// return a list of the down stream ports /// List of downstream ports @@ -458,7 +458,7 @@ static partial class Usb var portList = new List(); // Open a handle to the Hub device - IntPtr h = CreateFile(_hubDevicePath, GENERIC_WRITE, FILE_SHARE_WRITE, IntPtr.Zero, OPEN_EXISTING, 0, + IntPtr h = CreateFile(HubDevicePath, GENERIC_WRITE, FILE_SHARE_WRITE, IntPtr.Zero, OPEN_EXISTING, 0, IntPtr.Zero); if(h == _invalidHandleValue) @@ -469,7 +469,7 @@ static partial class Usb // loop thru all of the ports on the hub // BTW: Ports are numbered starting at 1 - for(var i = 1; i <= _hubPortCount; i++) + for(var i = 1; i <= HubPortCount; i++) { var nodeConnection = new UsbNodeConnectionInformationEx { @@ -490,14 +490,13 @@ static partial class Usb // load up the USBPort class var port = new UsbPort { - _portPortNumber = i, - _portHubDevicePath = _hubDevicePath, - _portStatus = ((UsbConnectionStatus)nodeConnection.ConnectionStatus).ToString(), - _portSpeed = ((UsbDeviceSpeed)nodeConnection.Speed).ToString(), - _portIsDeviceConnected = - nodeConnection.ConnectionStatus == (int)UsbConnectionStatus.DeviceConnected, - _portIsHub = Convert.ToBoolean(nodeConnection.DeviceIsHub), - _portDeviceDescriptor = nodeConnection.DeviceDescriptor + PortPortNumber = i, + PortHubDevicePath = HubDevicePath, + PortStatus = ((UsbConnectionStatus)nodeConnection.ConnectionStatus).ToString(), + PortSpeed = ((UsbDeviceSpeed)nodeConnection.Speed).ToString(), + PortIsDeviceConnected = nodeConnection.ConnectionStatus == (int)UsbConnectionStatus.DeviceConnected, + PortIsHub = Convert.ToBoolean(nodeConnection.DeviceIsHub), + PortDeviceDescriptor = nodeConnection.DeviceDescriptor }; // add it to the list @@ -519,58 +518,58 @@ static partial class Usb /// Represents an USB port internal class UsbPort { - internal UsbDeviceDescriptor _portDeviceDescriptor; - internal bool _portIsHub, _portIsDeviceConnected; - internal int _portPortNumber; - internal string _portStatus, _portHubDevicePath, _portSpeed; + internal UsbDeviceDescriptor PortDeviceDescriptor; + internal bool PortIsHub, PortIsDeviceConnected; + internal int PortPortNumber; + internal string PortStatus, PortHubDevicePath, PortSpeed; /// a simple default constructor internal UsbPort() { - _portPortNumber = 0; - _portStatus = ""; - _portHubDevicePath = ""; - _portSpeed = ""; - _portIsHub = false; - _portIsDeviceConnected = false; + PortPortNumber = 0; + PortStatus = ""; + PortHubDevicePath = ""; + PortSpeed = ""; + PortIsHub = false; + PortIsDeviceConnected = false; } /// return Port Index of the Hub - internal int PortNumber => _portPortNumber; + internal int PortNumber => PortPortNumber; /// return the Device Path of the Hub - internal string HubDevicePath => _portHubDevicePath; + internal string HubDevicePath => PortHubDevicePath; /// the status (see USB_CONNECTION_STATUS above) - internal string Status => _portStatus; + internal string Status => PortStatus; /// the speed of the connection (see USB_DEVICE_SPEED above) - internal string Speed => _portSpeed; + internal string Speed => PortSpeed; /// is this a downstream external hub? - internal bool IsHub => _portIsHub; + internal bool IsHub => PortIsHub; /// is anybody home? - internal bool IsDeviceConnected => _portIsDeviceConnected; + internal bool IsDeviceConnected => PortIsDeviceConnected; /// return a down stream external hub /// Downstream external hub internal UsbDevice GetDevice() { - if(!_portIsDeviceConnected) + if(!PortIsDeviceConnected) return null; // Copy over some values from the Port class // Ya know, I've given some thought about making Device a derived class... var device = new UsbDevice { - _devicePortNumber = _portPortNumber, - _deviceHubDevicePath = _portHubDevicePath, - _deviceDescriptor = _portDeviceDescriptor + DevicePortNumber = PortPortNumber, + DeviceHubDevicePath = PortHubDevicePath, + DeviceDescriptor = PortDeviceDescriptor }; // Open a handle to the Hub device - IntPtr h = CreateFile(_portHubDevicePath, GENERIC_WRITE, FILE_SHARE_WRITE, IntPtr.Zero, OPEN_EXISTING, 0, + IntPtr h = CreateFile(PortHubDevicePath, GENERIC_WRITE, FILE_SHARE_WRITE, IntPtr.Zero, OPEN_EXISTING, 0, IntPtr.Zero); if(h == _invalidHandleValue) @@ -586,17 +585,17 @@ static partial class Usb // Device Descriptor are really just indexes. So, we have to // request a String Descriptor to get the values for those strings. - if(_portDeviceDescriptor.iManufacturer > 0) + if(PortDeviceDescriptor.iManufacturer > 0) { // build a request for string descriptor var request = new UsbDescriptorRequest { - ConnectionIndex = _portPortNumber, + ConnectionIndex = PortPortNumber, SetupPacket = { // Language Code wIndex = 0x409, - wValue = (short)((USB_STRING_DESCRIPTOR_TYPE << 8) + _portDeviceDescriptor.iManufacturer) + wValue = (short)((USB_STRING_DESCRIPTOR_TYPE << 8) + PortDeviceDescriptor.iManufacturer) } }; @@ -620,23 +619,23 @@ static partial class Usb (UsbStringDescriptor)(Marshal.PtrToStructure(ptrStringDesc, typeof(UsbStringDescriptor)) ?? default(UsbStringDescriptor)); - device._deviceManufacturer = stringDesc.bString; + device.DeviceManufacturer = stringDesc.bString; } Marshal.FreeHGlobal(ptrRequest); } - if(_portDeviceDescriptor.iProduct > 0) + if(PortDeviceDescriptor.iProduct > 0) { // build a request for string descriptor var request = new UsbDescriptorRequest { - ConnectionIndex = _portPortNumber, + ConnectionIndex = PortPortNumber, SetupPacket = { // Language Code wIndex = 0x409, - wValue = (short)((USB_STRING_DESCRIPTOR_TYPE << 8) + _portDeviceDescriptor.iProduct) + wValue = (short)((USB_STRING_DESCRIPTOR_TYPE << 8) + PortDeviceDescriptor.iProduct) } }; @@ -657,23 +656,23 @@ static partial class Usb (UsbStringDescriptor)(Marshal.PtrToStructure(ptrStringDesc, typeof(UsbStringDescriptor)) ?? default(UsbStringDescriptor)); - device._deviceProduct = stringDesc.bString; + device.DeviceProduct = stringDesc.bString; } Marshal.FreeHGlobal(ptrRequest); } - if(_portDeviceDescriptor.iSerialNumber > 0) + if(PortDeviceDescriptor.iSerialNumber > 0) { // build a request for string descriptor var request = new UsbDescriptorRequest { - ConnectionIndex = _portPortNumber, + ConnectionIndex = PortPortNumber, SetupPacket = { // Language Code wIndex = 0x409, - wValue = (short)((USB_STRING_DESCRIPTOR_TYPE << 8) + _portDeviceDescriptor.iSerialNumber) + wValue = (short)((USB_STRING_DESCRIPTOR_TYPE << 8) + PortDeviceDescriptor.iSerialNumber) } }; @@ -694,7 +693,7 @@ static partial class Usb (UsbStringDescriptor)(Marshal.PtrToStructure(ptrStringDesc, typeof(UsbStringDescriptor)) ?? default(UsbStringDescriptor)); - device._deviceSerialNumber = stringDesc.bString; + device.DeviceSerialNumber = stringDesc.bString; } Marshal.FreeHGlobal(ptrRequest); @@ -703,7 +702,7 @@ static partial class Usb // build a request for configuration descriptor var dcrRequest = new UsbDescriptorRequest { - ConnectionIndex = _portPortNumber, + ConnectionIndex = PortPortNumber, SetupPacket = { wIndex = 0, @@ -722,8 +721,8 @@ static partial class Usb nBytes, out nBytesReturned, IntPtr.Zero)) { var ptrStringDesc = IntPtr.Add(dcrPtrRequest, Marshal.SizeOf(dcrRequest)); - device._binaryDeviceDescriptors = new byte[nBytesReturned]; - Marshal.Copy(ptrStringDesc, device._binaryDeviceDescriptors, 0, nBytesReturned); + device.BinaryDeviceDescriptors = new byte[nBytesReturned]; + Marshal.Copy(ptrStringDesc, device.BinaryDeviceDescriptors, 0, nBytesReturned); } Marshal.FreeHGlobal(dcrPtrRequest); @@ -731,7 +730,7 @@ static partial class Usb // Get the Driver Key Name (usefull in locating a device) var driverKey = new UsbNodeConnectionDriverkeyName { - ConnectionIndex = _portPortNumber + ConnectionIndex = PortPortNumber }; nBytes = Marshal.SizeOf(driverKey); @@ -746,11 +745,11 @@ static partial class Usb typeof(UsbNodeConnectionDriverkeyName)) ?? default(UsbNodeConnectionDriverkeyName)); - device._deviceDriverKey = driverKey.DriverKeyName; + device.DeviceDriverKey = driverKey.DriverKeyName; // use the DriverKeyName to get the Device Description and Instance ID - device._deviceName = GetDescriptionByKeyName(device._deviceDriverKey); - device._deviceInstanceId = GetInstanceIdByKeyName(device._deviceDriverKey); + device.DeviceName = GetDescriptionByKeyName(device.DeviceDriverKey); + device.DeviceInstanceId = GetInstanceIdByKeyName(device.DeviceDriverKey); } Marshal.FreeHGlobal(ptrDriverKey); @@ -763,17 +762,17 @@ static partial class Usb /// Downstream external hub internal UsbHub GetHub() { - if(!_portIsHub) + if(!PortIsHub) return null; var hub = new UsbHub { - _hubIsRootHub = false, - _hubDeviceDesc = "External Hub" + HubIsRootHub = false, + HubDeviceDesc = "External Hub" }; // Open a handle to the Host Controller - IntPtr h = CreateFile(_portHubDevicePath, GENERIC_WRITE, FILE_SHARE_WRITE, IntPtr.Zero, OPEN_EXISTING, 0, + IntPtr h = CreateFile(PortHubDevicePath, GENERIC_WRITE, FILE_SHARE_WRITE, IntPtr.Zero, OPEN_EXISTING, 0, IntPtr.Zero); if(h == _invalidHandleValue) @@ -782,7 +781,7 @@ static partial class Usb // Get the DevicePath for downstream hub var nodeName = new UsbNodeConnectionName { - ConnectionIndex = _portPortNumber + ConnectionIndex = PortPortNumber }; int nBytes = Marshal.SizeOf(nodeName); @@ -796,11 +795,11 @@ static partial class Usb nodeName = (UsbNodeConnectionName)(Marshal.PtrToStructure(ptrNodeName, typeof(UsbNodeConnectionName)) ?? default(UsbNodeConnectionName)); - hub._hubDevicePath = @"\\.\" + nodeName.NodeName; + hub.HubDevicePath = @"\\.\" + nodeName.NodeName; } // Now let's open the Hub (based upon the HubName we got above) - IntPtr h2 = CreateFile(hub._hubDevicePath, GENERIC_WRITE, FILE_SHARE_WRITE, IntPtr.Zero, OPEN_EXISTING, 0, + IntPtr h2 = CreateFile(hub.HubDevicePath, GENERIC_WRITE, FILE_SHARE_WRITE, IntPtr.Zero, OPEN_EXISTING, 0, IntPtr.Zero); if(h2 != _invalidHandleValue) @@ -821,8 +820,8 @@ static partial class Usb nodeInfo = (UsbNodeInformation)(Marshal.PtrToStructure(ptrNodeInfo, typeof(UsbNodeInformation)) ?? default(UsbNodeInformation)); - hub._hubIsBusPowered = Convert.ToBoolean(nodeInfo.HubInformation.HubIsBusPowered); - hub._hubPortCount = nodeInfo.HubInformation.HubDescriptor.bNumberOfPorts; + hub.HubIsBusPowered = Convert.ToBoolean(nodeInfo.HubInformation.HubIsBusPowered); + hub.HubPortCount = nodeInfo.HubInformation.HubDescriptor.bNumberOfPorts; } Marshal.FreeHGlobal(ptrNodeInfo); @@ -832,11 +831,11 @@ static partial class Usb // Fill in the missing Manufacture, Product, and SerialNumber values // values by just creating a Device instance and copying the values UsbDevice device = GetDevice(); - hub._hubInstanceId = device._deviceInstanceId; - hub._hubManufacturer = device.Manufacturer; - hub._hubProduct = device.Product; - hub._hubSerialNumber = device.SerialNumber; - hub._hubDriverKey = device.DriverKey; + hub.HubInstanceId = device.DeviceInstanceId; + hub.HubManufacturer = device.Manufacturer; + hub.HubProduct = device.Product; + hub.HubSerialNumber = device.SerialNumber; + hub.HubDriverKey = device.DriverKey; Marshal.FreeHGlobal(ptrNodeName); CloseHandle(h); diff --git a/Aaru.Devices/Windows/UsbFunctions.cs b/Aaru.Devices/Windows/UsbFunctions.cs index 5edc9a85c..5ac4a559c 100644 --- a/Aaru.Devices/Windows/UsbFunctions.cs +++ b/Aaru.Devices/Windows/UsbFunctions.cs @@ -117,7 +117,7 @@ static partial class Usb UsbDevice device = port.GetDevice(); - if(device._deviceDriverKey != driverKeyName) + if(device.DeviceDriverKey != driverKeyName) continue; foundDevice = device; diff --git a/Aaru.Filesystems/AppleDOS/Dir.cs b/Aaru.Filesystems/AppleDOS/Dir.cs index e0080f7fa..6b43134fe 100644 --- a/Aaru.Filesystems/AppleDOS/Dir.cs +++ b/Aaru.Filesystems/AppleDOS/Dir.cs @@ -76,9 +76,9 @@ public sealed partial class AppleDOS node = new AppleDosDirNode { - Path = path, - _position = 0, - _contents = contents.ToArray() + Path = path, + Position = 0, + Contents = contents.ToArray() }; return ErrorNumber.NoError; @@ -95,13 +95,13 @@ public sealed partial class AppleDOS if(node is not AppleDosDirNode mynode) return ErrorNumber.InvalidArgument; - if(mynode._position < 0) + if(mynode.Position < 0) return ErrorNumber.InvalidArgument; - if(mynode._position >= mynode._contents.Length) + if(mynode.Position >= mynode.Contents.Length) return ErrorNumber.NoError; - filename = mynode._contents[mynode._position++]; + filename = mynode.Contents[mynode.Position++]; return ErrorNumber.NoError; } @@ -112,8 +112,8 @@ public sealed partial class AppleDOS if(node is not AppleDosDirNode mynode) return ErrorNumber.InvalidArgument; - mynode._position = -1; - mynode._contents = null; + mynode.Position = -1; + mynode.Contents = null; return ErrorNumber.NoError; } diff --git a/Aaru.Filesystems/AppleDOS/File.cs b/Aaru.Filesystems/AppleDOS/File.cs index 6b9629ac2..f5d7f9569 100644 --- a/Aaru.Filesystems/AppleDOS/File.cs +++ b/Aaru.Filesystems/AppleDOS/File.cs @@ -130,7 +130,7 @@ public sealed partial class AppleDOS Path = path, Length = file.Length, Offset = 0, - _cache = file + Cache = file }; return ErrorNumber.NoError; @@ -145,7 +145,7 @@ public sealed partial class AppleDOS if(node is not AppleDosFileNode mynode) return ErrorNumber.InvalidArgument; - mynode._cache = null; + mynode.Cache = null; return ErrorNumber.NoError; } @@ -169,7 +169,7 @@ public sealed partial class AppleDOS if(length + mynode.Offset >= mynode.Length) read = mynode.Length - mynode.Offset; - Array.Copy(mynode._cache, mynode.Offset, buffer, 0, read); + Array.Copy(mynode.Cache, mynode.Offset, buffer, 0, read); mynode.Offset += read; diff --git a/Aaru.Filesystems/AppleDOS/Structs.cs b/Aaru.Filesystems/AppleDOS/Structs.cs index f138258ca..78363fde9 100644 --- a/Aaru.Filesystems/AppleDOS/Structs.cs +++ b/Aaru.Filesystems/AppleDOS/Structs.cs @@ -37,8 +37,8 @@ public sealed partial class AppleDOS sealed class AppleDosDirNode : IDirNode { - internal string[] _contents; - internal int _position; + internal string[] Contents; + internal int Position; #region IDirNode Members @@ -54,7 +54,7 @@ public sealed partial class AppleDOS sealed class AppleDosFileNode : IFileNode { - internal byte[] _cache; + internal byte[] Cache; #region IFileNode Members diff --git a/Aaru.Filesystems/CPM/Dir.cs b/Aaru.Filesystems/CPM/Dir.cs index 41a7be7c0..51d347136 100644 --- a/Aaru.Filesystems/CPM/Dir.cs +++ b/Aaru.Filesystems/CPM/Dir.cs @@ -55,9 +55,9 @@ public sealed partial class CPM node = new CpmDirNode { - Path = path, - _position = 0, - _contents = _dirList.ToArray() + Path = path, + Position = 0, + Contents = _dirList.ToArray() }; return ErrorNumber.NoError; @@ -74,13 +74,13 @@ public sealed partial class CPM if(node is not CpmDirNode mynode) return ErrorNumber.InvalidArgument; - if(mynode._position < 0) + if(mynode.Position < 0) return ErrorNumber.InvalidArgument; - if(mynode._position >= mynode._contents.Length) + if(mynode.Position >= mynode.Contents.Length) return ErrorNumber.NoError; - filename = mynode._contents[mynode._position++]; + filename = mynode.Contents[mynode.Position++]; return ErrorNumber.NoError; } @@ -91,8 +91,8 @@ public sealed partial class CPM if(node is not CpmDirNode mynode) return ErrorNumber.InvalidArgument; - mynode._position = -1; - mynode._contents = null; + mynode.Position = -1; + mynode.Contents = null; return ErrorNumber.NoError; } diff --git a/Aaru.Filesystems/CPM/File.cs b/Aaru.Filesystems/CPM/File.cs index 0005a75b0..e9ff46bad 100644 --- a/Aaru.Filesystems/CPM/File.cs +++ b/Aaru.Filesystems/CPM/File.cs @@ -95,7 +95,7 @@ public sealed partial class CPM Path = path, Length = file.Length, Offset = 0, - _cache = file + Cache = file }; return ErrorNumber.NoError; @@ -110,7 +110,7 @@ public sealed partial class CPM if(node is not CpmFileNode mynode) return ErrorNumber.InvalidArgument; - mynode._cache = null; + mynode.Cache = null; return ErrorNumber.NoError; } @@ -134,7 +134,7 @@ public sealed partial class CPM if(length + mynode.Offset >= mynode.Length) read = mynode.Length - mynode.Offset; - Array.Copy(mynode._cache, mynode.Offset, buffer, 0, read); + Array.Copy(mynode.Cache, mynode.Offset, buffer, 0, read); mynode.Offset += read; diff --git a/Aaru.Filesystems/CPM/Structs.cs b/Aaru.Filesystems/CPM/Structs.cs index 9e3ff4aa8..4f7ff8ba4 100644 --- a/Aaru.Filesystems/CPM/Structs.cs +++ b/Aaru.Filesystems/CPM/Structs.cs @@ -86,8 +86,8 @@ public sealed partial class CPM sealed class CpmDirNode : IDirNode { - internal string[] _contents; - internal int _position; + internal string[] Contents; + internal int Position; #region IDirNode Members @@ -103,7 +103,7 @@ public sealed partial class CPM sealed class CpmFileNode : IFileNode { - internal byte[] _cache; + internal byte[] Cache; #region IFileNode Members diff --git a/Aaru.Filesystems/FAT/Dir.cs b/Aaru.Filesystems/FAT/Dir.cs index 2dfa73fec..e72417bc8 100644 --- a/Aaru.Filesystems/FAT/Dir.cs +++ b/Aaru.Filesystems/FAT/Dir.cs @@ -65,9 +65,9 @@ public sealed partial class FAT { node = new FatDirNode { - Path = path, - _position = 0, - _entries = _rootDirectoryCache.Values.ToArray() + Path = path, + Position = 0, + Entries = _rootDirectoryCache.Values.ToArray() }; return ErrorNumber.NoError; @@ -81,9 +81,9 @@ public sealed partial class FAT { node = new FatDirNode { - Path = path, - _position = 0, - _entries = currentDirectory.Values.ToArray() + Path = path, + Position = 0, + Entries = currentDirectory.Values.ToArray() }; return ErrorNumber.NoError; @@ -133,9 +133,9 @@ public sealed partial class FAT node = new FatDirNode { - Path = path, - _position = 0, - _entries = Array.Empty() + Path = path, + Position = 0, + Entries = Array.Empty() }; return ErrorNumber.NoError; @@ -400,9 +400,9 @@ public sealed partial class FAT node = new FatDirNode { - Path = path, - _position = 0, - _entries = currentDirectory.Values.ToArray() + Path = path, + Position = 0, + Entries = currentDirectory.Values.ToArray() }; return ErrorNumber.NoError; @@ -419,13 +419,13 @@ public sealed partial class FAT if(node is not FatDirNode mynode) return ErrorNumber.InvalidArgument; - if(mynode._position < 0) + if(mynode.Position < 0) return ErrorNumber.InvalidArgument; - if(mynode._position >= mynode._entries.Length) + if(mynode.Position >= mynode.Entries.Length) return ErrorNumber.NoError; - CompleteDirectoryEntry entry = mynode._entries[mynode._position]; + CompleteDirectoryEntry entry = mynode.Entries[mynode.Position]; filename = _namespace switch { @@ -437,7 +437,7 @@ public sealed partial class FAT _ => entry.Shortname }; - mynode._position++; + mynode.Position++; return ErrorNumber.NoError; } @@ -448,8 +448,8 @@ public sealed partial class FAT if(node is not FatDirNode mynode) return ErrorNumber.InvalidArgument; - mynode._position = -1; - mynode._entries = null; + mynode.Position = -1; + mynode.Entries = null; return ErrorNumber.NoError; } diff --git a/Aaru.Filesystems/FAT/File.cs b/Aaru.Filesystems/FAT/File.cs index 1b60f2241..99670efea 100644 --- a/Aaru.Filesystems/FAT/File.cs +++ b/Aaru.Filesystems/FAT/File.cs @@ -83,10 +83,10 @@ public sealed partial class FAT node = new FatFileNode { - Path = path, - Length = stat.Length, - Offset = 0, - _clusters = clusters + Path = path, + Length = stat.Length, + Offset = 0, + Clusters = clusters }; return ErrorNumber.NoError; @@ -101,7 +101,7 @@ public sealed partial class FAT if(node is not FatFileNode mynode) return ErrorNumber.InvalidArgument; - mynode._clusters = null; + mynode.Clusters = null; return ErrorNumber.NoError; } @@ -136,11 +136,11 @@ public sealed partial class FAT for(var i = 0; i < sizeInClusters; i++) { - if(i + firstCluster >= mynode._clusters.Length) + if(i + firstCluster >= mynode.Clusters.Length) return ErrorNumber.InvalidArgument; ErrorNumber errno = - _image.ReadSectors(_firstClusterSector + mynode._clusters[i + firstCluster] * _sectorsPerCluster, + _image.ReadSectors(_firstClusterSector + mynode.Clusters[i + firstCluster] * _sectorsPerCluster, _sectorsPerCluster, out byte[] buf); if(errno != ErrorNumber.NoError) diff --git a/Aaru.Filesystems/FAT/Structs.cs b/Aaru.Filesystems/FAT/Structs.cs index f3451e147..40d0b778d 100644 --- a/Aaru.Filesystems/FAT/Structs.cs +++ b/Aaru.Filesystems/FAT/Structs.cs @@ -860,8 +860,8 @@ public sealed partial class FAT sealed class FatDirNode : IDirNode { - internal CompleteDirectoryEntry[] _entries; - internal int _position; + internal CompleteDirectoryEntry[] Entries; + internal int Position; #region IDirNode Members @@ -877,7 +877,7 @@ public sealed partial class FAT sealed class FatFileNode : IFileNode { - internal uint[] _clusters; + internal uint[] Clusters; #region IFileNode Members diff --git a/Aaru.Filesystems/FATX/Dir.cs b/Aaru.Filesystems/FATX/Dir.cs index 4e76fc1ab..906ec0d61 100644 --- a/Aaru.Filesystems/FATX/Dir.cs +++ b/Aaru.Filesystems/FATX/Dir.cs @@ -51,9 +51,9 @@ public sealed partial class XboxFatPlugin { node = new FatxDirNode { - Path = path, - _position = 0, - _entries = _rootDirectory.Values.ToArray() + Path = path, + Position = 0, + Entries = _rootDirectory.Values.ToArray() }; return ErrorNumber.NoError; @@ -65,9 +65,9 @@ public sealed partial class XboxFatPlugin { node = new FatxDirNode { - Path = path, - _position = 0, - _entries = currentDirectory.Values.ToArray() + Path = path, + Position = 0, + Entries = currentDirectory.Values.ToArray() }; return ErrorNumber.NoError; @@ -159,9 +159,9 @@ public sealed partial class XboxFatPlugin node = new FatxDirNode { - Path = path, - _position = 0, - _entries = currentDirectory.Values.ToArray() + Path = path, + Position = 0, + Entries = currentDirectory.Values.ToArray() }; return ErrorNumber.NoError; @@ -178,16 +178,16 @@ public sealed partial class XboxFatPlugin if(node is not FatxDirNode mynode) return ErrorNumber.InvalidArgument; - if(mynode._position < 0) + if(mynode.Position < 0) return ErrorNumber.InvalidArgument; - if(mynode._position >= mynode._entries.Length) + if(mynode.Position >= mynode.Entries.Length) return ErrorNumber.NoError; - filename = _encoding.GetString(mynode._entries[mynode._position].filename, 0, - mynode._entries[mynode._position].filenameSize); + filename = _encoding.GetString(mynode.Entries[mynode.Position].filename, 0, + mynode.Entries[mynode.Position].filenameSize); - mynode._position++; + mynode.Position++; return ErrorNumber.NoError; } @@ -198,8 +198,8 @@ public sealed partial class XboxFatPlugin if(node is not FatxDirNode mynode) return ErrorNumber.InvalidArgument; - mynode._position = -1; - mynode._entries = null; + mynode.Position = -1; + mynode.Entries = null; return ErrorNumber.NoError; } diff --git a/Aaru.Filesystems/FATX/File.cs b/Aaru.Filesystems/FATX/File.cs index bc6c06fb7..3913489d8 100644 --- a/Aaru.Filesystems/FATX/File.cs +++ b/Aaru.Filesystems/FATX/File.cs @@ -80,10 +80,10 @@ public sealed partial class XboxFatPlugin node = new FatxFileNode { - Path = path, - Length = stat.Length, - Offset = 0, - _clusters = clusters + Path = path, + Length = stat.Length, + Offset = 0, + Clusters = clusters }; return ErrorNumber.NoError; @@ -98,7 +98,7 @@ public sealed partial class XboxFatPlugin if(node is not FatxFileNode mynode) return ErrorNumber.InvalidArgument; - mynode._clusters = null; + mynode.Clusters = null; return ErrorNumber.NoError; } @@ -133,12 +133,12 @@ public sealed partial class XboxFatPlugin for(var i = 0; i < sizeInClusters; i++) { - if(i + firstCluster >= mynode._clusters.Length) + if(i + firstCluster >= mynode.Clusters.Length) return ErrorNumber.InvalidArgument; ErrorNumber errno = _imagePlugin. - ReadSectors(_firstClusterSector + (mynode._clusters[i + firstCluster] - 1) * _sectorsPerCluster, + ReadSectors(_firstClusterSector + (mynode.Clusters[i + firstCluster] - 1) * _sectorsPerCluster, _sectorsPerCluster, out byte[] buf); if(errno != ErrorNumber.NoError) diff --git a/Aaru.Filesystems/FATX/Structs.cs b/Aaru.Filesystems/FATX/Structs.cs index 7edb8aaa3..e667add36 100644 --- a/Aaru.Filesystems/FATX/Structs.cs +++ b/Aaru.Filesystems/FATX/Structs.cs @@ -58,8 +58,8 @@ public sealed partial class XboxFatPlugin sealed class FatxDirNode : IDirNode { - internal DirectoryEntry[] _entries; - internal int _position; + internal DirectoryEntry[] Entries; + internal int Position; #region IDirNode Members @@ -75,7 +75,7 @@ public sealed partial class XboxFatPlugin sealed class FatxFileNode : IFileNode { - internal uint[] _clusters; + internal uint[] Clusters; #region IFileNode Members diff --git a/Aaru.Filesystems/ISO9660/Dir.cs b/Aaru.Filesystems/ISO9660/Dir.cs index 1e6a6d4db..3631b3b48 100644 --- a/Aaru.Filesystems/ISO9660/Dir.cs +++ b/Aaru.Filesystems/ISO9660/Dir.cs @@ -57,9 +57,9 @@ public sealed partial class ISO9660 { node = new Iso9660DirNode { - Path = path, - _position = 0, - _entries = _rootDirectoryCache.Values.ToArray() + Path = path, + Position = 0, + Entries = _rootDirectoryCache.Values.ToArray() }; return ErrorNumber.NoError; @@ -73,9 +73,9 @@ public sealed partial class ISO9660 { node = new Iso9660DirNode { - Path = path, - _position = 0, - _entries = currentDirectory.Values.ToArray() + Path = path, + Position = 0, + Entries = currentDirectory.Values.ToArray() }; return ErrorNumber.NoError; @@ -150,9 +150,9 @@ public sealed partial class ISO9660 node = new Iso9660DirNode { - Path = path, - _position = 0, - _entries = currentDirectory.Values.ToArray() + Path = path, + Position = 0, + Entries = currentDirectory.Values.ToArray() }; return ErrorNumber.NoError; @@ -169,32 +169,32 @@ public sealed partial class ISO9660 if(node is not Iso9660DirNode mynode) return ErrorNumber.InvalidArgument; - if(mynode._position < 0) + if(mynode.Position < 0) return ErrorNumber.InvalidArgument; - if(mynode._position >= mynode._entries.Length) + if(mynode.Position >= mynode.Entries.Length) return ErrorNumber.NoError; switch(_namespace) { case Namespace.Normal: - filename = mynode._entries[mynode._position].Filename.EndsWith(";1", StringComparison.Ordinal) - ? mynode._entries[mynode._position].Filename[..^2] - : mynode._entries[mynode._position].Filename; + filename = mynode.Entries[mynode.Position].Filename.EndsWith(";1", StringComparison.Ordinal) + ? mynode.Entries[mynode.Position].Filename[..^2] + : mynode.Entries[mynode.Position].Filename; break; case Namespace.Vms: case Namespace.Joliet: case Namespace.Rrip: case Namespace.Romeo: - filename = mynode._entries[mynode._position].Filename; + filename = mynode.Entries[mynode.Position].Filename; break; default: return ErrorNumber.InvalidArgument; } - mynode._position++; + mynode.Position++; return ErrorNumber.NoError; } @@ -205,8 +205,8 @@ public sealed partial class ISO9660 if(node is not Iso9660DirNode mynode) return ErrorNumber.InvalidArgument; - mynode._position = -1; - mynode._entries = null; + mynode.Position = -1; + mynode.Entries = null; return ErrorNumber.NoError; } @@ -255,7 +255,7 @@ public sealed partial class ISO9660 var entry = new DecodedDirectoryEntry { Size = record.size, - Filename = Encoding.GetString(data, entryOff + _directoryRecordSize, record.name_len), + Filename = _encoding.GetString(data, entryOff + _directoryRecordSize, record.name_len), VolumeSequenceNumber = record.volume_sequence_number, Timestamp = DecodeHighSierraDateTime(record.date), XattrLength = record.xattr_len, @@ -338,7 +338,7 @@ public sealed partial class ISO9660 Flags = record.flags, Interleave = record.interleave, VolumeSequenceNumber = record.volume_sequence_number, - Filename = Encoding.GetString(data, entryOff + _directoryRecordSize, record.name_len), + Filename = _encoding.GetString(data, entryOff + _directoryRecordSize, record.name_len), Timestamp = DecodeHighSierraDateTime(record.date), XattrLength = record.xattr_len, Extents = new List<(uint extent, uint size)>() @@ -411,7 +411,7 @@ public sealed partial class ISO9660 Filename = _joliet ? Encoding.BigEndianUnicode.GetString(data, entryOff + _directoryRecordSize, record.name_len) - : Encoding.GetString(data, entryOff + _directoryRecordSize, record.name_len), + : _encoding.GetString(data, entryOff + _directoryRecordSize, record.name_len), FileUnitSize = record.file_unit_size, Interleave = record.interleave, VolumeSequenceNumber = record.volume_sequence_number, @@ -550,7 +550,7 @@ public sealed partial class ISO9660 return; var mr = new MemoryStream(transTbl, 0, (int)transTblEntry.Value.Size, false); - var sr = new StreamReader(mr, Encoding); + var sr = new StreamReader(mr, _encoding); string line = sr.ReadLine(); @@ -854,11 +854,11 @@ public sealed partial class ISO9660 systemAreaOff + Marshal.SizeOf() + Marshal.SizeOf(), slc.length) - : Encoding.GetString(data, - systemAreaOff + - Marshal.SizeOf() + - Marshal.SizeOf(), - slc.length); + : _encoding.GetString(data, + systemAreaOff + + Marshal.SizeOf() + + Marshal.SizeOf(), + slc.length); continueSymlink = sl.flags.HasFlag(SymlinkFlags.Continue); continueSymlinkComponent = slc.flags.HasFlag(SymlinkComponentFlags.Continue); @@ -886,7 +886,7 @@ public sealed partial class ISO9660 { nm = _joliet ? Encoding.BigEndianUnicode.GetBytes(Environment.MachineName) - : Encoding.GetBytes(Environment.MachineName); + : _encoding.GetBytes(Environment.MachineName); } else { @@ -907,7 +907,7 @@ public sealed partial class ISO9660 { entry.Filename = _joliet ? Encoding.BigEndianUnicode.GetString(entry.RockRidgeAlternateName) - : Encoding.GetString(entry.RockRidgeAlternateName); + : _encoding.GetString(entry.RockRidgeAlternateName); entry.RockRidgeAlternateName = null; } diff --git a/Aaru.Filesystems/ISO9660/File.cs b/Aaru.Filesystems/ISO9660/File.cs index 818354f14..77951c41e 100644 --- a/Aaru.Filesystems/ISO9660/File.cs +++ b/Aaru.Filesystems/ISO9660/File.cs @@ -85,10 +85,10 @@ public sealed partial class ISO9660 node = new Iso9660FileNode { - Path = path, - Length = (long)entry.Size, - Offset = 0, - _dentry = entry + Path = path, + Length = (long)entry.Size, + Offset = 0, + Dentry = entry }; return ErrorNumber.NoError; @@ -103,7 +103,7 @@ public sealed partial class ISO9660 if(node is not Iso9660FileNode mynode) return ErrorNumber.InvalidArgument; - mynode._dentry = null; + mynode.Dentry = null; return ErrorNumber.NoError; } @@ -128,15 +128,15 @@ public sealed partial class ISO9660 if(length + mynode.Offset >= mynode.Length) read = mynode.Length - mynode.Offset; - long offset = mynode.Offset + mynode._dentry.XattrLength * _blockSize; + long offset = mynode.Offset + mynode.Dentry.XattrLength * _blockSize; - if(mynode._dentry.CdiSystemArea?.attributes.HasFlag(CdiAttributes.DigitalAudio) != true || - mynode._dentry.Extents.Count != 1) + if(mynode.Dentry.CdiSystemArea?.attributes.HasFlag(CdiAttributes.DigitalAudio) != true || + mynode.Dentry.Extents.Count != 1) { - ErrorNumber err = ReadWithExtents(offset, read, mynode._dentry.Extents, - mynode._dentry.XA?.signature == XA_MAGIC && - mynode._dentry.XA?.attributes.HasFlag(XaAttributes.Interleaved) == true, - mynode._dentry.XA?.filenumber ?? 0, out byte[] buf); + ErrorNumber err = ReadWithExtents(offset, read, mynode.Dentry.Extents, + mynode.Dentry.XA?.signature == XA_MAGIC && + mynode.Dentry.XA?.attributes.HasFlag(XaAttributes.Interleaved) == true, + mynode.Dentry.XA?.filenumber ?? 0, out byte[] buf); if(err != ErrorNumber.NoError) { @@ -161,7 +161,7 @@ public sealed partial class ISO9660 if((read + offsetInSector) % 2352 > 0) sizeInSectors++; - ErrorNumber errno = _image.ReadSectorsLong((ulong)(mynode._dentry.Extents[0].extent + firstSector), + ErrorNumber errno = _image.ReadSectorsLong((ulong)(mynode.Dentry.Extents[0].extent + firstSector), (uint)sizeInSectors, out byte[] buf); if(errno != ErrorNumber.NoError) diff --git a/Aaru.Filesystems/ISO9660/ISO9660.cs b/Aaru.Filesystems/ISO9660/ISO9660.cs index 7b9674a49..971c4ea85 100644 --- a/Aaru.Filesystems/ISO9660/ISO9660.cs +++ b/Aaru.Filesystems/ISO9660/ISO9660.cs @@ -47,6 +47,7 @@ public sealed partial class ISO9660 : IReadOnlyFilesystem ushort _blockSize; bool _cdi; bool _debug; + Encoding _encoding; bool _highSierra; IMediaImage _image; bool _joliet; @@ -58,7 +59,6 @@ public sealed partial class ISO9660 : IReadOnlyFilesystem bool _useEvd; bool _usePathTable; bool _useTransTbl; - Encoding Encoding; #region IReadOnlyFilesystem Members diff --git a/Aaru.Filesystems/ISO9660/PathTable.cs b/Aaru.Filesystems/ISO9660/PathTable.cs index 74c86549c..6bf6930b9 100644 --- a/Aaru.Filesystems/ISO9660/PathTable.cs +++ b/Aaru.Filesystems/ISO9660/PathTable.cs @@ -61,7 +61,7 @@ public sealed partial class ISO9660 off += Marshal.SizeOf(); - string name = Encoding.GetString(data, off, entry.name_len); + string name = _encoding.GetString(data, off, entry.name_len); table.Add(new PathTableEntryInternal { @@ -102,7 +102,7 @@ public sealed partial class ISO9660 off += Marshal.SizeOf(); - string name = Encoding.GetString(data, off, entry.name_len); + string name = _encoding.GetString(data, off, entry.name_len); table.Add(new PathTableEntryInternal { diff --git a/Aaru.Filesystems/ISO9660/Structs/Internal.cs b/Aaru.Filesystems/ISO9660/Structs/Internal.cs index 936424248..803a599d0 100644 --- a/Aaru.Filesystems/ISO9660/Structs/Internal.cs +++ b/Aaru.Filesystems/ISO9660/Structs/Internal.cs @@ -106,8 +106,8 @@ public sealed partial class ISO9660 sealed class Iso9660DirNode : IDirNode { - internal DecodedDirectoryEntry[] _entries; - internal int _position; + internal DecodedDirectoryEntry[] Entries; + internal int Position; #region IDirNode Members @@ -123,7 +123,7 @@ public sealed partial class ISO9660 sealed class Iso9660FileNode : IFileNode { - internal DecodedDirectoryEntry _dentry; + internal DecodedDirectoryEntry Dentry; #region IFileNode Members diff --git a/Aaru.Filesystems/ISO9660/Super.cs b/Aaru.Filesystems/ISO9660/Super.cs index 5735a6ac5..1f56901fb 100644 --- a/Aaru.Filesystems/ISO9660/Super.cs +++ b/Aaru.Filesystems/ISO9660/Super.cs @@ -53,7 +53,7 @@ public sealed partial class ISO9660 public ErrorNumber Mount(IMediaImage imagePlugin, Partition partition, Encoding encoding, Dictionary options, string @namespace) { - Encoding = encoding ?? Encoding.GetEncoding(1252); + _encoding = encoding ?? Encoding.GetEncoding(1252); var vdMagic = new byte[5]; // Volume Descriptor magic "CD001" var hsMagic = new byte[5]; // Volume Descriptor magic "CDROM" @@ -123,7 +123,7 @@ public sealed partial class ISO9660 int xaOff = vdSector.Length == 2336 ? 8 : 0; Array.Copy(vdSector, 0x009 + xaOff, hsMagic, 0, 5); - _highSierra = Encoding.GetString(hsMagic) == HIGH_SIERRA_MAGIC; + _highSierra = _encoding.GetString(hsMagic) == HIGH_SIERRA_MAGIC; var hsOff = 0; if(_highSierra) @@ -164,9 +164,9 @@ public sealed partial class ISO9660 Array.Copy(vdSector, 0x001, vdMagic, 0, 5); Array.Copy(vdSector, 0x009, hsMagic, 0, 5); - if(Encoding.GetString(vdMagic) != ISO_MAGIC && - Encoding.GetString(hsMagic) != HIGH_SIERRA_MAGIC && - Encoding.GetString(vdMagic) != CDI_MAGIC) // Recognized, it is an ISO9660, now check for rest of data. + if(_encoding.GetString(vdMagic) != ISO_MAGIC && + _encoding.GetString(hsMagic) != HIGH_SIERRA_MAGIC && + _encoding.GetString(vdMagic) != CDI_MAGIC) // Recognized, it is an ISO9660, now check for rest of data. { if(counter == 0) return ErrorNumber.InvalidArgument; @@ -174,7 +174,7 @@ public sealed partial class ISO9660 break; } - _cdi |= Encoding.GetString(vdMagic) == CDI_MAGIC; + _cdi |= _encoding.GetString(vdMagic) == CDI_MAGIC; switch(vdType) { @@ -272,13 +272,13 @@ public sealed partial class ISO9660 else if(_cdi) decodedVd = DecodeVolumeDescriptor(fsvd.Value); else - decodedVd = DecodeVolumeDescriptor(pvd.Value, _namespace == Namespace.Romeo ? Encoding : Encoding.ASCII); + decodedVd = DecodeVolumeDescriptor(pvd.Value, _namespace == Namespace.Romeo ? _encoding : Encoding.ASCII); if(jolietvd != null) decodedJolietVd = DecodeJolietDescriptor(jolietvd.Value); if(_namespace != Namespace.Romeo) - Encoding = Encoding.ASCII; + _encoding = Encoding.ASCII; string fsFormat; byte[] pathTableData; @@ -317,7 +317,7 @@ public sealed partial class ISO9660 pathTableMsbLocation = fsvd.Value.path_table_addr; // TODO: Until escape sequences are implemented this is the default CD-i encoding. - Encoding = Encoding.GetEncoding("iso8859-1"); + _encoding = Encoding.GetEncoding("iso8859-1"); } else { diff --git a/Aaru.Filesystems/LisaFS/Dir.cs b/Aaru.Filesystems/LisaFS/Dir.cs index 49f687dd6..b978a7858 100644 --- a/Aaru.Filesystems/LisaFS/Dir.cs +++ b/Aaru.Filesystems/LisaFS/Dir.cs @@ -89,9 +89,9 @@ public sealed partial class LisaFS node = new LisaDirNode { - Path = path, - _contents = contents.ToArray(), - _position = 0 + Path = path, + Contents = contents.ToArray(), + Position = 0 }; return ErrorNumber.NoError; @@ -108,13 +108,13 @@ public sealed partial class LisaFS if(node is not LisaDirNode mynode) return ErrorNumber.InvalidArgument; - if(mynode._position < 0) + if(mynode.Position < 0) return ErrorNumber.InvalidArgument; - if(mynode._position >= mynode._contents.Length) + if(mynode.Position >= mynode.Contents.Length) return ErrorNumber.NoError; - filename = mynode._contents[mynode._position++]; + filename = mynode.Contents[mynode.Position++]; return ErrorNumber.NoError; } @@ -125,8 +125,8 @@ public sealed partial class LisaFS if(node is not LisaDirNode mynode) return ErrorNumber.InvalidArgument; - mynode._position = -1; - mynode._contents = null; + mynode.Position = -1; + mynode.Contents = null; return ErrorNumber.NoError; } diff --git a/Aaru.Filesystems/LisaFS/File.cs b/Aaru.Filesystems/LisaFS/File.cs index 3b9dd0995..569315226 100644 --- a/Aaru.Filesystems/LisaFS/File.cs +++ b/Aaru.Filesystems/LisaFS/File.cs @@ -81,10 +81,10 @@ public sealed partial class LisaFS node = new LisaFileNode { - Path = path, - Length = stat.Length, - Offset = 0, - _fileId = fileId + Path = path, + Length = stat.Length, + Offset = 0, + FileId = fileId }; return ErrorNumber.NoError; @@ -126,7 +126,7 @@ public sealed partial class LisaFS if(_debug) { - switch(mynode._fileId) + switch(mynode.FileId) { case FILEID_BOOT_SIGNED: case FILEID_LOADER_SIGNED: @@ -134,17 +134,17 @@ public sealed partial class LisaFS case (short)FILEID_BITMAP: case (short)FILEID_SRECORD: case (short)FILEID_CATALOG: - error = ReadSystemFile(mynode._fileId, out tmp); + error = ReadSystemFile(mynode.FileId, out tmp); break; default: - error = ReadFile(mynode._fileId, out tmp); + error = ReadFile(mynode.FileId, out tmp); break; } } else - error = ReadFile(mynode._fileId, out tmp); + error = ReadFile(mynode.FileId, out tmp); if(error != ErrorNumber.NoError) { diff --git a/Aaru.Filesystems/LisaFS/Structs.cs b/Aaru.Filesystems/LisaFS/Structs.cs index d53532319..399c62f1a 100644 --- a/Aaru.Filesystems/LisaFS/Structs.cs +++ b/Aaru.Filesystems/LisaFS/Structs.cs @@ -224,8 +224,8 @@ public sealed partial class LisaFS sealed class LisaDirNode : IDirNode { - internal string[] _contents; - internal int _position; + internal string[] Contents; + internal int Position; #region IDirNode Members @@ -241,7 +241,7 @@ public sealed partial class LisaFS sealed class LisaFileNode : IFileNode { - internal short _fileId; + internal short FileId; #region IFileNode Members diff --git a/Aaru.Filesystems/Opera/Dir.cs b/Aaru.Filesystems/Opera/Dir.cs index 1cc754fe9..da771a657 100644 --- a/Aaru.Filesystems/Opera/Dir.cs +++ b/Aaru.Filesystems/Opera/Dir.cs @@ -52,9 +52,9 @@ public sealed partial class OperaFS { node = new OperaDirNode { - Path = path, - _contents = _rootDirectoryCache.Keys.ToArray(), - _position = 0 + Path = path, + Contents = _rootDirectoryCache.Keys.ToArray(), + Position = 0 }; return ErrorNumber.NoError; @@ -68,9 +68,9 @@ public sealed partial class OperaFS { node = new OperaDirNode { - Path = path, - _contents = currentDirectory.Keys.ToArray(), - _position = 0 + Path = path, + Contents = currentDirectory.Keys.ToArray(), + Position = 0 }; return ErrorNumber.NoError; @@ -124,9 +124,9 @@ public sealed partial class OperaFS node = new OperaDirNode { - Path = path, - _contents = currentDirectory.Keys.ToArray(), - _position = 0 + Path = path, + Contents = currentDirectory.Keys.ToArray(), + Position = 0 }; return ErrorNumber.NoError; @@ -143,13 +143,13 @@ public sealed partial class OperaFS if(node is not OperaDirNode mynode) return ErrorNumber.InvalidArgument; - if(mynode._position < 0) + if(mynode.Position < 0) return ErrorNumber.InvalidArgument; - if(mynode._position >= mynode._contents.Length) + if(mynode.Position >= mynode.Contents.Length) return ErrorNumber.NoError; - filename = mynode._contents[mynode._position++]; + filename = mynode.Contents[mynode.Position++]; return ErrorNumber.NoError; } @@ -160,8 +160,8 @@ public sealed partial class OperaFS if(node is not OperaDirNode mynode) return ErrorNumber.InvalidArgument; - mynode._position = -1; - mynode._contents = null; + mynode.Position = -1; + mynode.Contents = null; return ErrorNumber.NoError; } diff --git a/Aaru.Filesystems/Opera/File.cs b/Aaru.Filesystems/Opera/File.cs index d7e91fcb5..5be23f4c3 100644 --- a/Aaru.Filesystems/Opera/File.cs +++ b/Aaru.Filesystems/Opera/File.cs @@ -79,10 +79,10 @@ public sealed partial class OperaFS node = new OperaFileNode { - Path = path, - Length = entry.Entry.byte_count, - Offset = 0, - _dentry = entry + Path = path, + Length = entry.Entry.byte_count, + Offset = 0, + Dentry = entry }; return ErrorNumber.NoError; @@ -119,21 +119,21 @@ public sealed partial class OperaFS if(length + mynode.Offset >= mynode.Length) read = mynode.Length - mynode.Offset; - long firstBlock = mynode.Offset / mynode._dentry.Entry.block_size; - long offsetInBlock = mynode.Offset % mynode._dentry.Entry.block_size; - long sizeInBlocks = (read + offsetInBlock) / mynode._dentry.Entry.block_size; + long firstBlock = mynode.Offset / mynode.Dentry.Entry.block_size; + long offsetInBlock = mynode.Offset % mynode.Dentry.Entry.block_size; + long sizeInBlocks = (read + offsetInBlock) / mynode.Dentry.Entry.block_size; - if((read + offsetInBlock) % mynode._dentry.Entry.block_size > 0) + if((read + offsetInBlock) % mynode.Dentry.Entry.block_size > 0) sizeInBlocks++; uint fileBlockSizeRatio; if(_image.Info.SectorSize is 2336 or 2352 or 2448) - fileBlockSizeRatio = mynode._dentry.Entry.block_size / 2048; + fileBlockSizeRatio = mynode.Dentry.Entry.block_size / 2048; else - fileBlockSizeRatio = mynode._dentry.Entry.block_size / _image.Info.SectorSize; + fileBlockSizeRatio = mynode.Dentry.Entry.block_size / _image.Info.SectorSize; - ErrorNumber errno = _image.ReadSectors((ulong)(mynode._dentry.Pointers[0] + firstBlock * fileBlockSizeRatio), + ErrorNumber errno = _image.ReadSectors((ulong)(mynode.Dentry.Pointers[0] + firstBlock * fileBlockSizeRatio), (uint)(sizeInBlocks * fileBlockSizeRatio), out byte[] buf); if(errno != ErrorNumber.NoError) diff --git a/Aaru.Filesystems/Opera/Structs.cs b/Aaru.Filesystems/Opera/Structs.cs index 8d8c6d3f3..59fd12c35 100644 --- a/Aaru.Filesystems/Opera/Structs.cs +++ b/Aaru.Filesystems/Opera/Structs.cs @@ -96,8 +96,8 @@ public sealed partial class OperaFS sealed class OperaDirNode : IDirNode { - internal string[] _contents; - internal int _position; + internal string[] Contents; + internal int Position; #region IDirNode Members @@ -113,7 +113,7 @@ public sealed partial class OperaFS sealed class OperaFileNode : IFileNode { - internal DirectoryEntryWithPointers _dentry; + internal DirectoryEntryWithPointers Dentry; #region IFileNode Members diff --git a/Aaru.Filesystems/UCSDPascal/Dir.cs b/Aaru.Filesystems/UCSDPascal/Dir.cs index f841b8f24..31f7f664c 100644 --- a/Aaru.Filesystems/UCSDPascal/Dir.cs +++ b/Aaru.Filesystems/UCSDPascal/Dir.cs @@ -66,9 +66,9 @@ public sealed partial class PascalPlugin node = new PascalDirNode { - Path = path, - _contents = contents.ToArray(), - _position = 0 + Path = path, + Contents = contents.ToArray(), + Position = 0 }; return ErrorNumber.NoError; @@ -85,13 +85,13 @@ public sealed partial class PascalPlugin if(node is not PascalDirNode mynode) return ErrorNumber.InvalidArgument; - if(mynode._position < 0) + if(mynode.Position < 0) return ErrorNumber.InvalidArgument; - if(mynode._position >= mynode._contents.Length) + if(mynode.Position >= mynode.Contents.Length) return ErrorNumber.NoError; - filename = mynode._contents[mynode._position++]; + filename = mynode.Contents[mynode.Position++]; return ErrorNumber.NoError; } @@ -102,8 +102,8 @@ public sealed partial class PascalPlugin if(node is not PascalDirNode mynode) return ErrorNumber.InvalidArgument; - mynode._position = -1; - mynode._contents = null; + mynode.Position = -1; + mynode.Contents = null; return ErrorNumber.NoError; } diff --git a/Aaru.Filesystems/UCSDPascal/File.cs b/Aaru.Filesystems/UCSDPascal/File.cs index ccb7782f2..c2a182ffb 100644 --- a/Aaru.Filesystems/UCSDPascal/File.cs +++ b/Aaru.Filesystems/UCSDPascal/File.cs @@ -112,7 +112,7 @@ public sealed partial class PascalPlugin Path = path, Length = file.Length, Offset = 0, - _cache = file + Cache = file }; return ErrorNumber.NoError; @@ -127,7 +127,7 @@ public sealed partial class PascalPlugin if(node is not PascalFileNode mynode) return ErrorNumber.InvalidArgument; - mynode._cache = null; + mynode.Cache = null; return ErrorNumber.NoError; } @@ -151,7 +151,7 @@ public sealed partial class PascalPlugin if(length + mynode.Offset >= mynode.Length) read = mynode.Length - mynode.Offset; - Array.Copy(mynode._cache, mynode.Offset, buffer, 0, read); + Array.Copy(mynode.Cache, mynode.Offset, buffer, 0, read); mynode.Offset += read; return ErrorNumber.NoError; diff --git a/Aaru.Filesystems/UCSDPascal/Structs.cs b/Aaru.Filesystems/UCSDPascal/Structs.cs index 5639a66a6..fc03f4ba2 100644 --- a/Aaru.Filesystems/UCSDPascal/Structs.cs +++ b/Aaru.Filesystems/UCSDPascal/Structs.cs @@ -43,8 +43,8 @@ public sealed partial class PascalPlugin sealed class PascalDirNode : IDirNode { - internal string[] _contents; - internal int _position; + internal string[] Contents; + internal int Position; #region IDirNode Members @@ -80,7 +80,7 @@ public sealed partial class PascalPlugin sealed class PascalFileNode : IFileNode { - internal byte[] _cache; + internal byte[] Cache; #region IFileNode Members diff --git a/Aaru.Gui/ViewModels/Dialogs/PluginsViewModel.cs b/Aaru.Gui/ViewModels/Dialogs/PluginsViewModel.cs index d20c1fe82..41bf7a560 100644 --- a/Aaru.Gui/ViewModels/Dialogs/PluginsViewModel.cs +++ b/Aaru.Gui/ViewModels/Dialogs/PluginsViewModel.cs @@ -206,7 +206,7 @@ public sealed class PluginsViewModel : ViewModelBase public string CloseLabel => UI.ButtonLabel_Close; public string NameLabel => UI.Title_Name; - public string UUIDLabel => UI.Title_UUID; + public string UuidLabel => UI.Title_UUID; public string VersionLabel => UI.Title_Version; public string AuthorLabel => UI.Title_Author; diff --git a/Aaru.Gui/ViewModels/Panels/DeviceInfoViewModel.cs b/Aaru.Gui/ViewModels/Panels/DeviceInfoViewModel.cs index ed5b4ef4a..3329335fe 100644 --- a/Aaru.Gui/ViewModels/Panels/DeviceInfoViewModel.cs +++ b/Aaru.Gui/ViewModels/Panels/DeviceInfoViewModel.cs @@ -948,14 +948,14 @@ public sealed class DeviceInfoViewModel : ViewModelBase public string ScsiTypeLabel => UI.Title_Peripheral_device_type; public string RemovableMediaLabel => UI.Title_Removable_media; public string UsbConnectedLabel => UI.Title_Connected_by_USB; - public string USBLabel => UI.Title_USB; + public string UsbLabel => UI.Title_USB; public string VendorIDLabel => UI.Title_Vendor_ID; public string ProductIDLabel => UI.Title_Product_ID; public string ProductLabel => UI.Title_Product; public string SaveUsbDescriptorsLabel => UI.Save_descriptors_to_file; public string FireWireLabel => UI.Title_FireWire; public string ModelIDLabel => UI.Title_Model_ID; - public string GUIDLabel => UI.Title_GUID; + public string GuidLabel => UI.Title_GUID; public string PlextorLabel => UI.Title_Plextor; public string PlextorDiscsLabel => UI.Total_loaded_discs; public string PlextorCdReadTimeLabel => UI.Time_spent_reading_CDs; @@ -1003,10 +1003,10 @@ public sealed class DeviceInfoViewModel : ViewModelBase public string OCRLabel => UI.Title_OCR; public string ExtendedCSDLabel => UI.Title_Extended_CSD; public string SCRLabel => UI.Title_SCR; - public string PCMCIALabel => UI.Title_PCMCIA; + public string PcmciaLabel => UI.Title_PCMCIA; public string ATA_ATAPILabel => UI.Title_ATA_ATAPI; public string SCSILabel => UI.Title_SCSI; - public string SD_MMCLabel => UI.Title_SD_MMC; + public string Sd_MMCLabel => UI.Title_SD_MMC; async Task ExecuteSaveUsbDescriptorsCommand() { diff --git a/Aaru.Gui/ViewModels/Panels/ImageInfoViewModel.cs b/Aaru.Gui/ViewModels/Panels/ImageInfoViewModel.cs index cec51404b..e2ee2a29c 100644 --- a/Aaru.Gui/ViewModels/Panels/ImageInfoViewModel.cs +++ b/Aaru.Gui/ViewModels/Panels/ImageInfoViewModel.cs @@ -793,11 +793,11 @@ public sealed class ImageInfoViewModel : ViewModelBase public string SCSILabel => UI.Title_SCSI; public string ATA_ATAPILabel => UI.Title_ATA_ATAPI; public string CompactDiscLabel => Localization.Core.Title_CompactDisc; - public string DVD_HD_DVDLabel => Localization.Core.Title_DVD_HD_DVD; - public string DVD_R_WLabel => Localization.Core.Title_DVD_Plus_Dash_R_W; + public string Dvd_Hd_DvdLabel => Localization.Core.Title_DVD_HD_DVD; + public string Dvd_R_WLabel => Localization.Core.Title_DVD_Plus_Dash_R_W; public string BluRayLabel => Localization.Core.Title_Blu_ray; - public string PCMCIALabel => UI.Title_PCMCIA; - public string SD_MMCLabel => UI.Title_SD_MMC; + public string PcmciaLabel => UI.Title_PCMCIA; + public string Sd_MMCLabel => UI.Title_SD_MMC; public string XboxLabel => Localization.Core.Title_Xbox; public string EntropyLabel => UI.ButtonLabel_Calculate_entropy; public string VerifyLabel => UI.ButtonLabel_Verify; diff --git a/Aaru.Gui/ViewModels/Panels/MediaInfoViewModel.cs b/Aaru.Gui/ViewModels/Panels/MediaInfoViewModel.cs index 6d3c51b36..be82d0373 100644 --- a/Aaru.Gui/ViewModels/Panels/MediaInfoViewModel.cs +++ b/Aaru.Gui/ViewModels/Panels/MediaInfoViewModel.cs @@ -342,14 +342,14 @@ public sealed class MediaInfoViewModel : ViewModelBase public string SaveGetConfigurationLabel => UI.ButtonLabel_Save_GET_CONFIGURATION_response; public string SaveRecognizedFormatLayersLabel => UI.ButtonLabel_Save_RECOGNIZED_FORMAT_LAYERS_response; public string SaveWriteProtectionStatusLabel => UI.ButtonLabel_Save_WRITE_PROTECTION_STATUS_response; - public string SSCLabel => Localization.Core.Title_SSC; + public string SscLabel => Localization.Core.Title_SSC; public string DensitySupportLabel => UI.Densities_supported_by_currently_inserted_media; public string MediumSupportLabel => UI.Medium_types_currently_inserted_in_device; public string SaveDensitySupportLabel => UI.ButtonLabel_Save_REPORT_DENSITY_SUPPORT_MEDIA_response; public string SaveMediumSupportLabel => UI.ButtonLabel_Save_REPORT_DENSITY_SUPPORT_MEDIUM_MEDIA_response; public string CompactDiscLabel => Localization.Core.Title_CompactDisc; - public string DVDLabel => Localization.Core.Title_DVD; - public string DVD_R_WLabel => Localization.Core.Title_DVD_Plus_Dash_R_W; + public string DvdLabel => Localization.Core.Title_DVD; + public string Dvd_R_WLabel => Localization.Core.Title_DVD_Plus_Dash_R_W; public string XboxLabel => Localization.Core.Title_Xbox; public string BluRayLabel => Localization.Core.Title_Blu_ray; public string DumpLabel => UI.ButtonLabel_Dump_media_to_image; diff --git a/Aaru.Gui/ViewModels/Tabs/CompactDiscInfoViewModel.cs b/Aaru.Gui/ViewModels/Tabs/CompactDiscInfoViewModel.cs index f067eff81..a029afe93 100644 --- a/Aaru.Gui/ViewModels/Tabs/CompactDiscInfoViewModel.cs +++ b/Aaru.Gui/ViewModels/Tabs/CompactDiscInfoViewModel.cs @@ -148,7 +148,7 @@ public sealed class CompactDiscInfoViewModel : ViewModelBase public string SaveCdAtipLabel => UI.ButtonLabel_Save_READ_ATIP_response; public string MiscellaneousLabel => UI.Title_Miscellaneous; public string McnLabel => UI.Title_Media_catalog_number; - public string ISRCsLabel => UI.Title_ISRCs; + public string IsrCsLabel => UI.Title_ISRCs; public string TrackLabel => Localization.Core.Title_Track; public string ISRCLabel => UI.Title_ISRC; public string SaveCdPmaLabel => UI.ButtonLabel_Save_READ_PMA_response; diff --git a/Aaru.Gui/Views/Dialogs/PluginsDialog.xaml b/Aaru.Gui/Views/Dialogs/PluginsDialog.xaml index 820580171..844c15d0e 100644 --- a/Aaru.Gui/Views/Dialogs/PluginsDialog.xaml +++ b/Aaru.Gui/Views/Dialogs/PluginsDialog.xaml @@ -53,7 +53,7 @@ - @@ -70,7 +70,7 @@ - @@ -93,7 +93,7 @@ - @@ -107,7 +107,7 @@ - @@ -131,7 +131,7 @@ - @@ -145,7 +145,7 @@ - @@ -169,7 +169,7 @@ - @@ -183,7 +183,7 @@ - diff --git a/Aaru.Gui/Views/Panels/DeviceInfo.xaml b/Aaru.Gui/Views/Panels/DeviceInfo.xaml index 7f2358ad2..18f9b7b35 100644 --- a/Aaru.Gui/Views/Panels/DeviceInfo.xaml +++ b/Aaru.Gui/Views/Panels/DeviceInfo.xaml @@ -80,7 +80,7 @@ - + @@ -131,7 +131,7 @@ - + @@ -362,7 +362,7 @@ - + @@ -380,7 +380,7 @@ - + diff --git a/Aaru.Gui/Views/Panels/ImageInfo.xaml b/Aaru.Gui/Views/Panels/ImageInfo.xaml index 74f10648d..a0384fdc1 100644 --- a/Aaru.Gui/Views/Panels/ImageInfo.xaml +++ b/Aaru.Gui/Views/Panels/ImageInfo.xaml @@ -181,13 +181,13 @@ - + - + @@ -199,13 +199,13 @@ - + - + diff --git a/Aaru.Gui/Views/Panels/MediaInfo.xaml b/Aaru.Gui/Views/Panels/MediaInfo.xaml index 746e18fa8..24b3e4c77 100644 --- a/Aaru.Gui/Views/Panels/MediaInfo.xaml +++ b/Aaru.Gui/Views/Panels/MediaInfo.xaml @@ -91,7 +91,7 @@ - + @@ -115,13 +115,13 @@ - + - + diff --git a/Aaru.Gui/Views/Tabs/CompactDiscInfo.xaml b/Aaru.Gui/Views/Tabs/CompactDiscInfo.xaml index e2c8dcfe1..85c1c9f79 100644 --- a/Aaru.Gui/Views/Tabs/CompactDiscInfo.xaml +++ b/Aaru.Gui/Views/Tabs/CompactDiscInfo.xaml @@ -115,7 +115,7 @@ - + diff --git a/Aaru.Images/A2R/A2R.cs b/Aaru.Images/A2R/A2R.cs index 66517534a..6c95cbc14 100644 --- a/Aaru.Images/A2R/A2R.cs +++ b/Aaru.Images/A2R/A2R.cs @@ -48,9 +48,9 @@ namespace Aaru.DiscImages; public sealed partial class A2R : IFluxImage, IMediaImage, IWritableImage, IWritableFluxImage { const string MODULE_NAME = "A2R plugin"; - List _a2rCaptures; - IFilter _a2rFilter; - Stream _a2rStream; + List _a2RCaptures; + IFilter _a2RFilter; + Stream _a2RStream; // Offset from the start of the current RWCP to the next capture uint _currentCaptureOffset = 16; @@ -58,12 +58,12 @@ public sealed partial class A2R : IFluxImage, IMediaImage, IWritableImage, IWrit // 53 = A2R header, INFO header, INFO data long _currentRwcpStart = 53; + A2RHeader _header; ImageInfo _imageInfo; InfoChunkV2 _infoChunkV2; InfoChunkV3 _infoChunkV3; + Dictionary _meta; FileStream _writingStream; - A2rHeader Header; - Dictionary Meta; public A2R() => _imageInfo = new ImageInfo diff --git a/Aaru.Images/A2R/Constants.cs b/Aaru.Images/A2R/Constants.cs index 067c44349..6ab9ef95f 100644 --- a/Aaru.Images/A2R/Constants.cs +++ b/Aaru.Images/A2R/Constants.cs @@ -37,12 +37,12 @@ namespace Aaru.DiscImages; [SuppressMessage("ReSharper", "UnusedType.Global")] public sealed partial class A2R { - readonly byte[] _a2rV2Signature = + readonly byte[] _a2RV2Signature = { 0x41, 0x32, 0x52, 0x32 // A2R2 }; - readonly byte[] _a2rV3Signature = + readonly byte[] _a2RV3Signature = { 0x41, 0x32, 0x52, 0x33 // A2R3 }; diff --git a/Aaru.Images/A2R/Enums.cs b/Aaru.Images/A2R/Enums.cs index 3656b04d0..a351bbeb7 100644 --- a/Aaru.Images/A2R/Enums.cs +++ b/Aaru.Images/A2R/Enums.cs @@ -37,9 +37,9 @@ namespace Aaru.DiscImages; [SuppressMessage("ReSharper", "UnusedType.Global")] public sealed partial class A2R { -#region A2rDiskType enum +#region A2RDiskType enum - public enum A2rDiskType : byte + public enum A2RDiskType : byte { _525 = 0x01, _35 = 0x2 diff --git a/Aaru.Images/A2R/Helpers.cs b/Aaru.Images/A2R/Helpers.cs index 6f81274b4..e76dcb716 100644 --- a/Aaru.Images/A2R/Helpers.cs +++ b/Aaru.Images/A2R/Helpers.cs @@ -50,7 +50,7 @@ public sealed partial class A2R /// The sub-track number /// The media type of the image /// A2R format location - static long HeadTrackSubToA2rLocation(uint head, ushort track, byte subTrack, MediaType mediaType) + static long HeadTrackSubToA2RLocation(uint head, ushort track, byte subTrack, MediaType mediaType) { if(mediaType == MediaType.Apple32SS) return head + track * 4 + subTrack; @@ -67,7 +67,7 @@ public sealed partial class A2R /// The sub-track number /// The drive type enum of the A2R image /// A2R format location - static long HeadTrackSubToA2rLocation(uint head, ushort track, byte subTrack, A2rDriveType driveType) + static long HeadTrackSubToA2RLocation(uint head, ushort track, byte subTrack, A2rDriveType driveType) { if(driveType == A2rDriveType.SS_525_40trk_quarterStep) return head + track * 4 + subTrack; @@ -85,7 +85,7 @@ public sealed partial class A2R /// The head number /// The track number /// The sub-track number - static void A2rLocationToHeadTrackSub(uint location, MediaType mediaType, out uint head, out ushort track, + static void A2RLocationToHeadTrackSub(uint location, MediaType mediaType, out uint head, out ushort track, out byte subTrack) { if(mediaType == MediaType.Apple32SS) diff --git a/Aaru.Images/A2R/Identify.cs b/Aaru.Images/A2R/Identify.cs index d85e6c7f7..20725c846 100644 --- a/Aaru.Images/A2R/Identify.cs +++ b/Aaru.Images/A2R/Identify.cs @@ -56,7 +56,7 @@ public sealed partial class A2R stream.EnsureRead(hdr, 0, 4); - return _a2rV2Signature.SequenceEqual(hdr) || _a2rV3Signature.SequenceEqual(hdr); + return _a2RV2Signature.SequenceEqual(hdr) || _a2RV3Signature.SequenceEqual(hdr); } #endregion diff --git a/Aaru.Images/A2R/Read.cs b/Aaru.Images/A2R/Read.cs index 4bc98f909..b7533e50c 100644 --- a/Aaru.Images/A2R/Read.cs +++ b/Aaru.Images/A2R/Read.cs @@ -52,40 +52,40 @@ public sealed partial class A2R /// public ErrorNumber Open(IFilter imageFilter) { - _a2rStream = imageFilter.GetDataForkStream(); - _a2rStream.Seek(0, SeekOrigin.Begin); + _a2RStream = imageFilter.GetDataForkStream(); + _a2RStream.Seek(0, SeekOrigin.Begin); - _a2rFilter = imageFilter; + _a2RFilter = imageFilter; - var hdr = new byte[Marshal.SizeOf()]; - _a2rStream.EnsureRead(hdr, 0, Marshal.SizeOf()); + var hdr = new byte[Marshal.SizeOf()]; + _a2RStream.EnsureRead(hdr, 0, Marshal.SizeOf()); - Header = Marshal.ByteArrayToStructureLittleEndian(hdr); + _header = Marshal.ByteArrayToStructureLittleEndian(hdr); AaruConsole.DebugWriteLine(MODULE_NAME, "header.signature = \"{0}\"", - StringHandlers.CToString(Header.signature)); + StringHandlers.CToString(_header.signature)); - AaruConsole.DebugWriteLine(MODULE_NAME, "header.version = {0}", Header.version); - AaruConsole.DebugWriteLine(MODULE_NAME, "header.highBitTest = {0:X2}", Header.highBitTest); + AaruConsole.DebugWriteLine(MODULE_NAME, "header.version = {0}", _header.version); + AaruConsole.DebugWriteLine(MODULE_NAME, "header.highBitTest = {0:X2}", _header.highBitTest); - AaruConsole.DebugWriteLine(MODULE_NAME, "header.lineTest = {0:X2} {1:X2} {2:X2}", Header.lineTest[0], - Header.lineTest[1], Header.lineTest[2]); + AaruConsole.DebugWriteLine(MODULE_NAME, "header.lineTest = {0:X2} {1:X2} {2:X2}", _header.lineTest[0], + _header.lineTest[1], _header.lineTest[2]); var infoMagic = new byte[4]; - _a2rStream.EnsureRead(infoMagic, 0, 4); + _a2RStream.EnsureRead(infoMagic, 0, 4); // There must be an INFO chunk after the header (at byte 16) if(!_infoChunkSignature.SequenceEqual(infoMagic)) return ErrorNumber.UnrecognizedFormat; - _a2rStream.Seek(-4, SeekOrigin.Current); + _a2RStream.Seek(-4, SeekOrigin.Current); - switch(Header.version) + switch(_header.version) { case 0x32: { var infoChnk = new byte[Marshal.SizeOf()]; - _a2rStream.EnsureRead(infoChnk, 0, Marshal.SizeOf()); + _a2RStream.EnsureRead(infoChnk, 0, Marshal.SizeOf()); _infoChunkV2 = Marshal.ByteArrayToStructureLittleEndian(infoChnk); AaruConsole.DebugWriteLine(MODULE_NAME, "infoChunk.header.chunkId = \"{0}\"", @@ -109,14 +109,14 @@ public sealed partial class A2R switch(_infoChunkV2.diskType) { - case A2rDiskType._35: + case A2RDiskType._35: _imageInfo.Heads = 2; _imageInfo.Cylinders = 80; _imageInfo.MediaType = MediaType.AppleSonyDS; _imageInfo.SectorsPerTrack = 10; break; - case A2rDiskType._525: + case A2RDiskType._525: _imageInfo.Heads = 1; _imageInfo.Cylinders = 40; _imageInfo.MediaType = MediaType.Apple32SS; @@ -131,7 +131,7 @@ public sealed partial class A2R case 0x33: { var infoChk = new byte[Marshal.SizeOf()]; - _a2rStream.EnsureRead(infoChk, 0, Marshal.SizeOf()); + _a2RStream.EnsureRead(infoChk, 0, Marshal.SizeOf()); _infoChunkV3 = Marshal.ByteArrayToStructureLittleEndian(infoChk); AaruConsole.DebugWriteLine(MODULE_NAME, "infoChunk.header.chunkId = \"{0}\"", @@ -204,35 +204,35 @@ public sealed partial class A2R } } - _a2rCaptures = new List(); + _a2RCaptures = new List(); - while(_a2rStream.Position < _a2rStream.Length) + while(_a2RStream.Position < _a2RStream.Length) { var chunkHdr = new byte[Marshal.SizeOf()]; - _a2rStream.EnsureRead(chunkHdr, 0, Marshal.SizeOf()); + _a2RStream.EnsureRead(chunkHdr, 0, Marshal.SizeOf()); ChunkHeader chunkHeader = Marshal.ByteArrayToStructureLittleEndian(chunkHdr); - _a2rStream.Seek(-Marshal.SizeOf(), SeekOrigin.Current); + _a2RStream.Seek(-Marshal.SizeOf(), SeekOrigin.Current); switch(chunkHeader.chunkId) { case var rwcp when rwcp.SequenceEqual(_rwcpChunkSignature): var rwcpBuffer = new byte[Marshal.SizeOf()]; - _a2rStream.EnsureRead(rwcpBuffer, 0, Marshal.SizeOf()); + _a2RStream.EnsureRead(rwcpBuffer, 0, Marshal.SizeOf()); RwcpChunkHeader rwcpChunk = Marshal.ByteArrayToStructureLittleEndian(rwcpBuffer); - while(_a2rStream.ReadByte() == 0x43) + while(_a2RStream.ReadByte() == 0x43) { var capture = new StreamCapture { mark = 0x43, - captureType = (byte)_a2rStream.ReadByte() + captureType = (byte)_a2RStream.ReadByte() }; var location = new byte[2]; - _a2rStream.EnsureRead(location, 0, 2); + _a2RStream.EnsureRead(location, 0, 2); capture.location = BitConverter.ToUInt16(location); - A2rLocationToHeadTrackSub(capture.location, _imageInfo.MediaType, out capture.head, + A2RLocationToHeadTrackSub(capture.location, _imageInfo.MediaType, out capture.head, out capture.track, out capture.subTrack); if(capture.head + 1 > _imageInfo.Heads) @@ -241,37 +241,37 @@ public sealed partial class A2R if(capture.track + 1 > _imageInfo.Cylinders) _imageInfo.Cylinders = (uint)(capture.track + 1); - capture.numberOfIndexSignals = (byte)_a2rStream.ReadByte(); + capture.numberOfIndexSignals = (byte)_a2RStream.ReadByte(); capture.indexSignals = new uint[capture.numberOfIndexSignals]; for(var i = 0; capture.numberOfIndexSignals > i; i++) { var index = new byte[4]; - _a2rStream.EnsureRead(index, 0, 4); + _a2RStream.EnsureRead(index, 0, 4); capture.indexSignals[i] = BitConverter.ToUInt32(index); } var dataSize = new byte[4]; - _a2rStream.EnsureRead(dataSize, 0, 4); + _a2RStream.EnsureRead(dataSize, 0, 4); capture.captureDataSize = BitConverter.ToUInt32(dataSize); - capture.dataOffset = _a2rStream.Position; + capture.dataOffset = _a2RStream.Position; capture.resolution = rwcpChunk.resolution; - _a2rCaptures.Add(capture); + _a2RCaptures.Add(capture); - _a2rStream.Seek(capture.captureDataSize, SeekOrigin.Current); + _a2RStream.Seek(capture.captureDataSize, SeekOrigin.Current); } break; case var meta when meta.SequenceEqual(_metaChunkSignature): - Meta = new Dictionary(); + _meta = new Dictionary(); - _a2rStream.Seek(Marshal.SizeOf(), SeekOrigin.Current); + _a2RStream.Seek(Marshal.SizeOf(), SeekOrigin.Current); var metadataBuffer = new byte[chunkHeader.chunkSize]; - _a2rStream.EnsureRead(metadataBuffer, 0, (int)chunkHeader.chunkSize); + _a2RStream.EnsureRead(metadataBuffer, 0, (int)chunkHeader.chunkSize); string metaData = Encoding.UTF8.GetString(metadataBuffer); @@ -279,12 +279,12 @@ public sealed partial class A2R foreach(string[] keyValue in metaFields.Select(field => field.Split('\t')). Where(keyValue => keyValue.Length == 2)) - Meta.Add(keyValue[0], keyValue[1]); + _meta.Add(keyValue[0], keyValue[1]); - if(Meta.TryGetValue("image_date", out string imageDate)) + if(_meta.TryGetValue("image_date", out string imageDate)) _imageInfo.CreationTime = DateTime.Parse(imageDate); - if(Meta.TryGetValue("title", out string title)) + if(_meta.TryGetValue("title", out string title)) _imageInfo.MediaTitle = title; break; @@ -292,23 +292,23 @@ public sealed partial class A2R return ErrorNumber.NotImplemented; case var strm when strm.SequenceEqual(_strmChunkSignature): var strmBuffer = new byte[Marshal.SizeOf()]; - _a2rStream.EnsureRead(strmBuffer, 0, Marshal.SizeOf()); + _a2RStream.EnsureRead(strmBuffer, 0, Marshal.SizeOf()); ChunkHeader strmChunk = Marshal.ByteArrayToStructureLittleEndian(strmBuffer); - long end = strmChunk.chunkSize + _a2rStream.Position - 1; + long end = strmChunk.chunkSize + _a2RStream.Position - 1; - while(_a2rStream.Position < end) + while(_a2RStream.Position < end) { var capture = new StreamCapture { indexSignals = new uint[1], - location = (byte)_a2rStream.ReadByte(), - captureType = (byte)_a2rStream.ReadByte(), + location = (byte)_a2RStream.ReadByte(), + captureType = (byte)_a2RStream.ReadByte(), resolution = 125000, numberOfIndexSignals = 1 }; - A2rLocationToHeadTrackSub(capture.location, _imageInfo.MediaType, out capture.head, + A2RLocationToHeadTrackSub(capture.location, _imageInfo.MediaType, out capture.head, out capture.track, out capture.subTrack); if(capture.head + 1 > _imageInfo.Heads) @@ -318,21 +318,21 @@ public sealed partial class A2R _imageInfo.Cylinders = (uint)(capture.track + 1); var dataSize = new byte[4]; - _a2rStream.EnsureRead(dataSize, 0, 4); + _a2RStream.EnsureRead(dataSize, 0, 4); capture.captureDataSize = BitConverter.ToUInt32(dataSize); var index = new byte[4]; - _a2rStream.EnsureRead(index, 0, 4); + _a2RStream.EnsureRead(index, 0, 4); capture.indexSignals[0] = BitConverter.ToUInt32(index); - capture.dataOffset = _a2rStream.Position; + capture.dataOffset = _a2RStream.Position; - _a2rCaptures.Add(capture); + _a2RCaptures.Add(capture); - _a2rStream.Seek(capture.captureDataSize, SeekOrigin.Current); + _a2RStream.Seek(capture.captureDataSize, SeekOrigin.Current); } - _a2rStream.ReadByte(); + _a2RStream.ReadByte(); break; } @@ -344,9 +344,9 @@ public sealed partial class A2R /// public ErrorNumber CapturesLength(uint head, ushort track, byte subTrack, out uint length) { - long index = HeadTrackSubToA2rLocation(head, track, subTrack, _imageInfo.MediaType); + long index = HeadTrackSubToA2RLocation(head, track, subTrack, _imageInfo.MediaType); - length = (uint)_a2rCaptures.FindAll(capture => index == capture.location).Count; + length = (uint)_a2RCaptures.FindAll(capture => index == capture.location).Count; return ErrorNumber.NoError; } @@ -440,7 +440,7 @@ public sealed partial class A2R if(capture.captureType == 2) return ErrorNumber.NotImplemented; - Stream stream = _a2rFilter.GetDataForkStream(); + Stream stream = _a2RFilter.GetDataForkStream(); var br = new BinaryReader(stream); br.BaseStream.Seek(capture.dataOffset, SeekOrigin.Begin); @@ -454,7 +454,7 @@ public sealed partial class A2R { length = 0; - List captures = _a2rCaptures.FindAll(c => c.head == head && c.track == track); + List captures = _a2RCaptures.FindAll(c => c.head == head && c.track == track); if(captures.Count <= 0) return ErrorNumber.OutOfRange; @@ -497,8 +497,8 @@ public sealed partial class A2R StreamCapture StreamCaptureAtIndex(uint head, ushort track, byte subTrack, uint captureIndex) { - long index = HeadTrackSubToA2rLocation(head, track, subTrack, _imageInfo.MediaType); + long index = HeadTrackSubToA2RLocation(head, track, subTrack, _imageInfo.MediaType); - return _a2rCaptures.FindAll(capture => index == capture.location)[(int)captureIndex]; + return _a2RCaptures.FindAll(capture => index == capture.location)[(int)captureIndex]; } } \ No newline at end of file diff --git a/Aaru.Images/A2R/Structs.cs b/Aaru.Images/A2R/Structs.cs index ca477ef6a..09ff3eb1b 100644 --- a/Aaru.Images/A2R/Structs.cs +++ b/Aaru.Images/A2R/Structs.cs @@ -38,10 +38,10 @@ namespace Aaru.DiscImages; [SuppressMessage("ReSharper", "UnusedType.Global")] public sealed partial class A2R { -#region Nested type: A2rHeader +#region Nested type: A2RHeader [StructLayout(LayoutKind.Sequential, Pack = 1)] - public struct A2rHeader + public struct A2RHeader { [MarshalAs(UnmanagedType.ByValArray, SizeConst = 3)] public byte[] signature; @@ -74,7 +74,7 @@ public sealed partial class A2R public byte version; [MarshalAs(UnmanagedType.ByValArray, SizeConst = 32)] public byte[] creator; - public A2rDiskType diskType; + public A2RDiskType diskType; public byte writeProtected; public byte synchronized; } diff --git a/Aaru.Images/A2R/Write.cs b/Aaru.Images/A2R/Write.cs index 794cc7dd6..761b3060a 100644 --- a/Aaru.Images/A2R/Write.cs +++ b/Aaru.Images/A2R/Write.cs @@ -87,19 +87,19 @@ public sealed partial class A2R _writingStream.WriteByte(IsCaptureTypeTiming(dataResolution, dataBuffer) ? (byte)1 : (byte)3); _writingStream. - Write(BitConverter.GetBytes((ushort)HeadTrackSubToA2rLocation(head, track, subTrack, _infoChunkV3.driveType)), + Write(BitConverter.GetBytes((ushort)HeadTrackSubToA2RLocation(head, track, subTrack, _infoChunkV3.driveType)), 0, 2); - List a2rIndices = FluxRepresentationsToUInt32List(indexBuffer); + List a2RIndices = FluxRepresentationsToUInt32List(indexBuffer); - if(a2rIndices[0] == 0) - a2rIndices.RemoveAt(0); + if(a2RIndices[0] == 0) + a2RIndices.RemoveAt(0); - _writingStream.WriteByte((byte)a2rIndices.Count); + _writingStream.WriteByte((byte)a2RIndices.Count); long previousIndex = 0; - foreach(uint index in a2rIndices) + foreach(uint index in a2RIndices) { _writingStream.Write(BitConverter.GetBytes(index + previousIndex), 0, 4); previousIndex += index; @@ -108,7 +108,7 @@ public sealed partial class A2R _writingStream.Write(BitConverter.GetBytes(dataBuffer.Length), 0, 4); _writingStream.Write(dataBuffer, 0, dataBuffer.Length); - _currentCaptureOffset += (uint)(9 + a2rIndices.Count * 4 + dataBuffer.Length); + _currentCaptureOffset += (uint)(9 + a2RIndices.Count * 4 + dataBuffer.Length); return ErrorNumber.NoError; } @@ -143,10 +143,10 @@ public sealed partial class A2R IsWriting = true; ErrorMessage = null; - Header.signature = "A2R"u8.ToArray(); - Header.version = 0x33; - Header.highBitTest = 0xFF; - Header.lineTest = "\n\r\n"u8.ToArray(); + _header.signature = "A2R"u8.ToArray(); + _header.version = 0x33; + _header.highBitTest = 0xFF; + _header.lineTest = "\n\r\n"u8.ToArray(); _infoChunkV3.driveType = mediaType switch { @@ -171,10 +171,10 @@ public sealed partial class A2R _writingStream.Seek(0, SeekOrigin.Begin); - _writingStream.Write(Header.signature, 0, 3); - _writingStream.WriteByte(Header.version); - _writingStream.WriteByte(Header.highBitTest); - _writingStream.Write(Header.lineTest, 0, 3); + _writingStream.Write(_header.signature, 0, 3); + _writingStream.WriteByte(_header.version); + _writingStream.WriteByte(_header.highBitTest); + _writingStream.Write(_header.lineTest, 0, 3); // First chunk needs to be an INFO chunk WriteInfoChunk(); @@ -200,7 +200,7 @@ public sealed partial class A2R /// public bool SetImageInfo(ImageInfo imageInfo) { - Meta = new Dictionary(); + _meta = new Dictionary(); _infoChunkV3.header.chunkId = _infoChunkSignature; _infoChunkV3.header.chunkSize = 37; @@ -213,8 +213,8 @@ public sealed partial class A2R _infoChunkV3.synchronized = 1; _infoChunkV3.hardSectorCount = 0; - Meta.Add("image_date", DateTime.Now.ToString("O")); - Meta.Add("title", imageInfo.MediaTitle); + _meta.Add("image_date", DateTime.Now.ToString("O")); + _meta.Add("title", imageInfo.MediaTitle); return true; } @@ -319,8 +319,8 @@ public sealed partial class A2R _writingStream.Write(_metaChunkSignature, 0, 4); - byte[] metaString = Encoding.UTF8.GetBytes(Meta.Select(static m => $"{m.Key}\t{m.Value}"). - Aggregate(static (concat, str) => $"{concat}\n{str}") + + byte[] metaString = Encoding.UTF8.GetBytes(_meta.Select(static m => $"{m.Key}\t{m.Value}"). + Aggregate(static (concat, str) => $"{concat}\n{str}") + '\n'); _writingStream.Write(BitConverter.GetBytes((uint)metaString.Length), 0, 4); diff --git a/Aaru.Partitions/Acorn.cs b/Aaru.Partitions/Acorn.cs index 185325d55..b15dcd282 100644 --- a/Aaru.Partitions/Acorn.cs +++ b/Aaru.Partitions/Acorn.cs @@ -66,7 +66,7 @@ public sealed class Acorn : IPartition public Guid Id => new("A7C8FEBE-8D00-4933-B9F3-42184C8BA808"); /// - public string Author => Authors.NataliaPortillo; + public string Author => Authors.NATALIA_PORTILLO; /// public bool GetInformation(IMediaImage imagePlugin, out List partitions, ulong sectorOffset) diff --git a/Aaru.Partitions/AppleMap.cs b/Aaru.Partitions/AppleMap.cs index d3d1f35c9..64d3066f2 100644 --- a/Aaru.Partitions/AppleMap.cs +++ b/Aaru.Partitions/AppleMap.cs @@ -70,7 +70,7 @@ public sealed class AppleMap : IPartition public Guid Id => new("36405F8D-4F1A-07F5-209C-223D735D6D22"); /// - public string Author => Authors.NataliaPortillo; + public string Author => Authors.NATALIA_PORTILLO; /// public bool GetInformation(IMediaImage imagePlugin, out List partitions, ulong sectorOffset) diff --git a/Aaru.Partitions/Apricot.cs b/Aaru.Partitions/Apricot.cs index f8adfa41c..8a307646a 100644 --- a/Aaru.Partitions/Apricot.cs +++ b/Aaru.Partitions/Apricot.cs @@ -95,7 +95,7 @@ public sealed class Apricot : IPartition public Guid Id => new("8CBF5864-7B5A-47A0-8CEB-199C74FA22DE"); /// - public string Author => Authors.NataliaPortillo; + public string Author => Authors.NATALIA_PORTILLO; /// public bool GetInformation(IMediaImage imagePlugin, out List partitions, ulong sectorOffset) diff --git a/Aaru.Partitions/Atari.cs b/Aaru.Partitions/Atari.cs index 2f44eae96..582aea3e3 100644 --- a/Aaru.Partitions/Atari.cs +++ b/Aaru.Partitions/Atari.cs @@ -70,7 +70,7 @@ public sealed class AtariPartitions : IPartition public Guid Id => new("d1dd0f24-ec39-4c4d-9072-be31919a3b5e"); /// - public string Author => Authors.NataliaPortillo; + public string Author => Authors.NATALIA_PORTILLO; /// public bool GetInformation(IMediaImage imagePlugin, out List partitions, ulong sectorOffset) @@ -414,9 +414,7 @@ public sealed class AtariPartitions : IPartition continue; if(table.IcdEntries[i].Start + table.IcdEntries[i].Length > imagePlugin.Info.Sectors) - { AaruConsole.DebugWriteLine(MODULE_NAME, Localization.WARNING_End_of_partition_goes_beyond_device_size); - } ulong sectorSize = imagePlugin.Info.SectorSize; diff --git a/Aaru.Partitions/Authors.cs b/Aaru.Partitions/Authors.cs index 6ebd135e0..c7b2ca485 100644 --- a/Aaru.Partitions/Authors.cs +++ b/Aaru.Partitions/Authors.cs @@ -30,5 +30,5 @@ namespace Aaru.Partitions; static class Authors { - internal const string NataliaPortillo = "Natalia Portillo"; + internal const string NATALIA_PORTILLO = "Natalia Portillo"; } \ No newline at end of file diff --git a/Aaru.Partitions/BSD.cs b/Aaru.Partitions/BSD.cs index f76001457..7f26be960 100644 --- a/Aaru.Partitions/BSD.cs +++ b/Aaru.Partitions/BSD.cs @@ -74,7 +74,7 @@ public sealed class BSD : IPartition public Guid Id => new("246A6D93-4F1A-1F8A-344D-50187A5513A9"); /// - public string Author => Authors.NataliaPortillo; + public string Author => Authors.NATALIA_PORTILLO; /// public bool GetInformation(IMediaImage imagePlugin, out List partitions, ulong sectorOffset) diff --git a/Aaru.Partitions/DEC.cs b/Aaru.Partitions/DEC.cs index 322e26bdc..b3834e268 100644 --- a/Aaru.Partitions/DEC.cs +++ b/Aaru.Partitions/DEC.cs @@ -56,7 +56,7 @@ public sealed class DEC : IPartition public Guid Id => new("58CEC3B7-3B93-4D47-86EE-D6DADE9D444F"); /// - public string Author => Authors.NataliaPortillo; + public string Author => Authors.NATALIA_PORTILLO; /// public bool GetInformation(IMediaImage imagePlugin, out List partitions, ulong sectorOffset) diff --git a/Aaru.Partitions/DragonFlyBSD.cs b/Aaru.Partitions/DragonFlyBSD.cs index 31e0e881e..4d9c5d7cd 100644 --- a/Aaru.Partitions/DragonFlyBSD.cs +++ b/Aaru.Partitions/DragonFlyBSD.cs @@ -57,7 +57,7 @@ public sealed class DragonFlyBSD : IPartition public Guid Id => new("D49E41A6-D952-4760-9D94-03DAE2450C5F"); /// - public string Author => Authors.NataliaPortillo; + public string Author => Authors.NATALIA_PORTILLO; /// public bool GetInformation(IMediaImage imagePlugin, out List partitions, ulong sectorOffset) diff --git a/Aaru.Partitions/GPT.cs b/Aaru.Partitions/GPT.cs index 2c44cf04b..0b4cfec67 100644 --- a/Aaru.Partitions/GPT.cs +++ b/Aaru.Partitions/GPT.cs @@ -61,7 +61,7 @@ public sealed class GuidPartitionTable : IPartition public Guid Id => new("CBC9D281-C1D0-44E8-9038-4D66FD2678AB"); /// - public string Author => Authors.NataliaPortillo; + public string Author => Authors.NATALIA_PORTILLO; /// public bool GetInformation(IMediaImage imagePlugin, out List partitions, ulong sectorOffset) diff --git a/Aaru.Partitions/Human68k.cs b/Aaru.Partitions/Human68k.cs index cc37131e3..fe88705fa 100644 --- a/Aaru.Partitions/Human68k.cs +++ b/Aaru.Partitions/Human68k.cs @@ -60,7 +60,7 @@ public sealed class Human68K : IPartition public Guid Id => new("246A6D93-4F1A-1F8A-344D-50187A5513A9"); /// - public string Author => Authors.NataliaPortillo; + public string Author => Authors.NATALIA_PORTILLO; /// public bool GetInformation(IMediaImage imagePlugin, out List partitions, ulong sectorOffset) diff --git a/Aaru.Partitions/MBR.cs b/Aaru.Partitions/MBR.cs index 32edc279c..42ce6fcd2 100644 --- a/Aaru.Partitions/MBR.cs +++ b/Aaru.Partitions/MBR.cs @@ -312,7 +312,7 @@ public sealed class MBR : IPartition public Guid Id => new("5E8A34E8-4F1A-59E6-4BF7-7EA647063A76"); /// - public string Author => Authors.NataliaPortillo; + public string Author => Authors.NATALIA_PORTILLO; /// [SuppressMessage("ReSharper", "UnusedVariable")] diff --git a/Aaru.Partitions/NeXT.cs b/Aaru.Partitions/NeXT.cs index a29537a5e..650659b80 100644 --- a/Aaru.Partitions/NeXT.cs +++ b/Aaru.Partitions/NeXT.cs @@ -74,7 +74,7 @@ public sealed class NeXTDisklabel : IPartition public Guid Id => new("246A6D93-4F1A-1F8A-344D-50187A5513A9"); /// - public string Author => Authors.NataliaPortillo; + public string Author => Authors.NATALIA_PORTILLO; /// public bool GetInformation(IMediaImage imagePlugin, out List partitions, ulong sectorOffset) diff --git a/Aaru.Partitions/PC98.cs b/Aaru.Partitions/PC98.cs index 991f58bd3..3b6137b01 100644 --- a/Aaru.Partitions/PC98.cs +++ b/Aaru.Partitions/PC98.cs @@ -57,7 +57,7 @@ public sealed class PC98 : IPartition public Guid Id => new("27333401-C7C2-447D-961C-22AD0641A09A"); /// - public string Author => Authors.NataliaPortillo; + public string Author => Authors.NATALIA_PORTILLO; /// public bool GetInformation(IMediaImage imagePlugin, out List partitions, ulong sectorOffset) diff --git a/Aaru.Partitions/Plan9.cs b/Aaru.Partitions/Plan9.cs index 8885b244d..63d8a69d2 100644 --- a/Aaru.Partitions/Plan9.cs +++ b/Aaru.Partitions/Plan9.cs @@ -58,7 +58,7 @@ public sealed class Plan9 : IPartition public Guid Id => new("F0BF4FFC-056E-4E7C-8B65-4EAEE250ADD9"); /// - public string Author => Authors.NataliaPortillo; + public string Author => Authors.NATALIA_PORTILLO; /// public bool GetInformation(IMediaImage imagePlugin, out List partitions, ulong sectorOffset) diff --git a/Aaru.Partitions/RDB.cs b/Aaru.Partitions/RDB.cs index 9442c286c..0206e6b27 100644 --- a/Aaru.Partitions/RDB.cs +++ b/Aaru.Partitions/RDB.cs @@ -187,7 +187,7 @@ public sealed class AmigaRigidDiskBlock : IPartition public Guid Id => new("8D72ED97-1854-4170-9CE4-6E8446FD9863"); /// - public string Author => Authors.NataliaPortillo; + public string Author => Authors.NATALIA_PORTILLO; /// public bool GetInformation(IMediaImage imagePlugin, out List partitions, ulong sectorOffset) diff --git a/Aaru.Partitions/RioKarma.cs b/Aaru.Partitions/RioKarma.cs index 667bafc71..97c5bb52e 100644 --- a/Aaru.Partitions/RioKarma.cs +++ b/Aaru.Partitions/RioKarma.cs @@ -57,7 +57,7 @@ public sealed class RioKarma : IPartition public Guid Id => new("246A6D93-4F1A-1F8A-344D-50187A5513A9"); /// - public string Author => Authors.NataliaPortillo; + public string Author => Authors.NATALIA_PORTILLO; /// public bool GetInformation(IMediaImage imagePlugin, out List partitions, ulong sectorOffset) diff --git a/Aaru.Partitions/SGI.cs b/Aaru.Partitions/SGI.cs index f9b6bacfb..cea8808fa 100644 --- a/Aaru.Partitions/SGI.cs +++ b/Aaru.Partitions/SGI.cs @@ -62,7 +62,7 @@ public sealed class SGI : IPartition public Guid Id => new("AEF5AB45-4880-4CE8-8735-F0A402E2E5F2"); /// - public string Author => Authors.NataliaPortillo; + public string Author => Authors.NATALIA_PORTILLO; /// public bool GetInformation(IMediaImage imagePlugin, out List partitions, ulong sectorOffset) diff --git a/Aaru.Partitions/Sun.cs b/Aaru.Partitions/Sun.cs index 1965c1b42..806ea0695 100644 --- a/Aaru.Partitions/Sun.cs +++ b/Aaru.Partitions/Sun.cs @@ -92,7 +92,7 @@ public sealed class SunDisklabel : IPartition public Guid Id => new("50F35CC4-8375-4445-8DCB-1BA550C931A3"); /// - public string Author => Authors.NataliaPortillo; + public string Author => Authors.NATALIA_PORTILLO; /// public bool GetInformation(IMediaImage imagePlugin, out List partitions, ulong sectorOffset) diff --git a/Aaru.Partitions/UNIX.cs b/Aaru.Partitions/UNIX.cs index fb0c43cae..f63ed0b35 100644 --- a/Aaru.Partitions/UNIX.cs +++ b/Aaru.Partitions/UNIX.cs @@ -1382,7 +1382,7 @@ public sealed class UNIX : IPartition public Guid Id => new("9ED7E30B-53BF-4619-87A0-5D2002155617"); /// - public string Author => Authors.NataliaPortillo; + public string Author => Authors.NATALIA_PORTILLO; /// public bool GetInformation(IMediaImage imagePlugin, out List partitions, ulong sectorOffset) diff --git a/Aaru.Partitions/VTOC.cs b/Aaru.Partitions/VTOC.cs index 42d5b42c9..95507ca60 100644 --- a/Aaru.Partitions/VTOC.cs +++ b/Aaru.Partitions/VTOC.cs @@ -66,7 +66,7 @@ public sealed class VTOC : IPartition public Guid Id => new("6D35A66F-8D77-426F-A562-D88F6A1F1702"); /// - public string Author => Authors.NataliaPortillo; + public string Author => Authors.NATALIA_PORTILLO; /// public bool GetInformation(IMediaImage imagePlugin, out List partitions, ulong sectorOffset) diff --git a/Aaru.Partitions/XENIX.cs b/Aaru.Partitions/XENIX.cs index ab5ce450f..a127defed 100644 --- a/Aaru.Partitions/XENIX.cs +++ b/Aaru.Partitions/XENIX.cs @@ -62,7 +62,7 @@ public sealed class XENIX : IPartition public Guid Id => new("53BE01DE-E68B-469F-A17F-EC2E4BD61CD9"); /// - public string Author => Authors.NataliaPortillo; + public string Author => Authors.NATALIA_PORTILLO; /// public bool GetInformation(IMediaImage imagePlugin, out List partitions, ulong sectorOffset) diff --git a/Aaru.Partitions/Xbox.cs b/Aaru.Partitions/Xbox.cs index 9f2650d33..770d37450 100644 --- a/Aaru.Partitions/Xbox.cs +++ b/Aaru.Partitions/Xbox.cs @@ -73,7 +73,7 @@ public sealed class Xbox : IPartition public Guid Id => new("E3F6FB91-D358-4F22-A550-81E92D50EB78"); /// - public string Author => Authors.NataliaPortillo; + public string Author => Authors.NATALIA_PORTILLO; /// public bool GetInformation(IMediaImage imagePlugin, out List partitions, ulong sectorOffset) diff --git a/Aaru/Commands/Image/Convert.cs b/Aaru/Commands/Image/Convert.cs index ca8f635a5..099a440cc 100644 --- a/Aaru/Commands/Image/Convert.cs +++ b/Aaru/Commands/Image/Convert.cs @@ -913,7 +913,7 @@ sealed class ConvertImageCommand : Command decrypt) { // Only sectors which are MPEG packets can be encrypted. - if(MPEG.ContainsMpegPackets(sector, sectorsToDo)) + if(Mpeg.ContainsMpegPackets(sector, sectorsToDo)) { byte[] cmi, titleKey;