diff options
| author | 2018-10-29 23:20:17 -0400 | |
|---|---|---|
| committer | 2018-10-29 23:28:04 -0400 | |
| commit | 6383653a8df93d3daa1d5b8e1e694905684ccbda (patch) | |
| tree | bba8b85a3aacf904bb5b1a18a87f69b586f0bca7 | |
| parent | hle_ipc: Make GetDomainMessageHeader return a regular pointer (diff) | |
| download | yuzu-6383653a8df93d3daa1d5b8e1e694905684ccbda.tar.gz yuzu-6383653a8df93d3daa1d5b8e1e694905684ccbda.tar.xz yuzu-6383653a8df93d3daa1d5b8e1e694905684ccbda.zip | |
hle_ipc: Add member function for querying the existence of a domain header
Gets rid of the need to call the getter and then check for null.
Diffstat (limited to '')
| -rw-r--r-- | src/core/hle/ipc_helpers.h | 3 | ||||
| -rw-r--r-- | src/core/hle/kernel/hle_ipc.h | 4 | ||||
| -rw-r--r-- | src/core/hle/kernel/server_session.cpp | 2 |
3 files changed, 6 insertions, 3 deletions
diff --git a/src/core/hle/ipc_helpers.h b/src/core/hle/ipc_helpers.h index a4bfe2eb0..0a7142ada 100644 --- a/src/core/hle/ipc_helpers.h +++ b/src/core/hle/ipc_helpers.h | |||
| @@ -117,8 +117,7 @@ public: | |||
| 117 | 117 | ||
| 118 | AlignWithPadding(); | 118 | AlignWithPadding(); |
| 119 | 119 | ||
| 120 | const bool request_has_domain_header{context.GetDomainMessageHeader() != nullptr}; | 120 | if (context.Session()->IsDomain() && context.HasDomainMessageHeader()) { |
| 121 | if (context.Session()->IsDomain() && request_has_domain_header) { | ||
| 122 | IPC::DomainMessageHeader domain_header{}; | 121 | IPC::DomainMessageHeader domain_header{}; |
| 123 | domain_header.num_objects = num_domain_objects; | 122 | domain_header.num_objects = num_domain_objects; |
| 124 | PushRaw(domain_header); | 123 | PushRaw(domain_header); |
diff --git a/src/core/hle/kernel/hle_ipc.h b/src/core/hle/kernel/hle_ipc.h index 2e49826a8..a38e34b74 100644 --- a/src/core/hle/kernel/hle_ipc.h +++ b/src/core/hle/kernel/hle_ipc.h | |||
| @@ -165,6 +165,10 @@ public: | |||
| 165 | return domain_message_header.get(); | 165 | return domain_message_header.get(); |
| 166 | } | 166 | } |
| 167 | 167 | ||
| 168 | bool HasDomainMessageHeader() const { | ||
| 169 | return domain_message_header != nullptr; | ||
| 170 | } | ||
| 171 | |||
| 168 | /// Helper function to read a buffer using the appropriate buffer descriptor | 172 | /// Helper function to read a buffer using the appropriate buffer descriptor |
| 169 | std::vector<u8> ReadBuffer(int buffer_index = 0) const; | 173 | std::vector<u8> ReadBuffer(int buffer_index = 0) const; |
| 170 | 174 | ||
diff --git a/src/core/hle/kernel/server_session.cpp b/src/core/hle/kernel/server_session.cpp index afb3beed2..80897f3a4 100644 --- a/src/core/hle/kernel/server_session.cpp +++ b/src/core/hle/kernel/server_session.cpp | |||
| @@ -111,7 +111,7 @@ ResultCode ServerSession::HandleSyncRequest(SharedPtr<Thread> thread) { | |||
| 111 | 111 | ||
| 112 | ResultCode result = RESULT_SUCCESS; | 112 | ResultCode result = RESULT_SUCCESS; |
| 113 | // If the session has been converted to a domain, handle the domain request | 113 | // If the session has been converted to a domain, handle the domain request |
| 114 | if (IsDomain() && context.GetDomainMessageHeader()) { | 114 | if (IsDomain() && context.HasDomainMessageHeader()) { |
| 115 | result = HandleDomainSyncRequest(context); | 115 | result = HandleDomainSyncRequest(context); |
| 116 | // If there is no domain header, the regular session handler is used | 116 | // If there is no domain header, the regular session handler is used |
| 117 | } else if (hle_handler != nullptr) { | 117 | } else if (hle_handler != nullptr) { |