Re: How to use __readmsr(int address) to get MSR of CPU




"Pavel A." <pavel_a@xxxxxxxxxxxxxxx> wrote in message
news:%23YR06KGIHHA.924@xxxxxxxxxxxxxxxxxxxxxxx
Correct. You can't do privileged instructions from user mode (even with
MFC :)

--PA

The usual solution is to find a driver that already exposes what you're
looking for. A common driver providing user-mode access to protected I/O
resources is giveio, there is probably something similar for MSRs. But
isn't all that information exposed via API calls already?


"BonBon" <BonBon@xxxxxxxxxxxxxxxxxxxxxxxxx> wrote in message
news:C88EB1E2-A79A-47C1-80EA-024C61052C50@xxxxxxxxxxxxxxxx
Hello~

I used MFC to get some MSR of CPU, I included "intrin.h" and used
"__readmsr()",

but it had error messages that "Privileged instrction".

I think OS maybe has protected it.

So, how to do that I can access MSR of CPU?

or where has some relative information of this? such as DDK, WDK or
others.

Please someone can kindly tell me!

Thank you!

Best regards.





.