mirror of
https://github.com/jkocon/g-helper.git
synced 2026-02-23 13:00:52 +01:00
25 lines
965 B
C#
25 lines
965 B
C#
using System.Runtime.InteropServices;
|
|
using WindowsDisplayAPI.Native.Structures;
|
|
|
|
namespace WindowsDisplayAPI.Native.DisplayConfig.Structures
|
|
{
|
|
// https://msdn.microsoft.com/en-us/library/vs/alm/ff553981(v=vs.85).aspx
|
|
[StructLayout(LayoutKind.Sequential)]
|
|
internal struct DisplayConfigSetTargetPersistence
|
|
{
|
|
// ReSharper disable once PrivateFieldCanBeConvertedToLocalVariable
|
|
[MarshalAs(UnmanagedType.Struct)] private readonly DisplayConfigDeviceInfoHeader _Header;
|
|
[MarshalAs(UnmanagedType.U4)] private readonly uint _BootPersistenceOn;
|
|
|
|
public bool BootPersistence
|
|
{
|
|
get => _BootPersistenceOn > 0;
|
|
}
|
|
|
|
public DisplayConfigSetTargetPersistence(LUID adapter, uint targetId, bool bootPersistence) : this()
|
|
{
|
|
_Header = new DisplayConfigDeviceInfoHeader(adapter, targetId, GetType());
|
|
_BootPersistenceOn = bootPersistence ? 1u : 0u;
|
|
}
|
|
}
|
|
} |