summaryrefslogtreecommitdiffstats
path: root/src/core/hle/kernel/hle_ipc.cpp
diff options
context:
space:
mode:
authorbunnei <bunneidev@gmail.com>2021-06-09 01:43:55 +0200
committerGitHub <noreply@github.com>2021-06-09 01:43:55 +0200
commit3c621d37f0477046b489ab809f4b4a563f982510 (patch)
treec6d6c48fc36d18990edd3fe70b8621e70c1c6cbb /src/core/hle/kernel/hle_ipc.cpp
parentMerge pull request #6426 from lat9nq/context-menu-start (diff)
parenthle: kernel: KServerSession: Work-around scenario where session is closed too early. (diff)
downloadyuzu-3c621d37f0477046b489ab809f4b4a563f982510.tar
yuzu-3c621d37f0477046b489ab809f4b4a563f982510.tar.gz
yuzu-3c621d37f0477046b489ab809f4b4a563f982510.tar.bz2
yuzu-3c621d37f0477046b489ab809f4b4a563f982510.tar.lz
yuzu-3c621d37f0477046b489ab809f4b4a563f982510.tar.xz
yuzu-3c621d37f0477046b489ab809f4b4a563f982510.tar.zst
yuzu-3c621d37f0477046b489ab809f4b4a563f982510.zip
Diffstat (limited to 'src/core/hle/kernel/hle_ipc.cpp')
-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());
}