Files
ThreadPilot/Platforms/Windows/ProcessMemoryPriorityNativeMethods.cs
T
2026-06-24 17:52:45 +02:00

34 lines
1.3 KiB
C#

/*
* ThreadPilot - Windows process memory priority P/Invoke declarations.
*/
namespace ThreadPilot.Platforms.Windows
{
using System.Runtime.InteropServices;
using Microsoft.Win32.SafeHandles;
internal static partial class ProcessMemoryPriorityNativeMethods
{
[LibraryImport("kernel32.dll", SetLastError = true)]
public static partial SafeProcessHandle OpenProcess(
ProcessAccessFlags access,
[MarshalAs(UnmanagedType.Bool)] bool inheritHandle,
uint processId);
[LibraryImport("kernel32.dll", SetLastError = true)]
[return: MarshalAs(UnmanagedType.Bool)]
public static partial bool GetProcessInformation(
SafeProcessHandle process,
ProcessInformationClass processInformationClass,
ref MemoryPriorityInformation processInformation,
uint processInformationSize);
[LibraryImport("kernel32.dll", SetLastError = true)]
[return: MarshalAs(UnmanagedType.Bool)]
public static partial bool SetProcessInformation(
SafeProcessHandle process,
ProcessInformationClass processInformationClass,
ref MemoryPriorityInformation processInformation,
uint processInformationSize);
}
}