From ea7f51a2791ca0ccfea7590e819f159374c183ed Mon Sep 17 00:00:00 2001 From: Michael Scire Date: Sat, 11 Jun 2022 00:58:14 -0700 Subject: [PATCH] os: fix whoops in SetMemoryPermission on windows --- .../source/os/impl/os_memory_permission_impl.os.windows.cpp | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/libraries/libstratosphere/source/os/impl/os_memory_permission_impl.os.windows.cpp b/libraries/libstratosphere/source/os/impl/os_memory_permission_impl.os.windows.cpp index 5f5dd2799..eaed1f805 100644 --- a/libraries/libstratosphere/source/os/impl/os_memory_permission_impl.os.windows.cpp +++ b/libraries/libstratosphere/source/os/impl/os_memory_permission_impl.os.windows.cpp @@ -28,21 +28,21 @@ namespace ams::os::impl { switch (perm) { case MemoryPermission_None: { - auto res = ::VirtualProtect(reinterpret_cast(address), static_cast(cur_size), PAGE_NOACCESS, std::addressof(old)); + auto res = ::VirtualProtect(reinterpret_cast(cur_address), static_cast(cur_size), PAGE_NOACCESS, std::addressof(old)); AMS_ABORT_UNLESS(res); AMS_UNUSED(res); } break; case MemoryPermission_ReadOnly: { - auto res = ::VirtualProtect(reinterpret_cast(address), static_cast(cur_size), PAGE_READONLY, std::addressof(old)); + auto res = ::VirtualProtect(reinterpret_cast(cur_address), static_cast(cur_size), PAGE_READONLY, std::addressof(old)); AMS_ABORT_UNLESS(res); AMS_UNUSED(res); } break; case MemoryPermission_ReadWrite: { - auto res = ::VirtualProtect(reinterpret_cast(address), static_cast(cur_size), PAGE_READWRITE, std::addressof(old)); + auto res = ::VirtualProtect(reinterpret_cast(cur_address), static_cast(cur_size), PAGE_READWRITE, std::addressof(old)); AMS_ABORT_UNLESS(res); AMS_UNUSED(res); }