mirror of https://github.com/RPCS3/rpcs3.git
Memory: Fix virtualProtect protecting too much memory.
This commit is contained in:
parent
4a7f6af8d9
commit
972515938c
|
@ -425,10 +425,10 @@ namespace vm
|
||||||
DWORD old;
|
DWORD old;
|
||||||
|
|
||||||
auto protection = f2 & page_writable ? PAGE_READWRITE : (f2 & page_readable ? PAGE_READONLY : PAGE_NOACCESS);
|
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
|
#else
|
||||||
auto protection = f2 & page_writable ? PROT_WRITE | PROT_READ : (f2 & page_readable ? PROT_READ : PROT_NONE);
|
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
|
#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);
|
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…
Reference in New Issue