summaryrefslogtreecommitdiffstats
path: root/src/core/hle/kernel/hle_ipc.cpp
diff options
context:
space:
mode:
authorSubv <subv2112@gmail.com>2018-01-07 15:22:20 +0100
committerbunnei <bunneidev@gmail.com>2018-01-07 23:11:51 +0100
commit32847d8b860af1210612027680eea1cbf9765b51 (patch)
tree234cabf0b424e2863540f704752e2838c914d491 /src/core/hle/kernel/hle_ipc.cpp
parentIPC: Don't attempt to read the command buffer if it holds a Close request. (diff)
downloadyuzu-32847d8b860af1210612027680eea1cbf9765b51.tar
yuzu-32847d8b860af1210612027680eea1cbf9765b51.tar.gz
yuzu-32847d8b860af1210612027680eea1cbf9765b51.tar.bz2
yuzu-32847d8b860af1210612027680eea1cbf9765b51.tar.lz
yuzu-32847d8b860af1210612027680eea1cbf9765b51.tar.xz
yuzu-32847d8b860af1210612027680eea1cbf9765b51.tar.zst
yuzu-32847d8b860af1210612027680eea1cbf9765b51.zip
Diffstat (limited to 'src/core/hle/kernel/hle_ipc.cpp')
-rw-r--r--src/core/hle/kernel/hle_ipc.cpp16
1 files changed, 14 insertions, 2 deletions
diff --git a/src/core/hle/kernel/hle_ipc.cpp b/src/core/hle/kernel/hle_ipc.cpp
index 0ab28c0a2..1c6adb4a0 100644
--- a/src/core/hle/kernel/hle_ipc.cpp
+++ b/src/core/hle/kernel/hle_ipc.cpp
@@ -53,8 +53,20 @@ void HLERequestContext::ParseCommandBuffer(u32_le* src_cmdbuf, bool incoming) {
if (handle_descriptor_header->send_current_pid) {
rp.Skip(2, false);
}
- rp.Skip(handle_descriptor_header->num_handles_to_copy, false);
- rp.Skip(handle_descriptor_header->num_handles_to_move, false);
+ if (incoming) {
+ // Populate the object lists with the data in the IPC request.
+ for (u32 handle = 0; handle < handle_descriptor_header->num_handles_to_copy; ++handle) {
+ copy_objects.push_back(Kernel::g_handle_table.GetGeneric(rp.Pop<Handle>()));
+ }
+ for (u32 handle = 0; handle < handle_descriptor_header->num_handles_to_move; ++handle) {
+ move_objects.push_back(Kernel::g_handle_table.GetGeneric(rp.Pop<Handle>()));
+ }
+ } else {
+ // For responses we just ignore the handles, they're empty and will be populated when
+ // translating the response.
+ rp.Skip(handle_descriptor_header->num_handles_to_copy, false);
+ rp.Skip(handle_descriptor_header->num_handles_to_move, false);
+ }
}
for (unsigned i = 0; i < command_header->num_buf_x_descriptors; ++i) {