2024-04-28 20:35:18 -04:00
|
|
|
using System.Runtime.InteropServices;
|
|
|
|
|
|
2024-10-24 00:20:46 -04:00
|
|
|
#pragma warning disable CS0618 // Obsolete unmanaged types
|
2024-04-28 20:35:18 -04:00
|
|
|
namespace SabreTools.IO.Test.Extensions
|
|
|
|
|
{
|
|
|
|
|
[StructLayout(LayoutKind.Sequential, CharSet = CharSet.Ansi)]
|
2024-04-28 22:18:44 -04:00
|
|
|
internal struct TestStructStrings
|
2024-04-28 20:35:18 -04:00
|
|
|
{
|
|
|
|
|
/// <summary>
|
|
|
|
|
/// ASCII-encoded, byte-length-prefixed string
|
|
|
|
|
/// </summary>
|
|
|
|
|
[MarshalAs(UnmanagedType.AnsiBStr)]
|
|
|
|
|
public string? AnsiBStr;
|
|
|
|
|
|
|
|
|
|
/// <summary>
|
|
|
|
|
/// Unicode-encoded, WORD-length-prefixed string
|
|
|
|
|
/// </summary>
|
|
|
|
|
[MarshalAs(UnmanagedType.BStr)]
|
|
|
|
|
public string? BStr;
|
|
|
|
|
|
|
|
|
|
/// <summary>
|
|
|
|
|
/// Fixed length string
|
|
|
|
|
/// </summary>
|
|
|
|
|
[MarshalAs(UnmanagedType.ByValTStr, SizeConst = 3)]
|
|
|
|
|
public string? ByValTStr;
|
|
|
|
|
|
|
|
|
|
/// <summary>
|
|
|
|
|
/// ASCII-encoded, null-terminated string
|
|
|
|
|
/// </summary>
|
|
|
|
|
[MarshalAs(UnmanagedType.LPStr)]
|
|
|
|
|
public string? LPStr;
|
|
|
|
|
|
|
|
|
|
/// <summary>
|
|
|
|
|
/// Unicode-encoded, null-terminated string
|
|
|
|
|
/// </summary>
|
|
|
|
|
[MarshalAs(UnmanagedType.LPWStr)]
|
|
|
|
|
public string? LPWStr;
|
|
|
|
|
}
|
|
|
|
|
}
|