summaryrefslogtreecommitdiff
path: root/src/core
diff options
context:
space:
mode:
Diffstat (limited to 'src/core')
-rw-r--r--src/core/hle/ipc_helpers.h3
-rw-r--r--src/core/hle/kernel/hle_ipc.cpp13
-rw-r--r--src/core/hle/kernel/server_session.cpp2
3 files changed, 12 insertions, 6 deletions
diff --git a/src/core/hle/ipc_helpers.h b/src/core/hle/ipc_helpers.h
index 6066d8a18..3f87c4297 100644
--- a/src/core/hle/ipc_helpers.h
+++ b/src/core/hle/ipc_helpers.h
@@ -118,7 +118,8 @@ public:
118 118
119 AlignWithPadding(); 119 AlignWithPadding();
120 120
121 if (context.Session()->IsDomain()) { 121 const bool request_has_domain_header{context.GetDomainMessageHeader() != nullptr};
122 if (context.Session()->IsDomain() && request_has_domain_header) {
122 IPC::DomainMessageHeader domain_header{}; 123 IPC::DomainMessageHeader domain_header{};
123 domain_header.num_objects = num_domain_objects; 124 domain_header.num_objects = num_domain_objects;
124 PushRaw(domain_header); 125 PushRaw(domain_header);
diff --git a/src/core/hle/kernel/hle_ipc.cpp b/src/core/hle/kernel/hle_ipc.cpp
index 25ba26f18..d9faf4b53 100644
--- a/src/core/hle/kernel/hle_ipc.cpp
+++ b/src/core/hle/kernel/hle_ipc.cpp
@@ -85,9 +85,14 @@ void HLERequestContext::ParseCommandBuffer(u32_le* src_cmdbuf, bool incoming) {
85 85
86 if (Session()->IsDomain() && (command_header->type == IPC::CommandType::Request || !incoming)) { 86 if (Session()->IsDomain() && (command_header->type == IPC::CommandType::Request || !incoming)) {
87 // If this is an incoming message, only CommandType "Request" has a domain header 87 // If this is an incoming message, only CommandType "Request" has a domain header
88 // All outgoing domain messages have the domain header 88 // All outgoing domain messages have the domain header, if only incoming has it
89 domain_message_header = 89 if (incoming || domain_message_header) {
90 std::make_unique<IPC::DomainMessageHeader>(rp.PopRaw<IPC::DomainMessageHeader>()); 90 domain_message_header =
91 std::make_unique<IPC::DomainMessageHeader>(rp.PopRaw<IPC::DomainMessageHeader>());
92 } else {
93 if (Session()->IsDomain())
94 LOG_WARNING(IPC, "Domain request has no DomainMessageHeader!");
95 }
91 } 96 }
92 97
93 data_payload_header = 98 data_payload_header =
@@ -196,7 +201,7 @@ ResultCode HLERequestContext::WriteToOutgoingCommandBuffer(u32_le* dst_cmdbuf, P
196 201
197 // TODO(Subv): Translate the X/A/B/W buffers. 202 // TODO(Subv): Translate the X/A/B/W buffers.
198 203
199 if (Session()->IsDomain()) { 204 if (Session()->IsDomain() && domain_message_header) {
200 ASSERT(domain_message_header->num_objects == domain_objects.size()); 205 ASSERT(domain_message_header->num_objects == domain_objects.size());
201 // Write the domain objects to the command buffer, these go after the raw untranslated data. 206 // Write the domain objects to the command buffer, these go after the raw untranslated data.
202 // TODO(Subv): This completely ignores C buffers. 207 // TODO(Subv): This completely ignores C buffers.
diff --git a/src/core/hle/kernel/server_session.cpp b/src/core/hle/kernel/server_session.cpp
index 5608418c3..5f31cf19b 100644
--- a/src/core/hle/kernel/server_session.cpp
+++ b/src/core/hle/kernel/server_session.cpp
@@ -96,7 +96,7 @@ ResultCode ServerSession::HandleSyncRequest(SharedPtr<Thread> thread) {
96 96
97 ResultCode result = RESULT_SUCCESS; 97 ResultCode result = RESULT_SUCCESS;
98 // If the session has been converted to a domain, handle the domain request 98 // If the session has been converted to a domain, handle the domain request
99 if (IsDomain()) { 99 if (IsDomain() && context.GetDomainMessageHeader()) {
100 result = HandleDomainSyncRequest(context); 100 result = HandleDomainSyncRequest(context);
101 // If there is no domain header, the regular session handler is used 101 // If there is no domain header, the regular session handler is used
102 } else if (hle_handler != nullptr) { 102 } else if (hle_handler != nullptr) {