From 7701526d3f7834295eff7334ec60277b2dddbde2 Mon Sep 17 00:00:00 2001 From: momo5502 Date: Tue, 24 Dec 2024 07:57:23 +0100 Subject: [PATCH] Support implicit memory reserving --- src/windows-emulator/syscalls.cpp | 6 ++---- 1 file changed, 2 insertions(+), 4 deletions(-) diff --git a/src/windows-emulator/syscalls.cpp b/src/windows-emulator/syscalls.cpp index 783bf10a..651cfdbd 100644 --- a/src/windows-emulator/syscalls.cpp +++ b/src/windows-emulator/syscalls.cpp @@ -1806,11 +1806,9 @@ namespace throw std::runtime_error("Unsupported allocation type!"); } - if (commit && !reserve) + if (commit && !reserve && c.emu.commit_memory(potential_base, allocation_bytes, protection)) { - return c.emu.commit_memory(potential_base, allocation_bytes, protection) - ? STATUS_SUCCESS - : STATUS_MEMORY_NOT_ALLOCATED; + return STATUS_SUCCESS; } return c.emu.allocate_memory(potential_base, allocation_bytes, protection, !commit)