驱动中 定时

NTSTATUS 
  KeWaitForSingleObject(
    IN PVOID  Object,
    IN KWAIT_REASON  WaitReason,
    IN KPROCESSOR_MODE  WaitMode,
    IN BOOLEAN  Alertable,
    IN PLARGE_INTEGER  Timeout  OPTIONAL   // Pointer to a time-out value that specifies the absolute or relative time, in 100 nanosecond units, 
    );


VOID 
  KeStallExecutionProcessor(
    IN ULONG
  MicroSeconds                    // Specifies the number of microseconds to stall.
    );


BOOLEAN 
  KeSetTimer(
    IN PKTIMER
  Timer,
    IN LARGE_INTEGER
  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.
    IN PKDPC
  Dpc  OPTIONAL
    );


为了重复地调用CustomTimerDpc例程,使用KeSetTimerEx来设置定时器,并在Period参数中规定一个再次发生的间隔。除了这个附加的参数,KeSetTimerEx就象KeSetTimer一样。
posted @ 2007-11-29 09:14  至尊王者  阅读(696)  评论(0编辑  收藏  举报