Add Ryzen SMU support (#428)

Thanks to @kolos.
This commit is contained in:
kolos
2021-06-11 09:36:17 +02:00
committed by GitHub
parent 0b5aaa07a9
commit 3df898af24
11 changed files with 930 additions and 42 deletions
@@ -137,6 +137,26 @@ namespace LibreHardwareMonitor.Hardware
return b;
}
public bool DeviceIOControl<T>(Kernel32.IOControlCode ioControlCode, object inBuffer, ref T[] outBuffer)
{
if (_device == null)
return false;
object boxedOutBuffer = outBuffer;
bool b = Kernel32.DeviceIoControl(_device,
ioControlCode,
inBuffer,
inBuffer == null ? 0 : (uint)Marshal.SizeOf(inBuffer),
boxedOutBuffer,
(uint)(Marshal.SizeOf(typeof(T)) * outBuffer.Length),
out uint _,
IntPtr.Zero);
outBuffer = (T[])boxedOutBuffer;
return b;
}
public void Close()
{
if (_device != null)