diff --git a/LibreHardwareMonitor/LibreHardwareMonitor.csproj b/LibreHardwareMonitor/LibreHardwareMonitor.csproj index 4210438..66d4a22 100644 --- a/LibreHardwareMonitor/LibreHardwareMonitor.csproj +++ b/LibreHardwareMonitor/LibreHardwareMonitor.csproj @@ -12,6 +12,7 @@ true ..\bin\$(Configuration)\ latest + AnyCPU full diff --git a/LibreHardwareMonitorLib/Hardware/RyzenSMU.cs b/LibreHardwareMonitorLib/Hardware/RyzenSMU.cs index 74ffd9a..e84f89f 100644 --- a/LibreHardwareMonitorLib/Hardware/RyzenSMU.cs +++ b/LibreHardwareMonitorLib/Hardware/RyzenSMU.cs @@ -86,12 +86,14 @@ namespace LibreHardwareMonitor.Hardware { _cpuCodeName = GetCpuCodeName(family, model, packageType); - _supportedCPU = SetAddresses(_cpuCodeName); + _supportedCPU = Environment.Is64BitOperatingSystem == Environment.Is64BitProcess && SetAddresses(_cpuCodeName); if (_supportedCPU) + { InpOut.Open(); - SetupPmTableAddrAndSize(); + SetupPmTableAddrAndSize(); + } } private static CpuCodeName GetCpuCodeName(uint family, uint model, uint packageType) @@ -274,13 +276,7 @@ namespace LibreHardwareMonitor.Hardware public float[] GetPmTable() { - if (!_supportedCPU) - return new float[] { 0 }; - - if (!SetupPmTableAddrAndSize()) - return new float[] { 0 }; - - if (!TransferTableToDram()) + if (!_supportedCPU || !TransferTableToDram()) return new float[] { 0 }; @@ -301,10 +297,6 @@ namespace LibreHardwareMonitor.Hardware { float[] table = new float[_pmTableSize / 4]; - if (_dramBaseAddr > int.MaxValue) - return table; - - byte[] bytes = InpOut.ReadMemory(new IntPtr(_dramBaseAddr), _pmTableSize); if (bytes != null) Buffer.BlockCopy(bytes, 0, table, 0, bytes.Length);