memory: avoid redundant Windows view protection

This commit is contained in:
nmzik committed 2026-10-07 22:47:50 +04:00
1 parent 038d2257de
commit c30ac7c904
3 files changed
+49 -1

No files matched your search

+1 -1
View File
@@ -597,7 +597,7 @@ private:
return nullptr;
}
if (!ApplyProtection(ptr, size, mode)) {
if (mode == VirtualMemory::Mode::NoAccess && !ApplyProtection(ptr, size, mode)) {
UnmapViewOfFile2(GetCurrentProcess(), ptr, MEM_PRESERVE_PLACEHOLDER);
SetFailure(failure_reason, FailureReason::ProtectFailed);
return nullptr;