diff options
| author | liamwhite <liamwhite@users.noreply.github.com> | 2023-12-26 11:46:11 -0500 |
|---|---|---|
| committer | GitHub <noreply@github.com> | 2023-12-26 11:46:11 -0500 |
| commit | de1e5584b32edcc5b43dd7b5757ee4b361f9f70c (patch) | |
| tree | a11721530b76fa281f0793ed8469fd9a847f5489 /src/core/hle/service/am/am.cpp | |
| parent | 1559984f77c4cf7474a8f806046b709576e4e439 (diff) | |
| parent | 47e44a6693ad2e8c7fbdaa23ed440d9780e1d54b (diff) | |
Merge pull request #12465 from liamwhite/proper-handle-table
service: fetch objects from the client handle table
Diffstat (limited to 'src/core/hle/service/am/am.cpp')
| -rw-r--r-- | src/core/hle/service/am/am.cpp | 12 |
1 files changed, 4 insertions, 8 deletions
diff --git a/src/core/hle/service/am/am.cpp b/src/core/hle/service/am/am.cpp index a266d7c21..97eb56ff0 100644 --- a/src/core/hle/service/am/am.cpp +++ b/src/core/hle/service/am/am.cpp @@ -1513,8 +1513,7 @@ void ILibraryAppletCreator::CreateTransferMemoryStorage(HLERequestContext& ctx) return; } - auto transfer_mem = - system.ApplicationProcess()->GetHandleTable().GetObject<Kernel::KTransferMemory>(handle); + auto transfer_mem = ctx.GetObjectFromHandle<Kernel::KTransferMemory>(handle); if (transfer_mem.IsNull()) { LOG_ERROR(Service_AM, "transfer_mem is a nullptr for handle={:08X}", handle); @@ -1524,8 +1523,7 @@ void ILibraryAppletCreator::CreateTransferMemoryStorage(HLERequestContext& ctx) } std::vector<u8> memory(transfer_mem->GetSize()); - system.ApplicationMemory().ReadBlock(transfer_mem->GetSourceAddress(), memory.data(), - memory.size()); + ctx.GetMemory().ReadBlock(transfer_mem->GetSourceAddress(), memory.data(), memory.size()); IPC::ResponseBuilder rb{ctx, 2, 0, 1}; rb.Push(ResultSuccess); @@ -1547,8 +1545,7 @@ void ILibraryAppletCreator::CreateHandleStorage(HLERequestContext& ctx) { return; } - auto transfer_mem = - system.ApplicationProcess()->GetHandleTable().GetObject<Kernel::KTransferMemory>(handle); + auto transfer_mem = ctx.GetObjectFromHandle<Kernel::KTransferMemory>(handle); if (transfer_mem.IsNull()) { LOG_ERROR(Service_AM, "transfer_mem is a nullptr for handle={:08X}", handle); @@ -1558,8 +1555,7 @@ void ILibraryAppletCreator::CreateHandleStorage(HLERequestContext& ctx) { } std::vector<u8> memory(transfer_mem->GetSize()); - system.ApplicationMemory().ReadBlock(transfer_mem->GetSourceAddress(), memory.data(), - memory.size()); + ctx.GetMemory().ReadBlock(transfer_mem->GetSourceAddress(), memory.data(), memory.size()); IPC::ResponseBuilder rb{ctx, 2, 0, 1}; rb.Push(ResultSuccess); |
