Fix null reference in MemoryGroup when Ring0 is disabled. (#1796)

* Create RAMSPDToolkitDriver with null when Ring0 is absent

* Update MemoryGroup.cs

---------

Co-authored-by: PhyxionNL <7643972+PhyxionNL@users.noreply.github.com>
This commit is contained in:
xnaught
2025-07-21 16:55:20 +02:00
committed by GitHub
co-authored by PhyxionNL
parent 3b1c1cbd12
commit 6267899eb8
@@ -33,10 +33,16 @@ internal class MemoryGroup : IGroup
{
if (Ring0.IsOpen)
{
//Assign implementation of IDriver
// Assign implementation of IDriver.
DriverManager.Driver = new RAMSPDToolkitDriver(Ring0.KernelDriver);
SMBusManager.UseWMI = false;
}
else
{
// Still need to set Driver if Ring0 is absent.
DriverManager.Driver = new RAMSPDToolkitDriver(null);
SMBusManager.UseWMI = false;
}
}
public MemoryGroup(ISettings settings)