阅读:2150回复:2
我的Timer为什么不动?
目的是每秒钟通过DebugPrint输出一条信息,我在DeviceExtension中定义了timer及dpc object,然后在PNP的startDevice处理函数中进行一下的初始化:
KeInitializeTimer(&dx->timer); KeInitializeDpc(&dx->dpc,DpcRoutine,NULL); LARGE_INTEGER durtime; durtime.QuadPart=-1000; KeSetTimerEx(&dx->timer,durtime,1000,&dx->dpc); DpcRoutine是这样的: VOID DpcRoutine(PKDPC dpc, PVOID context, PVOID junk1, PVOID junk2) { DebugPrint("Dpc Routine Execute"); } 编译、连接、安装都没有问题,可就是DpcRoutine得不到执行?请问个位大哥,这是怎么回事?问题出在哪? [Rick 编辑于 2001-05-21 16:55] |
|
沙发#
发布于:2001-05-21 18:34
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.
上述是ddk中KeSetTimerEx的参数DurTime的说明,使用绝对时间试一下。 |
|
板凳#
发布于:2001-05-22 08:36
今天可以了,我也不清楚是怎么回事!:)
|
|