mirror of
https://github.com/aaru-dps/Aaru.Decoders.git
synced 2025-12-16 19:24:32 +00:00
General code cleanup and style refactor.
This commit is contained in:
@@ -32,8 +32,6 @@
|
||||
|
||||
// ReSharper disable MemberCanBePrivate.Global
|
||||
|
||||
namespace Aaru.Decoders.SCSI.MMC;
|
||||
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Diagnostics.CodeAnalysis;
|
||||
@@ -41,6 +39,8 @@ using System.Text;
|
||||
using Aaru.CommonTypes.Structs.Devices.SCSI;
|
||||
using Aaru.Helpers;
|
||||
|
||||
namespace Aaru.Decoders.SCSI.MMC;
|
||||
|
||||
/// <summary>MMC Feature enumeration</summary>
|
||||
[SuppressMessage("ReSharper", "InconsistentNaming")]
|
||||
public enum FeatureNumber : ushort
|
||||
@@ -1307,7 +1307,7 @@ public static class Features
|
||||
if(feature.Length < 4)
|
||||
return null;
|
||||
|
||||
var number = (ushort)((feature[0] << 8) + feature[1]);
|
||||
ushort number = (ushort)((feature[0] << 8) + feature[1]);
|
||||
|
||||
if(number != 0x0000)
|
||||
return null;
|
||||
@@ -1321,8 +1321,8 @@ public static class Features
|
||||
decoded.Persistent |= (feature[2] & 0x02) == 0x02;
|
||||
decoded.Version = (byte)((feature[2] & 0x3C) >> 2);
|
||||
|
||||
var offset = 4;
|
||||
var listProfiles = new List<Profile>();
|
||||
int offset = 4;
|
||||
List<Profile> listProfiles = new();
|
||||
|
||||
while(offset < feature.Length)
|
||||
{
|
||||
@@ -1349,7 +1349,7 @@ public static class Features
|
||||
if(feature.Length < 8)
|
||||
return null;
|
||||
|
||||
var number = (ushort)((feature[0] << 8) + feature[1]);
|
||||
ushort number = (ushort)((feature[0] << 8) + feature[1]);
|
||||
|
||||
if(number != 0x0001)
|
||||
return null;
|
||||
@@ -1385,7 +1385,7 @@ public static class Features
|
||||
if(feature.Length < 8)
|
||||
return null;
|
||||
|
||||
var number = (ushort)((feature[0] << 8) + feature[1]);
|
||||
ushort number = (ushort)((feature[0] << 8) + feature[1]);
|
||||
|
||||
if(number != 0x0002)
|
||||
return null;
|
||||
@@ -1415,7 +1415,7 @@ public static class Features
|
||||
if(feature.Length < 8)
|
||||
return null;
|
||||
|
||||
var number = (ushort)((feature[0] << 8) + feature[1]);
|
||||
ushort number = (ushort)((feature[0] << 8) + feature[1]);
|
||||
|
||||
if(number != 0x0003)
|
||||
return null;
|
||||
@@ -1451,7 +1451,7 @@ public static class Features
|
||||
if(feature.Length < 8)
|
||||
return null;
|
||||
|
||||
var number = (ushort)((feature[0] << 8) + feature[1]);
|
||||
ushort number = (ushort)((feature[0] << 8) + feature[1]);
|
||||
|
||||
if(number != 0x0004)
|
||||
return null;
|
||||
@@ -1485,7 +1485,7 @@ public static class Features
|
||||
if(feature.Length < 12)
|
||||
return null;
|
||||
|
||||
var number = (ushort)((feature[0] << 8) + feature[1]);
|
||||
ushort number = (ushort)((feature[0] << 8) + feature[1]);
|
||||
|
||||
if(number != 0x0010)
|
||||
return null;
|
||||
@@ -1516,7 +1516,7 @@ public static class Features
|
||||
if(feature.Length < 4)
|
||||
return null;
|
||||
|
||||
var number = (ushort)((feature[0] << 8) + feature[1]);
|
||||
ushort number = (ushort)((feature[0] << 8) + feature[1]);
|
||||
|
||||
if(number != 0x001D)
|
||||
return null;
|
||||
@@ -1541,7 +1541,7 @@ public static class Features
|
||||
if(feature.Length < 8)
|
||||
return null;
|
||||
|
||||
var number = (ushort)((feature[0] << 8) + feature[1]);
|
||||
ushort number = (ushort)((feature[0] << 8) + feature[1]);
|
||||
|
||||
if(number != 0x001E)
|
||||
return null;
|
||||
@@ -1575,7 +1575,7 @@ public static class Features
|
||||
if(feature.Length < 4)
|
||||
return null;
|
||||
|
||||
var number = (ushort)((feature[0] << 8) + feature[1]);
|
||||
ushort number = (ushort)((feature[0] << 8) + feature[1]);
|
||||
|
||||
if(number != 0x001F)
|
||||
return null;
|
||||
@@ -1612,7 +1612,7 @@ public static class Features
|
||||
if(feature.Length < 16)
|
||||
return null;
|
||||
|
||||
var number = (ushort)((feature[0] << 8) + feature[1]);
|
||||
ushort number = (ushort)((feature[0] << 8) + feature[1]);
|
||||
|
||||
if(number != 0x0020)
|
||||
return null;
|
||||
@@ -1647,7 +1647,7 @@ public static class Features
|
||||
if(feature.Length < 8)
|
||||
return null;
|
||||
|
||||
var number = (ushort)((feature[0] << 8) + feature[1]);
|
||||
ushort number = (ushort)((feature[0] << 8) + feature[1]);
|
||||
|
||||
if(number != 0x0021)
|
||||
return null;
|
||||
@@ -1688,7 +1688,7 @@ public static class Features
|
||||
if(feature.Length < 4)
|
||||
return null;
|
||||
|
||||
var number = (ushort)((feature[0] << 8) + feature[1]);
|
||||
ushort number = (ushort)((feature[0] << 8) + feature[1]);
|
||||
|
||||
if(number != 0x0022)
|
||||
return null;
|
||||
@@ -1713,7 +1713,7 @@ public static class Features
|
||||
if(feature.Length < 4)
|
||||
return null;
|
||||
|
||||
var number = (ushort)((feature[0] << 8) + feature[1]);
|
||||
ushort number = (ushort)((feature[0] << 8) + feature[1]);
|
||||
|
||||
if(number != 0x0023)
|
||||
return null;
|
||||
@@ -1752,7 +1752,7 @@ public static class Features
|
||||
if(feature.Length < 4)
|
||||
return null;
|
||||
|
||||
var number = (ushort)((feature[0] << 8) + feature[1]);
|
||||
ushort number = (ushort)((feature[0] << 8) + feature[1]);
|
||||
|
||||
if(number != 0x0024)
|
||||
return null;
|
||||
@@ -1781,7 +1781,7 @@ public static class Features
|
||||
if(feature.Length < 12)
|
||||
return null;
|
||||
|
||||
var number = (ushort)((feature[0] << 8) + feature[1]);
|
||||
ushort number = (ushort)((feature[0] << 8) + feature[1]);
|
||||
|
||||
if(number != 0x0025)
|
||||
return null;
|
||||
@@ -1812,7 +1812,7 @@ public static class Features
|
||||
if(feature.Length < 4)
|
||||
return null;
|
||||
|
||||
var number = (ushort)((feature[0] << 8) + feature[1]);
|
||||
ushort number = (ushort)((feature[0] << 8) + feature[1]);
|
||||
|
||||
if(number != 0x0026)
|
||||
return null;
|
||||
@@ -1837,7 +1837,7 @@ public static class Features
|
||||
if(feature.Length < 8)
|
||||
return null;
|
||||
|
||||
var number = (ushort)((feature[0] << 8) + feature[1]);
|
||||
ushort number = (ushort)((feature[0] << 8) + feature[1]);
|
||||
|
||||
if(number != 0x0027)
|
||||
return null;
|
||||
@@ -1862,7 +1862,7 @@ public static class Features
|
||||
if(feature.Length < 8)
|
||||
return null;
|
||||
|
||||
var number = (ushort)((feature[0] << 8) + feature[1]);
|
||||
ushort number = (ushort)((feature[0] << 8) + feature[1]);
|
||||
|
||||
if(number != 0x0028)
|
||||
return null;
|
||||
@@ -1895,7 +1895,7 @@ public static class Features
|
||||
if(feature.Length < 8)
|
||||
return null;
|
||||
|
||||
var number = (ushort)((feature[0] << 8) + feature[1]);
|
||||
ushort number = (ushort)((feature[0] << 8) + feature[1]);
|
||||
|
||||
if(number != 0x0029)
|
||||
return null;
|
||||
@@ -1924,7 +1924,7 @@ public static class Features
|
||||
if(feature.Length < 8)
|
||||
return null;
|
||||
|
||||
var number = (ushort)((feature[0] << 8) + feature[1]);
|
||||
ushort number = (ushort)((feature[0] << 8) + feature[1]);
|
||||
|
||||
if(number != 0x002A)
|
||||
return null;
|
||||
@@ -1955,7 +1955,7 @@ public static class Features
|
||||
if(feature.Length < 8)
|
||||
return null;
|
||||
|
||||
var number = (ushort)((feature[0] << 8) + feature[1]);
|
||||
ushort number = (ushort)((feature[0] << 8) + feature[1]);
|
||||
|
||||
if(number != 0x002B)
|
||||
return null;
|
||||
@@ -1982,7 +1982,7 @@ public static class Features
|
||||
if(feature.Length < 8)
|
||||
return null;
|
||||
|
||||
var number = (ushort)((feature[0] << 8) + feature[1]);
|
||||
ushort number = (ushort)((feature[0] << 8) + feature[1]);
|
||||
|
||||
if(number != 0x002C)
|
||||
return null;
|
||||
@@ -2012,7 +2012,7 @@ public static class Features
|
||||
if(feature.Length < 8)
|
||||
return null;
|
||||
|
||||
var number = (ushort)((feature[0] << 8) + feature[1]);
|
||||
ushort number = (ushort)((feature[0] << 8) + feature[1]);
|
||||
|
||||
if(number != 0x002D)
|
||||
return null;
|
||||
@@ -2049,7 +2049,7 @@ public static class Features
|
||||
if(feature.Length < 8)
|
||||
return null;
|
||||
|
||||
var number = (ushort)((feature[0] << 8) + feature[1]);
|
||||
ushort number = (ushort)((feature[0] << 8) + feature[1]);
|
||||
|
||||
if(number != 0x002E)
|
||||
return null;
|
||||
@@ -2085,7 +2085,7 @@ public static class Features
|
||||
if(feature.Length < 8)
|
||||
return null;
|
||||
|
||||
var number = (ushort)((feature[0] << 8) + feature[1]);
|
||||
ushort number = (ushort)((feature[0] << 8) + feature[1]);
|
||||
|
||||
if(number != 0x002F)
|
||||
return null;
|
||||
@@ -2119,7 +2119,7 @@ public static class Features
|
||||
if(feature.Length < 4)
|
||||
return null;
|
||||
|
||||
var number = (ushort)((feature[0] << 8) + feature[1]);
|
||||
ushort number = (ushort)((feature[0] << 8) + feature[1]);
|
||||
|
||||
if(number != 0x0030)
|
||||
return null;
|
||||
@@ -2144,7 +2144,7 @@ public static class Features
|
||||
if(feature.Length < 8)
|
||||
return null;
|
||||
|
||||
var number = (ushort)((feature[0] << 8) + feature[1]);
|
||||
ushort number = (ushort)((feature[0] << 8) + feature[1]);
|
||||
|
||||
if(number != 0x0031)
|
||||
return null;
|
||||
@@ -2171,7 +2171,7 @@ public static class Features
|
||||
if(feature.Length < 8)
|
||||
return null;
|
||||
|
||||
var number = (ushort)((feature[0] << 8) + feature[1]);
|
||||
ushort number = (ushort)((feature[0] << 8) + feature[1]);
|
||||
|
||||
if(number != 0x0032)
|
||||
return null;
|
||||
@@ -2199,7 +2199,7 @@ public static class Features
|
||||
if(feature.Length < 8)
|
||||
return null;
|
||||
|
||||
var number = (ushort)((feature[0] << 8) + feature[1]);
|
||||
ushort number = (ushort)((feature[0] << 8) + feature[1]);
|
||||
|
||||
if(number != 0x0033)
|
||||
return null;
|
||||
@@ -2231,7 +2231,7 @@ public static class Features
|
||||
if(feature.Length < 4)
|
||||
return null;
|
||||
|
||||
var number = (ushort)((feature[0] << 8) + feature[1]);
|
||||
ushort number = (ushort)((feature[0] << 8) + feature[1]);
|
||||
|
||||
if(number != 0x0035)
|
||||
return null;
|
||||
@@ -2256,7 +2256,7 @@ public static class Features
|
||||
if(feature.Length < 8)
|
||||
return null;
|
||||
|
||||
var number = (ushort)((feature[0] << 8) + feature[1]);
|
||||
ushort number = (ushort)((feature[0] << 8) + feature[1]);
|
||||
|
||||
if(number != 0x0037)
|
||||
return null;
|
||||
@@ -2283,7 +2283,7 @@ public static class Features
|
||||
if(feature.Length < 8)
|
||||
return null;
|
||||
|
||||
var number = (ushort)((feature[0] << 8) + feature[1]);
|
||||
ushort number = (ushort)((feature[0] << 8) + feature[1]);
|
||||
|
||||
if(number != 0x0038)
|
||||
return null;
|
||||
@@ -2308,7 +2308,7 @@ public static class Features
|
||||
if(feature.Length < 8)
|
||||
return null;
|
||||
|
||||
var number = (ushort)((feature[0] << 8) + feature[1]);
|
||||
ushort number = (ushort)((feature[0] << 8) + feature[1]);
|
||||
|
||||
if(number != 0x003A)
|
||||
return null;
|
||||
@@ -2337,7 +2337,7 @@ public static class Features
|
||||
if(feature.Length < 8)
|
||||
return null;
|
||||
|
||||
var number = (ushort)((feature[0] << 8) + feature[1]);
|
||||
ushort number = (ushort)((feature[0] << 8) + feature[1]);
|
||||
|
||||
if(number != 0x003B)
|
||||
return null;
|
||||
@@ -2364,7 +2364,7 @@ public static class Features
|
||||
if(feature.Length < 32)
|
||||
return null;
|
||||
|
||||
var number = (ushort)((feature[0] << 8) + feature[1]);
|
||||
ushort number = (ushort)((feature[0] << 8) + feature[1]);
|
||||
|
||||
if(number != 0x0040)
|
||||
return null;
|
||||
@@ -2402,7 +2402,7 @@ public static class Features
|
||||
if(feature.Length < 24)
|
||||
return null;
|
||||
|
||||
var number = (ushort)((feature[0] << 8) + feature[1]);
|
||||
ushort number = (ushort)((feature[0] << 8) + feature[1]);
|
||||
|
||||
if(number != 0x0041)
|
||||
return null;
|
||||
@@ -2438,7 +2438,7 @@ public static class Features
|
||||
if(feature.Length < 4)
|
||||
return null;
|
||||
|
||||
var number = (ushort)((feature[0] << 8) + feature[1]);
|
||||
ushort number = (ushort)((feature[0] << 8) + feature[1]);
|
||||
|
||||
if(number != 0x0042)
|
||||
return null;
|
||||
@@ -2463,7 +2463,7 @@ public static class Features
|
||||
if(feature.Length < 8)
|
||||
return null;
|
||||
|
||||
var number = (ushort)((feature[0] << 8) + feature[1]);
|
||||
ushort number = (ushort)((feature[0] << 8) + feature[1]);
|
||||
|
||||
if(number != 0x0050)
|
||||
return null;
|
||||
@@ -2491,7 +2491,7 @@ public static class Features
|
||||
if(feature.Length < 8)
|
||||
return null;
|
||||
|
||||
var number = (ushort)((feature[0] << 8) + feature[1]);
|
||||
ushort number = (ushort)((feature[0] << 8) + feature[1]);
|
||||
|
||||
if(number != 0x0051)
|
||||
return null;
|
||||
@@ -2519,7 +2519,7 @@ public static class Features
|
||||
if(feature.Length < 8)
|
||||
return null;
|
||||
|
||||
var number = (ushort)((feature[0] << 8) + feature[1]);
|
||||
ushort number = (ushort)((feature[0] << 8) + feature[1]);
|
||||
|
||||
if(number != 0x0080)
|
||||
return null;
|
||||
@@ -2546,7 +2546,7 @@ public static class Features
|
||||
if(feature.Length < 4)
|
||||
return null;
|
||||
|
||||
var number = (ushort)((feature[0] << 8) + feature[1]);
|
||||
ushort number = (ushort)((feature[0] << 8) + feature[1]);
|
||||
|
||||
if(number != 0x0100)
|
||||
return null;
|
||||
@@ -2571,7 +2571,7 @@ public static class Features
|
||||
if(feature.Length < 8)
|
||||
return null;
|
||||
|
||||
var number = (ushort)((feature[0] << 8) + feature[1]);
|
||||
ushort number = (ushort)((feature[0] << 8) + feature[1]);
|
||||
|
||||
if(number != 0x0101)
|
||||
return null;
|
||||
@@ -2598,7 +2598,7 @@ public static class Features
|
||||
if(feature.Length < 4)
|
||||
return null;
|
||||
|
||||
var number = (ushort)((feature[0] << 8) + feature[1]);
|
||||
ushort number = (ushort)((feature[0] << 8) + feature[1]);
|
||||
|
||||
if(number != 0x0102)
|
||||
return null;
|
||||
@@ -2627,7 +2627,7 @@ public static class Features
|
||||
if(feature.Length < 8)
|
||||
return null;
|
||||
|
||||
var number = (ushort)((feature[0] << 8) + feature[1]);
|
||||
ushort number = (ushort)((feature[0] << 8) + feature[1]);
|
||||
|
||||
if(number != 0x0103)
|
||||
return null;
|
||||
@@ -2657,7 +2657,7 @@ public static class Features
|
||||
if(feature.Length < 4)
|
||||
return null;
|
||||
|
||||
var number = (ushort)((feature[0] << 8) + feature[1]);
|
||||
ushort number = (ushort)((feature[0] << 8) + feature[1]);
|
||||
|
||||
if(number != 0x0104)
|
||||
return null;
|
||||
@@ -2686,7 +2686,7 @@ public static class Features
|
||||
if(feature.Length < 4)
|
||||
return null;
|
||||
|
||||
var number = (ushort)((feature[0] << 8) + feature[1]);
|
||||
ushort number = (ushort)((feature[0] << 8) + feature[1]);
|
||||
|
||||
if(number != 0x0105)
|
||||
return null;
|
||||
@@ -2718,7 +2718,7 @@ public static class Features
|
||||
if(feature.Length < 8)
|
||||
return null;
|
||||
|
||||
var number = (ushort)((feature[0] << 8) + feature[1]);
|
||||
ushort number = (ushort)((feature[0] << 8) + feature[1]);
|
||||
|
||||
if(number != 0x0106)
|
||||
return null;
|
||||
@@ -2745,7 +2745,7 @@ public static class Features
|
||||
if(feature.Length < 4)
|
||||
return null;
|
||||
|
||||
var number = (ushort)((feature[0] << 8) + feature[1]);
|
||||
ushort number = (ushort)((feature[0] << 8) + feature[1]);
|
||||
|
||||
if(number != 0x0107)
|
||||
return null;
|
||||
@@ -2787,7 +2787,7 @@ public static class Features
|
||||
if(feature.Length < 4)
|
||||
return null;
|
||||
|
||||
var number = (ushort)((feature[0] << 8) + feature[1]);
|
||||
ushort number = (ushort)((feature[0] << 8) + feature[1]);
|
||||
|
||||
if(number != 0x0108)
|
||||
return null;
|
||||
@@ -2801,7 +2801,7 @@ public static class Features
|
||||
decoded.Persistent |= (feature[2] & 0x02) == 0x02;
|
||||
decoded.Version = (byte)((feature[2] & 0x3C) >> 2);
|
||||
|
||||
var serial = new byte[feature.Length];
|
||||
byte[] serial = new byte[feature.Length];
|
||||
Array.Copy(feature, 4, serial, 0, feature.Length - 4);
|
||||
decoded.Serial = StringHandlers.CToString(serial).Trim();
|
||||
|
||||
@@ -2816,7 +2816,7 @@ public static class Features
|
||||
if(feature.Length < 4)
|
||||
return null;
|
||||
|
||||
var number = (ushort)((feature[0] << 8) + feature[1]);
|
||||
ushort number = (ushort)((feature[0] << 8) + feature[1]);
|
||||
|
||||
if(number != 0x0109)
|
||||
return null;
|
||||
@@ -2841,7 +2841,7 @@ public static class Features
|
||||
if(feature.Length < 8)
|
||||
return null;
|
||||
|
||||
var number = (ushort)((feature[0] << 8) + feature[1]);
|
||||
ushort number = (ushort)((feature[0] << 8) + feature[1]);
|
||||
|
||||
if(number != 0x010A)
|
||||
return null;
|
||||
@@ -2857,9 +2857,9 @@ public static class Features
|
||||
|
||||
decoded.DCBs = new uint[feature[3] / 4];
|
||||
|
||||
for(var i = 0; i < decoded.DCBs.Length; i++)
|
||||
decoded.DCBs[i] = (uint)((feature[0 + 4 + i * 4] << 24) + (feature[1 + 4 + i * 4] << 16) +
|
||||
(feature[2 + 4 + i * 4] << 8) + feature[3 + 4 + i * 4]);
|
||||
for(int i = 0; i < decoded.DCBs.Length; i++)
|
||||
decoded.DCBs[i] = (uint)((feature[0 + 4 + (i * 4)] << 24) + (feature[1 + 4 + (i * 4)] << 16) +
|
||||
(feature[2 + 4 + (i * 4)] << 8) + feature[3 + 4 + (i * 4)]);
|
||||
|
||||
return decoded;
|
||||
}
|
||||
@@ -2872,7 +2872,7 @@ public static class Features
|
||||
if(feature.Length < 4)
|
||||
return null;
|
||||
|
||||
var number = (ushort)((feature[0] << 8) + feature[1]);
|
||||
ushort number = (ushort)((feature[0] << 8) + feature[1]);
|
||||
|
||||
if(number != 0x010B)
|
||||
return null;
|
||||
@@ -2899,7 +2899,7 @@ public static class Features
|
||||
if(feature.Length < 20)
|
||||
return null;
|
||||
|
||||
var number = (ushort)((feature[0] << 8) + feature[1]);
|
||||
ushort number = (ushort)((feature[0] << 8) + feature[1]);
|
||||
|
||||
if(number != 0x010C)
|
||||
return null;
|
||||
@@ -2932,7 +2932,7 @@ public static class Features
|
||||
if(feature.Length < 8)
|
||||
return null;
|
||||
|
||||
var number = (ushort)((feature[0] << 8) + feature[1]);
|
||||
ushort number = (ushort)((feature[0] << 8) + feature[1]);
|
||||
|
||||
if(number != 0x010D)
|
||||
return null;
|
||||
@@ -2970,7 +2970,7 @@ public static class Features
|
||||
if(feature.Length < 8)
|
||||
return null;
|
||||
|
||||
var number = (ushort)((feature[0] << 8) + feature[1]);
|
||||
ushort number = (ushort)((feature[0] << 8) + feature[1]);
|
||||
|
||||
if(number != 0x010E)
|
||||
return null;
|
||||
@@ -2997,7 +2997,7 @@ public static class Features
|
||||
if(feature.Length < 8)
|
||||
return null;
|
||||
|
||||
var number = (ushort)((feature[0] << 8) + feature[1]);
|
||||
ushort number = (ushort)((feature[0] << 8) + feature[1]);
|
||||
|
||||
if(number != 0x0110)
|
||||
return null;
|
||||
@@ -3022,7 +3022,7 @@ public static class Features
|
||||
if(feature.Length < 4)
|
||||
return null;
|
||||
|
||||
var number = (ushort)((feature[0] << 8) + feature[1]);
|
||||
ushort number = (ushort)((feature[0] << 8) + feature[1]);
|
||||
|
||||
if(number != 0x0113)
|
||||
return null;
|
||||
@@ -3047,7 +3047,7 @@ public static class Features
|
||||
if(feature.Length < 6)
|
||||
return null;
|
||||
|
||||
var number = (ushort)((feature[0] << 8) + feature[1]);
|
||||
ushort number = (ushort)((feature[0] << 8) + feature[1]);
|
||||
|
||||
if(number != 0x0142)
|
||||
return null;
|
||||
@@ -3066,11 +3066,11 @@ public static class Features
|
||||
decoded.ME |= (feature[4] & 0x01) == 0x01;
|
||||
decoded.Profiles = new ushort[feature[5]];
|
||||
|
||||
if(feature[5] * 2 + 6 != feature.Length)
|
||||
if((feature[5] * 2) + 6 != feature.Length)
|
||||
return decoded;
|
||||
|
||||
for(var i = 0; i < feature[5]; i++)
|
||||
decoded.Profiles[i] = (ushort)((feature[0 + 6 + 2 * i] << 8) + feature[1 + 6 + 2 * i]);
|
||||
for(int i = 0; i < feature[5]; i++)
|
||||
decoded.Profiles[i] = (ushort)((feature[0 + 6 + (2 * i)] << 8) + feature[1 + 6 + (2 * i)]);
|
||||
|
||||
return decoded;
|
||||
}
|
||||
@@ -3734,12 +3734,10 @@ public static class Features
|
||||
Feature_0028 ftr = feature.Value;
|
||||
var sb = new StringBuilder();
|
||||
|
||||
if(ftr.Write &&
|
||||
ftr.DVDPRead &&
|
||||
ftr.DVDPWrite)
|
||||
if(ftr.Write &&
|
||||
ftr is { DVDPRead: true, DVDPWrite: true })
|
||||
sb.Append("Drive can read and write CD-MRW and DVD+MRW");
|
||||
else if(ftr.DVDPRead &&
|
||||
ftr.DVDPWrite)
|
||||
else if(ftr is { DVDPRead: true, DVDPWrite: true })
|
||||
sb.Append("Drive can read and write DVD+MRW");
|
||||
else
|
||||
switch(ftr.Write)
|
||||
@@ -3993,8 +3991,7 @@ public static class Features
|
||||
break;
|
||||
}
|
||||
|
||||
if(ftr.RAW &&
|
||||
ftr.RAWMS)
|
||||
if(ftr is { RAW: true, RAWMS: true })
|
||||
sb.AppendLine("\tDrive can write multi-session CDs in raw mode");
|
||||
|
||||
if(ftr.RW)
|
||||
@@ -4024,8 +4021,7 @@ public static class Features
|
||||
Feature_002F ftr = feature.Value;
|
||||
var sb = new StringBuilder();
|
||||
|
||||
if(ftr.DVDRW &&
|
||||
ftr.RDL)
|
||||
if(ftr is { DVDRW: true, RDL: true })
|
||||
sb.AppendLine("Drive supports writing DVD-R, DVD-RW and DVD-R DL");
|
||||
else if(ftr.RDL)
|
||||
sb.AppendLine("Drive supports writing DVD-R and DVD-R DL");
|
||||
@@ -4588,7 +4584,7 @@ public static class Features
|
||||
Feature_010C ftr = feature.Value;
|
||||
var sb = new StringBuilder();
|
||||
|
||||
var temp = new byte[4];
|
||||
byte[] temp = new byte[4];
|
||||
temp[0] = (byte)((ftr.Century & 0xFF00) >> 8);
|
||||
temp[1] = (byte)(ftr.Century & 0xFF);
|
||||
temp[2] = (byte)((ftr.Year & 0xFF00) >> 8);
|
||||
@@ -4747,7 +4743,7 @@ public static class Features
|
||||
if(ftr.Profiles == null)
|
||||
return sb.ToString();
|
||||
|
||||
for(var i = 0; i < ftr.Profiles.Length; i++)
|
||||
for(int i = 0; i < ftr.Profiles.Length; i++)
|
||||
sb.AppendFormat("\tProfile {0}: {1}", i, ftr.Profiles[i]).AppendLine();
|
||||
|
||||
return sb.ToString();
|
||||
@@ -4877,8 +4873,8 @@ public static class Features
|
||||
CurrentProfile = (ushort)((response[6] << 8) + response[7])
|
||||
};
|
||||
|
||||
uint offset = 8;
|
||||
var descLst = new List<FeatureDescriptor>();
|
||||
uint offset = 8;
|
||||
List<FeatureDescriptor> descLst = new();
|
||||
|
||||
while(offset + 4 < response.Length)
|
||||
{
|
||||
|
||||
Reference in New Issue
Block a user