mirror of
https://github.com/RPCS3/rpcs3.git
synced 2025-04-21 20:15:27 +00:00
Memory: Fix virtualProtect protecting too much memory.
This commit is contained in:
parent
4a7f6af8d9
commit
972515938c
1 changed files with 2 additions and 2 deletions
|
@ -425,10 +425,10 @@ namespace vm
|
|||
DWORD old;
|
||||
|
||||
auto protection = f2 & page_writable ? PAGE_READWRITE : (f2 & page_readable ? PAGE_READONLY : PAGE_NOACCESS);
|
||||
if (!VirtualProtect(real_addr, size, protection, &old))
|
||||
if (!VirtualProtect(real_addr, 4096, protection, &old))
|
||||
#else
|
||||
auto protection = f2 & page_writable ? PROT_WRITE | PROT_READ : (f2 & page_readable ? PROT_READ : PROT_NONE);
|
||||
if (mprotect(real_addr, size, protection))
|
||||
if (mprotect(real_addr, 4096, protection))
|
||||
#endif
|
||||
{
|
||||
throw fmt::format("vm::page_protect(addr=0x%x, size=0x%x, flags_test=0x%x, flags_set=0x%x, flags_clear=0x%x) failed (API)", addr, size, flags_test, flags_set, flags_clear);
|
||||
|
|
Loading…
Add table
Reference in a new issue