summaryrefslogtreecommitdiffstats
path: root/src/core/hle/kernel/hle_ipc.cpp
diff options
context:
space:
mode:
authorbunnei <bunneidev@gmail.com>2021-06-08 06:55:37 +0200
committerbunnei <bunneidev@gmail.com>2021-06-08 06:55:37 +0200
commit08d798b6fe8b09f28c0302b52c3b832b786d1b8a (patch)
tree925a674b4f2f7a038aade0dc9e8eb218531b13c8 /src/core/hle/kernel/hle_ipc.cpp
parenthle: kernel: Remove service thread manager and use weak_ptr. (diff)
downloadyuzu-08d798b6fe8b09f28c0302b52c3b832b786d1b8a.tar
yuzu-08d798b6fe8b09f28c0302b52c3b832b786d1b8a.tar.gz
yuzu-08d798b6fe8b09f28c0302b52c3b832b786d1b8a.tar.bz2
yuzu-08d798b6fe8b09f28c0302b52c3b832b786d1b8a.tar.lz
yuzu-08d798b6fe8b09f28c0302b52c3b832b786d1b8a.tar.xz
yuzu-08d798b6fe8b09f28c0302b52c3b832b786d1b8a.tar.zst
yuzu-08d798b6fe8b09f28c0302b52c3b832b786d1b8a.zip
Diffstat (limited to '')
-rw-r--r--src/core/hle/kernel/hle_ipc.cpp15
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());
}