Notice: This website is an unofficial Microsoft Knowledge Base (hereinafter KB) archive and is intended to provide a reliable access to deleted content from Microsoft KB. All KB articles are owned by Microsoft Corporation. Read full disclaimer for more details.

How to use the timeSetEvent multimedia timer


View products that this article applies to.

Source: Microsoft Support

↑ Back to the top


Symptom

If you set a timer by calling the API timeSetEvent() with an event delay of more than 429,496 milliseconds, the system will not call back in time.

↑ Back to the top


Cause

This is an overflow of the 32-bit long timeSetEvent uDelay parameter.

Even though you set the uDelay parameter in milliseconds, internally in the function, it uses 100 nanosecond units. So a value of 429,496 ms (4,294,960,000 = 0xFFFFE380) is the maximum. This is about 7 minutes and 9 seconds. If you set uDelay to 429,497 the event will almost immediately occur.

If we examine these values in hexadecimal, we see: �
429,496(ms) * 10,000 = 4,294,960,000 (100ns) = 0xFFFFE380
429,497(ms) * 10,000 = 4,294,970,000 (100ns) = 0x00000a90
The second value goes beyond the limit and the hexadecimal value starts to count over again.

This problem happens only when using TIME_PERIODIC mode.

↑ Back to the top


More information

Microsoft has confirmed that this is a problem in the timeSetEvent timer.

↑ Back to the top


Keywords: KB974281, kbhowto

↑ Back to the top

Article Info
Article ID : 974281
Revision : 2
Created on : 8/6/2009
Published on : 8/6/2009
Exists online : False
Views : 200