Getting OS Information — The KUSER_SHARED_DATA Structure

Ever asked how Windows API retrieves the current time, the version of the OS, or whether an evaluation period has expired? This structure will answers some of these questions.

Read more

A Performance Issue in Windows Timer Management?

I was just crawling through the Windows sources to find out some details about Windows timer management when I figured out the following comment on lines 621 thru 624 in file base\ntos\inc\ntosdef.h:

00618 // 
00619 // Define timer table size. 
00620 // 
00621 // N.B. The size of the timer table must be less than or equal to 256 and a 
00622 // power of 2 in size. 
00623 
00624 #define TIMER_TABLE_SIZE 512

Obviously, the definition of TIMER_TABLE_SIZE does not follow the comment. But, as the code evolved over the years, I thought it was just another comment inconsistency.

Diving deeper into the Windows timer management, I found the reason why TIMER_TABLE_SIZE has to be a less than or equal to 256. Let me first tell you some principles of the Windows timer management.

Read more