ns: Added nsGetDynamicRightsInterface, nsGetReadOnlyApplicationRecordInterface, nsGetApplicationVersionInterface, nsGetAccountProxyInterface, nsGetDocumentInterface.

This commit is contained in:
yellows8 2020-03-03 16:27:44 -05:00
parent f589c95214
commit c85dd5fe2f
No known key found for this signature in database
GPG Key ID: 0AF90DA3F1E60E43
2 changed files with 55 additions and 0 deletions

View File

@ -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

View File

@ -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,