* Add DIMM Temperature to LHM. * Remove RAMSPDToolkit as submodule and use nuget package instead. Upgrade System.Management assembly (required for nuget package). Implement retry mechanism for RAM detection due to possible issue at system boot. * Change to static field. * Driver now back in LHM. Ring0 replaced with OLS implementation. * Update package version. * Undo most of changes. Implement IDriver interface. * Change package to new one. * Review changes. Explicitly set UseWMI (current default is also false). * PR comments: Now having one DimmMemory instance per RAM stick. Separated memory sensors into two new classes. * PR feedback --------- Co-authored-by: PhyxionNL <7643972+PhyxionNL@users.noreply.github.com>
36 lines
2.2 KiB
C#
36 lines
2.2 KiB
C#
// This Source Code Form is subject to the terms of the Mozilla Public License, v. 2.0.
|
|
// If a copy of the MPL was not distributed with this file, You can obtain one at http://mozilla.org/MPL/2.0/.
|
|
// Copyright (C) LibreHardwareMonitor and Contributors.
|
|
// All Rights Reserved.
|
|
|
|
// ReSharper disable InconsistentNaming
|
|
// ReSharper disable IdentifierTypo
|
|
|
|
namespace LibreHardwareMonitor.Interop;
|
|
|
|
/// <summary>
|
|
/// Driver with access at kernel level.
|
|
/// </summary>
|
|
internal static class Ring0
|
|
{
|
|
public const uint INVALID_PCI_ADDRESS = 0xFFFFFFFF;
|
|
|
|
private const uint OLS_TYPE = 40000;
|
|
|
|
public static readonly Kernel32.IOControlCode IOCTL_OLS_GET_REFCOUNT = new(OLS_TYPE, 0x801, Kernel32.IOControlCode.Access.Any);
|
|
public static readonly Kernel32.IOControlCode IOCTL_OLS_READ_MSR = new(OLS_TYPE, 0x821, Kernel32.IOControlCode.Access.Any);
|
|
public static readonly Kernel32.IOControlCode IOCTL_OLS_WRITE_MSR = new(OLS_TYPE, 0x822, Kernel32.IOControlCode.Access.Any);
|
|
public static readonly Kernel32.IOControlCode IOCTL_OLS_READ_MEMORY = new(OLS_TYPE, 0x841, Kernel32.IOControlCode.Access.Read);
|
|
|
|
public static readonly Kernel32.IOControlCode IOCTL_OLS_READ_IO_PORT_BYTE = new(OLS_TYPE, 0x833, Kernel32.IOControlCode.Access.Read);
|
|
public static readonly Kernel32.IOControlCode IOCTL_OLS_READ_IO_PORT_WORD = new(OLS_TYPE, 0x834, Kernel32.IOControlCode.Access.Read);
|
|
public static readonly Kernel32.IOControlCode IOCTL_OLS_READ_IO_PORT_DWORD = new(OLS_TYPE, 0x835, Kernel32.IOControlCode.Access.Read);
|
|
|
|
public static readonly Kernel32.IOControlCode IOCTL_OLS_WRITE_IO_PORT_BYTE = new(OLS_TYPE, 0x836, Kernel32.IOControlCode.Access.Write);
|
|
public static readonly Kernel32.IOControlCode IOCTL_OLS_WRITE_IO_PORT_WORD = new(OLS_TYPE, 0x837, Kernel32.IOControlCode.Access.Write);
|
|
public static readonly Kernel32.IOControlCode IOCTL_OLS_WRITE_IO_PORT_DWORD = new(OLS_TYPE, 0x838, Kernel32.IOControlCode.Access.Write);
|
|
|
|
public static readonly Kernel32.IOControlCode IOCTL_OLS_READ_PCI_CONFIG = new(OLS_TYPE, 0x851, Kernel32.IOControlCode.Access.Read);
|
|
public static readonly Kernel32.IOControlCode IOCTL_OLS_WRITE_PCI_CONFIG = new(OLS_TYPE, 0x852, Kernel32.IOControlCode.Access.Write);
|
|
}
|