summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorGravatar mailwl2018-02-20 19:27:49 +0300
committerGravatar mailwl2018-02-20 19:27:49 +0300
commit1572c45aa05febd01b3765706d701e935a5c60f3 (patch)
tree53c36e4bc1ec4d562314df88daa76667a5ce7deb /src
parentMerge pull request #206 from mailwl/aoc-listaddoncontent (diff)
downloadyuzu-1572c45aa05febd01b3765706d701e935a5c60f3.tar.gz
yuzu-1572c45aa05febd01b3765706d701e935a5c60f3.tar.xz
yuzu-1572c45aa05febd01b3765706d701e935a5c60f3.zip
IPC: add domain header to response if only it exists in request
Diffstat (limited to 'src')
-rw-r--r--src/core/hle/ipc_helpers.h2
-rw-r--r--src/core/hle/kernel/hle_ipc.cpp10
-rw-r--r--src/core/hle/kernel/server_session.cpp2
3 files changed, 8 insertions, 6 deletions
diff --git a/src/core/hle/ipc_helpers.h b/src/core/hle/ipc_helpers.h
index 6066d8a18..97290fec5 100644
--- a/src/core/hle/ipc_helpers.h
+++ b/src/core/hle/ipc_helpers.h
@@ -118,7 +118,7 @@ public:
118 118
119 AlignWithPadding(); 119 AlignWithPadding();
120 120
121 if (context.Session()->IsDomain()) { 121 if (context.Session()->IsDomain() && context.GetDomainMessageHeader()) {
122 IPC::DomainMessageHeader domain_header{}; 122 IPC::DomainMessageHeader domain_header{};
123 domain_header.num_objects = num_domain_objects; 123 domain_header.num_objects = num_domain_objects;
124 PushRaw(domain_header); 124 PushRaw(domain_header);
diff --git a/src/core/hle/kernel/hle_ipc.cpp b/src/core/hle/kernel/hle_ipc.cpp
index 25ba26f18..3b1f3154d 100644
--- a/src/core/hle/kernel/hle_ipc.cpp
+++ b/src/core/hle/kernel/hle_ipc.cpp
@@ -85,9 +85,11 @@ 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 }
91 } 93 }
92 94
93 data_payload_header = 95 data_payload_header =
@@ -196,7 +198,7 @@ ResultCode HLERequestContext::WriteToOutgoingCommandBuffer(u32_le* dst_cmdbuf, P
196 198
197 // TODO(Subv): Translate the X/A/B/W buffers. 199 // TODO(Subv): Translate the X/A/B/W buffers.
198 200
199 if (Session()->IsDomain()) { 201 if (domain_message_header && Session()->IsDomain()) {
200 ASSERT(domain_message_header->num_objects == domain_objects.size()); 202 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. 203 // Write the domain objects to the command buffer, these go after the raw untranslated data.
202 // TODO(Subv): This completely ignores C buffers. 204 // 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..42c2f760b 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 (context.GetDomainMessageHeader() && IsDomain()) {
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) {