I'm trying to use WinRing0 to get the CPU temperature in a Qt/C++ project, but i don't found any sample code explaining how to do this. Can someone provide to me a sample code? I made the download of WinRing0 containing a sample code in C++, but i don't found how to get CPU temperature.
Asked
Active
Viewed 3,089 times
0
-
What you mean when say "What processor"? Processor architecture? – Antonio Dias Jan 30 '13 at 19:14
-
Yes, Intel or AMD, or something else? And which generation? There are several different ways to determine CPU temperature, depending on which brand and generation it is. – Mats Petersson Jan 30 '13 at 19:17
-
The winring0 library does not provide a unique way to access the temperatures? – Antonio Dias Jan 30 '13 at 19:29
-
I was under the impression that it's just a driver to provide the interfaces necessary to do Ring0 access - such as reading MSR's. You then need to actually read the correct MSR for the processor you have. But I've never used the product myself, and aside from reading the source code, there isn't much docs. – Mats Petersson Jan 30 '13 at 19:36
-
We can start with my notebook processor Intel Core i3-2310M. – Antonio Dias Jan 30 '13 at 19:47
-
Maybe this will help you: http://stackoverflow.com/questions/5327203/how-to-access-cpus-heat-sensors – Mats Petersson Jan 30 '13 at 19:51
-
I've used MSAcpi_ThermalZoneTemperature and the OpenHardwareMonitor library in C# to get CPU temperature, but i don't know a way do it in C++, also not all processors support MSAcpi_ThermalZoneTemperature, i was looking a most embracing way to do this. – Antonio Dias Jan 30 '13 at 20:00
-
I'm pretty sure the ACPI method is MORE encompassing than the MSR method, which relies on knowing brand and model of CPU. You do realize that this is not something you can just hack a few lines of codes together to make it work, right? But the link I posted also covers Intel MSR's. I'm sure you can find AMD MSR's if you search a bit on the wbe. – Mats Petersson Jan 30 '13 at 20:07
-
Ok, i've tried to use the MSAcpi_ThermalZoneTemperature in c++ but i not understand how to do this, can you provide an example? I can't understand only with MSDN examples. – Antonio Dias Jan 30 '13 at 20:18
-
The code in the link is C/C++ tho'. Without understanding exactly what you are "don't understand", it's very hard to help. If you can produce a small example of what you are actually struggling with, someone may be able to help - I don't have any intel processors, I only have three machines and all have AMD processors, and only my laptop runs Windows - the other two are Linux. So I'm afraid I can't really help much here. – Mats Petersson Jan 30 '13 at 20:23
-
Anyway thanks for stay with me, i will try to do this in c++. – Antonio Dias Jan 30 '13 at 20:28