Windows: Ignore MEM_RESET(_UNDO) allocation protection notifications

When these are set the allocation permissions aren't actually updated.
This commit is contained in:
Billy Laws committed 2025-08-07 02:05:35 +01:00
1 parent cd1cf6f615
commit 52af0aceea
2 files changed
+4 -1

No files matched your search

+2
View File
@@ -804,6 +804,8 @@ void NotifyMemoryAlloc(void* Address, SIZE_T Size, ULONG Type, ULONG Prot, BOOL
if (!After) {
ThreadCreationMutex.lock();
} else {
// MEM_RESET(_UNDO) ignores the passed permissions
if (!Status && !(Type & (MEM_RESET | MEM_RESET_UNDO))) {
InvalidationTracker->HandleMemoryProtectionNotification(reinterpret_cast<uint64_t>(Address), static_cast<uint64_t>(Size), Prot);
}
ThreadCreationMutex.unlock();