From dcdaac8a0b5ae5b8d251c3713d3024287b0720b1 Mon Sep 17 00:00:00 2001 From: bunnei Date: Fri, 29 Dec 2017 00:36:22 -0500 Subject: kernel: Fix implementation of ConvertSessionToDomain. --- src/core/hle/kernel/hle_ipc.h | 29 ++++++++++++++++++++++++----- 1 file changed, 24 insertions(+), 5 deletions(-) (limited to 'src/core/hle/kernel/hle_ipc.h') diff --git a/src/core/hle/kernel/hle_ipc.h b/src/core/hle/kernel/hle_ipc.h index bf8cfc2a3..7de13b36b 100644 --- a/src/core/hle/kernel/hle_ipc.h +++ b/src/core/hle/kernel/hle_ipc.h @@ -20,7 +20,9 @@ class ServiceFrameworkBase; namespace Kernel { +class Domain; class HandleTable; +class HLERequestContext; class Process; /** @@ -40,7 +42,7 @@ public: * this request (ServerSession, Originator thread, Translated command buffer, etc). * @returns ResultCode the result code of the translate operation. */ - virtual ResultCode HandleSyncRequest(SharedPtr server_session) = 0; + virtual ResultCode HandleSyncRequest(Kernel::HLERequestContext& context) = 0; /** * Signals that a client has just connected to this HLE handler and keeps the @@ -84,7 +86,8 @@ protected: */ class HLERequestContext { public: - HLERequestContext(SharedPtr session); + HLERequestContext(SharedPtr domain); + HLERequestContext(SharedPtr session); ~HLERequestContext(); /// Returns a pointer to the IPC command buffer for this request. @@ -92,12 +95,19 @@ public: return cmd_buf.data(); } + /** + * Returns the domain through which this request was made. + */ + const SharedPtr& Domain() const { + return domain; + } + /** * Returns the session through which this request was made. This can be used as a map key to * access per-client data on services. */ - SharedPtr Session() const { - return session; + const SharedPtr& ServerSession() const { + return server_session; } /** @@ -144,9 +154,18 @@ public: return buffer_x_desciptors; } + const std::unique_ptr& GetDomainMessageHeader() const { + return domain_message_header; + } + + bool IsDomain() const { + return domain != nullptr; + } + private: std::array cmd_buf; - SharedPtr session; + SharedPtr domain; + SharedPtr server_session; // TODO(yuriks): Check common usage of this and optimize size accordingly boost::container::small_vector, 8> request_handles; -- cgit v1.2.3