diff options
| author | bunnei <bunneidev@gmail.com> | 2022-01-09 02:17:17 -0800 |
|---|---|---|
| committer | bunnei <bunneidev@gmail.com> | 2022-01-11 16:28:11 -0800 |
| commit | 49a0e4330ee37bdfa503918f841ab9599ccc1c24 (patch) | |
| tree | e38e9dc90acbbf4fa8d64ea8c30736a86f32b37b /src/core/hle/kernel/svc.cpp | |
| parent | 6ac44f3bdca29c3b0530aa600b914c5952e525f3 (diff) | |
hle: kernel: k_page_table: Update SetProcessMemoryPermission.
Diffstat (limited to 'src/core/hle/kernel/svc.cpp')
| -rw-r--r-- | src/core/hle/kernel/svc.cpp | 4 |
1 files changed, 3 insertions, 1 deletions
diff --git a/src/core/hle/kernel/svc.cpp b/src/core/hle/kernel/svc.cpp index 55ce0236f..c7f5140f4 100644 --- a/src/core/hle/kernel/svc.cpp +++ b/src/core/hle/kernel/svc.cpp @@ -1309,6 +1309,8 @@ static ResultCode SetProcessMemoryPermission(Core::System& system, Handle proces R_UNLESS(Common::IsAligned(size, PageSize), ResultInvalidSize); R_UNLESS(size > 0, ResultInvalidSize); R_UNLESS((address < address + size), ResultInvalidCurrentMemory); + R_UNLESS(address == static_cast<uintptr_t>(address), ResultInvalidCurrentMemory); + R_UNLESS(size == static_cast<size_t>(size), ResultInvalidCurrentMemory); // Validate the memory permission. R_UNLESS(IsValidProcessMemoryPermission(perm), ResultInvalidNewMemoryPermission); @@ -1323,7 +1325,7 @@ static ResultCode SetProcessMemoryPermission(Core::System& system, Handle proces R_UNLESS(page_table.Contains(address, size), ResultInvalidCurrentMemory); // Set the memory permission. - return page_table.SetProcessMemoryPermission(address, size, ConvertToKMemoryPermission(perm)); + return page_table.SetProcessMemoryPermission(address, size, perm); } static ResultCode MapProcessMemory(Core::System& system, VAddr dst_address, Handle process_handle, |
