From 03bf0739a48157397c0f2a60b385466526239777 Mon Sep 17 00:00:00 2001 From: bunnei Date: Wed, 18 Oct 2017 21:34:19 -0400 Subject: service: Add CreatePort function (that does not register/install). --- src/core/hle/service/service.cpp | 10 ++++++++++ 1 file changed, 10 insertions(+) (limited to 'src/core/hle/service/service.cpp') diff --git a/src/core/hle/service/service.cpp b/src/core/hle/service/service.cpp index 93a6d2618..826a775d1 100644 --- a/src/core/hle/service/service.cpp +++ b/src/core/hle/service/service.cpp @@ -74,6 +74,16 @@ void ServiceFrameworkBase::InstallAsNamedPort() { AddNamedPort(service_name, std::move(client_port)); } +Kernel::SharedPtr ServiceFrameworkBase::CreatePort() { + ASSERT(port == nullptr); + Kernel::SharedPtr server_port; + Kernel::SharedPtr client_port; + std::tie(server_port, client_port) = Kernel::ServerPort::CreatePortPair(max_sessions, service_name); + port = MakeResult>(std::move(server_port)).Unwrap(); + port->SetHleHandler(shared_from_this()); + return client_port; +} + void ServiceFrameworkBase::RegisterHandlersBase(const FunctionInfoBase* functions, size_t n) { handlers.reserve(handlers.size() + n); for (size_t i = 0; i < n; ++i) { -- cgit v1.2.3