mirror of
https://github.com/FEX-Emu/FEX.git
synced 2026-10-06 09:00:17 +02:00
AllocatorHooks: Amend VirtualProtect for Windows
VirtualProtect returns non-zero on success, also the old protection flag parameter isn't allowed to be null.
This commit is contained in:
1 parent
76b35dfeb0
commit
25f2021711
1 file changed
+2
-1
@@ -97,7 +97,8 @@ inline bool VirtualProtect(void* Ptr, size_t Size, ProtectOptions options) {
|
||||
LOGMAN_MSG_A_FMT("Unknown VirtualProtect options combination");
|
||||
}
|
||||
|
||||
return ::VirtualProtect(Ptr, Size, prot, nullptr) == 0;
|
||||
DWORD OldProt {};
|
||||
return ::VirtualProtect(Ptr, Size, prot, &OldProt) != 0;
|
||||
}
|
||||
|
||||
FEX_DEFAULT_VISIBILITY extern VirtualNamePtr VirtualName;
|
||||
|
||||
Reference in new issue
Block a user