diff --git a/nx/include/switch/services/ns.h b/nx/include/switch/services/ns.h index c9286547..c4383481 100644 --- a/nx/include/switch/services/ns.h +++ b/nx/include/switch/services/ns.h @@ -244,18 +244,34 @@ Service* nsGetServiceSession_GetterInterface(void); /// Gets the Service object for IApplicationManagerInterface. Only initialized on pre-3.0.0, on [3.0.0+] use \ref nsGetApplicationManagerInterface. Service* nsGetServiceSession_ApplicationManagerInterface(void); +/// Gets the Service object for IDynamicRightsInterface via the cmd for that. +/// Only available on [6.0.0+]. +Result nsGetDynamicRightsInterface(Service* srv_out); + /// Gets the Service object for IReadOnlyApplicationControlDataInterface via the cmd for that. /// Only available on [5.1.0+]. Result nsGetReadOnlyApplicationControlDataInterface(Service* srv_out); +/// Gets the Service object for IReadOnlyApplicationRecordInterface via the cmd for that. +/// Only available on [5.0.0+]. +Result nsGetReadOnlyApplicationRecordInterface(Service* srv_out); + /// Gets the Service object for IECommerceInterface via the cmd for that. /// Only available on [4.0.0+]. Result nsGetECommerceInterface(Service* srv_out); +/// Gets the Service object for IApplicationVersionInterface via the cmd for that. +/// Only available on [4.0.0+]. +Result nsGetApplicationVersionInterface(Service* srv_out); + /// Gets the Service object for IFactoryResetInterface via the cmd for that. /// Only available on [3.0.0+]. Result nsGetFactoryResetInterface(Service* srv_out); +/// Gets the Service object for IAccountProxyInterface via the cmd for that. +/// Only available on [3.0.0+]. +Result nsGetAccountProxyInterface(Service* srv_out); + /// Gets the Service object for IApplicationManagerInterface via the cmd for that. /// Only available on [3.0.0+], on prior sysvers use \ref nsGetServiceSession_ApplicationManagerInterface. Result nsGetApplicationManagerInterface(Service* srv_out); @@ -268,6 +284,10 @@ Result nsGetDownloadTaskInterface(Service* srv_out); /// Only available on [3.0.0+]. Result nsGetContentManagementInterface(Service* srv_out); +/// Gets the Service object for IDocumentInterface via the cmd for that. +/// Only available on [3.0.0+]. +Result nsGetDocumentInterface(Service* srv_out); + ///@} ///@name IReadOnlyApplicationControlDataInterface diff --git a/nx/source/services/ns.c b/nx/source/services/ns.c index 45fb4b81..cf55029e 100644 --- a/nx/source/services/ns.c +++ b/nx/source/services/ns.c @@ -47,6 +47,13 @@ Service* nsGetServiceSession_ApplicationManagerInterface(void) { return &g_nsAppManSrv; } +Result nsGetDynamicRightsInterface(Service* srv_out) { + if (hosversionBefore(6,0,0)) + return MAKERESULT(Module_Libnx, LibnxError_IncompatSysVer); + + return _nsGetSession(&g_nsGetterSrv, srv_out, 7988); +} + Result nsGetReadOnlyApplicationControlDataInterface(Service* srv_out) { if (hosversionBefore(5,1,0)) return MAKERESULT(Module_Libnx, LibnxError_IncompatSysVer); @@ -54,6 +61,13 @@ Result nsGetReadOnlyApplicationControlDataInterface(Service* srv_out) { return _nsGetSession(&g_nsGetterSrv, srv_out, 7989); } +Result nsGetReadOnlyApplicationRecordInterface(Service* srv_out) { + if (hosversionBefore(5,0,0)) + return MAKERESULT(Module_Libnx, LibnxError_IncompatSysVer); + + return _nsGetSession(&g_nsGetterSrv, srv_out, 7991); +} + Result nsGetECommerceInterface(Service* srv_out) { if (hosversionBefore(4,0,0)) return MAKERESULT(Module_Libnx, LibnxError_IncompatSysVer); @@ -61,6 +75,13 @@ Result nsGetECommerceInterface(Service* srv_out) { return _nsGetSession(&g_nsGetterSrv, srv_out, 7992); } +Result nsGetApplicationVersionInterface(Service* srv_out) { + if (hosversionBefore(4,0,0)) + return MAKERESULT(Module_Libnx, LibnxError_IncompatSysVer); + + return _nsGetSession(&g_nsGetterSrv, srv_out, 7993); +} + Result nsGetFactoryResetInterface(Service* srv_out) { if (hosversionBefore(3,0,0)) return MAKERESULT(Module_Libnx, LibnxError_IncompatSysVer); @@ -68,6 +89,13 @@ Result nsGetFactoryResetInterface(Service* srv_out) { return _nsGetSession(&g_nsGetterSrv, srv_out, 7994); } +Result nsGetAccountProxyInterface(Service* srv_out) { + if (hosversionBefore(3,0,0)) + return MAKERESULT(Module_Libnx, LibnxError_IncompatSysVer); + + return _nsGetSession(&g_nsGetterSrv, srv_out, 7995); +} + Result nsGetApplicationManagerInterface(Service* srv_out) { if (hosversionBefore(3,0,0)) return MAKERESULT(Module_Libnx, LibnxError_IncompatSysVer); @@ -89,6 +117,13 @@ Result nsGetContentManagementInterface(Service* srv_out) { return _nsGetSession(&g_nsGetterSrv, srv_out, 7998); } +Result nsGetDocumentInterface(Service* srv_out) { + if (hosversionBefore(3,0,0)) + return MAKERESULT(Module_Libnx, LibnxError_IncompatSysVer); + + return _nsGetSession(&g_nsGetterSrv, srv_out, 7999); +} + static Result _nsGetSession(Service* srv, Service* srv_out, u32 cmd_id) { return serviceDispatch(srv, cmd_id, .out_num_objects = 1,