mirror of
https://github.com/shadps4-emu/shadPS4.git
synced 2026-06-02 21:05:13 -06:00
MapViewOfFile3 fails on PAGE_NOACCESS (#4392)
This commit is contained in:
parent
1409b26e50
commit
201aaf232b
@ -257,9 +257,20 @@ struct AddressSpace::Impl {
|
|||||||
ret = VirtualProtect(ptr, size, prot, &resultvar);
|
ret = VirtualProtect(ptr, size, prot, &resultvar);
|
||||||
ASSERT_MSG(ret, "VirtualProtect failed. {}", Common::GetLastErrorMsg());
|
ASSERT_MSG(ret, "VirtualProtect failed. {}", Common::GetLastErrorMsg());
|
||||||
} else {
|
} else {
|
||||||
ptr = MapViewOfFile3(backing, process, reinterpret_cast<PVOID>(virtual_addr),
|
if (prot == PAGE_NOACCESS) {
|
||||||
phys_addr, size, MEM_REPLACE_PLACEHOLDER, prot, nullptr, 0);
|
DWORD resultvar;
|
||||||
ASSERT_MSG(ptr, "MapViewOfFile3 failed. {}", Common::GetLastErrorMsg());
|
ptr = MapViewOfFile3(backing, process, reinterpret_cast<PVOID>(virtual_addr),
|
||||||
|
phys_addr, size, MEM_REPLACE_PLACEHOLDER, PAGE_READWRITE,
|
||||||
|
nullptr, 0);
|
||||||
|
ASSERT_MSG(ptr, "MapViewOfFile3 failed. {}", Common::GetLastErrorMsg());
|
||||||
|
bool ret = VirtualProtect(ptr, size, prot, &resultvar);
|
||||||
|
ASSERT_MSG(ret, "VirtualProtect failed. {}", Common::GetLastErrorMsg());
|
||||||
|
} else {
|
||||||
|
ptr =
|
||||||
|
MapViewOfFile3(backing, process, reinterpret_cast<PVOID>(virtual_addr),
|
||||||
|
phys_addr, size, MEM_REPLACE_PLACEHOLDER, prot, nullptr, 0);
|
||||||
|
ASSERT_MSG(ptr, "MapViewOfFile3 failed. {}", Common::GetLastErrorMsg());
|
||||||
|
}
|
||||||
}
|
}
|
||||||
} else {
|
} else {
|
||||||
ptr =
|
ptr =
|
||||||
|
|||||||
Loading…
Reference in New Issue
Block a user