Move to file scoped namespaces.

This commit is contained in:
2022-03-06 13:29:38 +00:00
parent b6c3a54955
commit 0bc819feab
1322 changed files with 268651 additions and 270003 deletions

View File

@@ -33,135 +33,134 @@
using System;
using System.Runtime.InteropServices;
namespace Aaru.DiscImages
namespace Aaru.DiscImages;
public sealed partial class Vhdx
{
public sealed partial class Vhdx
[StructLayout(LayoutKind.Sequential, Pack = 1)]
readonly struct Identifier
{
[StructLayout(LayoutKind.Sequential, Pack = 1)]
readonly struct Identifier
{
/// <summary>Signature, <see cref="Vhdx.VHDX_SIGNATURE" /></summary>
public readonly ulong signature;
/// <summary>UTF-16 string containing creator</summary>
[MarshalAs(UnmanagedType.ByValArray, SizeConst = 512)]
public readonly byte[] creator;
}
/// <summary>Signature, <see cref="Vhdx.VHDX_SIGNATURE" /></summary>
public readonly ulong signature;
/// <summary>UTF-16 string containing creator</summary>
[MarshalAs(UnmanagedType.ByValArray, SizeConst = 512)]
public readonly byte[] creator;
}
#pragma warning disable 649
#pragma warning disable 169
struct Header
{
/// <summary>Signature, <see cref="Vhdx.VHDX_HEADER_SIG" /></summary>
public uint Signature;
/// <summary>CRC-32C of whole 4096 bytes header with this field set to 0</summary>
public uint Checksum;
/// <summary>Sequence number</summary>
public ulong Sequence;
/// <summary>Unique identifier for file contents, must be changed on first write to metadata</summary>
public Guid FileWriteGuid;
/// <summary>Unique identifier for disk contents, must be changed on first write to metadata or data</summary>
public Guid DataWriteGuid;
/// <summary>Unique identifier for log entries</summary>
public Guid LogGuid;
/// <summary>Version of log format</summary>
public ushort LogVersion;
/// <summary>Version of VHDX format</summary>
public ushort Version;
/// <summary>Length in bytes of the log</summary>
public uint LogLength;
/// <summary>Offset from image start to the log</summary>
public ulong LogOffset;
[MarshalAs(UnmanagedType.ByValArray, SizeConst = 4016)]
public byte[] Reserved;
}
#pragma warning restore 649
#pragma warning restore 169
#pragma warning disable 649
#pragma warning disable 169
struct Header
{
/// <summary>Signature, <see cref="Vhdx.VHDX_HEADER_SIG" /></summary>
public uint Signature;
/// <summary>CRC-32C of whole 4096 bytes header with this field set to 0</summary>
public uint Checksum;
/// <summary>Sequence number</summary>
public ulong Sequence;
/// <summary>Unique identifier for file contents, must be changed on first write to metadata</summary>
public Guid FileWriteGuid;
/// <summary>Unique identifier for disk contents, must be changed on first write to metadata or data</summary>
public Guid DataWriteGuid;
/// <summary>Unique identifier for log entries</summary>
public Guid LogGuid;
/// <summary>Version of log format</summary>
public ushort LogVersion;
/// <summary>Version of VHDX format</summary>
public ushort Version;
/// <summary>Length in bytes of the log</summary>
public uint LogLength;
/// <summary>Offset from image start to the log</summary>
public ulong LogOffset;
[MarshalAs(UnmanagedType.ByValArray, SizeConst = 4016)]
public byte[] Reserved;
}
#pragma warning restore 649
#pragma warning restore 169
[StructLayout(LayoutKind.Sequential, Pack = 1)]
readonly struct RegionTableHeader
{
/// <summary>Signature, <see cref="Vhdx.VHDX_REGION_SIG" /></summary>
public readonly uint signature;
/// <summary>CRC-32C of whole 64Kb table with this field set to 0</summary>
public readonly uint checksum;
/// <summary>How many entries follow this table</summary>
public readonly uint entries;
/// <summary>Reserved</summary>
public readonly uint reserved;
}
[StructLayout(LayoutKind.Sequential, Pack = 1)]
readonly struct RegionTableHeader
{
/// <summary>Signature, <see cref="Vhdx.VHDX_REGION_SIG" /></summary>
public readonly uint signature;
/// <summary>CRC-32C of whole 64Kb table with this field set to 0</summary>
public readonly uint checksum;
/// <summary>How many entries follow this table</summary>
public readonly uint entries;
/// <summary>Reserved</summary>
public readonly uint reserved;
}
[StructLayout(LayoutKind.Sequential, Pack = 1)]
readonly struct RegionTableEntry
{
/// <summary>Object identifier</summary>
public readonly Guid guid;
/// <summary>Offset in image of the object</summary>
public readonly ulong offset;
/// <summary>Length in bytes of the object</summary>
public readonly uint length;
/// <summary>Flags</summary>
public readonly uint flags;
}
[StructLayout(LayoutKind.Sequential, Pack = 1)]
readonly struct RegionTableEntry
{
/// <summary>Object identifier</summary>
public readonly Guid guid;
/// <summary>Offset in image of the object</summary>
public readonly ulong offset;
/// <summary>Length in bytes of the object</summary>
public readonly uint length;
/// <summary>Flags</summary>
public readonly uint flags;
}
[StructLayout(LayoutKind.Sequential, Pack = 1)]
readonly struct MetadataTableHeader
{
/// <summary>Signature</summary>
public readonly ulong signature;
/// <summary>Reserved</summary>
public readonly ushort reserved;
/// <summary>How many entries are in the table</summary>
public readonly ushort entries;
/// <summary>Reserved</summary>
[MarshalAs(UnmanagedType.ByValArray, SizeConst = 5)]
public readonly uint[] reserved2;
}
[StructLayout(LayoutKind.Sequential, Pack = 1)]
readonly struct MetadataTableHeader
{
/// <summary>Signature</summary>
public readonly ulong signature;
/// <summary>Reserved</summary>
public readonly ushort reserved;
/// <summary>How many entries are in the table</summary>
public readonly ushort entries;
/// <summary>Reserved</summary>
[MarshalAs(UnmanagedType.ByValArray, SizeConst = 5)]
public readonly uint[] reserved2;
}
[StructLayout(LayoutKind.Sequential, Pack = 1)]
readonly struct MetadataTableEntry
{
/// <summary>Metadata ID</summary>
public readonly Guid itemId;
/// <summary>Offset relative to start of metadata region</summary>
public readonly uint offset;
/// <summary>Length in bytes</summary>
public readonly uint length;
/// <summary>Flags</summary>
public readonly uint flags;
/// <summary>Reserved</summary>
public readonly uint reserved;
}
[StructLayout(LayoutKind.Sequential, Pack = 1)]
readonly struct MetadataTableEntry
{
/// <summary>Metadata ID</summary>
public readonly Guid itemId;
/// <summary>Offset relative to start of metadata region</summary>
public readonly uint offset;
/// <summary>Length in bytes</summary>
public readonly uint length;
/// <summary>Flags</summary>
public readonly uint flags;
/// <summary>Reserved</summary>
public readonly uint reserved;
}
[StructLayout(LayoutKind.Sequential, Pack = 1)]
struct FileParameters
{
/// <summary>Block size in bytes</summary>
public uint blockSize;
/// <summary>Flags</summary>
public uint flags;
}
[StructLayout(LayoutKind.Sequential, Pack = 1)]
struct FileParameters
{
/// <summary>Block size in bytes</summary>
public uint blockSize;
/// <summary>Flags</summary>
public uint flags;
}
[StructLayout(LayoutKind.Sequential, Pack = 1)]
readonly struct ParentLocatorHeader
{
/// <summary>Type of parent virtual disk</summary>
public readonly Guid locatorType;
public readonly ushort reserved;
/// <summary>How many KVPs are in this parent locator</summary>
public readonly ushort keyValueCount;
}
[StructLayout(LayoutKind.Sequential, Pack = 1)]
readonly struct ParentLocatorHeader
{
/// <summary>Type of parent virtual disk</summary>
public readonly Guid locatorType;
public readonly ushort reserved;
/// <summary>How many KVPs are in this parent locator</summary>
public readonly ushort keyValueCount;
}
[StructLayout(LayoutKind.Sequential, Pack = 1)]
readonly struct ParentLocatorEntry
{
/// <summary>Offset from metadata to key</summary>
public readonly uint keyOffset;
/// <summary>Offset from metadata to value</summary>
public readonly uint valueOffset;
/// <summary>Size of key</summary>
public readonly ushort keyLength;
/// <summary>Size of value</summary>
public readonly ushort valueLength;
}
[StructLayout(LayoutKind.Sequential, Pack = 1)]
readonly struct ParentLocatorEntry
{
/// <summary>Offset from metadata to key</summary>
public readonly uint keyOffset;
/// <summary>Offset from metadata to value</summary>
public readonly uint valueOffset;
/// <summary>Size of key</summary>
public readonly ushort keyLength;
/// <summary>Size of value</summary>
public readonly ushort valueLength;
}
}