- 4


"" RDPMC , Enable Counter MSR- PerfEvtSel0/PerfEvtSel1 (, PerfEvtSel0):

DriverUnload: ; //

; // pce cr4

; //

MOV EAX, CR4

MOV ECX, 100h

NOT ECX ; // RDPMC

AND EAX, ECX

MOV CR4, EAX

; //

XOR EDX, EDX

XOR EAX, EAX

MOV ECX, 186h

WRMSR

 5 

( 996.SYS), CreateFile. , RDPMC, , , , .

:

//

#define PrefCtrl0 0x0000

#define DCU_MISS_OUTSTANDING 0x0048

// 996

static HANDLE _996_handle = INVALID_HANDLE_VALUE;

int _996_init()

{

if (_996_handle == INVALID_HANDLE_VALUE)

{

_996_handle = CreateFile("\\\\.\\996",GENERIC_READ,

FILE_SHARE_READ | FILE_SHARE_WRITE, NULL,

OPEN_EXISTING, FILE_ATTRIBUTE_NORMAL, NULL);

if (_996_handle == INVALID_HANDLE_VALUE) return 0;