Add support for multiple processor groups.

Merge from upstream.
This commit is contained in:
Phyxion
2020-05-11 13:29:52 +02:00
parent a18136b55e
commit 3cc3d9139c
22 changed files with 390 additions and 135 deletions
@@ -209,6 +209,12 @@ namespace LibreHardwareMonitor.Interop
[DllImport(DllName, CallingConvention = CallingConvention.Winapi)]
internal static extern IntPtr GetCurrentThread();
[DllImport(DllName, CallingConvention = CallingConvention.Winapi)]
public static extern ushort GetActiveProcessorGroupCount();
[DllImport(DllName, CallingConvention = CallingConvention.Winapi)]
public static extern bool SetThreadGroupAffinity(IntPtr thread, ref GROUP_AFFINITY groupAffinity, out GROUP_AFFINITY previousGroupAffinity);
[DllImport(DllName, CallingConvention = CallingConvention.Winapi)]
internal static extern IntPtr VirtualAlloc(IntPtr lpAddress, UIntPtr dwSize, MEM flAllocationType, PAGE flProtect);
@@ -245,6 +251,18 @@ namespace LibreHardwareMonitor.Interop
[DllImport(DllName, CallingConvention = CallingConvention.Winapi, SetLastError = true)]
internal static extern int GetSystemFirmwareTable(Provider firmwareTableProviderSignature, int firmwareTableID, IntPtr firmwareTableBuffer, int bufferSize);
[StructLayout(LayoutKind.Sequential, Pack = 4)]
public struct GROUP_AFFINITY
{
public UIntPtr Mask;
[MarshalAs(UnmanagedType.U2)]
public ushort Group;
[MarshalAs(UnmanagedType.ByValArray, SizeConst = 3, ArraySubType = UnmanagedType.U2)]
public ushort[] Reserved;
}
internal enum DFP : uint
{
DFP_GET_VERSION = 0x00074080,