summaryrefslogtreecommitdiffstats
path: root/src/core/hle/kernel
diff options
context:
space:
mode:
authorbunnei <bunneidev@gmail.com>2018-05-01 05:24:31 +0200
committerbunnei <bunneidev@gmail.com>2018-05-02 03:57:44 +0200
commitfadab1d5f365c11f0b4c33e74b0d297756f2f3f9 (patch)
treed8add81daca8bc72d5344549528ce4f3953f250f /src/core/hle/kernel
parentMerge pull request #429 from Subv/ioctl_corruption (diff)
downloadyuzu-fadab1d5f365c11f0b4c33e74b0d297756f2f3f9.tar
yuzu-fadab1d5f365c11f0b4c33e74b0d297756f2f3f9.tar.gz
yuzu-fadab1d5f365c11f0b4c33e74b0d297756f2f3f9.tar.bz2
yuzu-fadab1d5f365c11f0b4c33e74b0d297756f2f3f9.tar.lz
yuzu-fadab1d5f365c11f0b4c33e74b0d297756f2f3f9.tar.xz
yuzu-fadab1d5f365c11f0b4c33e74b0d297756f2f3f9.tar.zst
yuzu-fadab1d5f365c11f0b4c33e74b0d297756f2f3f9.zip
Diffstat (limited to 'src/core/hle/kernel')
-rw-r--r--src/core/hle/kernel/hle_ipc.h12
-rw-r--r--src/core/hle/kernel/server_session.cpp3
2 files changed, 15 insertions, 0 deletions
diff --git a/src/core/hle/kernel/hle_ipc.h b/src/core/hle/kernel/hle_ipc.h
index 6d4ed7648..376263eac 100644
--- a/src/core/hle/kernel/hle_ipc.h
+++ b/src/core/hle/kernel/hle_ipc.h
@@ -202,6 +202,16 @@ public:
domain_objects.emplace_back(std::move(object));
}
+ template <typename T>
+ std::shared_ptr<T> GetDomainRequestHandler(size_t index) const {
+ return std::static_pointer_cast<T>(domain_request_handlers[index]);
+ }
+
+ void SetDomainRequestHandlers(
+ const std::vector<std::shared_ptr<SessionRequestHandler>>& handlers) {
+ domain_request_handlers = handlers;
+ }
+
/// Clears the list of objects so that no lingering objects are written accidentally to the
/// response buffer.
void ClearIncomingObjects() {
@@ -245,6 +255,8 @@ private:
unsigned data_payload_offset{};
unsigned buffer_c_offset{};
u32_le command{};
+
+ std::vector<std::shared_ptr<SessionRequestHandler>> domain_request_handlers;
};
} // namespace Kernel
diff --git a/src/core/hle/kernel/server_session.cpp b/src/core/hle/kernel/server_session.cpp
index b1f8e771c..ed33c8600 100644
--- a/src/core/hle/kernel/server_session.cpp
+++ b/src/core/hle/kernel/server_session.cpp
@@ -61,6 +61,9 @@ void ServerSession::Acquire(Thread* thread) {
ResultCode ServerSession::HandleDomainSyncRequest(Kernel::HLERequestContext& context) {
auto& 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) {