mirror of
https://github.com/jkocon/g-helper.git
synced 2026-02-23 13:00:52 +01:00
31 lines
762 B
C#
31 lines
762 B
C#
using System;
|
|
using System.Runtime.InteropServices;
|
|
|
|
namespace NvAPIWrapper.Native.General.Structures
|
|
{
|
|
[StructLayout(LayoutKind.Sequential)]
|
|
internal struct StructureVersion
|
|
{
|
|
private readonly uint _version;
|
|
|
|
public int VersionNumber
|
|
{
|
|
get => (int) (_version >> 16);
|
|
}
|
|
|
|
public int StructureSize
|
|
{
|
|
get => (int) (_version & ~(0xFFFF << 16));
|
|
}
|
|
|
|
public StructureVersion(int version, Type structureType)
|
|
{
|
|
_version = (uint) (Marshal.SizeOf(structureType) | (version << 16));
|
|
}
|
|
|
|
public override string ToString()
|
|
{
|
|
return $"Structure Size: {StructureSize} Bytes, Version: {VersionNumber}";
|
|
}
|
|
}
|
|
} |