aboutsummaryrefslogtreecommitdiff
path: root/src/core/hle/service/service.cpp
diff options
context:
space:
mode:
authorSubv <subv2112@gmail.com>2016-06-18 13:39:26 -0500
committerSubv <subv2112@gmail.com>2016-11-30 23:04:00 -0500
commitc5e7e0fa26fc793c8b9f3effe25586f7fb57953e (patch)
tree2acac9450de6b1d8cc42d89f9aa08759d77f9cd9 /src/core/hle/service/service.cpp
parentc19afd21188e91b9dd2780cf5cb9872a17ad113d (diff)
IPC/HLE: Associate the ClientSessions with their parent port's HLE interface if it exists.
Pass the triggering ServerSession to the HLE command handler to differentiate which session caused the request.
Diffstat (limited to 'src/core/hle/service/service.cpp')
-rw-r--r--src/core/hle/service/service.cpp8
1 files changed, 5 insertions, 3 deletions
diff --git a/src/core/hle/service/service.cpp b/src/core/hle/service/service.cpp
index abfc1806b..56e4f8734 100644
--- a/src/core/hle/service/service.cpp
+++ b/src/core/hle/service/service.cpp
@@ -61,7 +61,9 @@ static std::string MakeFunctionString(const char* name, const char* port_name,
return function_string;
}
-ResultCode Interface::HandleSyncRequest() {
+ResultCode Interface::HandleSyncRequest(Kernel::SharedPtr<Kernel::ServerSession> server_session) {
+ // TODO(Subv): Make use of the server_session in the HLE service handlers to distinguish which session triggered each command.
+
u32* cmd_buff = Kernel::GetCommandBuffer();
auto itr = m_functions.find(cmd_buff[0]);
@@ -97,12 +99,12 @@ void Interface::Register(const FunctionInfo* functions, size_t n) {
// Module interface
static void AddNamedPort(Interface* interface_) {
- auto client_port = Kernel::ClientPort::CreateForHLE(interface_->GetMaxSessions(), std::unique_ptr<Interface>(interface_));
+ auto client_port = Kernel::ClientPort::CreateForHLE(interface_->GetMaxSessions(), std::shared_ptr<Interface>(interface_));
g_kernel_named_ports.emplace(interface_->GetPortName(), client_port);
}
void AddService(Interface* interface_) {
- auto client_port = Kernel::ClientPort::CreateForHLE(interface_->GetMaxSessions(), std::unique_ptr<Interface>(interface_));
+ auto client_port = Kernel::ClientPort::CreateForHLE(interface_->GetMaxSessions(), std::shared_ptr<Interface>(interface_));
g_srv_services.emplace(interface_->GetPortName(), client_port);
}