參考了WinRing0如何使用,這篇示例中較詳細的描述了讀取SIO芯片型號以及風扇轉速(風扇的好像不行),
我再參考了[業余知識:PC 硬件監控]使用WinRing0 2.0.0.20讀取CPU溫度這篇博客,加入了獲取CPU溫度的代碼。親測可用~v~。主要增加代碼如下:
/// <summary>
/// CPU溫度
/// </summary>
/// <returns></returns>
public int CpuTemp()
{
uint eax, edx;
eax = edx = 0;
MyOls.Rdmsr(0x1A2, ref eax, ref edx);
uint TjMax = eax;
TjMax &= 0xFF0000;
TjMax = TjMax >> 16;
MyOls.Rdmsr(0x19C, ref eax, ref edx);
uint IAcore = eax;
IAcore &= 0xFF0000;
IAcore = IAcore >> 16;
int cputemp = (int)(TjMax - IAcore);
return cputemp;
}
還有許多的API不清楚用法,待后續研究。我補充的代碼