| 836 | } |
| 837 | |
| 838 | void NotifyMemoryAlloc(void* Address, SIZE_T Size, ULONG Type, ULONG Prot, BOOL After, NTSTATUS Status) { |
| 839 | if (!InvalidationTracker || !GetCPUArea().ThreadState()) { |
| 840 | return; |
| 841 | } |
| 842 | |
| 843 | if (!After) { |
| 844 | ThreadCreationMutex.lock(); |
| 845 | } else { |
| 846 | // MEM_RESET(_UNDO) ignores the passed permissions |
| 847 | if (!Status && !(Type & (MEM_RESET | MEM_RESET_UNDO))) { |
| 848 | InvalidationTracker->HandleMemoryProtectionNotification(reinterpret_cast<uint64_t>(Address), static_cast<uint64_t>(Size), Prot); |
| 849 | } |
| 850 | ThreadCreationMutex.unlock(); |
| 851 | } |
| 852 | } |
| 853 | |
| 854 | void NotifyMemoryFree(void* Address, SIZE_T Size, ULONG FreeType, BOOL After, NTSTATUS Status) { |
| 855 | if (!InvalidationTracker || !GetCPUArea().ThreadState()) { |
nothing calls this directly
no test coverage detected