当前位置: 代码迷 >> 驱动开发 >> 请教能在WDM驱动中使用GetTickCount吗
  详细解决方案

请教能在WDM驱动中使用GetTickCount吗

热度:141   发布时间:2016-04-28 11:14:00.0
请问能在WDM驱动中使用GetTickCount吗
如果想获得一个粗劣的计时器,可以用什么方法?

比如   QueryPerfermanceXXXX   ?

------解决方案--------------------
在驱动中可以使用别的定时器函数。如下:
IoInitializeTimer:
Associates a timer with the given device object and registers a driver-supplied IoTimer routine for the device object.
IoStartTimer:
Enables the timer for a given device object and calls the driver-supplied IoTimer routine once every second.
IoStopTimer :
Disables the timer for a given device object so the driver-supplied IoTimer routine is not called unless the driver re-enables the timer.
KeInitializeDpc:
Initializes a DPC object and sets up a driver-supplied CustomTimerDpc routine that can be called with a given context.
KeInitializeTimer:
Initializes a notification timer object to the Not-Signaled state.
KeInitializeTimerEx:
Initializes a notification or synchronization timer object to the Not-Signaled state.
KeSetTimer:
Sets the absolute or relative interval at which a timer object will be set to the Signaled state; optionally supplies a timer DPC to be executed when the interval expires.
KeSetTimerEx:
Sets the absolute or relative interval at which a timer object will be set to the Signaled state; optionally supplies a timer DPC to be executed when the interval expires; and optionally supplies a recurring interval for the timer.
KeCancelTimer:
Cancels a timer object before the interval passed to KeSetTimer expires; dequeues a timer DPC before the timer interval, if any was set, expires.
KeReadStateTimer:
Returns TRUE if a given timer object is set to the Signaled state.
KeQuerySystemTime :
Returns the current system time.
KeQueryTickCount:
Returns the number of interval-timer interrupts that have occurred since the system was booted.
KeQueryTimeIncrement:
Returns the number of 100-nanosecond units that are added to the system time at each interval-timer interrupt.
KeQueryInterruptTime:
Returns the current value of the system interrupt-time count in 100-nanosecond units.
KeQueryPerformanceCounter:
Returns the system performance counter value in hertz.
如果想看更具体的,请参阅windowsddk
  相关解决方案