diff options
author | bunnei <bunneidev@gmail.com> | 2021-06-08 06:55:37 +0200 |
---|---|---|
committer | bunnei <bunneidev@gmail.com> | 2021-06-08 06:55:37 +0200 |
commit | 08d798b6fe8b09f28c0302b52c3b832b786d1b8a (patch) | |
tree | 925a674b4f2f7a038aade0dc9e8eb218531b13c8 /src/core/hle/kernel/hle_ipc.cpp | |
parent | hle: kernel: Remove service thread manager and use weak_ptr. (diff) | |
download | yuzu-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.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()); } |