From 60776e8111ba9d0b35a24a191c809e1c7e49efc4 Mon Sep 17 00:00:00 2001 From: Michael Scire Date: Fri, 15 Mar 2019 00:25:09 -0700 Subject: [PATCH] loader: fix ldr:ro mapping error on < 3.0.0 --- stratosphere/loader/source/ldr_map.cpp | 14 +++++++------- 1 file changed, 7 insertions(+), 7 deletions(-) diff --git a/stratosphere/loader/source/ldr_map.cpp b/stratosphere/loader/source/ldr_map.cpp index dc9393f73..f6e39e200 100644 --- a/stratosphere/loader/source/ldr_map.cpp +++ b/stratosphere/loader/source/ldr_map.cpp @@ -131,7 +131,7 @@ Result MapUtils::MapCodeMemoryForProcessModern(Handle process_h, u64 base_addres AddressSpaceInfo address_space = {0}; Result rc; - if (R_FAILED((rc = GetAddressSpaceInfo(&address_space, CUR_PROCESS_HANDLE)))) { + if (R_FAILED((rc = GetAddressSpaceInfo(&address_space, process_h)))) { return rc; } @@ -193,22 +193,22 @@ Result MapUtils::MapCodeMemoryForProcessDeprecated(Handle process_h, bool is_64_ Result MapUtils::GetAddressSpaceInfo(AddressSpaceInfo *out, Handle process_h) { Result rc; - if (R_FAILED((rc = svcGetInfo(&out->heap_base, 4, CUR_PROCESS_HANDLE, 0)))) { + if (R_FAILED((rc = svcGetInfo(&out->heap_base, 4, process_h, 0)))) { return rc; } - if (R_FAILED((rc = svcGetInfo(&out->heap_size, 5, CUR_PROCESS_HANDLE, 0)))) { + if (R_FAILED((rc = svcGetInfo(&out->heap_size, 5, process_h, 0)))) { return rc; } - if (R_FAILED((rc = svcGetInfo(&out->map_base, 2, CUR_PROCESS_HANDLE, 0)))) { + if (R_FAILED((rc = svcGetInfo(&out->map_base, 2, process_h, 0)))) { return rc; } - if (R_FAILED((rc = svcGetInfo(&out->map_size, 3, CUR_PROCESS_HANDLE, 0)))) { + if (R_FAILED((rc = svcGetInfo(&out->map_size, 3, process_h, 0)))) { return rc; } - if (R_FAILED((rc = svcGetInfo(&out->addspace_base, 12, CUR_PROCESS_HANDLE, 0)))) { + if (R_FAILED((rc = svcGetInfo(&out->addspace_base, 12, process_h, 0)))) { return rc; } - if (R_FAILED((rc = svcGetInfo(&out->addspace_size, 13, CUR_PROCESS_HANDLE, 0)))) { + if (R_FAILED((rc = svcGetInfo(&out->addspace_size, 13, process_h, 0)))) { return rc; } out->heap_end = out->heap_base + out->heap_size;