PhyxionNL
2021-10-16 10:34:05 +02:00
parent ce882e3910
commit 9bf2447ab9
2 changed files with 6 additions and 13 deletions
@@ -12,6 +12,7 @@
<UseWindowsForms>true</UseWindowsForms>
<OutputPath>..\bin\$(Configuration)\</OutputPath>
<LangVersion>latest</LangVersion>
<PlatformTarget>AnyCPU</PlatformTarget>
</PropertyGroup>
<PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Debug|AnyCPU' ">
<DebugType>full</DebugType>
+5 -13
View File
@@ -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);