experiencegift.blogg.se

Open hardware monitor
Open hardware monitor










open hardware monitor
  1. #OPEN HARDWARE MONITOR HOW TO#
  2. #OPEN HARDWARE MONITOR SOFTWARE#

Private const uint MSR_PLATFORM_INFO = 0xCE Private const uint IA32_PERF_STATUS = 0x0198 Private const uint IA32_TEMPERATURE_TARGET = 0x01A2

open hardware monitor

For example, the IntelCPU class defines some model-specific registers: private const uint IA32_THERM_STATUS_MSR = 0x019C The link to source for OpenHardwareMonitorLib provided in Tomer's answer illustrates what has to happen at a low level to read this information out of different types of CPUs. For example, a temperature sensor for every core, so don't always take the last one as I did in the example above. Note that the CPU of the user can have multiple temperature sensors. You can get a lot of other information about the system with this library. It will most likely work for most other CPUs from AMD and Intel. This C# code gets the temperature of the CPU in Celcius. If (sensor.SensorType = SensorType.Temperature) If (hardware.HardwareType = HardwareType.CPU)įoreach (ISensor sensor in hardware.Sensors) After reading the source for a while this is my take: using OpenHardwareMonitor.Hardware įoreach (IHardware hardware in computer.Hardware) So considering it has no docs it can be a bit hard to work with.

#OPEN HARDWARE MONITOR HOW TO#

How to call a C# library from Native C++ (using C++\CLI and IJW)

open hardware monitor

Fortunately you can get it as a DLL, and the GUI is completely separated from the actual backend which is OpenHardwareMonitorLib. NET C Sharp and of course, only works for Windows.

#OPEN HARDWARE MONITOR SOFTWARE#

It's part of an open source software named "Open Hardware Monitor". Unfortunately, it has no documentation and actually doesn't really exist as an independent piece of software. Truth to be told, it depends on the hardware.Ī library that works on most hardware is OpenHardwareMonitorLib. Hr = pObject->Get(temp, 0, &v, NULL, NULL) Hr = pEnum->Next(WBEM_INFINITE, 1, &pObject, &returned) īSTR temp = SysAllocString(L"CurrentTemperature") Hr = pServices->ExecQuery(wql, query, WBEM_FLAG_RETURN_IMMEDIATELY | WBEM_FLAG_FORWARD_ONLY, NULL, &pEnum) Hr = pLocator->ConnectServer(ns, NULL, NULL, NULL, 0, NULL, NULL, &pServices) īSTR query = SysAllocString(L"SELECT * FROM MSAcpi_ThermalZoneTemperature") Hr = CoCreateInstance(CLSID_WbemAdministrativeLocator, NULL, CLSCTX_INPROC_SERVER, IID_IWbemLocator, (LPVOID*)&pLocator) HRESULT hr = CoInitializeSecurity(NULL, -1, NULL, NULL, RPC_C_AUTHN_LEVEL_DEFAULT, RPC_C_IMP_LEVEL_IMPERSONATE, NULL, EOAC_NONE, NULL) HRESULT GetCpuTemperature(LPLONG pTemperature) Is there any way to get the real temperature of the CPU without having to write drivers? Or are there any libs which I can use? Thank you in advance. I'm reading MSAcpi_ThermalZoneTemperature, but it's always the same and it's not the CPU temperature at all. Below is what I've done using C++ and WMI.












Open hardware monitor