From ea8f633dc088ca5e40d3391d1b826c753a94bf26 Mon Sep 17 00:00:00 2001 From: Lioncash Date: Wed, 3 Apr 2019 16:35:14 -0400 Subject: service/am: Correct behavior of CreateTransferMemoryStorage() For whatever reason, shared memory was being used here instead of transfer memory, which (quite clearly) will not work based off the name of the function. This corrects this wonky usage of shared memory. --- src/core/hle/service/am/am.cpp | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) (limited to 'src/core/hle') diff --git a/src/core/hle/service/am/am.cpp b/src/core/hle/service/am/am.cpp index 9c44e27c6..7d3e0e545 100644 --- a/src/core/hle/service/am/am.cpp +++ b/src/core/hle/service/am/am.cpp @@ -13,7 +13,7 @@ #include "core/hle/kernel/kernel.h" #include "core/hle/kernel/process.h" #include "core/hle/kernel/readable_event.h" -#include "core/hle/kernel/shared_memory.h" +#include "core/hle/kernel/transfer_memory.h" #include "core/hle/kernel/writable_event.h" #include "core/hle/service/acc/profile_manager.h" #include "core/hle/service/am/am.h" @@ -907,19 +907,19 @@ void ILibraryAppletCreator::CreateTransferMemoryStorage(Kernel::HLERequestContex rp.SetCurrentOffset(3); const auto handle{rp.Pop()}; - const auto shared_mem = - Core::System::GetInstance().CurrentProcess()->GetHandleTable().Get( + const auto transfer_mem = + Core::System::GetInstance().CurrentProcess()->GetHandleTable().Get( handle); - if (shared_mem == nullptr) { + if (transfer_mem == nullptr) { LOG_ERROR(Service_AM, "shared_mem is a nullpr for handle={:08X}", handle); IPC::ResponseBuilder rb{ctx, 2}; rb.Push(ResultCode(-1)); return; } - const u8* mem_begin = shared_mem->GetPointer(); - const u8* mem_end = mem_begin + shared_mem->GetSize(); + const u8* const mem_begin = transfer_mem->GetPointer(); + const u8* const mem_end = mem_begin + transfer_mem->GetSize(); std::vector memory{mem_begin, mem_end}; IPC::ResponseBuilder rb{ctx, 2, 0, 1}; -- cgit v1.2.3