Source code of Windows XP (NT5)
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
 
 
 
 
 
 

43 lines
839 B

#include <nt.h>
#include <ntrtl.h>
#include <nturtl.h>
VOID TimerCallback(PVOID pv, BOOLEAN b)
{
DbgPrint("TimerCallback called!\n");
}
int main(int argc, char *argv[])
{
NTSTATUS st;
HANDLE Q;
HANDLE T;
LARGE_INTEGER li;
DbgPrint("Creating timer queue...\n");
RtlCreateTimerQueue(&Q);
DbgPrint("In main... setting a timer...\n");
st = RtlSetTimer(Q,
&T,
TimerCallback,
NULL,
500,
500,
0);
DbgPrint("In main... sleeping...\n");
li.QuadPart = -500*20*5000;
NtDelayExecution(FALSE, &li);
DbgPrint("In main... cancelling timer...\n");
RtlCancelTimer(Q, T);
DbgPrint("In main... deleting timer...\n");
RtlDeleteTimerQueue(Q);
return 1;
}