1

I have an app using the GetLastInputInfo function and compares it with the value of GetTickCount (which returns the number of milliseconds since Windows started) as a way of detecting nobody at the keyboard or mouse application for more than a certain time. This code had a bug which did not manifest itself will the GetTickCount counter rolled over - around 49 days.

I want to be able to test applications generally for susceptibility to this roll-over - but faster than every 7 weeks. Does anyone know of a means of forcing the value returned by GetTickCount (example in any legible programming language - including .BAT - is fine)?

This isn't really a duplicate of this earlier question. I'm interested in a technique that will allow me to characterise the behaviour of code that's already in the wild.

Community
  • 1
  • 1
rossmcm
  • 5,493
  • 10
  • 55
  • 118

1 Answers1

4

Run the checked build of Windows. It artificially sets the GetTickCount value to 1 hour before rollover at boot, so that the counter value rolls over in 1 hour instead of 49 days.

Raymond Chen
  • 44,448
  • 11
  • 96
  • 135
  • Sounds almost perfect. I am [downloading it](http://www.microsoft.com/download/en/details.aspx?id=1260) now, but (assuming I install it on a virtual machine) what will happen as regards licensing when I install it? – rossmcm Sep 21 '11 at 14:31