开发者

Is there any way to manipulate the value of the TimeGetTime timer

开发者 https://www.devze.com 2023-04-06 02:58 出处:网络
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 ke

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 g开发者_JAVA技巧enerally 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.


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.

0

精彩评论

暂无评论...
验证码 换一张
取 消

关注公众号