MemoryGroup: Remove retry + proper identifier (#1797)

* Remove retry + proper identifier

* Update LibreHardwareMonitorLib.csproj

* Revert "Update LibreHardwareMonitorLib.csproj"

This reverts commit 185aa2dbd3d338da79aff8bfa9419f016d107e77.

* Add safer retry logic for MemoryGroup

* Move kernel driver assignation in instance ctor instead of static (one time) ctor, since Ring0 can get closed and reopened multiple times in the lifetime of an application.
* Add Task based retry logic with try catch + exception reporting + hardware changed event

* Update MemoryGroup.cs

* Update RAMSPDToolkitDriver.cs

* Update RAMSPDToolkitDriver.cs

* Mutate _hardware field to avoid enumeration exceptions

* Add Report + set configureAwait on the Delay.
This commit is contained in:
Rémi Mercier
2025-07-21 21:28:46 +02:00
committed by GitHub
parent 8dc7d17e45
commit 06b714ae1b
2 changed files with 149 additions and 81 deletions
@@ -18,11 +18,11 @@ namespace LibreHardwareMonitor.Hardware
{
private KernelDriver _kernelDriver;
private const byte PCI_MAX_NUMBER_OF_BUS = 255;
private const byte PCI_NUMBER_OF_DEVICE = 32;
private const byte PCI_NUMBER_OF_FUNCTION = 8;
private const byte PCI_MAX_NUMBER_OF_BUS = 255;
private const byte PCI_NUMBER_OF_DEVICE = 32;
private const byte PCI_NUMBER_OF_FUNCTION = 8;
public bool IsOpen => _kernelDriver != null;
public bool IsOpen => _kernelDriver?.IsOpen ?? false;
public RAMSPDToolkitDriver(KernelDriver kernelDriver)
{