mirror of
https://github.com/hrydgard/ppsspp.git
synced 2026-10-10 21:16:24 +02:00
Assorted cleanup, UWP memory map fixes. PSPFlower runs in both 32-bit and 64-bit.
This commit is contained in:
1 parent
c0f6a24a21
commit
ff2b6b3fca
31 files changed
+258
-138
No files matched your search
@@ -16,6 +16,7 @@
|
||||
// http://code.google.com/p/dolphin-emu/
|
||||
|
||||
#include "ppsspp_config.h"
|
||||
|
||||
#include "Common.h"
|
||||
#include "MemoryUtil.h"
|
||||
#include "StringUtils.h"
|
||||
@@ -302,11 +303,20 @@ bool ProtectMemoryPages(const void* ptr, size_t size, uint32_t memProtFlags) {
|
||||
// mprotect does not seem to, at least not on Android unless I made a mistake somewhere, so we manually round.
|
||||
#ifdef _WIN32
|
||||
uint32_t protect = ConvertProtFlagsWin32(memProtFlags);
|
||||
|
||||
#if PPSSPP_PLATFORM(UWP)
|
||||
DWORD oldValue;
|
||||
if (!VirtualProtectFromApp((void *)ptr, size, protect, &oldValue)) {
|
||||
PanicAlert("WriteProtectMemory failed!\n%s", GetLastErrorMsg());
|
||||
return false;
|
||||
}
|
||||
#else
|
||||
DWORD oldValue;
|
||||
if (!VirtualProtect((void *)ptr, size, protect, &oldValue)) {
|
||||
PanicAlert("WriteProtectMemory failed!\n%s", GetLastErrorMsg());
|
||||
return false;
|
||||
}
|
||||
#endif
|
||||
return true;
|
||||
#else
|
||||
uint32_t protect = ConvertProtFlagsUnix(memProtFlags);
|
||||
|
||||
Reference in new issue
Block a user