[ISO9660] Use new source generator based big endian marshaller

This commit is contained in:
2025-10-21 02:00:44 +01:00
parent 18679890c2
commit 7c1253a088
11 changed files with 395 additions and 366 deletions

View File

@@ -33,6 +33,7 @@
using System;
using System.Runtime.InteropServices;
using Aaru.CommonTypes.Attributes;
using Aaru.Helpers;
namespace Aaru.Filesystems;
@@ -89,21 +90,22 @@ public sealed partial class ISO9660
#region Nested type: CdiDirectoryRecord
[StructLayout(LayoutKind.Sequential, Pack = 1)]
readonly struct CdiDirectoryRecord
[SwapEndian]
partial struct CdiDirectoryRecord
{
public readonly byte length;
public readonly byte xattr_len;
public readonly uint reserved1;
public readonly uint start_lbn;
public readonly uint reserved2;
public readonly uint size;
public readonly HighSierraTimestamp date;
public readonly byte reserved3;
public readonly CdiFileFlags flags;
public readonly ushort file_unit_size;
public readonly ushort reserved4;
public readonly ushort volume_sequence_number;
public readonly byte name_len;
public byte length;
public byte xattr_len;
public uint reserved1;
public uint start_lbn;
public uint reserved2;
public uint size;
public HighSierraTimestamp date;
public byte reserved3;
public CdiFileFlags flags;
public ushort file_unit_size;
public ushort reserved4;
public ushort volume_sequence_number;
public byte name_len;
// Followed by name[name_len] and then CdiSystemArea until length arrives
}
@@ -114,14 +116,15 @@ public sealed partial class ISO9660
// Follows filename on directory record
[StructLayout(LayoutKind.Sequential, Pack = 1)]
readonly struct CdiSystemArea
[SwapEndian]
partial struct CdiSystemArea
{
public readonly ushort group;
public readonly ushort owner;
public readonly CdiAttributes attributes;
public readonly ushort reserved1;
public readonly byte file_no;
public readonly byte reserved2;
public ushort group;
public ushort owner;
public CdiAttributes attributes;
public ushort reserved1;
public byte file_no;
public byte reserved2;
}
#endregion
@@ -129,74 +132,75 @@ public sealed partial class ISO9660
#region Nested type: FileStructureVolumeDescriptor
[StructLayout(LayoutKind.Sequential, Pack = 1)]
readonly struct FileStructureVolumeDescriptor
[SwapEndian]
partial struct FileStructureVolumeDescriptor
{
public readonly byte type;
public byte type;
[MarshalAs(UnmanagedType.ByValArray, SizeConst = 5)]
public readonly byte[] id;
public readonly byte version;
public readonly CdiVolumeFlags flags;
public byte[] id;
public byte version;
public CdiVolumeFlags flags;
[MarshalAs(UnmanagedType.ByValArray, SizeConst = 32)]
public readonly byte[] system_id;
public byte[] system_id;
[MarshalAs(UnmanagedType.ByValArray, SizeConst = 32)]
public readonly byte[] volume_id;
public byte[] volume_id;
[MarshalAs(UnmanagedType.ByValArray, SizeConst = 12)]
public readonly byte[] reserved1;
public readonly uint volume_space_size;
public byte[] reserved1;
public uint volume_space_size;
// Only used in SVDs
[MarshalAs(UnmanagedType.ByValArray, SizeConst = 32)]
public readonly byte[] escape_sequences;
public readonly ushort reserved2;
public readonly ushort volume_set_size;
public readonly ushort reserved3;
public readonly ushort volume_sequence_number;
public readonly ushort reserved4;
public readonly ushort logical_block_size;
public readonly uint reserved5;
public readonly uint path_table_size;
public readonly ulong reserved6;
public readonly uint path_table_addr;
public byte[] escape_sequences;
public ushort reserved2;
public ushort volume_set_size;
public ushort reserved3;
public ushort volume_sequence_number;
public ushort reserved4;
public ushort logical_block_size;
public uint reserved5;
public uint path_table_size;
public ulong reserved6;
public uint path_table_addr;
[MarshalAs(UnmanagedType.ByValArray, SizeConst = 38)]
public readonly byte[] reserved7;
public byte[] reserved7;
[MarshalAs(UnmanagedType.ByValArray, SizeConst = 128)]
public readonly byte[] volume_set_id;
public byte[] volume_set_id;
[MarshalAs(UnmanagedType.ByValArray, SizeConst = 128)]
public readonly byte[] publisher_id;
public byte[] publisher_id;
[MarshalAs(UnmanagedType.ByValArray, SizeConst = 128)]
public readonly byte[] preparer_id;
public byte[] preparer_id;
[MarshalAs(UnmanagedType.ByValArray, SizeConst = 128)]
public readonly byte[] application_id;
public byte[] application_id;
[MarshalAs(UnmanagedType.ByValArray, SizeConst = 32)]
public readonly byte[] copyright_file_id;
public byte[] copyright_file_id;
[MarshalAs(UnmanagedType.ByValArray, SizeConst = 5)]
public readonly byte[] reserved8;
public byte[] reserved8;
[MarshalAs(UnmanagedType.ByValArray, SizeConst = 32)]
public readonly byte[] abstract_file_id;
public byte[] abstract_file_id;
[MarshalAs(UnmanagedType.ByValArray, SizeConst = 5)]
public readonly byte[] reserved9;
public byte[] reserved9;
[MarshalAs(UnmanagedType.ByValArray, SizeConst = 32)]
public readonly byte[] bibliographic_file_id;
public byte[] bibliographic_file_id;
[MarshalAs(UnmanagedType.ByValArray, SizeConst = 5)]
public readonly byte[] reserved10;
public byte[] reserved10;
[MarshalAs(UnmanagedType.ByValArray, SizeConst = 16)]
public readonly byte[] creation_date;
public readonly byte reserved11;
public byte[] creation_date;
public byte reserved11;
[MarshalAs(UnmanagedType.ByValArray, SizeConst = 16)]
public readonly byte[] modification_date;
public readonly byte reserved12;
public byte[] modification_date;
public byte reserved12;
[MarshalAs(UnmanagedType.ByValArray, SizeConst = 16)]
public readonly byte[] expiration_date;
public readonly byte reserved13;
public byte[] expiration_date;
public byte reserved13;
[MarshalAs(UnmanagedType.ByValArray, SizeConst = 16)]
public readonly byte[] effective_date;
public readonly byte reserved14;
public readonly byte file_structure_version;
public readonly byte reserved15;
public byte[] effective_date;
public byte reserved14;
public byte file_structure_version;
public byte reserved15;
[MarshalAs(UnmanagedType.ByValArray, SizeConst = 512)]
public readonly byte[] application_data;
public byte[] application_data;
[MarshalAs(UnmanagedType.ByValArray, SizeConst = 653)]
public readonly byte[] reserved16;
public byte[] reserved16;
}
#endregion