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:
@@ -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();
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user