Clear the queue of alerts. */
| 22 | Clear the queue of alerts. |
| 23 | */ |
| 24 | AlertQueue::~AlertQueue() |
| 25 | { |
| 26 | PLIST_ENTRY currentEntry; |
| 27 | KIRQL oldIRQL; |
| 28 | |
| 29 | // |
| 30 | // Make sure no one is doing operations on the AlertQueue. |
| 31 | // |
| 32 | this->destroying = TRUE; |
| 33 | |
| 34 | KeAcquireSpinLock(this->alertsLock, &oldIRQL); |
| 35 | KeReleaseSpinLock(this->alertsLock, oldIRQL); |
| 36 | |
| 37 | while (IsListEmpty(RCAST<PLIST_ENTRY>(&this->alertsHead)) == FALSE) |
| 38 | { |
| 39 | currentEntry = RemoveHeadList(RCAST<PLIST_ENTRY>(&this->alertsHead)); |
| 40 | // |
| 41 | // Free the entry. |
| 42 | // |
| 43 | ExFreePoolWithTag(SCAST<PVOID>(currentEntry), ALERT_QUEUE_ENTRY_TAG); |
| 44 | } |
| 45 | |
| 46 | ExFreePoolWithTag(this->alertsLock, ALERT_LOCK_TAG); |
| 47 | } |
| 48 | |
| 49 | /** |
| 50 | Push an alert to the queue. |