[Memory/CPU] UWP: Support separate code execution and write memory, FromApp functions + other Windows memory fixes
This commit is contained in:
@@ -39,6 +39,8 @@ uint32_t ToPosixProtectFlags(PageAccess access) {
|
||||
return PROT_READ;
|
||||
case PageAccess::kReadWrite:
|
||||
return PROT_READ | PROT_WRITE;
|
||||
case PageAccess::kExecuteReadOnly:
|
||||
return PROT_READ | PROT_EXEC;
|
||||
case PageAccess::kExecuteReadWrite:
|
||||
return PROT_READ | PROT_WRITE | PROT_EXEC;
|
||||
default:
|
||||
@@ -47,6 +49,8 @@ uint32_t ToPosixProtectFlags(PageAccess access) {
|
||||
}
|
||||
}
|
||||
|
||||
bool IsWritableExecutableMemorySupported() { return true; }
|
||||
|
||||
void* AllocFixed(void* base_address, size_t length,
|
||||
AllocationType allocation_type, PageAccess access) {
|
||||
// mmap does not support reserve / commit, so ignore allocation_type.
|
||||
@@ -112,6 +116,7 @@ FileMappingHandle CreateFileMappingHandle(const std::filesystem::path& path,
|
||||
oflag = 0;
|
||||
break;
|
||||
case PageAccess::kReadOnly:
|
||||
case PageAccess::kExecuteReadOnly:
|
||||
oflag = O_RDONLY;
|
||||
break;
|
||||
case PageAccess::kReadWrite:
|
||||
|
||||
Reference in New Issue
Block a user