Click here to Skip to main content
15,867,686 members
Please Sign up or sign in to vote.
4.50/5 (2 votes)
See more:
I need to control C-State configuration. Specifically, I'd like to execute the following asm code:
C
__asm
    {
        rdmsr
        and eax, 0x00
        or eax, 0x01
        wrmsr
    }

Currently, I got this exception on rdmsr line:
Unhandled exception at 0x00e3139e in MessWithCStates.exe: 0xC0000096: Privileged instruction.

How can I (permanently) elevate priviliges of my app so it could execute the code above? I use VS 2010.

NOTE: It is possible without writing a kernel-mode driver. See R/W Everything.
Posted
Updated 3-May-11 0:57am
v2
Comments
Lutosław 4-May-11 8:20am    
Could anybody provide a solution to at least a *similar* problem? Any valid __asm code which didn't execute for some reason and started working after applying a priviliges-related trick. I couldn't find any suitable and working solution over the Internet.

this instruction must be executed at a privilege level of 0.
 
Share this answer
 
I think you're out of luck unless you can elevate yourself to Kernel Mode[^].
 
Share this answer
 

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900