Files
SabreTools.Models/PortableExecutable/VarData.cs

59 lines
2.2 KiB
C#
Raw Normal View History

2023-09-04 00:12:49 -04:00
namespace SabreTools.Models.PortableExecutable
2023-09-04 00:11:04 -04:00
{
/// <summary>
/// Represents the organization of data in a file-version resource. It typically contains a
/// list of language and code page identifier pairs that the version of the application or
/// DLL supports.
/// </summary>
/// <see href="https://learn.microsoft.com/en-us/windows/win32/menurc/var-str"/>
public sealed class VarData
{
/// <summary>
/// The length, in bytes, of the Var structure.
/// </summary>
2023-09-10 21:24:10 -04:00
public ushort Length { get; set; }
2023-09-04 00:11:04 -04:00
/// <summary>
/// The size, in words, of the Value member.
/// </summary>
2023-09-10 21:24:10 -04:00
public ushort ValueLength { get; set; }
2023-09-04 00:11:04 -04:00
/// <summary>
/// The type of data in the version resource.
/// </summary>
2023-09-10 21:24:10 -04:00
public VersionResourceType ResourceType { get; set; }
2023-09-04 00:11:04 -04:00
/// <summary>
/// The Unicode string L"Translation".
/// </summary>
2023-09-04 21:14:41 -04:00
#if NET48
2023-09-10 21:24:10 -04:00
public string Key { get; set; }
2023-09-04 21:14:41 -04:00
#else
2023-09-10 21:24:10 -04:00
public string? Key { get; set; }
2023-09-04 21:14:41 -04:00
#endif
2023-09-04 00:11:04 -04:00
/// <summary>
/// As many zero words as necessary to align the Value member on a 32-bit boundary.
/// </summary>
2023-09-10 21:24:10 -04:00
public ushort Padding { get; set; }
2023-09-04 00:11:04 -04:00
/// <summary>
/// An array of one or more values that are language and code page identifier pairs.
///
/// If you use the Var structure to list the languages your application or DLL supports
/// instead of using multiple version resources, use the Value member to contain an array
/// of DWORD values indicating the language and code page combinations supported by this
/// file. The low-order word of each DWORD must contain a Microsoft language identifier,
/// and the high-order word must contain the IBM code page number. Either high-order or
/// low-order word can be zero, indicating that the file is language or code page
/// independent. If the Var structure is omitted, the file will be interpreted as both
/// language and code page independent.
/// </summary>
2023-09-04 21:14:41 -04:00
#if NET48
2023-09-10 21:24:10 -04:00
public uint[] Value { get; set; }
2023-09-04 21:14:41 -04:00
#else
2023-09-10 21:24:10 -04:00
public uint[]? Value { get; set; }
2023-09-04 21:14:41 -04:00
#endif
2023-09-04 00:11:04 -04:00
}
}