Add option to disable Ring0 driver installation (#1777)

* Add option to disable Ring0 driver installation

* Update Computer.cs

---------

Co-authored-by: PhyxionNL <7643972+PhyxionNL@users.noreply.github.com>
This commit is contained in:
coldays
2025-07-09 23:24:57 +02:00
committed by GitHub
co-authored by PhyxionNL
parent f8b198a7d4
commit e94018d7d5
2 changed files with 22 additions and 2 deletions
+14 -1
View File
@@ -46,6 +46,7 @@ public class Computer : IComputer
private bool _psuEnabled;
private SMBios _smbios;
private bool _storageEnabled;
private bool _ring0Enabled = true;
/// <summary>
/// Creates a new <see cref="IComputer" /> instance with basic initial <see cref="Settings" />.
@@ -279,6 +280,16 @@ public class Computer : IComputer
}
}
/// <inheritdoc />
public bool IsRing0Enabled
{
get { return _ring0Enabled; }
set
{
_ring0Enabled = value;
}
}
/// <summary>
/// Contains computer information table read in accordance with <see href="https://www.dmtf.org/standards/smbios">System Management BIOS (SMBIOS) Reference Specification</see>.
/// </summary>
@@ -489,7 +500,9 @@ public class Computer : IComputer
_smbios = new SMBios();
Ring0.Open();
if (IsRing0Enabled)
Ring0.Open();
Mutexes.Open();
OpCode.Open();
@@ -108,9 +108,16 @@ public interface IComputer : IElement
/// <returns><see langword="true" /> if a given category of devices is already enabled.</returns>
bool IsStorageEnabled { get; }
/// <summary>
/// Gets or sets a value indicating whether the Ring0 driver should be installed if user privileges is sufficient.
/// </summary>
/// <returns><see langword="true" /> if Ring0 driver installation is enabled</returns>
/// <remarks>Default value is <see langword="true" />. Only affects Windows.</remarks>
bool IsRing0Enabled { get; }
/// <summary>
/// Generates full LibreHardwareMonitor report for devices that have been enabled.
/// </summary>
/// <returns>A formatted text string with library, OS and hardware information.</returns>
string GetReport();
}
}