summaryrefslogtreecommitdiffstats
path: root/src/core/hle/kernel/server_session.cpp
diff options
context:
space:
mode:
authorLioncash <mathew1800@gmail.com>2019-03-07 22:44:28 +0100
committerLioncash <mathew1800@gmail.com>2019-03-08 05:34:37 +0100
commitfbb82e61e35a4e40154ad9a9fcb1ecc46f6622b8 (patch)
treeefe360f1934201e7950a61e710b388f799dd8ad7 /src/core/hle/kernel/server_session.cpp
parenttravis: Bump macOS version to 10.14 (diff)
downloadyuzu-fbb82e61e35a4e40154ad9a9fcb1ecc46f6622b8.tar
yuzu-fbb82e61e35a4e40154ad9a9fcb1ecc46f6622b8.tar.gz
yuzu-fbb82e61e35a4e40154ad9a9fcb1ecc46f6622b8.tar.bz2
yuzu-fbb82e61e35a4e40154ad9a9fcb1ecc46f6622b8.tar.lz
yuzu-fbb82e61e35a4e40154ad9a9fcb1ecc46f6622b8.tar.xz
yuzu-fbb82e61e35a4e40154ad9a9fcb1ecc46f6622b8.tar.zst
yuzu-fbb82e61e35a4e40154ad9a9fcb1ecc46f6622b8.zip
Diffstat (limited to '')
-rw-r--r--src/core/hle/kernel/server_session.cpp63
1 files changed, 32 insertions, 31 deletions
diff --git a/src/core/hle/kernel/server_session.cpp b/src/core/hle/kernel/server_session.cpp
index 3452a9c0c..4d8a337a7 100644
--- a/src/core/hle/kernel/server_session.cpp
+++ b/src/core/hle/kernel/server_session.cpp
@@ -92,41 +92,42 @@ std::size_t ServerSession::NumDomainRequestHandlers() const {
}
ResultCode ServerSession::HandleDomainSyncRequest(Kernel::HLERequestContext& context) {
- auto* const domain_message_header = context.GetDomainMessageHeader();
- if (domain_message_header) {
- // Set domain handlers in HLE context, used for domain objects (IPC interfaces) as inputs
- context.SetDomainRequestHandlers(domain_request_handlers);
-
- // If there is a DomainMessageHeader, then this is CommandType "Request"
- const u32 object_id{context.GetDomainMessageHeader()->object_id};
- switch (domain_message_header->command) {
- case IPC::DomainMessageHeader::CommandType::SendMessage:
- if (object_id > domain_request_handlers.size()) {
- LOG_CRITICAL(IPC,
- "object_id {} is too big! This probably means a recent service call "
- "to {} needed to return a new interface!",
- object_id, name);
- UNREACHABLE();
- return RESULT_SUCCESS; // Ignore error if asserts are off
- }
- return domain_request_handlers[object_id - 1]->HandleSyncRequest(context);
-
- case IPC::DomainMessageHeader::CommandType::CloseVirtualHandle: {
- LOG_DEBUG(IPC, "CloseVirtualHandle, object_id=0x{:08X}", object_id);
-
- domain_request_handlers[object_id - 1] = nullptr;
-
- IPC::ResponseBuilder rb{context, 2};
- rb.Push(RESULT_SUCCESS);
- return RESULT_SUCCESS;
- }
+ if (!context.HasDomainMessageHeader()) {
+ return RESULT_SUCCESS;
+ }
+
+ // Set domain handlers in HLE context, used for domain objects (IPC interfaces) as inputs
+ context.SetDomainRequestHandlers(domain_request_handlers);
+
+ // If there is a DomainMessageHeader, then this is CommandType "Request"
+ const auto& domain_message_header = context.GetDomainMessageHeader();
+ const u32 object_id{domain_message_header.object_id};
+ switch (domain_message_header.command) {
+ case IPC::DomainMessageHeader::CommandType::SendMessage:
+ if (object_id > domain_request_handlers.size()) {
+ LOG_CRITICAL(IPC,
+ "object_id {} is too big! This probably means a recent service call "
+ "to {} needed to return a new interface!",
+ object_id, name);
+ UNREACHABLE();
+ return RESULT_SUCCESS; // Ignore error if asserts are off
}
+ return domain_request_handlers[object_id - 1]->HandleSyncRequest(context);
- LOG_CRITICAL(IPC, "Unknown domain command={}",
- static_cast<int>(domain_message_header->command.Value()));
- ASSERT(false);
+ case IPC::DomainMessageHeader::CommandType::CloseVirtualHandle: {
+ LOG_DEBUG(IPC, "CloseVirtualHandle, object_id=0x{:08X}", object_id);
+
+ domain_request_handlers[object_id - 1] = nullptr;
+
+ IPC::ResponseBuilder rb{context, 2};
+ rb.Push(RESULT_SUCCESS);
+ return RESULT_SUCCESS;
+ }
}
+ LOG_CRITICAL(IPC, "Unknown domain command={}",
+ static_cast<int>(domain_message_header.command.Value()));
+ ASSERT(false);
return RESULT_SUCCESS;
}