Push an alert to the queue. @param Alert - The alert to push. @return Whether or not pushing the alert was successful. */
| 52 | @return Whether or not pushing the alert was successful. |
| 53 | */ |
| 54 | VOID |
| 55 | AlertQueue::PushAlert ( |
| 56 | _In_ PBASE_ALERT_INFO Alert, |
| 57 | _In_ ULONG AlertSize |
| 58 | ) |
| 59 | { |
| 60 | PBASE_ALERT_INFO newAlert; |
| 61 | |
| 62 | if (this->destroying) |
| 63 | { |
| 64 | return; |
| 65 | } |
| 66 | |
| 67 | // |
| 68 | // Allocate space for the new alert and copy the details. |
| 69 | // |
| 70 | newAlert = RCAST<PBASE_ALERT_INFO>(ExAllocatePoolWithTag(NonPagedPool, AlertSize, ALERT_QUEUE_ENTRY_TAG)); |
| 71 | if (newAlert == NULL) |
| 72 | { |
| 73 | DBGPRINT("AlertQueue!PushAlert: Failed to allocate space for new alert."); |
| 74 | return; |
| 75 | } |
| 76 | memset(newAlert, 0, AlertSize); |
| 77 | memcpy(newAlert, Alert, AlertSize); |
| 78 | newAlert->AlertSize = AlertSize; |
| 79 | |
| 80 | // |
| 81 | // Queue the alert. |
| 82 | // |
| 83 | ExInterlockedInsertTailList(RCAST<PLIST_ENTRY>(&this->alertsHead), RCAST<PLIST_ENTRY>(newAlert), this->alertsLock); |
| 84 | } |
| 85 | |
| 86 | /** |
| 87 | Pop an alert from the queue of alerts. Follows FI-FO. |
no outgoing calls
no test coverage detected