Hello everybody,
I try to set a finer timer resolution in kernel mode and thus read about ExSetTimerResolution, NtSetTimerResolution and NtQueryTimerResolution from various sources, including here. What I want to do is to make a KTIMER plus KDPC that has been scheduled via KeSetTimer() fire with a smaller time interval than the usual 10 or 15ms.
Right now, I can measure how many timer callbacks I get and it’s 64 per 1 sec on my Win2k3 box, 100 on my XP box. I would like to increase that number (of course they should be sort of evenly spaced).
From what I read I assumed that using ExSetTimerResolution(50000, TRUE) would do exactly this, i.e. in my example generate about 200 callbacks per 1 sec. Unfortunately, the effect is exactly zero. Nothing changes at all, exept that a call to ExSetTimerResolution(1000000, TRUE) (some very high value) returns about 50000, the formerly set value. So it *says* it did it, but didn’t do it ??
I even tried to use NtSetTimerResolution() from user mode via native API, same effect, i.e. the return value suggests success, but nothing changes.
I tried this on two machines: one running Windows Server 2003 Multiprocessor Free (2 procs) v5.02.3790.4035, SP2 (15 ms resolution) and one running Windows XP Uniprocessor Free v5.01.2600, SP2 (10 ms resolution).
At last, I tried to change the clock resolution with the BOOT.INI switch /TIMERES=21000, as is suggested in Windows Internals. Same here, no effect at all. Here, even ExSetTimerResolution(1000000, TRUE) returns the default value.
Mark’s CLOCKRES tool always prints the default value (15 ms resp. 10 ms).
So, I’m wondering, what did I do wrong? Or is what I’m trying to do unsupported in the first place?
Please help & take care,
Chris