diff options
author | bunnei <bunneidev@gmail.com> | 2021-05-16 08:49:03 +0200 |
---|---|---|
committer | bunnei <bunneidev@gmail.com> | 2021-05-21 06:41:49 +0200 |
commit | 7361eac10ff8991f16165190792a948a02b9b756 (patch) | |
tree | 9fdd0bd629afb6a6d20602c341e74511de2cc135 /src/core/hle/ipc_helpers.h | |
parent | Revert "WORKAROUND: temp. disable session resource limits while we work out issues" (diff) | |
download | yuzu-7361eac10ff8991f16165190792a948a02b9b756.tar yuzu-7361eac10ff8991f16165190792a948a02b9b756.tar.gz yuzu-7361eac10ff8991f16165190792a948a02b9b756.tar.bz2 yuzu-7361eac10ff8991f16165190792a948a02b9b756.tar.lz yuzu-7361eac10ff8991f16165190792a948a02b9b756.tar.xz yuzu-7361eac10ff8991f16165190792a948a02b9b756.tar.zst yuzu-7361eac10ff8991f16165190792a948a02b9b756.zip |
Diffstat (limited to '')
-rw-r--r-- | src/core/hle/ipc_helpers.h | 23 |
1 files changed, 13 insertions, 10 deletions
diff --git a/src/core/hle/ipc_helpers.h b/src/core/hle/ipc_helpers.h index c0d0860fd..963f3db30 100644 --- a/src/core/hle/ipc_helpers.h +++ b/src/core/hle/ipc_helpers.h @@ -86,10 +86,8 @@ public: // The entire size of the raw data section in u32 units, including the 16 bytes of mandatory // padding. - u32 raw_data_size = ctx.IsTipc() - ? normal_params_size - 1 - : sizeof(IPC::DataPayloadHeader) / 4 + 4 + normal_params_size; - + u32 raw_data_size = ctx.write_size = + ctx.IsTipc() ? normal_params_size - 1 : normal_params_size; u32 num_handles_to_move{}; u32 num_domain_objects{}; const bool always_move_handles{ @@ -101,16 +99,20 @@ public: } if (ctx.Session()->IsDomain()) { - raw_data_size += static_cast<u32>(sizeof(DomainMessageHeader) / 4 + num_domain_objects); + raw_data_size += + static_cast<u32>(sizeof(DomainMessageHeader) / sizeof(u32) + num_domain_objects); + ctx.write_size += num_domain_objects; } if (ctx.IsTipc()) { header.type.Assign(ctx.GetCommandType()); + } else { + raw_data_size += static_cast<u32>(sizeof(IPC::DataPayloadHeader) / sizeof(u32) + 4 + + normal_params_size); } - ctx.data_size = static_cast<u32>(raw_data_size); - header.data_size.Assign(static_cast<u32>(raw_data_size)); - if (num_handles_to_copy != 0 || num_handles_to_move != 0) { + header.data_size.Assign(raw_data_size); + if (num_handles_to_copy || num_handles_to_move) { header.enable_handle_descriptor.Assign(1); } PushRaw(header); @@ -143,7 +145,8 @@ public: data_payload_index = index; ctx.data_payload_offset = index; - ctx.domain_offset = index + raw_data_size / 4; + ctx.write_size += index; + ctx.domain_offset = static_cast<u32>(index + raw_data_size / sizeof(u32)); } template <class T> @@ -404,7 +407,7 @@ public: std::shared_ptr<T> PopIpcInterface() { ASSERT(context->Session()->IsDomain()); ASSERT(context->GetDomainMessageHeader().input_object_count > 0); - return context->GetDomainRequestHandler<T>(Pop<u32>() - 1); + return context->GetDomainHandler<T>(Pop<u32>() - 1); } }; |