[再mark] 系统注册的dpc,枚举定时器相关的……

续 http://hi.baidu.com/andriy_aolala/blog/item/7cff8a344b67d0a3d1a2d3d1.html

刚没事儿又看了下~mark而已啊~

 

1. ExpTimerDpcRoutine

 

R3程序调用NtCreateTimer

 

创建句柄对应Etimeretimer包含一个ktimer结构,最终是通过ktimerdpc机制实现的

 

KtimerdpcExpTimerDpcRoutine,Routine context是etimer,这个routine插入apc  ExpTimerApcRoutine 通知线程


这个apc是ntdll!RtlpTimerThread

 

ETIMER. ApcAssociated0的话,就不用管了,timer这时候已经expire

 

2. IopTimerDispatch

 

IoStartTimer是给驱动用的定时器

 

       RtlZeroMemory( timer, sizeof( IO_TIMER ) );

       timer->Type = IO_TYPE_TIMER;

       timer->DeviceObject = DeviceObject;

       DeviceObject->Timer = timer;

   ExInterlockedInsertTailList( &IopTimerQueueHead,

                                &timer->TimerList,

                                &IopTimerLock );

 

系统使用IopTimerDispatch 这个dpc routine 集中处理这个链表,1秒一次什么的

 

3. ExpTimeRefreshDpcRoutine

 

插入routine ExpTimeRefreshWork的工作线程

 

只有nt4里面有这部分代码 systime.c,看http://www.debugman.com/thread/2752/1/1ida

 

刷新系统时间用的


剩下的神马IopIrpStackProfilerTime CcScanDpc PopScanIdleList之类的不管了~~


ps:xuetr 0.32是显示应用层定时器的进程的,0.45怎么不显示了= =




阅读全文
类别:内核 查看评论
posted on 2012-02-21 17:18  retme  阅读(559)  评论(0编辑  收藏  举报