Assorted cleanup, UWP memory map fixes. PSPFlower runs in both 32-bit and 64-bit.

This commit is contained in:
Henrik Rydgard authored and Henrik Rydgård committed 2017-03-23 10:02:28 +01:00
1 parent c0f6a24a21
commit ff2b6b3fca
31 files changed
+258 -138

No files matched your search

+10
View File
@@ -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);