Remove LayoutKind.Sequential

This may be replaced in the future when byte-serialzable types are more well-defined
This commit is contained in:
Matt Nadareski
2023-09-10 21:33:22 -04:00
parent 670b8428c2
commit 41a90278d5
71 changed files with 74 additions and 290 deletions

View File

@@ -1,5 +1,3 @@
using System.Runtime.InteropServices;
namespace SabreTools.Models.NewExecutable
{
/// <summary>
@@ -8,7 +6,6 @@ namespace SabreTools.Models.NewExecutable
/// </summary>
/// <see href="http://bytepointer.com/resources/win16_ne_exe_format_win3.0.htm"/>
/// <see href="https://github.com/libyal/libexe/blob/main/documentation/Executable%20(EXE)%20file%20format.asciidoc#24-ne-extended-header"/>
[StructLayout(LayoutKind.Sequential)]
public sealed class ExecutableHeader
{
/// <summary>
@@ -16,7 +13,6 @@ namespace SabreTools.Models.NewExecutable
/// "N" is low-order byte.
/// "E" is high-order byte.
/// </summary>
[MarshalAs(UnmanagedType.ByValArray, SizeConst = 2)]
#if NET48
public string Magic;
#else

View File

@@ -1,9 +1,6 @@
using System.Runtime.InteropServices;
namespace SabreTools.Models.NewExecutable
namespace SabreTools.Models.NewExecutable
{
/// <see href="http://bytepointer.com/resources/win16_ne_exe_format_win3.0.htm"/>
[StructLayout(LayoutKind.Sequential)]
public sealed class ImportNameRelocationRecord
{
/// <summary>

View File

@@ -1,9 +1,6 @@
using System.Runtime.InteropServices;
namespace SabreTools.Models.NewExecutable
namespace SabreTools.Models.NewExecutable
{
/// <see href="http://bytepointer.com/resources/win16_ne_exe_format_win3.0.htm"/>
[StructLayout(LayoutKind.Sequential)]
public sealed class ImportOrdinalRelocationRecord
{
/// <summary>

View File

@@ -1,6 +1,4 @@
using System.Runtime.InteropServices;
namespace SabreTools.Models.NewExecutable
namespace SabreTools.Models.NewExecutable
{
/// <summary>
/// The imported-name table follows the module-reference table. This table
@@ -11,7 +9,6 @@ namespace SabreTools.Models.NewExecutable
/// sensitive.
/// </summary>
/// <see href="http://bytepointer.com/resources/win16_ne_exe_format_win3.0.htm"/>
[StructLayout(LayoutKind.Sequential)]
public sealed class ImportedNameTableEntry
{
/// <summary>

View File

@@ -1,9 +1,6 @@
using System.Runtime.InteropServices;
namespace SabreTools.Models.NewExecutable
namespace SabreTools.Models.NewExecutable
{
/// <see href="http://bytepointer.com/resources/win16_ne_exe_format_win3.0.htm"/>
[StructLayout(LayoutKind.Sequential)]
public sealed class InternalRefRelocationRecord
{
/// <summary>

View File

@@ -1,6 +1,4 @@
using System.Runtime.InteropServices;
namespace SabreTools.Models.NewExecutable
namespace SabreTools.Models.NewExecutable
{
/// <summary>
/// The module-reference table follows the resident-name table. Each entry
@@ -8,7 +6,6 @@ namespace SabreTools.Models.NewExecutable
/// names table; each entry is 2 bytes long.
/// </summary>
/// <see href="http://bytepointer.com/resources/win16_ne_exe_format_win3.0.htm"/>
[StructLayout(LayoutKind.Sequential)]
public sealed class ModuleReferenceTableEntry
{
/// <summary>

View File

@@ -1,6 +1,4 @@
using System.Runtime.InteropServices;
namespace SabreTools.Models.NewExecutable
namespace SabreTools.Models.NewExecutable
{
/// <summary>
/// The nonresident-name table follows the entry table, and contains a
@@ -11,7 +9,6 @@ namespace SabreTools.Models.NewExecutable
/// table.
/// </summary>
/// <see href="http://bytepointer.com/resources/win16_ne_exe_format_win3.0.htm"/>
[StructLayout(LayoutKind.Sequential)]
public sealed class NonResidentNameTableEntry
{
/// <summary>

View File

@@ -1,9 +1,6 @@
using System.Runtime.InteropServices;
namespace SabreTools.Models.NewExecutable
namespace SabreTools.Models.NewExecutable
{
/// <see href="http://bytepointer.com/resources/win16_ne_exe_format_win3.0.htm"/>
[StructLayout(LayoutKind.Sequential)]
public sealed class OSFixupRelocationRecord
{
/// <summary>

View File

@@ -1,13 +1,10 @@
using System.Runtime.InteropServices;
namespace SabreTools.Models.NewExecutable
namespace SabreTools.Models.NewExecutable
{
/// <summary>
/// A table of relocation records follows. The following is the format
/// of each relocation record.
/// </summary>
/// <see href="http://bytepointer.com/resources/win16_ne_exe_format_win3.0.htm"/>
[StructLayout(LayoutKind.Sequential)]
public sealed class RelocationRecord
{
/// <summary>

View File

@@ -1,6 +1,4 @@
using System.Runtime.InteropServices;
namespace SabreTools.Models.NewExecutable
namespace SabreTools.Models.NewExecutable
{
/// <summary>
/// The resident-name table follows the resource table, and contains this
@@ -10,7 +8,6 @@ namespace SabreTools.Models.NewExecutable
/// describes the format of the name strings:
/// </summary>
/// <see href="http://bytepointer.com/resources/win16_ne_exe_format_win3.0.htm"/>
[StructLayout(LayoutKind.Sequential)]
public sealed class ResidentNameTableEntry
{
/// <summary>

View File

@@ -1,5 +1,4 @@
using System.Collections.Generic;
using System.Runtime.InteropServices;
namespace SabreTools.Models.NewExecutable
{
@@ -14,7 +13,6 @@ namespace SabreTools.Models.NewExecutable
/// following describes the contents of each of these structures:
/// </summary>
/// <see href="http://bytepointer.com/resources/win16_ne_exe_format_win3.0.htm"/>
[StructLayout(LayoutKind.Sequential)]
public sealed class ResourceTable
{
/// <summary>

View File

@@ -1,6 +1,4 @@
using System.Runtime.InteropServices;
namespace SabreTools.Models.NewExecutable
namespace SabreTools.Models.NewExecutable
{
/// <summary>
/// Resource type and name strings are stored at the end of the
@@ -8,7 +6,6 @@ namespace SabreTools.Models.NewExecutable
/// are case sensitive.
/// </summary>
/// <see href="http://bytepointer.com/resources/win16_ne_exe_format_win3.0.htm"/>
[StructLayout(LayoutKind.Sequential)]
public sealed class ResourceTypeAndNameString
{
/// <summary>

View File

@@ -1,13 +1,10 @@
using System.Runtime.InteropServices;
namespace SabreTools.Models.NewExecutable
namespace SabreTools.Models.NewExecutable
{
/// <summary>
/// A table of resource type information blocks follows. The following
/// is the format of each type information block:
/// </summary>
/// <see href="http://bytepointer.com/resources/win16_ne_exe_format_win3.0.htm"/>
[StructLayout(LayoutKind.Sequential)]
public sealed class ResourceTypeInformationEntry
{
/// <summary>

View File

@@ -1,13 +1,10 @@
using System.Runtime.InteropServices;
namespace SabreTools.Models.NewExecutable
namespace SabreTools.Models.NewExecutable
{
/// <summary>
/// A table of resources for this type follows. The following is
/// the format of each resource (8 bytes each):
/// </summary>
/// <see href="http://bytepointer.com/resources/win16_ne_exe_format_win3.0.htm"/>
[StructLayout(LayoutKind.Sequential)]
public sealed class ResourceTypeResourceEntry
{
/// <summary>

View File

@@ -1,6 +1,4 @@
using System.Runtime.InteropServices;
namespace SabreTools.Models.NewExecutable
namespace SabreTools.Models.NewExecutable
{
/// <summary>
/// The segment table contains an entry for each segment in the executable
@@ -9,7 +7,6 @@ namespace SabreTools.Models.NewExecutable
/// The following is the structure of a segment table entry.
/// </summary>
/// <see href="http://bytepointer.com/resources/win16_ne_exe_format_win3.0.htm"/>
[StructLayout(LayoutKind.Sequential)]
public sealed class SegmentTableEntry
{
/// <summary>