mirror of
https://github.com/switchbrew/libnx.git
synced 2025-07-03 10:02:14 +02:00
sm: add smDetachClient
This commit is contained in:
parent
ab71d6033a
commit
44dcabd214
@ -124,6 +124,12 @@ Result smRegisterService(Handle* handle_out, SmServiceName name, bool is_light,
|
||||
*/
|
||||
Result smUnregisterService(SmServiceName name);
|
||||
|
||||
/**
|
||||
* @brief Detaches the current SM session.
|
||||
* @note After this function is called, the rest of the SM API cannot be used.
|
||||
*/
|
||||
Result smDetachClient(void);
|
||||
|
||||
/**
|
||||
* @brief Gets the Service session used to communicate with SM.
|
||||
* @return Pointer to service session used to communicate with SM.
|
||||
|
@ -1,5 +1,6 @@
|
||||
#define NX_SERVICE_ASSUME_NON_DOMAIN
|
||||
#include "service_guard.h"
|
||||
#include "runtime/hosversion.h"
|
||||
#include "runtime/diag.h"
|
||||
|
||||
static Service g_smSrv;
|
||||
@ -105,3 +106,8 @@ Result smRegisterService(Handle* handle_out, SmServiceName name, bool is_light,
|
||||
Result smUnregisterService(SmServiceName name) {
|
||||
return serviceDispatchIn(&g_smSrv, 3, name);
|
||||
}
|
||||
|
||||
Result smDetachClient(void) {
|
||||
if (hosversionBefore(11,0,0)) return MAKERESULT(Module_Libnx, LibnxError_IncompatSysVer);
|
||||
return serviceDispatch(&g_smSrv, 4);
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user