Destroy the CustomFilters class by clearing the filters linked list and deleting the associated lock. */
| 44 | Destroy the CustomFilters class by clearing the filters linked list and deleting the associated lock. |
| 45 | */ |
| 46 | StringFilters::~StringFilters() |
| 47 | { |
| 48 | PLIST_ENTRY currentFilter; |
| 49 | |
| 50 | // |
| 51 | // Set destroying to TRUE so that no other threads can get a lock. |
| 52 | // |
| 53 | this->destroying = TRUE; |
| 54 | |
| 55 | // |
| 56 | // Acquire an exclusive lock to push out other threads. |
| 57 | // |
| 58 | FltAcquirePushLockExclusive(&this->filtersLock); |
| 59 | |
| 60 | // |
| 61 | // Release the lock. |
| 62 | // |
| 63 | FltReleasePushLock(&this->filtersLock); |
| 64 | |
| 65 | // |
| 66 | // Delete the lock for the filters. |
| 67 | // |
| 68 | FltDeletePushLock(&this->filtersLock); |
| 69 | |
| 70 | // |
| 71 | // Go through each filter and free it. |
| 72 | // |
| 73 | if (this->filtersHead) |
| 74 | { |
| 75 | while (IsListEmpty(RCAST<PLIST_ENTRY>(this->filtersHead)) == FALSE) |
| 76 | { |
| 77 | currentFilter = RemoveHeadList(RCAST<PLIST_ENTRY>(this->filtersHead)); |
| 78 | // |
| 79 | // Free the filter. |
| 80 | // |
| 81 | ExFreePoolWithTag(SCAST<PVOID>(currentFilter), FILTER_INFO_TAG); |
| 82 | } |
| 83 | |
| 84 | // |
| 85 | // Finally, free the list head. |
| 86 | // |
| 87 | ExFreePoolWithTag(SCAST<PVOID>(this->filtersHead), FILTER_INFO_TAG); |
| 88 | } |
| 89 | |
| 90 | // |
| 91 | // Free the driver registy path. |
| 92 | // |
| 93 | ExFreePoolWithTag(this->driverRegistryPath.Buffer, FILTER_INFO_TAG); |
| 94 | } |
| 95 | |
| 96 | /** |
| 97 | Add a filter to the linked list of filters. |
no outgoing calls
no test coverage detected