circle

Can't read control registers

Discussion created by circle on Dec 23, 2007
Latest reply on Dec 30, 2007 by alexey_khosh@rambler.ru
Hi there
I'm trying to read and write to the control registers mainly CR4 with the intrinsics __readcr4 and the write equivalent. The code compiles without any warnings or errors but when I run it the program crashes.

Even the most basic code fails, like:
ULONG Cr4;
CR4 = __readcr4();
or
if(__readcr4())
{...}


I'm running the AMD 64 X2 with XP, I would really appreciate any help.

/Dan

Outcomes