From 05832cec7373b751a0f5e291827e8eb9db72d85e Mon Sep 17 00:00:00 2001 From: Michael Scire Date: Mon, 30 Nov 2020 22:18:18 -0800 Subject: [PATCH] sm: implement UserService::DetachClient --- .../include/stratosphere/sm/impl/sm_user_interface.hpp | 1 + stratosphere/sm/source/sm_user_service.cpp | 5 +++++ stratosphere/sm/source/sm_user_service.hpp | 1 + 3 files changed, 7 insertions(+) diff --git a/libraries/libstratosphere/include/stratosphere/sm/impl/sm_user_interface.hpp b/libraries/libstratosphere/include/stratosphere/sm/impl/sm_user_interface.hpp index 6bb7c72f5..d94a44500 100644 --- a/libraries/libstratosphere/include/stratosphere/sm/impl/sm_user_interface.hpp +++ b/libraries/libstratosphere/include/stratosphere/sm/impl/sm_user_interface.hpp @@ -26,6 +26,7 @@ namespace ams::sm::impl { AMS_SF_METHOD_INFO(C, H, 1, Result, GetServiceHandle, (sf::OutMoveHandle out_h, ServiceName service)) \ AMS_SF_METHOD_INFO(C, H, 2, Result, RegisterService, (sf::OutMoveHandle out_h, ServiceName service, u32 max_sessions, bool is_light)) \ AMS_SF_METHOD_INFO(C, H, 3, Result, UnregisterService, (ServiceName service)) \ + AMS_SF_METHOD_INFO(C, H, 4, Result, DetachClient, (const sf::ClientProcessId &client_process_id)) \ AMS_SF_METHOD_INFO(C, H, 65000, Result, AtmosphereInstallMitm, (sf::OutMoveHandle srv_h, sf::OutMoveHandle qry_h, ServiceName service)) \ AMS_SF_METHOD_INFO(C, H, 65001, Result, AtmosphereUninstallMitm, (ServiceName service)) \ AMS_SF_METHOD_INFO(C, H, 65003, Result, AtmosphereAcknowledgeMitmSession, (sf::Out client_info, sf::OutMoveHandle fwd_h, ServiceName service)) \ diff --git a/stratosphere/sm/source/sm_user_service.cpp b/stratosphere/sm/source/sm_user_service.cpp index de9c8b6e2..f3b15295d 100644 --- a/stratosphere/sm/source/sm_user_service.cpp +++ b/stratosphere/sm/source/sm_user_service.cpp @@ -51,6 +51,11 @@ namespace ams::sm { return impl::UnregisterService(this->process_id, service); } + Result UserService::DetachClient(const sf::ClientProcessId &client_process_id) { + this->has_initialized = false; + return ResultSuccess(); + } + Result UserService::AtmosphereInstallMitm(sf::OutMoveHandle srv_h, sf::OutMoveHandle qry_h, ServiceName service) { R_TRY(this->EnsureInitialized()); return impl::InstallMitm(srv_h.GetHandlePointer(), qry_h.GetHandlePointer(), this->process_id, service); diff --git a/stratosphere/sm/source/sm_user_service.hpp b/stratosphere/sm/source/sm_user_service.hpp index dfb64b530..8dd22d6b8 100644 --- a/stratosphere/sm/source/sm_user_service.hpp +++ b/stratosphere/sm/source/sm_user_service.hpp @@ -34,6 +34,7 @@ namespace ams::sm { Result GetServiceHandle(sf::OutMoveHandle out_h, ServiceName service); Result RegisterService(sf::OutMoveHandle out_h, ServiceName service, u32 max_sessions, bool is_light); Result UnregisterService(ServiceName service); + Result DetachClient(const sf::ClientProcessId &client_process_id); /* Atmosphere commands. */ Result AtmosphereInstallMitm(sf::OutMoveHandle srv_h, sf::OutMoveHandle qry_h, ServiceName service);