summaryrefslogtreecommitdiffstats
path: root/src/core/hle/service/srv.cpp
diff options
context:
space:
mode:
authorSubv <subv2112@gmail.com>2016-12-01 04:50:13 +0100
committerSubv <subv2112@gmail.com>2016-12-01 05:12:35 +0100
commit009b15b3aa9858930f461d825f7dd030fc963801 (patch)
tree060b6a82ad6c093b1832cd9e96a4fdacf29448b5 /src/core/hle/service/srv.cpp
parentIPC/HLE: Associate the ClientSessions with their parent port's HLE interface if it exists. (diff)
downloadyuzu-009b15b3aa9858930f461d825f7dd030fc963801.tar
yuzu-009b15b3aa9858930f461d825f7dd030fc963801.tar.gz
yuzu-009b15b3aa9858930f461d825f7dd030fc963801.tar.bz2
yuzu-009b15b3aa9858930f461d825f7dd030fc963801.tar.lz
yuzu-009b15b3aa9858930f461d825f7dd030fc963801.tar.xz
yuzu-009b15b3aa9858930f461d825f7dd030fc963801.tar.zst
yuzu-009b15b3aa9858930f461d825f7dd030fc963801.zip
Diffstat (limited to 'src/core/hle/service/srv.cpp')
-rw-r--r--src/core/hle/service/srv.cpp10
1 files changed, 8 insertions, 2 deletions
diff --git a/src/core/hle/service/srv.cpp b/src/core/hle/service/srv.cpp
index eb2e06041..6731afc22 100644
--- a/src/core/hle/service/srv.cpp
+++ b/src/core/hle/service/srv.cpp
@@ -10,6 +10,7 @@
#include "core/hle/kernel/client_session.h"
#include "core/hle/kernel/event.h"
#include "core/hle/service/srv.h"
+#include "core/hle/kernel/server_session.h"
////////////////////////////////////////////////////////////////////////////////////////////////////
// Namespace SRV
@@ -85,13 +86,18 @@ static void GetServiceHandle(Service::Interface* self) {
auto it = Service::g_srv_services.find(port_name);
if (it != Service::g_srv_services.end()) {
- auto client_port = it->second;
+ auto client_port = std::get<Kernel::SharedPtr<Kernel::ClientPort>>(it->second);
+ // The hle_handler will be nullptr if this port was registered by the emulated
+ // application by means of srv:RegisterService.
+ auto hle_handler = std::get<std::shared_ptr<Service::Interface>>(it->second);
// Create a new session pair
- auto sessions = Kernel::ServerSession::CreateSessionPair(client_port, port_name);
+ auto sessions = Kernel::ServerSession::CreateSessionPair(port_name, hle_handler);
auto client_session = std::get<Kernel::SharedPtr<Kernel::ClientSession>>(sessions);
auto server_session = std::get<Kernel::SharedPtr<Kernel::ServerSession>>(sessions);
+ // TODO(Subv): Wait the current thread until the ServerPort calls AcceptSession.
+
// Add the server session to the port's queue
client_port->AddWaitingSession(server_session);