NS services: Difference between revisions

 
(10 intermediate revisions by 2 users not shown)
Line 406: Line 406:
These are "nn::ns::detail::IServiceGetterInterface".
These are "nn::ns::detail::IServiceGetterInterface".


These commands check a state field for a command-specific bit and returns an error if not set, this is likely a permissions check for service+command.
These commands check a state field for a command-specific bit and returns an error if not set, this is a permissions check for service+command.


[11.0.0+] ns:ro was added.
[11.0.0+] ns:ro was added.
Line 414: Line 414:
{| class="wikitable" border="1"
{| class="wikitable" border="1"
|-
|-
! Cmd || Name
! Cmd || Name || Permission bit
|-
| 7988 || [6.0.0+] [[#IDynamicRightsInterface|GetDynamicRightsInterface]] || 10
|-
| 7989 || [5.1.0+] [[#IReadOnlyApplicationControlDataInterface|GetReadOnlyApplicationControlDataInterface]] || 9
|-
| 7991 || [5.0.0+] [[#IReadOnlyApplicationRecordInterface|GetReadOnlyApplicationRecordInterface]] || 8
|-
| 7992 || [4.0.0+] [[#IECommerceInterface|GetECommerceInterface]] || 7
|-
| 7993 || [4.0.0+] [[#IApplicationVersionInterface|GetApplicationVersionInterface]] || 6
|-
| 7994 || [[#IFactoryResetInterface|GetFactoryResetInterface]] || 5
|-
| 7995 || [[#IAccountProxyInterface|GetAccountProxyInterface]] || 4
|-
|-
| 7988 || [6.0.0+] [[#IDynamicRightsInterface|GetDynamicRightsInterface]]
| 7996 || [[#IApplicationManagerInterface|GetApplicationManagerInterface]] || 3
|-
|-
| 7989 || [5.1.0+] [[#IReadOnlyApplicationControlDataInterface|GetReadOnlyApplicationControlDataInterface]]
| 7997 || [[#IDownloadTaskInterface|GetDownloadTaskInterface]] || 1
|-
|-
| 7991 || [5.0.0+] [[#IReadOnlyApplicationRecordInterface|GetReadOnlyApplicationRecordInterface]]
| 7998 || [[#IContentManagementInterface|GetContentManagementInterface]] || 0
|-
|-
| 7992 || [4.0.0+] [[#IECommerceInterface|GetECommerceInterface]]
| 7999 || [[#IDocumentInterface|GetDocumentInterface]] || 2
|}
 
Permissions state field with each service:
 
{| class="wikitable" border="1"
|-
|-
| 7993 || [4.0.0+] [[#IApplicationVersionInterface|GetApplicationVersionInterface]]
! Service || Permissions
|-
|-
| 7994 || [[#IFactoryResetInterface|GetFactoryResetInterface]]
| ns:web || 0x304
|-
|-
| 7995 || [[#IAccountProxyInterface|GetAccountProxyInterface]]
| ns:ec || 0x83
|-
|-
| 7996 || [[#IApplicationManagerInterface|GetApplicationManagerInterface]]
| ns:sweb || 0x387
|-
|-
| 7997 || [[#IDownloadTaskInterface|GetDownloadTaskInterface]]
| ns:rid || 0x10
|-
|-
| 7998 || [[#IContentManagementInterface|GetContentManagementInterface]]
| ns:rt || 0x20
|-
|-
| 7999 || [[#IDocumentInterface|GetDocumentInterface]]
| ns:ro || 0x301
|-
| ns:am2 || 0x7FF
|}
|}


Line 649: Line 670:
|-
|-
| 307 || TerminateOverlayApplet
| 307 || TerminateOverlayApplet
|-
| 308 || [S2]
|-
| 309 || [S2]
|-
|-
| 400 || [[#GetApplicationControlData]]
| 400 || [[#GetApplicationControlData]]
Line 667: Line 692:
|-
|-
| 408 || [8.0.0+] [[#ListApplicationIcon]]
| 408 || [8.0.0+] [[#ListApplicationIcon]]
|-
| 409 || [S2]
|-
| 410 || [S2]
|-
|-
| 411 || [19.0.0+]
| 411 || [19.0.0+]
Line 701: Line 730:
|-
|-
| 427 || [20.0.0+]
| 427 || [20.0.0+]
|-
| 428 || [21.0.0+]
|-
| 429 || [21.0.0+]
|-
| 430 || [21.0.0+]
|-
|-
| 502 || [[#RequestCheckGameCardRegistration]]
| 502 || [[#RequestCheckGameCardRegistration]]
Line 729: Line 764:
|-
|-
| 515 || [20.0.0+]
| 515 || [20.0.0+]
|-
| 516 || [21.0.0+]
|-
| 517 || [21.0.0+]
|-
| 518 || [21.0.0+]
|-
| 519 || [21.0.0+]
|-
|-
| 600 || [[#CountApplicationContentMeta]]
| 600 || [[#CountApplicationContentMeta]]
Line 817: Line 860:
|-
|-
| 923 || [20.0.0+]
| 923 || [20.0.0+]
|-
| 924 || [S2]
|-
| 925 || [S2]
|-
| 926 || [S2]
|-
| 927 || [S2]
|-
|-
| 928 || [20.0.0+]
| 928 || [20.0.0+]
Line 827: Line 878:
|-
|-
| 933 || [20.1.0+]
| 933 || [20.1.0+]
|-
| 934 || [21.0.0+]
|-
| 935 || [21.0.0+]
|-
| 936 || [21.0.0+]
|-
|-
| 1000 || [[#RequestVerifyApplicationDeprecated]]
| 1000 || [[#RequestVerifyApplicationDeprecated]]
Line 1,053: Line 1,110:
|-
|-
| 2368 || [20.0.0+]
| 2368 || [20.0.0+]
|-
| 2369 || [21.0.0+]
|-
|-
| 2400 || [8.0.0+] [[#GetPromotionInfo]]
| 2400 || [8.0.0+] [[#GetPromotionInfo]]
Line 1,132: Line 1,191:
| 3050 || [14.0.0+] ListAssignELicenseTaskResult
| 3050 || [14.0.0+] ListAssignELicenseTaskResult
|-
|-
| 3100 || [17.0.0+] GetSafeSystemVersionCheckInfo
| 3100 || [17.0.0+] [[#GetSafeSystemVersionCheckInfo|GetSafeSystemVersionCheckInfo]]
|-
|-
| 3101 || [17.0.0+] RequestUpdateSafeSystemVersionCheckInfo
| 3101 || [17.0.0+] [[#RequestUpdateSafeSystemVersionCheckInfo|RequestUpdateSafeSystemVersionCheckInfo]]
|-
|-
| 3102 || [17.0.0+] ResetSafeSystemVersionCheckInfo
| 3102 || [17.0.0+] [[#ResetSafeSystemVersionCheckInfo|ResetSafeSystemVersionCheckInfo]]
|-
|-
| 3104 || [18.0.0+] GetApplicationNintendoLogo
| 3104 || [18.0.0+] GetApplicationNintendoLogo
|-
|-
| 3105 || [18.0.0+] GetApplicationStartupMovie
| 3105 || [18.0.0+] GetApplicationStartupMovie
|-
| 3150 || [S2]
|-
|-
| 4000 || [20.0.0+]
| 4000 || [20.0.0+]
Line 1,315: Line 1,376:
|-
|-
| 4097 || [20.0.0+]
| 4097 || [20.0.0+]
|-
| 4099 || [21.0.0+]
|-
|-
| 5000 || [18.0.0+]  
| 5000 || [18.0.0+]  
Line 2,241: Line 2,304:
|-
|-
| 607 || [[#IsAnyApplicationRunning]]
| 607 || [[#IsAnyApplicationRunning]]
|-
| 608 || [21.0.0+]
|}
|}


Line 2,270: Line 2,335:
|-
|-
| 92 || [5.0.0+] GetRunningApplicationProgramId
| 92 || [5.0.0+] GetRunningApplicationProgramId
|-
| 100 || [S2]
|-
| 101 || [S2]
|-
|-
| 2524 || [19.0.0+]  
| 2524 || [19.0.0+]  
|}
|}
==== Cmd100 ====
Takes a type-0x16 output buffer containing a 0x300-byte struct, an input u8, an u64. Returns two output u8s.
==== Cmd101 ====
Takes a type-0x16 output buffer containing a 0x300-byte struct, an input u8, an u64. Returns an output u8, an u8 [[Filesystem_services|ContentAttributes]], and a [[NCM_services#ProgramId|ProgramId]].
This is similar to Cmd2524. On [S2] this is used instead of Cmd2524.
==== Cmd2524 ====
Takes a type-0x16 output buffer containing a 0x300-byte struct, an input u8, an u64. Returns an output u8 [[Filesystem_services|ContentAttributes]] and a [[NCM_services#ProgramId|ProgramId]].
The user-process uses the output from this as the input for [[Filesystem_services|OpenFileSystemWithId]] (out-buffer is used as the [[Filesystem_services|FspPath]]).


=== IDownloadTaskInterface ===
=== IDownloadTaskInterface ===
Line 2,343: Line 2,425:
| 2 || [10.0.0+] IsDataCorruptedResult ||
| 2 || [10.0.0+] IsDataCorruptedResult ||
|-
|-
| 3 || [20.0.0+] ||
| 3 || [20.0.0+] [[#ListApplicationRecord|ListApplicationRecord]] ||
|}
|}


Line 2,365: Line 2,447:
| 4 || [9.0.0+] SelectApplicationDesiredLanguage ||
| 4 || [9.0.0+] SelectApplicationDesiredLanguage ||
|-
|-
| 5 || [19.0.0+] ||
| 5 || [19.0.0+] || Same as [[#IApplicationManagerInterface]] cmd 411
|-
|-
| 6 || [19.0.0+] ||
| 6 || [19.0.0+] || Same as [[#IApplicationManagerInterface]] cmd 416
|-
|-
| 7 || [20.0.0+] ||
| 7 || [20.0.0+] || Same as [[#IApplicationManagerInterface]] cmd 921
|-
|-
| 8 || [20.0.0+] ||
| 8 || [20.0.0+] || Same as [[#IApplicationManagerInterface]] cmd 922
|-
|-
| 9 || [20.0.0+] ||
| 9 || [20.0.0+] || Same as [[#IApplicationManagerInterface]] cmd 923
|-
|-
| 10 || [20.0.0+] ||
| 10 || [20.0.0+] || Same as [[#IApplicationManagerInterface]] cmd 421
|-
|-
| 11 || [20.0.0+] ||
| 11 || [20.0.0+] || Same as [[#IApplicationManagerInterface]] cmd 422
|-
|-
| 12 || [20.0.0+] ||
| 12 || [20.0.0+] || Same as [[#IApplicationManagerInterface]] cmd 423
|-
|-
| 13 || [20.0.0+] ||
| 13 || [20.0.0+] || Same as [[#IApplicationManagerInterface]] cmd 407
|-
|-
| 14 || [20.0.0+] ||
| 14 || [20.0.0+] || Same as [[#IApplicationManagerInterface]] cmd 408
|-
|-
| 15 || [20.0.0+] ||
| 15 || [20.0.0+] || Same as [[#IApplicationManagerInterface]] cmd 415
|-
|-
| 16 || [20.0.0+] ||
| 16 || [20.0.0+] ||
|-
|-
| 17 || [20.1.0+] ||
| 17 || [20.1.0+] || Same as [[#IApplicationManagerInterface]] cmd 933
|-
| 18 || [21.0.0+] ||
|-
| 19 || [21.0.0+] ||
|-
| 20 || [21.0.0+] ||
|-
| 21 || [21.0.0+] ||
|-
| 22 || [21.0.0+] ||
|}
|}


Line 2,454: Line 2,546:
|-
|-
| 28 || [20.0.0+]
| 28 || [20.0.0+]
|-
| 29 || [21.0.0+]
|-
| 30 || [21.0.0+]
|}
|}


Line 2,549: Line 2,645:
|-
|-
| 13 || [20.0.0+]
| 13 || [20.0.0+]
|-
| 14 || [21.0.0+]
|}
|}


Line 2,676: Line 2,774:
| 1202 || [4.0.0+] [[#GetSafeSystemVersion]]
| 1202 || [4.0.0+] [[#GetSafeSystemVersion]]
|-
|-
| 3100 || [18.0.0+]  
| 3100 || [18.0.0+] [[#GetSafeSystemVersionCheckInfo|GetSafeSystemVersionCheckInfo]]
|-
|-
| 3101 || [18.0.0+]  
| 3101 || [18.0.0+] [[#RequestUpdateSafeSystemVersionCheckInfo|RequestUpdateSafeSystemVersionCheckInfo]]
|-
|-
| 3102 || [18.0.0+]  
| 3102 || [18.0.0+] [[#ResetSafeSystemVersionCheckInfo|ResetSafeSystemVersionCheckInfo]]
|}
|}


Line 2,686: Line 2,784:
No input, returns an output u8 bool flag.
No input, returns an output u8 bool flag.


Web-applets use this command to check if the system needs an update.
[S1] Web-applets use this command to check if the system needs an update.


== UpdateSafeSystemVersionForDebug ==
== UpdateSafeSystemVersionForDebug ==
Line 2,700: Line 2,798:
No input, returns an output [[NCM_services#ContentMetaKey|ContentMetaKey]] with the cached contents of "ns_ssversion:/entry" ([[NCM_services#ApplicationId|ApplicationId]], u32 '''version''' and u32 '''policy''' from <code>vulnerability!needs_update_vulnerability_policy</code>).
No input, returns an output [[NCM_services#ContentMetaKey|ContentMetaKey]] with the cached contents of "ns_ssversion:/entry" ([[NCM_services#ApplicationId|ApplicationId]], u32 '''version''' and u32 '''policy''' from <code>vulnerability!needs_update_vulnerability_policy</code>).


== Cmd3100 ==
== GetSafeSystemVersionCheckInfo ==
No input, returns 0x10-bytes of output.
No input, returns 0x10-bytes of output.


== Cmd3101 ==
[S2] Used by web-applets via ns:vm.
 
== RequestUpdateSafeSystemVersionCheckInfo ==
No input, returns an output Event handle and an [[#IAsyncResult|IAsyncResult]].
No input, returns an output Event handle and an [[#IAsyncResult|IAsyncResult]].


== Cmd3102 ==
[S2] Used by web-applets via ns:vm.
 
The async task thread uses [[NIM_services|nim]] RequestCheckSafeSystemVersion, etc.
 
== ResetSafeSystemVersionCheckInfo ==
No input/output.
No input/output.
This throws an error if [[Settings_services|GetDebugModeFlag]] returns false.


= ns:su =
= ns:su =