阅读:3406回复:4
内核定时器的一点问题(100分)
我使用内核的定时器
KeSetTimerEx( IN PKTIMER Timer, IN LARGE_INTEGER DueTime, IN LONG Period OPTIONAL, IN PKDPC Dpc OPTIONAL ); 其中DueTime, Period 两个参数各指的是什么意思?? |
|
沙发#
发布于:2004-12-17 20:21
我使用内核的定时器 DueTime Specifies the absolute or relative time at which the timer is to expire. If the value of the DueTime parameter is negative, the expiration time is relative to the current system time. Otherwise, the expiration time is absolute. The expiration time is expressed in system time units (100-nanosecond intervals). Absolute expiration times track any changes in the system time; relative expiration times are not affected by system time changes. Period Specifies an optional period for the timer in milliseconds. Must be less than or equal to MAXLONG |
|
|
板凳#
发布于:2004-12-17 21:46
MSDN或DDK说得很清楚
如楼上所贴 |
|
|
地板#
发布于:2004-12-17 21:48
多查一查MSDN或DDK的说明
很多都是在那里呢 |
|
|
地下室#
发布于:2004-12-18 03:57
duetime:
用来计算定时器变成signaled的时间t....如果是负数 duetime指的就是相对时间...定时器将在 (当前时间-duetime) 时刻signaled 如果是正的,duetime指的就是绝对时间 定时器将在duetime时刻 signaled! DDK没有显式指出如果duetime是正数,但是已经是过去某一时刻的情况,事实上这时候定时器马上singaled..... Period: 如果要周期性触发这个timer...传递一个间隔时间...// 如果传递0 该调用同 KeSetTimer 反汇编KeSetTimer 你会发现这函数会调用KeSetTimerEx KeSetTimer ( PKTIMER Timer, LARGE_INTEGER DueTime, PKDPC Dpc OPTIONAL ) { return KeSetTimerEx(Timer, DueTime, 0, Dpc); } |
|