| 17 | } |
| 18 | |
| 19 | void IoTimer::EnumIoTimer(IoTimerData* pData, IoTimerInfo* pInfo) { |
| 20 | PLIST_ENTRY pIopTimerQueueHead = *(PLIST_ENTRY*)pData->pIopTimerQueueHead; |
| 21 | LIST_ENTRY IopTimerQueueHead = *pIopTimerQueueHead; |
| 22 | PLIST_ENTRY timerEntry; |
| 23 | PIO_TIMER timer; |
| 24 | KIRQL irql; |
| 25 | PKSPIN_LOCK pIopTimerLock = (PKSPIN_LOCK)pData->pIopTimerLock; |
| 26 | |
| 27 | |
| 28 | KeAcquireSpinLock(pIopTimerLock, &irql); |
| 29 | ULONG count = *pData->pIopTimerCount; |
| 30 | int j = 0; |
| 31 | for (timerEntry = IopTimerQueueHead.Flink; |
| 32 | (timerEntry != &IopTimerQueueHead)&& count; |
| 33 | timerEntry = timerEntry->Flink) { |
| 34 | |
| 35 | timer = CONTAINING_RECORD(timerEntry, IO_TIMER, TimerList); |
| 36 | if (timer->TimerFlag) { |
| 37 | LogInfo("Type: %d,TimerRoutine: 0x%p,DeviceObject: 0x%p,TimerFlag: 0x%d", |
| 38 | timer->Type, |
| 39 | timer->TimerRoutine, |
| 40 | timer->DeviceObject, |
| 41 | timer->TimerFlag); |
| 42 | |
| 43 | pInfo[j].DeviceObject = timer->DeviceObject; |
| 44 | pInfo[j].TimerFlag = timer->TimerFlag; |
| 45 | pInfo[j].TimerRoutine = timer->TimerRoutine; |
| 46 | pInfo[j].Type = timer->Type; |
| 47 | j++; |
| 48 | count--; |
| 49 | } |
| 50 | } |
| 51 | KeReleaseSpinLock(pIopTimerLock, irql); |
| 52 | } |