using System.Runtime.InteropServices; namespace SabreTools.IO.Test.Extensions { [StructLayout(LayoutKind.Sequential, CharSet = CharSet.Ansi)] internal struct TestStructArrays { /// /// 4 entry byte array /// [MarshalAs(UnmanagedType.ByValArray, SizeConst = 4)] public byte[]? ByteArray; /// /// 4 entry int array /// [MarshalAs(UnmanagedType.ByValArray, SizeConst = 4)] public int[]? IntArray; /// /// 4 entry int array /// [MarshalAs(UnmanagedType.ByValArray, SizeConst = 4)] public TestEnum[]? EnumArray; /// /// 4 entry struct array /// [MarshalAs(UnmanagedType.ByValArray, SizeConst = 4)] public TestStructPoint[]? StructArray; /// /// Length of /// public ushort LPByteArrayLength; /// /// 4 entry byte array whose length is defined by /// [MarshalAs(UnmanagedType.LPArray, SizeParamIndex = 4)] public byte[]? LPByteArray; // /// // /// 4 entry nested byte array // /// // /// This will likely fail // [MarshalAs(UnmanagedType.ByValArray, SizeConst = 4)] // public byte[][]? NestedByteArray; } /// /// Struct for nested tests /// internal struct TestStructPoint { public ushort X; public ushort Y; } }