MCPcopy Create free account
hub / github.com/D4stiny/PeaceMaker / PushAlert

Method PushAlert

PeaceMaker Kernel/AlertQueue.cpp:54–84  ·  view source on GitHub ↗

Push an alert to the queue. @param Alert - The alert to push. @return Whether or not pushing the alert was successful. */

Source from the content-addressed store, hash-verified

52 @return Whether or not pushing the alert was successful.
53*/
54VOID
55AlertQueue::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.

Callers 3

AuditCallerProcessIdMethod · 0.80
ReportFilterViolationMethod · 0.80

Calls

no outgoing calls

Tested by

no test coverage detected