diff options
Diffstat (limited to 'src/core/hle/kernel/hle_ipc.cpp')
-rw-r--r-- | src/core/hle/kernel/hle_ipc.cpp | 15 |
1 files changed, 15 insertions, 0 deletions
diff --git a/src/core/hle/kernel/hle_ipc.cpp b/src/core/hle/kernel/hle_ipc.cpp index 260af87e5..45aced99f 100644 --- a/src/core/hle/kernel/hle_ipc.cpp +++ b/src/core/hle/kernel/hle_ipc.cpp @@ -41,6 +41,21 @@ SessionRequestManager::SessionRequestManager(KernelCore& kernel_) : kernel{kerne SessionRequestManager::~SessionRequestManager() = default; +bool SessionRequestManager::HasSessionRequestHandler(const HLERequestContext& context) const { + if (IsDomain() && context.HasDomainMessageHeader()) { + const auto& message_header = context.GetDomainMessageHeader(); + const auto object_id = message_header.object_id; + + if (object_id > DomainHandlerCount()) { + LOG_CRITICAL(IPC, "object_id {} is too big!", object_id); + return false; + } + return DomainHandler(object_id - 1) != nullptr; + } else { + return session_handler != nullptr; + } +} + void SessionRequestHandler::ClientConnected(KServerSession* session) { session->SetSessionHandler(shared_from_this()); } |