NS services: Difference between revisions

No edit summary
 
(17 intermediate revisions by 2 users not shown)
Line 349: Line 349:


== ListApplicationRecord ==
== ListApplicationRecord ==
Takes a type-0x6 output buffer containing an array of the below record and an s32 entry_offset, returns an output s32 out_entrycount.
Takes a type-0x6 output buffer containing an array of [[#ApplicationRecord]] and an s32 entry_offset, returns an output s32 out_entrycount.


Returns an array of entries with the below format using the specified offset and count.
Returns an array of entries with the below format using the specified offset and count.
=== Application Record Format ===
{| class="wikitable" border="1"
|-
! Offset
! Size
! Description
|-
| 0x0
| 0x8
| [[NCM_services#ApplicationId|ApplicationId]]
|-
| 0x8
| 0x1
| Type? (Known values: 0x2=Installing?, 0x3=Installed / Gamecard inserted, 0x5=Gamecard not inserted, 0xB=Archived)
|-
| 0x9
| 0x1
| Unknown, usually 0x02
|-
| 0xA
| 0x6
| Unknown, usually zeros?
|-
| 0x10
| 0x1
| Unknown, seems to change between reboots and removing/reinserting gamecards
|-
| 0x11
| 0x7
| Unknown, usually zeros?
|}


== LaunchApplication ==
== LaunchApplication ==
Line 429: Line 397:


Loads cached [[control.nacp]] to buf+0 and the cached icon to buf+0x4000. Returns an error if the buffer is too small.
Loads cached [[control.nacp]] to buf+0 and the cached icon to buf+0x4000. Returns an error if the buffer is too small.
=== ApplicationControlSource ===
{| class="wikitable" border="1"
|-
! Value
! Description
|-
| 0x0
| CacheOnly (Returns data from cache)
|-
| 0x1
| Storage (Returns data from storage if not present in cache)
|-
| 0x2
| StorageOnly (Returns data from storage without using cache)
|}


== ListApplicationContentMetaStatus ==
== ListApplicationContentMetaStatus ==
Takes a type-0x6 output buffer containing an array of the below entries, an input s32 index and [[NCM_services#ApplicationId|ApplicationId]], returns an output s32 out_entrycount.
Takes a type-0x6 output buffer containing an array of [[#ApplicationContentMetaStatus]], an input s32 index and [[NCM_services#ApplicationId|ApplicationId]], returns an output s32 out_entrycount.


Returns 0x10-byte entries using the specified [[NCM_services#ApplicationId|ApplicationId]] starting at the specified index. Can only return game titles. The second entry if any is the update-title usually. When the input entryindex is >= totalentries, this will return 0 with out_entrycount=0.
Returns 0x10-byte entries using the specified [[NCM_services#ApplicationId|ApplicationId]] starting at the specified index. Can only return game titles. The second entry if any is the update-title usually. When the input entryindex is >= totalentries, this will return 0 with out_entrycount=0.


Entry structure:
= ns:am2, ns:ec, ns:rid, ns:rt, ns:web, ns:ro, ns:sweb =
{| class="wikitable" border="1"
These are "nn::ns::detail::IServiceGetterInterface".
|-
 
! Offset
! Size
! Description
|-
| 0x0
| 0x1
| [[NCM_services#ContentMetaType|ContentMetaType]] ("type")
|-
| 0x1
| 0x1
| [[NCM_services#StorageId|StorageId]] ("installedStorage")
|-
| 0x2
| 0x1
| Unknown. Non-zero with output from cmd 605, differs for app/update titles.
|-
| 0x3
| 0x1
| Padding
|-
| 0x4
| 0x4
| Version
|-
| 0x8
| 0x8
| [[NCM_services#ApplicationId|ApplicationId]]
|}
 
= ns:am2, ns:ec, ns:rid, ns:rt, ns:web, ns:ro, ns:sweb =
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 likely a permissions check for service+command.


Line 742: Line 662:
| 405 || ListApplicationControlCacheEntryInfo
| 405 || ListApplicationControlCacheEntryInfo
|-
|-
| 406 || [6.0.0+] [[#GetApplicationControlProperty]]
| 406 || [6.0.0-18.1.0] [[#GetApplicationControlProperty]]
|-
|-
| 407 || [8.0.0+] [[#ListApplicationTitle]]
| 407 || [8.0.0+] [[#ListApplicationTitle]]
Line 748: Line 668:
| 408 || [8.0.0+] [[#ListApplicationIcon]]
| 408 || [8.0.0+] [[#ListApplicationIcon]]
|-
|-
| 502 || [[#RequestCheckGameCardRegistration]]
| 411 || [19.0.0+]
|-
|-
| 503 || [[#RequestGameCardRegistrationGoldPoint]]
| 412 || [19.0.0+]
|-
|-
| 504 || [[#RequestRegisterGameCard]]
| 413 || [19.0.0+]
|-
|-
| 505 || [3.0.0+] [[#GetGameCardMountFailureEvent]]
| 414 || [19.0.0+]
|-
|-
| 506 || [3.0.0+] [[#IsGameCardInserted]]
| 415 || [19.0.0+]
|-
|-
| 507 || [3.0.0+] [[#EnsureGameCardAccess]]
| 416 || [19.0.0+]
|-
|-
| 508 || [3.0.0+] [[#GetLastGameCardMountFailureResult]]
| 417 || [19.0.0+] InvalidateAllApplicationControlCacheOfTheStage
|-
|-
| 509 || [5.0.0+] [[#ListApplicationIdOnGameCard]]
| 418 || [19.0.0+] InvalidateApplicationControlCacheOfTheStage
|-
|-
| 510 || [9.0.0+] [[#GetGameCardPlatformRegion]]
| 419 || [19.0.0+] RequestDownloadApplicationControlDataInBackground
|-
|-
| 600 || [[#CountApplicationContentMeta]]
| 420 || [19.0.0+] CloneApplicationControlDataCacheForDebug
|-
|-
| 601 || [[#ListApplicationContentMetaStatus]]
| 421 || [20.0.0+]
|-
|-
| 602 || [2.0.0-5.1.0] ListAvailableAddOnContent
| 422 || [20.0.0+]
|-
|-
| 603 || GetOwnedApplicationContentMetaStatus
| 423 || [20.0.0+]
|-
| 424 || [20.0.0+]
|-
| 425 || [20.0.0+]
|-
| 426 || [20.0.0+]
|-
| 427 || [20.0.0+]
|-
| 502 || [[#RequestCheckGameCardRegistration]]
|-
| 503 || [[#RequestGameCardRegistrationGoldPoint]]
|-
| 504 || [[#RequestRegisterGameCard]]
|-
| 505 || [3.0.0+] [[#GetGameCardMountFailureEvent]]
|-
| 506 || [3.0.0+] [[#IsGameCardInserted]]
|-
| 507 || [3.0.0+] [[#EnsureGameCardAccess]]
|-
| 508 || [3.0.0+] [[#GetLastGameCardMountFailureResult]]
|-
| 509 || [5.0.0+] [[#ListApplicationIdOnGameCard]]
|-
| 510 || [9.0.0+] [[#GetGameCardPlatformRegion]]
|-
| 511 || [19.0.0+] GetGameCardWakenReadyEvent
|-
| 512 || [19.0.0+] IsGameCardApplicationRunning
|-
| 513 || [20.0.0+]
|-
| 514 || [20.0.0+]
|-
| 515 || [20.0.0+]
|-
| 600 || [[#CountApplicationContentMeta]]
|-
| 601 || [[#ListApplicationContentMetaStatus]]
|-
| 602 || [2.0.0-5.1.0] ListAvailableAddOnContent
|-
| 603 || GetOwnedApplicationContentMetaStatus
|-
|-
| 604 || [1.0.0-15.0.1] RegisterContentsExternalKey
| 604 || [1.0.0-15.0.1] RegisterContentsExternalKey
Line 840: Line 804:
| 916 || [11.0.0+] IsApplicationAutoDeleteDisabled
| 916 || [11.0.0+] IsApplicationAutoDeleteDisabled
|-
|-
| 1000 || [[#RequestVerifyApplicationDeprecated]]
| 917 || [20.0.0+]
|-
|-
| 1001 || CorruptApplicationForDebug
| 918 || [20.0.0+]
|-
|-
| 1002 || [3.0.0-9.2.0] [[#RequestVerifyAddOnContentsRights]]
| 919 || [20.0.0+]
|-
|-
| 1003 || [5.0.0+] [[#RequestVerifyApplication]]
| 920 || [20.0.0+]
|-
|-
| 1004 || [5.0.0+] CorruptContentForDebug
| 921 || [20.0.0+]
|-
| 922 || [20.0.0+]
|-
| 923 || [20.0.0+]
|-
| 928 || [20.0.0+]
|-
| 929 || [20.0.0+]
|-
| 930 || [20.0.0+]
|-
| 931 || [20.0.0+]
|-
| 933 || [20.1.0+]
|-
| 1000 || [[#RequestVerifyApplicationDeprecated]]
|-
| 1001 || CorruptApplicationForDebug
|-
| 1002 || [3.0.0-9.2.0] [[#RequestVerifyAddOnContentsRights]]
|-
| 1003 || [5.0.0+] [[#RequestVerifyApplication]]
|-
| 1004 || [5.0.0+] CorruptContentForDebug
|-
|-
| 1200 || [[#NeedsUpdateVulnerability]]
| 1200 || [[#NeedsUpdateVulnerability]]
Line 889: Line 877:
|-
|-
| 1506 || [9.0.0+] GetSdCardStartupStatus
| 1506 || [9.0.0+] GetSdCardStartupStatus
|-
| 1508 || [20.0.0+]
|-
| 1509 || [20.0.0+]
|-
| 1510 || [20.0.0+]
|-
| 1511 || [20.0.0+]
|-
| 1512 || [20.0.0+]
|-
|-
| 1600 || GetSystemSeedForPseudoDeviceId
| 1600 || GetSystemSeedForPseudoDeviceId
Line 905: Line 903:
|-
|-
| 1705 || [11.0.0+] [[#IsPatchAutoDeletableApplication]]
| 1705 || [11.0.0+] [[#IsPatchAutoDeletableApplication]]
|-
| 1706 || [20.0.0+]
|-
|-
| 1800 || IsNotificationSetupCompleted
| 1800 || IsNotificationSetupCompleted
Line 910: Line 910:
| 1801 || GetLastNotificationInfoCount
| 1801 || GetLastNotificationInfoCount
|-
|-
| 1802 || ListLastNotificationInfo
| 1802 || [[#ListLastNotificationInfo]]
|-
|-
| 1803 || [3.0.0+] ListNotificationTask
| 1803 || [3.0.0+] [[#ListNotificationTask]]
|-
|-
| 1900 || [3.0.0-12.1.0] IsActiveAccount
| 1900 || [3.0.0-12.1.0] IsActiveAccount
Line 959: Line 959:
|-
|-
| 2018 || [5.0.0+] [[#GetApplicationDeliveryInfoHash]]
| 2018 || [5.0.0+] [[#GetApplicationDeliveryInfoHash]]
|-
| 2019 || [20.0.0+]
|-
|-
| 2050 || [6.0.0+] [[#GetApplicationRightsOnClient]]
| 2050 || [6.0.0+] [[#GetApplicationRightsOnClient]]
|-
|-
| 2051 || [9.0.0+] InvalidateRightsIdCache
| 2051 || [9.0.0+] InvalidateRightsIdCache
|-
| 2052 || [20.0.0+]
|-
| 2053 || [20.0.0+]
|-
|-
| 2100 || [6.0.0+] [[#GetApplicationTerminateResult]]
| 2100 || [6.0.0+] [[#GetApplicationTerminateResult]]
Line 995: Line 1,001:
|-
|-
| 2182 || [6.0.0+] SetActiveRightsContextUsingStateToRightsEnvironment
| 2182 || [6.0.0+] SetActiveRightsContextUsingStateToRightsEnvironment
|-
| 2183 || [20.1.0+]
|-
|-
| 2190 || [6.0.0+] [[#GetRightsEnvironmentHandleForApplication]]
| 2190 || [6.0.0+] [[#GetRightsEnvironmentHandleForApplication]]
Line 1,027: Line 1,035:
|-
|-
| 2359 || [15.0.0+] IsMultiCoreDownloadEnabled
| 2359 || [15.0.0+] IsMultiCoreDownloadEnabled
|-
| 2360 || [19.0.0+] GetApplicationDownloadTaskCount
|-
| 2361 || [19.0.0+] GetMaxApplicationDownloadTaskCount
|-
| 2362 || [20.0.0+]
|-
| 2363 || [20.0.0+]
|-
| 2364 || [20.0.0+]
|-
| 2365 || [20.0.0+]
|-
| 2366 || [20.0.0+]
|-
| 2367 || [20.0.0+]
|-
| 2368 || [20.0.0+]
|-
|-
| 2400 || [8.0.0+] [[#GetPromotionInfo]]
| 2400 || [8.0.0+] [[#GetPromotionInfo]]
Line 1,032: Line 1,058:
| 2401 || [8.0.0+] CountPromotionInfo
| 2401 || [8.0.0+] CountPromotionInfo
|-
|-
| 2402 || [8.0.0+] ListPromotionInfo
| 2402 || [8.0.0+] [[#ListPromotionInfo|ListPromotionInfo]]
|-
|-
| 2403 || [8.0.0+] [[#ImportPromotionJsonForDebug]]
| 2403 || [8.0.0+] [[#ImportPromotionJsonForDebug]]
Line 1,065: Line 1,091:
|-
|-
| 2523 || [17.0.0+] GetProgramId
| 2523 || [17.0.0+] GetProgramId
|-
| 2524 || [19.0.0+]
|-
| 2525 || [20.0.0+]
|-
|-
| 2800 || [9.0.0+] GetApplicationIdOfPreomia
| 2800 || [9.0.0+] GetApplicationIdOfPreomia
Line 1,098: Line 1,128:
| 3014 || [11.0.0+] [[#IsLocalContentShareEnabled]]
| 3014 || [11.0.0+] [[#IsLocalContentShareEnabled]]
|-
|-
| 3015 || [18.0.0+]  
| 3015 || [18.0.0+] GetNetworkUpdateRequiredByGameCardDetectionEvent
|-
|-
| 3050 || [14.0.0+] ListAssignELicenseTaskResult
| 3050 || [14.0.0+] ListAssignELicenseTaskResult
Line 1,108: Line 1,138:
| 3102 || [17.0.0+] ResetSafeSystemVersionCheckInfo
| 3102 || [17.0.0+] ResetSafeSystemVersionCheckInfo
|-
|-
| 3104 || [18.0.0+]  
| 3104 || [18.0.0+] GetApplicationNintendoLogo
|-
|-
| 3105 || [18.0.0+]  
| 3105 || [18.0.0+] GetApplicationStartupMovie
|-
|-
| 5000 || [18.0.0+]  
| 4000 || [20.0.0+]
|-
|-
| 5001 || [18.0.0+]  
| 4004 || [20.0.0+]
|-
|-
| 9999 || [10.0.0-10.2.0] GetApplicationCertificate
| 4006 || [20.0.0+]
|}
|-
 
| 4007 || [20.0.0+]
[4.0.0+] RequestDownloadAddOnContent now takes an additional 8-bytes of input.
|-
 
| 4008 || [20.0.0+]
==== GetApplicationRecordUpdateSystemEvent ====
|-
No input, returns an output Event handle with EventClearMode=1.
| 4009 || [20.0.0+]
 
|-
==== GetApplicationViewDeprecated ====
| 4010 || [20.0.0+]
Takes a type-0x6 output buffer containing an array of [[#ApplicationViewDeprecated]], a type-0x5 input buffer containing an array of u64 [[NCM_services#ApplicationId|ApplicationIds]], no output.
|-
 
| 4011 || [20.0.0+]
On newer system-versions this is the same as [[#GetApplicationView]], except this converts the output from the func called in the loop from [[#ApplicationView]] to [[#ApplicationViewDeprecated]].
|-
 
| 4012 || [20.0.0+]
==== DeleteApplicationEntity ====
|-
Takes an input [[NCM_services#ApplicationId|ApplicationId]], no output.
| 4013 || [20.0.0+]
 
|-
==== DeleteApplicationCompletely ====
| 4015 || [20.0.0+]
Takes an input [[NCM_services#ApplicationId|ApplicationId]], no output.
|-
 
| 4017 || [20.0.0+]
==== DeleteRedundantApplicationEntity ====
|-
No input/output.
| 4019 || [20.0.0+]
 
|-
==== IsApplicationEntityMovable ====
| 4020 || [20.0.0+]
Takes an input u8 [[NCM_services#StorageId|StorageId]], an [[NCM_services#ApplicationId|ApplicationId]], returns an output u8 bool.
|-
 
| 4021 || [20.0.0+]
==== MoveApplicationEntity ====
|-
Takes an input u8 [[NCM_services#StorageId|StorageId]], an [[NCM_services#ApplicationId|ApplicationId]], no output.
| 4022 || [20.0.0+]
 
|-
==== RequestApplicationUpdateInfo ====
| 4023 || [20.0.0+]
Takes an input [[NCM_services#ApplicationId|ApplicationId]], returns an output Event handle and an [[#IAsyncValue]].
|-
 
| 4024 || [20.0.0+]
The data that can be read from the [[#IAsyncValue]] is [[#ApplicationUpdateInfo]].
|-
 
| 4025 || [20.0.0+]
Before using the cmd, official sw uses [[Network_Interface_services#IsAnyInternetRequestAccepted|IsAnyInternetRequestAccepted]] with the output from [[Network_Interface_services#GetClientId|GetClientId]], throwing an error when the returned bool is false.
|-
 
| 4026 || [20.0.0+]
==== CancelApplicationDownload ====
|-
Takes an input [[NCM_services#ApplicationId|ApplicationId]], no output.
| 4027 || [20.0.0+]
 
|-
==== ResumeApplicationDownload ====
| 4028 || [20.0.0+]
Takes an input [[NCM_services#ApplicationId|ApplicationId]], no output.
|-
 
| 4029 || [20.0.0+]
==== CheckApplicationLaunchVersion ====
|-
Takes an input [[NCM_services#ApplicationId|ApplicationId]], no output.
| 4030 || [20.0.0+]
 
|-
==== CalculateApplicationDownloadRequiredSize ====
| 4031 || [20.0.0+]
Takes an input u8 [[NCM_services#StorageId|StorageId]], an [[NCM_services#ApplicationId|ApplicationId]], returns an output s64.
|-
 
| 4032 || [20.0.0+]
==== CleanupSdCard ====
|-
No input/output.
| 4033 || [20.0.0+]
 
|-
==== GetSdCardMountStatusChangedEvent ====
| 4034 || [20.0.0+]
No input, returns an output Event handle with EventClearMode=0.
|-
 
| 4035 || [20.0.0+]
==== GetGameCardUpdateDetectionEvent ====
|-
No input, returns an output Event handle with EventClearMode=0.
| 4037 || [20.0.0+]
 
|-
==== DisableApplicationAutoDelete ====
| 4038 || [20.0.0+]
Takes an input [[NCM_services#ApplicationId|ApplicationId]], no output.
|-
 
| 4039 || [20.0.0+]
==== EnableApplicationAutoDelete ====
|-
Takes an input [[NCM_services#ApplicationId|ApplicationId]], no output.
| 4040 || [20.0.0+]
|-
| 4041 || [20.0.0+]
|-
| 4042 || [20.0.0+]
|-
| 4043 || [20.0.0+]
|-
| 4044 || [20.0.0+]
|-
| 4045 || [20.0.0+]
|-
| 4046 || [20.0.0+]
|-
| 4049 || [20.0.0+]
|-
| 4050 || [20.0.0+]
|-
| 4051 || [20.0.0+]
|-
| 4052 || [20.0.0+]
|-
| 4053 || [20.0.0+]
|-
| 4054 || [20.0.0+]
|-
| 4055 || [20.0.0+]
|-
| 4056 || [20.0.0+]
|-
| 4057 || [20.0.0+]
|-
| 4058 || [20.0.0+]
|-
| 4059 || [20.0.0+]
|-
| 4060 || [20.0.0+]
|-
| 4061 || [20.0.0+]
|-
| 4062 || [20.0.0+]
|-
| 4063 || [20.0.0+]
|-
| 4064 || [20.0.0+]
|-
| 4065 || [20.0.0+]
|-
| 4066 || [20.0.0+]
|-
| 4067 || [20.0.0+]
|-
| 4068 || [20.0.0+]
|-
| 4069 || [20.0.0+]
|-
| 4070 || [20.0.0+]
|-
| 4071 || [20.0.0+]
|-
| 4072 || [20.0.0+]
|-
| 4073 || [20.0.0+]
|-
| 4074 || [20.0.0+]
|-
| 4075 || [20.0.0+]
|-
| 4076 || [20.0.0+]
|-
| 4077 || [20.0.0+]
|-
| 4078 || [20.0.0+]
|-
| 4079 || [20.0.0+]
|-
| 4080 || [20.0.0+]
|-
| 4081 || [20.0.0+]
|-
| 4083 || [20.0.0+]
|-
| 4084 || [20.0.0+]
|-
| 4085 || [20.0.0+]
|-
| 4086 || [20.0.0+]
|-
| 4087 || [20.0.0+]
|-
| 4088 || [20.0.0+]
|-
| 4089 || [20.0.0+]
|-
| 4090 || [20.0.0+]
|-
| 4091 || [20.0.0+]
|-
| 4092 || [20.0.0+]
|-
| 4093 || [20.0.0+]
|-
| 4094 || [20.0.0+]
|-
| 4095 || [20.0.0+]
|-
| 4096 || [20.0.0+]
|-
| 4097 || [20.0.0+]
|-
| 5000 || [18.0.0+]
|-
| 5001 || [18.0.0+]  
|-
| 9999 || [10.0.0-10.2.0] GetApplicationCertificate
|}


==== SetApplicationTerminateResult ====
[4.0.0+] RequestDownloadAddOnContent now takes an additional 8-bytes of input.
Takes an input u32 Result, an [[NCM_services#ApplicationId|ApplicationId]], no output.


==== ClearApplicationTerminateResult ====
==== GetApplicationRecordUpdateSystemEvent ====
Takes an input [[NCM_services#ApplicationId|ApplicationId]], no output.
No input, returns an output Event handle with EventClearMode=1.


==== GetLastSdCardMountUnexpectedResult ====
==== GetApplicationViewDeprecated ====
No input/output.
Takes a type-0x6 output buffer containing an array of [[#ApplicationViewDeprecated]], a type-0x5 input buffer containing an array of u64 [[NCM_services#ApplicationId|ApplicationIds]], no output.


==== GetRequestServerStopper ====
On newer system-versions this is the same as [[#GetApplicationView]], except this converts the output from the func called in the loop from [[#ApplicationView]] to [[#ApplicationViewDeprecated]].
No input, returns an output [[#IRequestServerStopper]].


==== CancelApplicationApplyDelta ====
==== DeleteApplicationEntity ====
Takes an input [[NCM_services#ApplicationId|ApplicationId]], no output.
Takes an input [[NCM_services#ApplicationId|ApplicationId]], no output.


==== ResumeApplicationApplyDelta ====
==== DeleteApplicationCompletely ====
Takes an input [[NCM_services#ApplicationId|ApplicationId]], no output.
Takes an input [[NCM_services#ApplicationId|ApplicationId]], no output.


==== CalculateApplicationApplyDeltaRequiredSize ====
==== DeleteRedundantApplicationEntity ====
Takes an input u8 [[NCM_services#StorageId|StorageId]], an [[NCM_services#ApplicationId|ApplicationId]], returns an output s64.
 
==== ResumeAll ====
No input/output.
No input/output.


==== GetStorageSize ====
==== IsApplicationEntityMovable ====
Takes an input u8 [[NCM_services#StorageId|StorageId]], returns two output s64s.
Takes an input u8 [[NCM_services#StorageId|StorageId]], an [[NCM_services#ApplicationId|ApplicationId]], returns an output u8 bool.


This temporarily mounts the [[Filesystem_services#OpenContentStorageFileSystem|ContentStorage]] specified by the StorageId (must be BuiltInUser or SdCard). The two output s64s are the output from [[Filesystem_services#GetTotalSpaceSize|GetTotalSpaceSize]] and [[Filesystem_services#GetFreeSpaceSize|GetFreeSpaceSize]] with this ContentStorage, with it this being unmounted afterwards.
==== MoveApplicationEntity ====
Takes an input u8 [[NCM_services#StorageId|StorageId]], an [[NCM_services#ApplicationId|ApplicationId]], no output.


==== RequestUpdateApplication2 ====
==== RequestApplicationUpdateInfo ====
Takes an input [[NCM_services#ApplicationId|ApplicationId]], returns an output Event handle and an [[#IAsyncResult]].
Takes an input [[NCM_services#ApplicationId|ApplicationId]], returns an output Event handle and an [[#IAsyncValue]].


See [[#RequestApplicationUpdateInfo]] regarding nifm.
The data that can be read from the [[#IAsyncValue]] is [[#ApplicationUpdateInfo]].


==== LaunchApplication ====
Before using the cmd, official sw uses [[Network_Interface_services#IsAnyInternetRequestAccepted|IsAnyInternetRequestAccepted]] with the output from [[Network_Interface_services#GetClientId|GetClientId]], throwing an error when the returned bool is false.
Takes an input u8 ProgramIndex, an input [[#ApplicationLaunchInfo]], returns an output u64.


[18.0.0+] Now takes a total of 0x58 bytes of input.
==== CancelApplicationDownload ====
Takes an input [[NCM_services#ApplicationId|ApplicationId]], no output.


==== GetApplicationLaunchInfo ====
==== ResumeApplicationDownload ====
Takes an input [[NCM_services#ApplicationId|ApplicationId]], returns an output [[#ApplicationLaunchInfo]].
Takes an input [[NCM_services#ApplicationId|ApplicationId]], no output.


[18.0.0+] Now returns a total of 0x50 bytes of output.
==== CheckApplicationLaunchVersion ====
Takes an input [[NCM_services#ApplicationId|ApplicationId]], no output.


==== AcquireApplicationLaunchInfo ====
==== CalculateApplicationDownloadRequiredSize ====
Takes an input [[NCM_services#ApplicationId|ApplicationId]], returns an output [[#ApplicationLaunchInfo]].
Takes an input u8 [[NCM_services#StorageId|StorageId]], an [[NCM_services#ApplicationId|ApplicationId]], returns an output s64.


This verifies that a state flag is set and that a state field matches the input ApplicationId, throwing an error otherwise. The [[#ApplicationLaunchInfo]] from state is copied to output, then the state flag is cleared.
==== CleanupSdCard ====
No input/output.


[18.0.0+] Now returns a total of 0x50 bytes of output.
==== GetSdCardMountStatusChangedEvent ====
No input, returns an output Event handle with EventClearMode=0.


==== GetMainApplicationProgramIndexByApplicationLaunchInfo ====
==== GetGameCardUpdateDetectionEvent ====
[18.0.0+] Now takes a total of 0x50 bytes of input.
No input, returns an output Event handle with EventClearMode=0.


==== LaunchDevMenu ====
==== DisableApplicationAutoDelete ====
No input/output.
Takes an input [[NCM_services#ApplicationId|ApplicationId]], no output.


This is used by AM cmd [[Applet_Manager_services#LaunchDevMenu|LaunchDevMenu]].
==== EnableApplicationAutoDelete ====
Takes an input [[NCM_services#ApplicationId|ApplicationId]], no output.


This loads ProgramIds from [[System_Settings|system-settings]] <code>ns.applet!devmenu_id</code> and <code>ns.applet!devoverlaydisp_id</code>, which only exists on devunits. An error is thrown if loading these fail.
==== SetApplicationTerminateResult ====
Takes an input u32 Result, an [[NCM_services#ApplicationId|ApplicationId]], no output.


[[NCM_services#ncm|OpenContentMetaDatabase]] is used with StorageId = NandSystem, then IContentMetaDatabase GetLatestContentMetaKey is used with both of the above ProgramIds to verify that the cmd is successful.
==== ClearApplicationTerminateResult ====
Takes an input [[NCM_services#ApplicationId|ApplicationId]], no output.


Then if the above succeeds, the above titles are launched with the above StorageId via [[Process_Manager_services|pmshell]] LaunchProgram ([10.0.0+] [[PGL_services#LaunchProgram|pgl]] with pgl_launch_flags=0), with a 0.5s sleep-thread afterwards on success. [[Process_Manager_services#LaunchFlags|LaunchFlags]] value 0xB is used here.
==== GetLastSdCardMountUnexpectedResult ====
No input/output.


==== DeleteUserSaveDataAll ====
==== GetRequestServerStopper ====
Takes an input [[Account_services#Uid|Uid]], returns an output [[#IProgressMonitorForDeleteUserSaveDataAll]].
No input, returns an output [[#IRequestServerStopper]].


On success, [[#IProgressMonitorForDeleteUserSaveDataAll]] GetProgress is used with the output being copied into object state.
==== CancelApplicationApplyDelta ====
Takes an input [[NCM_services#ApplicationId|ApplicationId]], no output.


==== DeleteUserSystemSaveData ====
==== ResumeApplicationApplyDelta ====
Takes an input [[Account_services#Uid|Uid]], an u64 SystemSaveDataId, no output.
Takes an input [[NCM_services#ApplicationId|ApplicationId]], no output.


==== DeleteSaveData ====
==== CalculateApplicationApplyDeltaRequiredSize ====
Takes an input u8 [[Filesystem_services#SaveDataSpaceId|SaveDataSpaceId]], an u64 SaveDataId, no output.
Takes an input u8 [[NCM_services#StorageId|StorageId]], an [[NCM_services#ApplicationId|ApplicationId]], returns an output s64.


==== UnregisterNetworkServiceAccount ====
==== ResumeAll ====
Takes an input [[Account_services#Uid|Uid]], no output.
No input/output.


==== UnregisterNetworkServiceAccountWithUserSaveDataDeletion ====
==== GetStorageSize ====
Takes an input [[Account_services#Uid|Uid]], no output.
Takes an input u8 [[NCM_services#StorageId|StorageId]], returns two output s64s.


==== LaunchLibraryApplet ====
This temporarily mounts the [[Filesystem_services#OpenContentStorageFileSystem|ContentStorage]] specified by the StorageId (must be BuiltInUser or SdCard). The two output s64s are the output from [[Filesystem_services#GetTotalSpaceSize|GetTotalSpaceSize]] and [[Filesystem_services#GetFreeSpaceSize|GetFreeSpaceSize]] with this ContentStorage, with it this being unmounted afterwards.
Takes an input u64 [[NCM_services#ProgramId|ProgramId]], returns an output u64.


The specified program is launched with StorageId=BuiltInSystem via [[Process_Manager_services|pmshell]] LaunchProgram ([10.0.0+] [[PGL_services#LaunchProgram|pgl]] with pgl_launch_flags=0). [[Process_Manager_services#LaunchFlags|LaunchFlags]] value 0x9 is used here. The output u64 from here is written to the output for this cmd, on success.
==== RequestUpdateApplication2 ====
Takes an input [[NCM_services#ApplicationId|ApplicationId]], returns an output Event handle and an [[#IAsyncResult]].


This is used by [[Applet_Manager_services|AM]].
See [[#RequestApplicationUpdateInfo]] regarding nifm.


==== LaunchSystemApplet ====
==== LaunchApplication ====
No input, returns an output u64.
Takes an input u8 ProgramIndex, an input [[#ApplicationLaunchInfo]], returns an output u64.


A state flag must be non-zero, otherwise an error is thrown. When a state field is value 1, a hard-coded ProgramId for MaintenanceMenu is used. Otherwise, the ProgramId is loaded from [[System_Settings|system-setting]] <code>ns.applet!system_applet_id</code>.
[18.0.0+] Now takes a total of 0x58 bytes of input.


The SystemApplet is launched with StorageId=BuiltInSystem via [[Process_Manager_services|pmshell]] LaunchProgram ([10.0.0+] [[PGL_services#LaunchProgram|pgl]] with pgl_launch_flags=0). [[Process_Manager_services#LaunchFlags|LaunchFlags]] value 0x9 is used here. The output u64 from here is written to the output for this cmd, on success.
[19.0.0+] Now takes a total of 0x88 bytes of input.


This is used by [[Applet_Manager_services|AM]].
==== GetApplicationLaunchInfo ====
Takes an input [[NCM_services#ApplicationId|ApplicationId]], returns an output [[#ApplicationLaunchInfo]].


==== LaunchOverlayApplet ====
[18.0.0+] Now returns a total of 0x50 bytes of output.
No input, returns an output u64.


A state flag must be non-zero, otherwise an error is thrown. The ProgramId is loaded from [[System_Settings|system-setting]] <code>ns.applet!overlay_applet_id</code>.
[19.0.0+] Now returns a total of 0x80 bytes of output.


The OverlayApplet is launched with StorageId=BuiltInSystem via [[Process_Manager_services|pmshell]] LaunchProgram ([10.0.0+] [[PGL_services#LaunchProgram|pgl]] with pgl_launch_flags=0). [[Process_Manager_services#LaunchFlags|LaunchFlags]] value 0x9 is used here. The output u64 from here is written to the output for this cmd, on success.
==== AcquireApplicationLaunchInfo ====
Takes an input [[NCM_services#ApplicationId|ApplicationId]], returns an output [[#ApplicationLaunchInfo]].


This is used by [[Applet_Manager_services|AM]].
This verifies that a state flag is set and that a state field matches the input ApplicationId, throwing an error otherwise. The [[#ApplicationLaunchInfo]] from state is copied to output, then the state flag is cleared.


==== RequestDownloadApplicationControlData ====
[18.0.0+] Now returns a total of 0x50 bytes of output.
Takes an input [[NCM_services#ApplicationId|ApplicationId]], returns an output Event handle and an [[#IAsyncResult]].


See [[#RequestApplicationUpdateInfo]] regarding nifm.
[19.0.0+] Now returns a total of 0x80 bytes of output.


==== GetApplicationControlProperty ====
==== GetMainApplicationProgramIndexByApplicationLaunchInfo ====
[18.0.0+] Now takes a total of 0x58 bytes of input.
[18.0.0+] Now takes a total of 0x50 bytes of input.


==== ListApplicationTitle ====
[19.0.0+] Now returns a total of 0x80 bytes of output.
Takes an input TransferMemory handle, a type-0x5 input buffer containing an array of u64 [[NCM_services#ApplicationId|ApplicationIds]], an u8 [[#ApplicationControlSource]], an u64 size, returns an output Event handle and an [[#IAsyncValue]].


[[qlaunch]] uses value 0x1 for the u8.
==== LaunchDevMenu ====
No input/output.


The user-process creates the TransferMemory with permissions=R--.
This is used by AM cmd [[Applet_Manager_services#LaunchDevMenu|LaunchDevMenu]].


The data available with [[#IAsyncValue]] Get is a s32 for the offset within the TransferMemory where the output data is located, GetSize returns the total byte-size of the data located here. The data located here is the [[NACP_Format|NACP]] title-entry for each specified ApplicationId.
This loads ProgramIds from [[System_Settings|system-settings]] <code>ns.applet!devmenu_id</code> and <code>ns.applet!devoverlaydisp_id</code>, which only exists on devunits. An error is thrown if loading these fail.


The TransferMemory size must be at least: count*sizeof([[NACP_Format|title-entry]]) + count*sizeof(u64) + count*[[#GetApplicationControlData|0x24000]].
[[NCM_services#ncm|OpenContentMetaDatabase]] is used with StorageId = NandSystem, then IContentMetaDatabase GetLatestContentMetaKey is used with both of the above ProgramIds to verify that the cmd is successful.


This is essentially an async wrapper for [[#GetApplicationControlData]], with support for multiple ApplicationIds.
Then if the above succeeds, the above titles are launched with the above StorageId via [[Process_Manager_services|pmshell]] LaunchProgram ([10.0.0+] [[PGL_services#LaunchProgram|pgl]] with pgl_launch_flags=0), with a 0.5s sleep-thread afterwards on success. [[Process_Manager_services#LaunchFlags|LaunchFlags]] value 0xB is used here.


==== ListApplicationIcon ====
==== DeleteUserSaveDataAll ====
Takes an input TransferMemory handle, a type-0x5 input buffer containing an array of u64 [[NCM_services#ApplicationId|ApplicationIds]], an u8 [[#ApplicationControlSource]], an u64 size, returns an output Event handle and an [[#IAsyncValue]].
Takes an input [[Account_services#Uid|Uid]], returns an output [[#IProgressMonitorForDeleteUserSaveDataAll]].


The user-process creates the TransferMemory with permissions=R--.
On success, [[#IProgressMonitorForDeleteUserSaveDataAll]] GetProgress is used with the output being copied into object state.


The data available with [[#IAsyncValue]] Get is a s32 for the offset within the TransferMemory where the output data is located, GetSize returns the total byte-size of the data located here. This data is: an u64 for total entries, an array of u64s for each icon size, then the icon JPEGs for the specified ApplicationIds.
==== DeleteUserSystemSaveData ====
Takes an input [[Account_services#Uid|Uid]], an u64 SystemSaveDataId, no output.


The TransferMemory size must be at least: 0x4 + count*sizeof(u64) + count*[[#GetApplicationControlData|0x20000]] + count*sizeof(u64) + [[#GetApplicationControlData|0x24000]].
==== DeleteSaveData ====
Takes an input u8 [[Filesystem_services#SaveDataSpaceId|SaveDataSpaceId]], an u64 SaveDataId, no output.


This is essentially an async wrapper for [[#GetApplicationControlData]], with support for multiple ApplicationIds.
==== UnregisterNetworkServiceAccount ====
Takes an input [[Account_services#Uid|Uid]], no output.


==== RequestCheckGameCardRegistration ====
==== UnregisterNetworkServiceAccountWithUserSaveDataDeletion ====
Takes an input [[NCM_services#ApplicationId|ApplicationId]], returns an output Event handle and an [[#IAsyncResult]].
Takes an input [[Account_services#Uid|Uid]], no output.


See [[#RequestApplicationUpdateInfo]] regarding nifm.
==== LaunchLibraryApplet ====
Takes an input u64 [[NCM_services#ProgramId|ProgramId]], returns an output u64.


==== RequestGameCardRegistrationGoldPoint ====
The specified program is launched with StorageId=BuiltInSystem via [[Process_Manager_services|pmshell]] LaunchProgram ([10.0.0+] [[PGL_services#LaunchProgram|pgl]] with pgl_launch_flags=0). [[Process_Manager_services#LaunchFlags|LaunchFlags]] value 0x9 is used here. The output u64 from here is written to the output for this cmd, on success.
Takes an input [[Account_services#Uid|Uid]], an [[NCM_services#ApplicationId|ApplicationId]], returns an output Event handle and an [[#IAsyncValue]].


The data that can be read from the [[#IAsyncValue]] is 4-bytes.
This is used by [[Applet_Manager_services|AM]].


See [[#RequestApplicationUpdateInfo]] regarding nifm.
==== LaunchSystemApplet ====
No input, returns an output u64.


==== RequestRegisterGameCard ====
A state flag must be non-zero, otherwise an error is thrown. When a state field is value 1, a hard-coded ProgramId for MaintenanceMenu is used. Otherwise, the ProgramId is loaded from [[System_Settings|system-setting]] <code>ns.applet!system_applet_id</code> ([20.0.0+] <code>ns.applet!system_applet_id_gen2</code>).
Takes an input s32, an [[Account_services#Uid|Uid]], an [[NCM_services#ApplicationId|ApplicationId]], returns an output Event handle and an [[#IAsyncResult]].


See [[#RequestApplicationUpdateInfo]] regarding nifm.
The SystemApplet is launched with StorageId=BuiltInSystem via [[Process_Manager_services|pmshell]] LaunchProgram ([10.0.0+] [[PGL_services#LaunchProgram|pgl]] with pgl_launch_flags=0). [[Process_Manager_services#LaunchFlags|LaunchFlags]] value 0x9 is used here. The output u64 from here is written to the output for this cmd, on success.


==== GetGameCardMountFailureEvent ====
This is used by [[Applet_Manager_services|AM]].
No input, returns an output Event handle with EventClearMode=0.


==== IsGameCardInserted ====
==== LaunchOverlayApplet ====
No input, returns an output u8 bool.
No input, returns an output u64.


==== EnsureGameCardAccess ====
A state flag must be non-zero, otherwise an error is thrown. The ProgramId is loaded from [[System_Settings|system-setting]] <code>ns.applet!overlay_applet_id</code>.
No input/output.


==== GetLastGameCardMountFailureResult ====
The OverlayApplet is launched with StorageId=BuiltInSystem via [[Process_Manager_services|pmshell]] LaunchProgram ([10.0.0+] [[PGL_services#LaunchProgram|pgl]] with pgl_launch_flags=0). [[Process_Manager_services#LaunchFlags|LaunchFlags]] value 0x9 is used here. The output u64 from here is written to the output for this cmd, on success.
No input/output.


==== ListApplicationIdOnGameCard ====
This is used by [[Applet_Manager_services|AM]].
Takes a type-0x6 output buffer containing an array of u64 [[NCM_services#ApplicationId|ApplicationIds]], returns an output s32 for total output entries.


==== GetGameCardPlatformRegion ====
==== RequestDownloadApplicationControlData ====
No input, returns an u8 '''GameCardPlatformRegion''' (0x00 = Global, 0x01 = China).
Takes an input [[NCM_services#ApplicationId|ApplicationId]], returns an output Event handle and an [[#IAsyncResult]].


This calls [[Filesystem_services#IDeviceOperator|fsp-srv IDeviceOperator]] GetGameCardCompatibilityType and returns the result.
See [[#RequestApplicationUpdateInfo]] regarding nifm.


==== ListAvailableAddOnContent ====
==== GetApplicationControlProperty ====
[10.0.0+] This now takes a total of 0x10-bytes of input instead of a total of 0x18-bytes of input.
[18.0.0+] Now takes a total of 0x58 bytes of input.


[15.0.0+] This now takes a total of 0x8-bytes of input instead of a total of 0x10-bytes of input.
==== ListApplicationTitle ====
Takes an input TransferMemory handle, a type-0x5 input buffer containing an array of u64 [[NCM_services#ApplicationId|ApplicationIds]], an u8 [[#ApplicationControlSource]], an u64 size, returns an output Event handle and an [[#IAsyncValue]].


==== RequestDownloadTaskListData ====
[[qlaunch]] uses value 0x1 for the u8.
No input, returns an output Event handle and an [[#IAsyncValue]].


==== TouchApplication ====
The user-process creates the TransferMemory with permissions=R--.
Takes an input [[NCM_services#ApplicationId|ApplicationId]], no output.


==== IsApplicationUpdateRequested ====
The data available with [[#IAsyncValue]] Get is a s32 for the offset within the TransferMemory where the output data is located, GetSize returns the total byte-size of the data located here. The data located here is the [[NACP_Format|NACP]] title-entry for each specified ApplicationId.
Takes an input [[NCM_services#ApplicationId|ApplicationId]], returns an output u8 bool and an u32.


The output u32 is only valid when the output bool is set.
The TransferMemory size must be at least: count*sizeof([[NACP_Format|title-entry]]) + count*sizeof(u64) + count*[[#GetApplicationControlData|0x24000]].


==== WithdrawApplicationUpdateRequest ====
This is essentially an async wrapper for [[#GetApplicationControlData]], with support for multiple ApplicationIds.
Takes an input [[NCM_services#ApplicationId|ApplicationId]], no output.


==== RequestVerifyApplicationDeprecated ====
==== ListApplicationIcon ====
Takes an input TransferMemory handle, an [[NCM_services#ApplicationId|ApplicationId]], an u64 size, returns an output Event handle and an [[#IProgressAsyncResult]].
Takes an input TransferMemory handle, a type-0x5 input buffer containing an array of u64 [[NCM_services#ApplicationId|ApplicationIds]], an u8 [[#ApplicationControlSource]], an u64 size, returns an output Event handle and an [[#IAsyncValue]].


On newer system-versions this calls the same func as [[#RequestVerifyApplication]], with the u32 value set to 0x7.
The user-process creates the TransferMemory with permissions=R--.


==== RequestVerifyAddOnContentsRights ====
The data available with [[#IAsyncValue]] Get is a s32 for the offset within the TransferMemory where the output data is located, GetSize returns the total byte-size of the data located here. This data is: an u64 for total entries, an array of u64s for each icon size, then the icon JPEGs for the specified ApplicationIds.
Takes an input [[NCM_services#ApplicationId|ApplicationId]], returns an output Event handle and an [[#IProgressAsyncResult]].


==== RequestVerifyApplication ====
The TransferMemory size must be at least: 0x4 + count*sizeof(u64) + count*[[#GetApplicationControlData|0x20000]] + count*sizeof(u64) + [[#GetApplicationControlData|0x24000]].
Takes an input TransferMemory handle, an u32, an [[NCM_services#ApplicationId|ApplicationId]], an u64 size, returns an output Event handle and an [[#IProgressAsyncResult]].


Official sw creates the TransferMemory with an user-specified buffer with permissions=0. [[qlaunch]] uses buffer size 0x100000.
This is essentially an async wrapper for [[#GetApplicationControlData]], with support for multiple ApplicationIds.


Official sw has an additional wrapper func which calls the original wrapper func, this uses value 0x7 for the u32. This is the same func used by [[qlaunch]].
==== RequestCheckGameCardRegistration ====
Takes an input [[NCM_services#ApplicationId|ApplicationId]], returns an output Event handle and an [[#IAsyncResult]].


==== IsAnyApplicationEntityInstalled ====
See [[#RequestApplicationUpdateInfo]] regarding nifm.
Takes an input [[NCM_services#ApplicationId|ApplicationId]], returns an output u8 bool.


==== CleanupUnavailableAddOnContents ====
==== RequestGameCardRegistrationGoldPoint ====
Takes an input u64 [[NCM_services#ApplicationId|ApplicationId]], an [[Account_services#Uid|Uid]], no output.
Takes an input [[Account_services#Uid|Uid]], an [[NCM_services#ApplicationId|ApplicationId]], returns an output Event handle and an [[#IAsyncValue]].


==== RequestMoveApplicationEntity ====
The data that can be read from the [[#IAsyncValue]] is 4-bytes.
Takes an input TransferMemory handle, a type-0x5 input buffer containing an array of [[NCM_services#StorageId|StorageId]], a [[NCM_services#StorageId|StorageId]], an u32 bitfield of "nn::ns::KeepApplicationEntityFlagTag", an [[NCM_services#ApplicationId|ApplicationId]], an u64 tmem_size, returns an output Event handle and an [[#IProgressAsyncResult]].


The TransferMemory uses permissions=0.
See [[#RequestApplicationUpdateInfo]] regarding nifm.


==== EstimateSizeToMove ====
==== RequestRegisterGameCard ====
Takes a type-0x5 input buffer containing an array of [[NCM_services#StorageId|StorageId]], a [[NCM_services#StorageId|StorageId]], an u32 bitfield of "nn::ns::KeepApplicationEntityFlagTag", an [[NCM_services#ApplicationId|ApplicationId]], returns an output s64.
Takes an input s32, an [[Account_services#Uid|Uid]], an [[NCM_services#ApplicationId|ApplicationId]], returns an output Event handle and an [[#IAsyncResult]].


This calls a func also used by [[#RequestMoveApplicationEntity]], then calls another func.
See [[#RequestApplicationUpdateInfo]] regarding nifm.


==== FormatSdCard ====
==== GetGameCardMountFailureEvent ====
No input/output.
No input, returns an output Event handle with EventClearMode=0.


==== NeedsSystemUpdateToFormatSdCard ====
==== IsGameCardInserted ====
No input, returns an output u8 bool.
No input, returns an output u8 bool.


==== GetLastSdCardFormatUnexpectedResult ====
==== EnsureGameCardAccess ====
No input/output.
No input/output.


==== GetApplicationView ====
==== GetLastGameCardMountFailureResult ====
Takes a type-0x6 output buffer containing an array of [[#ApplicationView]], a type-0x5 input buffer containing an array of u64 [[NCM_services#ApplicationId|ApplicationIds]], no output.
No input/output.


==== GetApplicationViewDownloadErrorContext ====
==== ListApplicationIdOnGameCard ====
Takes a type-0x16 output buffer containg an [[Error_Applet#ErrorContext|ErrorContext]], an u64 [[NCM_services#ApplicationId|ApplicationId]], no output.
Takes a type-0x6 output buffer containing an array of u64 [[NCM_services#ApplicationId|ApplicationIds]], returns an output s32 for total output entries.


==== GetApplicationViewWithPromotionInfo ====
==== GetGameCardPlatformRegion ====
Takes a type-0x6 output buffer containing an array of [[#ApplicationViewWithPromotionInfo]], a type-0x5 input buffer containing an array of u64 [[NCM_services#ApplicationId|ApplicationIds]], no output.
No input, returns an u8 '''GameCardPlatformRegion''' (0x00 = Global, 0x01 = China).


==== IsPatchAutoDeletableApplication ====
This calls [[Filesystem_services#IDeviceOperator|fsp-srv IDeviceOperator]] GetGameCardCompatibilityType and returns the result.
Takes an input [[NCM_services#ApplicationId|ApplicationId]], returns an output bool.


Compares the input ApplicationId with the value of [[System_Settings|system-setting]] <code>ns.application!auto_deletable_application_id_on_not_enough_space</code>, with the bool being set to the comparsion result.
==== ListAvailableAddOnContent ====
[10.0.0+] This now takes a total of 0x10-bytes of input instead of a total of 0x18-bytes of input.


==== RequestDownloadApplicationPrepurchasedRights ====
[15.0.0+] This now takes a total of 0x8-bytes of input instead of a total of 0x10-bytes of input.
Takes an input [[NCM_services#ApplicationId|ApplicationId]], returns an output Event handle and an [[#IAsyncResult]].


See [[#RequestApplicationUpdateInfo]] regarding nifm.
==== RequestDownloadTaskListData ====
No input, returns an output Event handle and an [[#IAsyncValue]].


==== GetSystemDeliveryInfo ====
==== TouchApplication ====
Takes a type-0x16 output buffer containing a [[#SystemDeliveryInfo]], no output.
Takes an input [[NCM_services#ApplicationId|ApplicationId]], no output.


This generates a [[#SystemDeliveryInfo]] using the currently installed SystemUpdate meta title.
==== IsApplicationUpdateRequested ====
Takes an input [[NCM_services#ApplicationId|ApplicationId]], returns an output u8 bool and an u32.


==== SelectLatestSystemDeliveryInfo ====
The output u32 is only valid when the output bool is set.
Takes a type-0x15 input buffer containing a [[#SystemDeliveryInfo]], a type-0x5 input buffer containing an array of [[#SystemDeliveryInfo]], a type-0x5 input buffer containing an array of [[#ApplicationDeliveryInfo]], and returns an output s32.


This determines the latest version from the input [[#ApplicationDeliveryInfo]] array, using value 0 if the array is empty. If this value is less than a state field, the state field value is used instead. Then this selects a [[#SystemDeliveryInfo]] with the latest version from the input array, where the minimum version is the previously mentioned value. The version must also be also be at least the version value from the type-0x15 [[#SystemDeliveryInfo]] buffer. This also does various validation, etc. The output s32 is an index in that array for the selected entry, -1 if none found.
==== WithdrawApplicationUpdateRequest ====
Takes an input [[NCM_services#ApplicationId|ApplicationId]], no output.


==== VerifyDeliveryProtocolVersion ====
==== RequestVerifyApplicationDeprecated ====
Takes a type-0x15 input buffer containing a [[#SystemDeliveryInfo]], no output.
Takes an input TransferMemory handle, an [[NCM_services#ApplicationId|ApplicationId]], an u64 size, returns an output Event handle and an [[#IProgressAsyncResult]].


This validates the [[#SystemDeliveryInfo]] HMAC and the protocol-version fields. Then the meta version is compared with a state field, an error is returned on match otherwise 0 is returned.
On newer system-versions this calls the same func as [[#RequestVerifyApplication]], with the u32 value set to 0x7.


==== GetApplicationDeliveryInfo ====
==== RequestVerifyAddOnContentsRights ====
Takes a type-0x6 output buffer containing an array of [[#ApplicationDeliveryInfo]], an input u32 bitmask <code>nn::ns::ApplicationDeliveryAttributeTag</code>, an [[NCM_services#ApplicationId|ApplicationId]], and returns an output s32 total_out.
Takes an input [[NCM_services#ApplicationId|ApplicationId]], returns an output Event handle and an [[#IProgressAsyncResult]].


An error is thrown if any bit is set in ApplicationDeliveryAttributeTag besides bit1. The output array-count must be at least 1: only 1 entry will be written to this array (hence on success total_out will also only be 1 on success).
==== RequestVerifyApplication ====
Takes an input TransferMemory handle, an u32, an [[NCM_services#ApplicationId|ApplicationId]], an u64 size, returns an output Event handle and an [[#IProgressAsyncResult]].


==== HasAllContentsToDeliver ====
Official sw creates the TransferMemory with an user-specified buffer with permissions=0. [[qlaunch]] uses buffer size 0x100000.
Takes a type-0x5 input buffer containing an array of [[#ApplicationDeliveryInfo]], returns an output u8 bool.


The array-count must match 1. After validating the [[#ApplicationDeliveryInfo]], the output bool is set to u32 [[#ApplicationDeliveryInfo]]+0x1C & 0x10000002 != 0x2, then this returns 0.
Official sw has an additional wrapper func which calls the original wrapper func, this uses value 0x7 for the u32. This is the same func used by [[qlaunch]].


==== CompareApplicationDeliveryInfo ====
==== IsAnyApplicationEntityInstalled ====
Takes two type-0x5 input buffers containing an array of [[#ApplicationDeliveryInfo]], returns an output s32.
Takes an input [[NCM_services#ApplicationId|ApplicationId]], returns an output u8 bool.


The array-count for both buffers must be 1, otherwise an error is returned.
==== CleanupUnavailableAddOnContents ====
Takes an input u64 [[NCM_services#ApplicationId|ApplicationId]], an [[Account_services#Uid|Uid]], no output.


Both [[#ApplicationDeliveryInfo]] are validated, then the application-version in the first/second buffer are compared. The output s32 is set to the comparison result: -1 for less than, 0 for equal, and 1 for higher than.
==== RequestMoveApplicationEntity ====
Takes an input TransferMemory handle, a type-0x5 input buffer containing an array of [[NCM_services#StorageId|StorageId]], a [[NCM_services#StorageId|StorageId]], an u32 bitfield of "nn::ns::KeepApplicationEntityFlagTag", an [[NCM_services#ApplicationId|ApplicationId]], an u64 tmem_size, returns an output Event handle and an [[#IProgressAsyncResult]].


==== CanDeliverApplication ====
The TransferMemory uses permissions=0.
Takes two type-0x5 input buffers containing an array of [[#ApplicationDeliveryInfo]], returns an output u8 bool.


The array-count for the second buffer must be 1 and the array-count for the first buffer must be <=1, otherwise an error is returned. If the array-count for the first buffer is 0, this will return 0 with the output bool set to 0.
==== EstimateSizeToMove ====
Takes a type-0x5 input buffer containing an array of [[NCM_services#StorageId|StorageId]], a [[NCM_services#StorageId|StorageId]], an u32 bitfield of "nn::ns::KeepApplicationEntityFlagTag", an [[NCM_services#ApplicationId|ApplicationId]], returns an output s64.


==== ListContentMetaKeyToDeliverApplication ====
This calls a func also used by [[#RequestMoveApplicationEntity]], then calls another func.
Takes a type-0x6 output buffer containing an array of [[NCM_services#ContentMetaKey|ContentMetaKey]], a type-0x5 input buffer containing an array of [[#ApplicationDeliveryInfo]], a s32, and returns an output s32 total_out.


The array-count for ContentMetaKey must be at least 1, and for ApplicationDeliveryInfo it must match 1.
==== FormatSdCard ====
No input/output.


This will only return 1 ContentMetaKey entry. This will not output the entry when the input s32 is larger than 0. This also does other validation, etc.
==== NeedsSystemUpdateToFormatSdCard ====
No input, returns an output u8 bool.


==== NeedsSystemUpdateToDeliverApplication ====
==== GetLastSdCardFormatUnexpectedResult ====
Takes a type-0x15 input buffer containing a [[#SystemDeliveryInfo]], a type-0x5 input buffer containing an array of [[#ApplicationDeliveryInfo]], and returns an output u8 bool.
No input/output.


The array-count must match 1.
==== GetApplicationView ====
Takes a type-0x6 output buffer containing an array of [[#ApplicationView]], a type-0x5 input buffer containing an array of u64 [[NCM_services#ApplicationId|ApplicationIds]], no output.


After validation etc, this sets the output bool by comparing system-version fields in the [[#SystemDeliveryInfo]]/[[#ApplicationDeliveryInfo]] and with a state field.
==== GetApplicationViewDownloadErrorContext ====
Takes a type-0x16 output buffer containg an [[Error_Applet#ErrorContext|ErrorContext]], an u64 [[NCM_services#ApplicationId|ApplicationId]], no output.


==== EstimateRequiredSize ====
==== GetApplicationViewWithPromotionInfo ====
Takes a type-0x5 input buffer containing an array of [[NCM_services#ContentMetaKey|ContentMetaKey]], returns an output s64.
Takes a type-0x6 output buffer containing an array of [[#ApplicationViewWithPromotionInfo]], a type-0x5 input buffer containing an array of u64 [[NCM_services#ApplicationId|ApplicationIds]], no output.


When the array-count is less than 1, this will return 0 with the s64 set to 0.
==== IsPatchAutoDeletableApplication ====
Takes an input [[NCM_services#ApplicationId|ApplicationId]], returns an output bool.


==== RequestReceiveApplication ====
Compares the input ApplicationId with the value of [[System_Settings|system-setting]] <code>ns.application!auto_deletable_application_id_on_not_enough_space</code>, with the bool being set to the comparsion result.
Takes a type-0x5 input buffer containing an array of [[NCM_services#ContentMetaKey|ContentMetaKey]], a [[NCM_services#StorageId|StorageId]], an u16 port, an u32 Ipv4Address, an [[NCM_services#ApplicationId|ApplicationId]], returns an output Event handle and an [[#IAsyncResult]].


[[qlaunch]] uses value Any for the StorageId, and value 55556 for the port.
==== ListLastNotificationInfo ====
Takes a type-0x6 buffer containing an array with struct entry size 0x90-bytes. Returns 4-bytes of output.


An error is thrown if a state ref-count is zero. An error is thrown if [[NIM_services|nim]] ListApplicationApplyDeltaTask returns a task.
[19.0.0+] The struct size is now 0x98-bytes.


This loops through the input [[NCM_services#ContentMetaKey|ContentMetaKey]] array, throwing an error if the [[NCM_services#ContentMetaType|ContentMetaType]] doesn't match Patch. The input array is copied into state which is used later by the thread for [[NIM_services|nim]] cmd53, max entries is 0x12.
==== ListNotificationTask ====
Takes a type-0x6 buffer containing an array with struct entry size 0xB0-bytes. Returns 4-bytes of output.


This does various setup then creates the [[#IAsyncResult]] + the async thread which handles the [[#IAsyncResult]] operation. Then the thread does:
[19.0.0+] The struct size is now 0xB8-bytes.


* Calls a func which does:
==== RequestDownloadApplicationPrepurchasedRights ====
** Throws an error if a state flag is set.
Takes an input [[NCM_services#ApplicationId|ApplicationId]], returns an output Event handle and an [[#IAsyncResult]].
** Uses [[NIM_services|nim]] cmd53, returning the Result on failure.
** Uses [[NIM_services|nim]] cmd56, returning the Result on failure. Waits for the IAsyncResult operation from this to finish, then uses the Get cmd to get the output Result.
** Handles cleanup and returns.
* On success, this loads various data which is then used for saving a SystemPlayReport when the cached [[System_Settings|system-setting]] "systemreport!enabled" is set.
** The EventId is "receive_app_contents" with ApplicationId <NS ProgramId>.


==== CommitReceiveApplication ====
See [[#RequestApplicationUpdateInfo]] regarding nifm.
Takes an input [[NCM_services#ApplicationId|ApplicationId]], no output.


==== GetReceiveApplicationProgress ====
==== GetSystemDeliveryInfo ====
Takes an input [[NCM_services#ApplicationId|ApplicationId]], returns an output [[#ReceiveApplicationProgress]].
Takes a type-0x16 output buffer containing a [[#SystemDeliveryInfo]], no output.


An error is thrown if a state ref-count is zero. An error is thrown if [[NIM_services|nim]] ListApplicationApplyDeltaTask returns a task.
This generates a [[#SystemDeliveryInfo]] using the currently installed SystemUpdate meta title.


Uses [[NIM_services|nim]] cmd67, throwing an error if no task is returned. Then [[NIM_services|nim]] cmd57 is used, returning the error from there on failure. Lastly, this writes the 0x10-bytes from output+8 from the latter cmd to the output [[#ReceiveApplicationProgress]], and returns 0.
==== SelectLatestSystemDeliveryInfo ====
Takes a type-0x15 input buffer containing a [[#SystemDeliveryInfo]], a type-0x5 input buffer containing an array of [[#SystemDeliveryInfo]], a type-0x5 input buffer containing an array of [[#ApplicationDeliveryInfo]], and returns an output s32.


==== RequestSendApplication ====
This determines the latest version from the input [[#ApplicationDeliveryInfo]] array, using value 0 if the array is empty. If this value is less than a state field, the state field value is used instead. Then this selects a [[#SystemDeliveryInfo]] with the latest version from the input array, where the minimum version is the previously mentioned value. The version must also be also be at least the version value from the type-0x15 [[#SystemDeliveryInfo]] buffer. This also does various validation, etc. The output s32 is an index in that array for the selected entry, -1 if none found.
Takes a type-0x5 input buffer containing an array of [[NCM_services#ContentMetaKey|ContentMetaKey]], an u16 port, an u32 Ipv4Address, an [[NCM_services#ApplicationId|ApplicationId]], returns an output Event handle and an [[#IAsyncResult]].


[[qlaunch]] uses value 55556 for the port.
==== VerifyDeliveryProtocolVersion ====
Takes a type-0x15 input buffer containing a [[#SystemDeliveryInfo]], no output.


An error is thrown if a state ref-count is zero. An error is thrown if [[NIM_services|nim]] ListApplicationApplyDeltaTask returns a task.
This validates the [[#SystemDeliveryInfo]] HMAC and the protocol-version fields. Then the meta version is compared with a state field, an error is returned on match otherwise 0 is returned.


The [[NCM_services#ContentMetaType|ContentMetaType]] must match Patch.
==== GetApplicationDeliveryInfo ====
Takes a type-0x6 output buffer containing an array of [[#ApplicationDeliveryInfo]], an input u32 bitmask <code>nn::ns::ApplicationDeliveryAttributeTag</code>, an [[NCM_services#ApplicationId|ApplicationId]], and returns an output s32 total_out.


This does various setup and selects a ContentMetaKey to use from the input, then creates the [[#IAsyncResult]] + the async thread which handles the [[#IAsyncResult]] operation. Then the thread does:
An error is thrown if any bit is set in ApplicationDeliveryAttributeTag besides bit1. The output array-count must be at least 1: only 1 entry will be written to this array (hence on success total_out will also only be 1 on success).


* Calls a func which does:
==== HasAllContentsToDeliver ====
** Throws an error if a state flag is set.
Takes a type-0x5 input buffer containing an array of [[#ApplicationDeliveryInfo]], returns an output u8 bool.
** Uses [[NIM_services|nim]] cmd60, returning the Result on failure.
** Uses [[NIM_services|nim]] cmd61, returning the Result on failure. Waits for the IAsyncResult operation from this to finish, then uses the Get cmd to get the output Result.
** Handles cleanup and returns.
* On success, this loads various data which is then used for saving a SystemPlayReport when the cached [[System_Settings|system-setting]] "systemreport!enabled" is set.
** The EventId is "send_app_contents" with ApplicationId <NS ProgramId>.


==== GetSendApplicationProgress ====
The array-count must match 1. After validating the [[#ApplicationDeliveryInfo]], the output bool is set to u32 [[#ApplicationDeliveryInfo]]+0x1C & 0x10000002 != 0x2, then this returns 0.
Takes an input [[NCM_services#ApplicationId|ApplicationId]], returns an output [[#SendApplicationProgress]].


Same as [[#GetReceiveApplicationProgress]] except this is the Send version, and uses [[NIM_services|nim]] cmd68/cmd63 instead.
==== CompareApplicationDeliveryInfo ====
Takes two type-0x5 input buffers containing an array of [[#ApplicationDeliveryInfo]], returns an output s32.


==== CompareSystemDeliveryInfo ====
The array-count for both buffers must be 1, otherwise an error is returned.
Takes two type-0x15 input buffers containing a [[#SystemDeliveryInfo]], returns an output s32.


This is essentially the same as [[#CompareApplicationDeliveryInfo]], except this compares the [[#SystemDeliveryInfo]] SystemUpdate version.
Both [[#ApplicationDeliveryInfo]] are validated, then the application-version in the first/second buffer are compared. The output s32 is set to the comparison result: -1 for less than, 0 for equal, and 1 for higher than.


==== ListNotCommittedContentMeta ====
==== CanDeliverApplication ====
Takes a type-0x6 output buffer containing an array of [[NCM_services#ContentMetaKey|ContentMetaKey]], a s32, an [[NCM_services#ApplicationId|ApplicationId]], returns an output s32 total_out.
Takes two type-0x5 input buffers containing an array of [[#ApplicationDeliveryInfo]], returns an output u8 bool.


==== RecoverDownloadTask ====
The array-count for the second buffer must be 1 and the array-count for the first buffer must be <=1, otherwise an error is returned. If the array-count for the first buffer is 0, this will return 0 with the output bool set to 0.
Takes a type-0x5 input buffer containing an array of {unknown} and an input u64, no output.


==== GetApplicationDeliveryInfoHash ====
==== ListContentMetaKeyToDeliverApplication ====
Takes a type-0x5 input buffer containing an array of [[#ApplicationDeliveryInfo]], returns an output 0x20-byte SHA256 hash.
Takes a type-0x6 output buffer containing an array of [[NCM_services#ContentMetaKey|ContentMetaKey]], a type-0x5 input buffer containing an array of [[#ApplicationDeliveryInfo]], a s32, and returns an output s32 total_out.


This extracts data from the input array for hashing with SHA256, with validation being done when handling each entry.
The array-count for ContentMetaKey must be at least 1, and for ApplicationDeliveryInfo it must match 1.


==== GetApplicationRightsOnClient ====
This will only return 1 ContentMetaKey entry. This will not output the entry when the input s32 is larger than 0. This also does other validation, etc.
Takes a type-0x6 output buffer containing an array of [[#ApplicationRightsOnClient]], an input u32 flags, an [[NCM_services#ApplicationId|ApplicationId]], an [[Account_services#Uid|Uid]], returns 4-bytes of output for total output entries.


Official sw has at least two wrappers which use this cmd: one with an all-zero Uid, one with an user-specified Uid. With both of these, the passed flags are hard-coded to value 0x3.
==== NeedsSystemUpdateToDeliverApplication ====
Takes a type-0x15 input buffer containing a [[#SystemDeliveryInfo]], a type-0x5 input buffer containing an array of [[#ApplicationDeliveryInfo]], and returns an output u8 bool.


For the output array count, [[qlaunch]] uses value 3.
The array-count must match 1.


==== GetApplicationTerminateResult ====
After validation etc, this sets the output bool by comparing system-version fields in the [[#SystemDeliveryInfo]]/[[#ApplicationDeliveryInfo]] and with a state field.
Takes an input [[NCM_services#ApplicationId|ApplicationId]], returns an output u32 Result.


==== GetRightsEnvironmentHandleForApplication ====
==== EstimateRequiredSize ====
No input, returns a total of 8-bytes of output.
Takes a type-0x5 input buffer containing an array of [[NCM_services#ContentMetaKey|ContentMetaKey]], returns an output s64.


[9.0.0+] Now takes a total of 8-bytes of input, returns a total of 8-bytes of output.
When the array-count is less than 1, this will return 0 with the s64 set to 0.


==== RequestNoDownloadRightsErrorResolution ====
==== RequestReceiveApplication ====
Takes an input [[NCM_services#ApplicationId|ApplicationId]], returns an output Event handle and an [[#IAsyncValue]].
Takes a type-0x5 input buffer containing an array of [[NCM_services#ContentMetaKey|ContentMetaKey]], a [[NCM_services#StorageId|StorageId]], an u16 port, an u32 Ipv4Address, an [[NCM_services#ApplicationId|ApplicationId]], returns an output Event handle and an [[#IAsyncResult]].


The data that can be read from the [[#IAsyncValue]] is [[#NoDownloadRightsErrorResolution]].
[[qlaunch]] uses value Any for the StorageId, and value 55556 for the port.


See [[#RequestApplicationUpdateInfo]] regarding nifm.
An error is thrown if a state ref-count is zero. An error is thrown if [[NIM_services|nim]] ListApplicationApplyDeltaTask returns a task.


==== RequestResolveNoDownloadRightsError ====
This loops through the input [[NCM_services#ContentMetaKey|ContentMetaKey]] array, throwing an error if the [[NCM_services#ContentMetaType|ContentMetaType]] doesn't match Patch. The input array is copied into state which is used later by the thread for [[NIM_services|nim]] cmd53, max entries is 0x12.
Takes an input [[NCM_services#ApplicationId|ApplicationId]], returns an output Event handle and an [[#IAsyncValue]].


The data that can be read from the [[#IAsyncValue]] is [[#NoDownloadRightsErrorResolution]].
This does various setup then creates the [[#IAsyncResult]] + the async thread which handles the [[#IAsyncResult]] operation. Then the thread does:


See [[#RequestApplicationUpdateInfo]] regarding nifm.
* Calls a func which does:
** Throws an error if a state flag is set.
** Uses [[NIM_services|nim]] cmd53, returning the Result on failure.
** Uses [[NIM_services|nim]] cmd56, returning the Result on failure. Waits for the IAsyncResult operation from this to finish, then uses the Get cmd to get the output Result.
** Handles cleanup and returns.
* On success, this loads various data which is then used for saving a SystemPlayReport when the cached [[System_Settings|system-setting]] "systemreport!enabled" is set.
** The EventId is "receive_app_contents" with ApplicationId <NS ProgramId>.


==== GetPromotionInfo ====
==== CommitReceiveApplication ====
Takes a type-0x6 output buffer containing an array of [[#PromotionInfo]], a type-0x5 input buffer containing an array of u64 [[NCM_services#ApplicationId|ApplicationIds]], a type-0x5 input buffer containing an array of [[Account_services#Uid|Uids]], no output.
Takes an input [[NCM_services#ApplicationId|ApplicationId]], no output.


Official sw uses hard-coded value 1 for the count with each of these arrays.
==== GetReceiveApplicationProgress ====
Takes an input [[NCM_services#ApplicationId|ApplicationId]], returns an output [[#ReceiveApplicationProgress]].


==== ImportPromotionJsonForDebug ====
An error is thrown if a state ref-count is zero. An error is thrown if [[NIM_services|nim]] ListApplicationApplyDeltaTask returns a task.
Takes a type-0x5 input buffer, no output.


The output from [[Settings_services#GetDebugModeFlag]] must be 1, otherwise an error is returned.
Uses [[NIM_services|nim]] cmd67, throwing an error if no task is returned. Then [[NIM_services|nim]] cmd57 is used, returning the error from there on failure. Lastly, this writes the 0x10-bytes from output+8 from the latter cmd to the output [[#ReceiveApplicationProgress]], and returns 0.


==== ClearPromotionInfoForDebug ====
==== RequestSendApplication ====
No input/output.
Takes a type-0x5 input buffer containing an array of [[NCM_services#ContentMetaKey|ContentMetaKey]], an u16 port, an u32 Ipv4Address, an [[NCM_services#ApplicationId|ApplicationId]], returns an output Event handle and an [[#IAsyncResult]].


The output from [[Settings_services#GetDebugModeFlag]] must be 1, otherwise an error is returned.
[[qlaunch]] uses value 55556 for the port.


This just clears 0xC-bytes in state.
An error is thrown if a state ref-count is zero. An error is thrown if [[NIM_services|nim]] ListApplicationApplyDeltaTask returns a task.


==== CreateApplicationResource ====
The [[NCM_services#ContentMetaType|ContentMetaType]] must match Patch.
Takes an input [[#ApplicationResourceType]]. Returns an [[#IApplicationResource]].


==== GetApplicationResource ====
This does various setup and selects a ContentMetaKey to use from the input, then creates the [[#IAsyncResult]] + the async thread which handles the [[#IAsyncResult]] operation. Then the thread does:
Takes an input u64 ProcessId and an input [[#ApplicationResourceType]]. Returns an [[#IApplicationResource]].


==== LaunchMicroApplication ====
* Calls a func which does:
[18.0.0+] Now takes a total of 0x50 bytes of input.
** Throws an error if a state flag is set.
** Uses [[NIM_services|nim]] cmd60, returning the Result on failure.
** Uses [[NIM_services|nim]] cmd61, returning the Result on failure. Waits for the IAsyncResult operation from this to finish, then uses the Get cmd to get the output Result.
** Handles cleanup and returns.
* On success, this loads various data which is then used for saving a SystemPlayReport when the cached [[System_Settings|system-setting]] "systemreport!enabled" is set.
** The EventId is "send_app_contents" with ApplicationId <NS ProgramId>.


==== CreateApplicationInstance ====
==== GetSendApplicationProgress ====
[18.0.0+] Now takes a total of 0x50 bytes of input.
Takes an input [[NCM_services#ApplicationId|ApplicationId]], returns an output [[#SendApplicationProgress]].


==== RegisterDeviceLockKey ====
Same as [[#GetReceiveApplicationProgress]] except this is the Send version, and uses [[NIM_services|nim]] cmd68/cmd63 instead.
Takes a type-0x5 input buffer containing an InArray of u8, no output.


User-processes expose this with two funcs: one which uses an user-specified u8 array directly, while the other uses [[HID_services#NpadButtonSet|NpadButton]].
==== CompareSystemDeliveryInfo ====
Takes two type-0x15 input buffers containing a [[#SystemDeliveryInfo]], returns an output s32.


This does SHA256 hashing, etc.
This is essentially the same as [[#CompareApplicationDeliveryInfo]], except this compares the [[#SystemDeliveryInfo]] SystemUpdate version.


==== UnregisterDeviceLockKey ====
==== ListNotCommittedContentMeta ====
No input/output.
Takes a type-0x6 output buffer containing an array of [[NCM_services#ContentMetaKey|ContentMetaKey]], a s32, an [[NCM_services#ApplicationId|ApplicationId]], returns an output s32 total_out.


Runs code identical to [[#RegisterDeviceLockKey]], except the passed buffer/size are 0.
==== RecoverDownloadTask ====
Takes a type-0x5 input buffer containing an array of {unknown} and an input u64, no output.


==== VerifyDeviceLockKey ====
==== GetApplicationDeliveryInfoHash ====
Takes a type-0x5 input buffer containing an InArray of u8, no output.
Takes a type-0x5 input buffer containing an array of [[#ApplicationDeliveryInfo]], returns an output 0x20-byte SHA256 hash.


User-processes expose this with two funcs: one which uses an user-specified u8 array directly, while the other uses [[HID_services#NpadButtonSet|NpadButton]].
This extracts data from the input array for hashing with SHA256, with validation being done when handling each entry.


This runs hashing similar to [[#RegisterDeviceLockKey]], with the calculated hash being verified with the one from state.
==== GetApplicationRightsOnClient ====
Takes a type-0x6 output buffer containing an array of [[#ApplicationRightsOnClient]], an input u32 flags, an [[NCM_services#ApplicationId|ApplicationId]], an [[Account_services#Uid|Uid]], returns 4-bytes of output for total output entries.


==== HideApplicationIcon ====
Official sw has at least two wrappers which use this cmd: one with an all-zero Uid, one with an user-specified Uid. With both of these, the passed flags are hard-coded to value 0x3.
No input/output.


==== ShowApplicationIcon ====
For the output array count, [[qlaunch]] uses value 3.
No input/output.


==== HideApplicationTitle ====
==== GetApplicationTerminateResult ====
No input/output.
Takes an input [[NCM_services#ApplicationId|ApplicationId]], returns an output u32 Result.


==== ShowApplicationTitle ====
==== GetRightsEnvironmentHandleForApplication ====
No input/output.
No input, returns a total of 8-bytes of output.


==== EnableGameCard ====
[9.0.0+] Now takes a total of 8-bytes of input, returns a total of 8-bytes of output.
No input/output.


==== DisableGameCard ====
==== RequestNoDownloadRightsErrorResolution ====
No input/output.
Takes an input [[NCM_services#ApplicationId|ApplicationId]], returns an output Event handle and an [[#IAsyncValue]].


==== EnableLocalContentShare ====
The data that can be read from the [[#IAsyncValue]] is [[#NoDownloadRightsErrorResolution]].
No input/output.


==== DisableLocalContentShare ====
See [[#RequestApplicationUpdateInfo]] regarding nifm.
No input/output.


==== IsApplicationIconHidden ====
==== RequestResolveNoDownloadRightsError ====
No input, returns an output bool.
Takes an input [[NCM_services#ApplicationId|ApplicationId]], returns an output Event handle and an [[#IAsyncValue]].
 
The data that can be read from the [[#IAsyncValue]] is [[#NoDownloadRightsErrorResolution]].
 
See [[#RequestApplicationUpdateInfo]] regarding nifm.


==== IsApplicationTitleHidden ====
==== GetPromotionInfo ====
No input, returns an output bool.
Takes a type-0x6 output buffer containing an array of [[#PromotionInfo]], a type-0x5 input buffer containing an array of u64 [[NCM_services#ApplicationId|ApplicationIds]], a type-0x5 input buffer containing an array of [[Account_services#Uid|Uids]], no output.


==== IsGameCardEnabled ====
Official sw uses hard-coded value 1 for the count with each of these arrays.
No input, returns an output bool.


==== IsLocalContentShareEnabled ====
==== ListPromotionInfo ====
No input, returns an output bool.
[20.0.0+] The struct size for the output buffer array is now 0x28-bytes instead of 0x20-bytes.


Various Deliver cmds now load the same flag used by this cmd (IsLocalContentShareEnabled), with an error being returned when it's not enabled.
==== ImportPromotionJsonForDebug ====
Takes a type-0x5 input buffer, no output.


=== IGameCardStopper ===
The output from [[Settings_services#GetDebugModeFlag]] must be 1, otherwise an error is returned.
This is "nn::ns::detail::IGameCardStopper".


This interface has no commands.
==== ClearPromotionInfoForDebug ====
No input/output.


=== IRequestServerStopper ===
The output from [[Settings_services#GetDebugModeFlag]] must be 1, otherwise an error is returned.
This is "nn::ns::detail::IRequestServerStopper".


This interface has no commands.
This just clears 0xC-bytes in state.


=== IProgressMonitorForDeleteUserSaveDataAll ===
==== CreateApplicationResource ====
This is "nn::ns::detail::IProgressMonitorForDeleteUserSaveDataAll".
Takes an input [[#ApplicationResourceType]]. Returns an [[#IApplicationResource]].


{| class="wikitable" border="1"
==== GetApplicationResource ====
|-
Takes an input u64 ProcessId and an input [[#ApplicationResourceType]]. Returns an [[#IApplicationResource]].
! Cmd || Name
|-
| 0 || GetSystemEvent
|-
| 1 || IsFinished
|-
| 2 || GetResult
|-
| 10 || GetProgress
|}


When closing the object, official sw uses IsFinished first, asserting when the output bool is false.
==== LaunchMicroApplication ====
[18.0.0+] Now takes a total of 0x50 bytes of input.


* GetSystemEvent: No input, returns an output Event handle. [[qlaunch]] doesn't use this.
[19.0.0+] Now takes a total of 0x80 bytes of input.


* IsFinished: No input, returns an output u8 bool.
==== CreateApplicationInstance ====
[18.0.0+] Now takes a total of 0x50 bytes of input.


* GetResult: No input/output.
[19.0.0+] Now takes a total of 0x80 bytes of input.


* GetProgress: No input, returns an output [[#ProgressForDeleteUserSaveDataAll]]. Official sw writes this struct directly to object state.
==== RegisterDeviceLockKey ====
Takes a type-0x5 input buffer containing an InArray of u8, no output.


=== IProgressAsyncResult ===
User-processes expose this with two funcs: one which uses an user-specified u8 array directly, while the other uses [[HID_services#NpadButtonSet|NpadButton]].
This is "nn::ns::detail::IProgressAsyncResult".


{| class="wikitable" border="1"
This does SHA256 hashing, etc.
|-
! Cmd || Name
|-
| 0 || Get
|-
| 1 || Cancel
|-
| 2 || GetProgress
|-
| 3 || GetDetailResult
|-
| 4 || [4.0.0+] GetErrorContext
|}


=== IApplicationVersionInterface ===
==== UnregisterDeviceLockKey ====
This is "nn::ns::detail::IApplicationVersionInterface".
No input/output.


This was added with [4.0.0+].
Runs code identical to [[#RegisterDeviceLockKey]], except the passed buffer/size are 0.


{| class="wikitable" border="1"
==== VerifyDeviceLockKey ====
|-
Takes a type-0x5 input buffer containing an InArray of u8, no output.
! Cmd || Name
|-
| 0 || GetLaunchRequiredVersion
|-
| 1 || UpgradeLaunchRequiredVersion
|-
| 35 || UpdateVersionList
|-
| 36 || PushLaunchVersion
|-
| 37 || ListRequiredVersion
|-
| 800 || RequestVersionList
|-
| 801 || ListVersionList
|-
| 802 || [[#RequestVersionListData]]
|-
| 900 || [12.0.0+] ImportAutoUpdatePolicyJsonForDebug
|-
| 901 || [12.0.0+] ListDefaultAutoUpdatePolicy
|-
| 902 || [12.0.0+] ListAutoUpdatePolicyForSpecificApplication
|-
| 1000 || PerformAutoUpdate
|-
| 1001 || [11.0.0+] ListAutoUpdateSchedule
|}


==== RequestVersionListData ====
User-processes expose this with two funcs: one which uses an user-specified u8 array directly, while the other uses [[HID_services#NpadButtonSet|NpadButton]].
No input, returns an output Event handle and an [[#IAsyncValue]].


The data that can be read from the [[#IAsyncValue]] is [[#VersionListData]].
This runs hashing similar to [[#RegisterDeviceLockKey]], with the calculated hash being verified with the one from state.


=== IContentManagementInterface ===
==== HideApplicationIcon ====
This is "nn::ns::detail::IContentManagementInterface".
No input/output.


{| class="wikitable" border="1"
==== ShowApplicationIcon ====
|-
No input/output.
! Cmd || Name
|-
| 11 || [[#CalculateApplicationOccupiedSize]]
|-
| 43 || [[#CheckSdCardMountStatus]]
|-
| 47 || [[#GetTotalSpaceSize]]
|-
| 48 || [[#GetFreeSpaceSize]]
|-
| 600 || [[#CountApplicationContentMeta]]
|-
| 601 || [[#ListApplicationContentMetaStatus]]
|-
| 605 || [[#ListApplicationContentMetaStatusWithRightsCheck]]
|-
| 607 || [[#IsAnyApplicationRunning]]
|}


==== CalculateApplicationOccupiedSize ====
==== HideApplicationTitle ====
Takes an input [[NCM_services#ApplicationId|ApplicationId]], returns an output [[#ApplicationOccupiedSize]].
No input/output.


==== CheckSdCardMountStatus ====
==== ShowApplicationTitle ====
No input/output.
No input/output.


==== CountApplicationContentMeta ====
==== EnableGameCard ====
Takes an input [[NCM_services#ApplicationId|ApplicationId]], returns an output s32.
No input/output.


==== ListApplicationContentMetaStatusWithRightsCheck ====
==== DisableGameCard ====
Same input/output as [[#ListApplicationContentMetaStatus]].
No input/output.
 
==== EnableLocalContentShare ====
No input/output.
 
==== DisableLocalContentShare ====
No input/output.
 
==== IsApplicationIconHidden ====
No input, returns an output bool.
 
==== IsApplicationTitleHidden ====
No input, returns an output bool.
 
==== IsGameCardEnabled ====
No input, returns an output bool.
 
==== IsLocalContentShareEnabled ====
No input, returns an output bool.
 
Various Deliver cmds now load the same flag used by this cmd (IsLocalContentShareEnabled), with an error being returned when it's not enabled.
 
=== IGameCardStopper ===
This is "nn::ns::detail::IGameCardStopper".
 
This interface has no commands.
 
=== IRequestServerStopper ===
This is "nn::ns::detail::IRequestServerStopper".


==== IsAnyApplicationRunning ====
This interface has no commands.
No input, returns an output u8 bool.


=== IDocumentInterface ===
=== IProgressMonitorForDeleteUserSaveDataAll ===
This is "nn::ns::detail::IDocumentInterface".
This is "nn::ns::detail::IProgressMonitorForDeleteUserSaveDataAll".


{| class="wikitable" border="1"
{| class="wikitable" border="1"
Line 1,813: Line 1,918:
! Cmd || Name
! Cmd || Name
|-
|-
| 21 || GetApplicationContentPath
| 0 || GetSystemEvent
|-
|-
| 23 || ResolveApplicationContentPath
| 1 || IsFinished
|-
|-
| 92 || [5.0.0+] GetRunningApplicationProgramId
| 2 || GetResult
|-
| 10 || GetProgress
|}
|}


=== IDownloadTaskInterface ===
When closing the object, official sw uses IsFinished first, asserting when the output bool is false.
This is "nn::ns::detail::IDownloadTaskInterface".
 
* GetSystemEvent: No input, returns an output Event handle. [[qlaunch]] doesn't use this.
 
* IsFinished: No input, returns an output u8 bool.
 
* GetResult: No input/output.
 
* GetProgress: No input, returns an output [[#ProgressForDeleteUserSaveDataAll]]. Official sw writes this struct directly to object state.
 
=== IProgressAsyncResult ===
This is "nn::ns::detail::IProgressAsyncResult".


{| class="wikitable" border="1"
{| class="wikitable" border="1"
Line 1,827: Line 1,944:
! Cmd || Name
! Cmd || Name
|-
|-
| 701 || [[#ClearTaskStatusList]]
| 0 || Get
|-
|-
| 702 || [[#RequestDownloadTaskList]]
| 1 || Cancel
|-
|-
| 703 || [[#RequestEnsureDownloadTask]]
| 2 || GetProgress
|-
|-
| 704 || [[#ListDownloadTaskStatus]]
| 3 || GetDetailResult
|-
|-
| 705 || [[#RequestDownloadTaskListData]]
| 4 || [4.0.0+] GetErrorContext
|}
 
=== IApplicationVersionInterface ===
This is "nn::ns::detail::IApplicationVersionInterface".
 
This was added with [4.0.0+].
 
{| class="wikitable" border="1"
|-
|-
| 706 || [4.0.0+] [[#TryCommitCurrentApplicationDownloadTask]]
! Cmd || Name
|-
|-
| 707 || [4.0.0+] [[#EnableAutoCommit]]
| 0 || GetLaunchRequiredVersion
|-
|-
| 708 || [4.0.0+] [[#DisableAutoCommit]]
| 1 || UpgradeLaunchRequiredVersion
|-
| 35 || UpdateVersionList
|-
| 36 || PushLaunchVersion
|-
| 37 || ListRequiredVersion
|-
| 800 || RequestVersionList
|-
| 801 || ListVersionList
|-
| 802 || [[#RequestVersionListData]]
|-
| 900 || [12.0.0+] ImportAutoUpdatePolicyJsonForDebug
|-
| 901 || [12.0.0+] ListDefaultAutoUpdatePolicy
|-
| 902 || [12.0.0+] ListAutoUpdatePolicyForSpecificApplication
|-
| 1000 || PerformAutoUpdate
|-
|-
| 709 || [4.0.0+] [[#TriggerDynamicCommitEvent]]
| 1001 || [11.0.0+] ListAutoUpdateSchedule
|}
|}


==== ClearTaskStatusList ====
==== RequestVersionListData ====
No input/output.
No input, returns an output Event handle and an [[#IAsyncValue]].


==== RequestDownloadTaskList ====
The data that can be read from the [[#IAsyncValue]] is [[#VersionListData]].
No input/output.


==== RequestEnsureDownloadTask ====
=== IContentManagementInterface ===
No input, returns an output Event handle and an [[#IAsyncResult]].
This is "nn::ns::detail::IContentManagementInterface".


==== ListDownloadTaskStatus ====
{| class="wikitable" border="1"
Takes a type-0x6 output buffer containing an array of [[#DownloadTaskStatus]], returns an output s32 total_out.
|-
! Cmd || Name
|-
| 11 || [[#CalculateApplicationOccupiedSize]]
|-
| 43 || [[#CheckSdCardMountStatus]]
|-
| 47 || [[#GetTotalSpaceSize]]
|-
| 48 || [[#GetFreeSpaceSize]]
|-
| 58 || [20.1.0+]
|-
| 71 || [20.1.0+]
|-
| 600 || [[#CountApplicationContentMeta]]
|-
| 601 || [[#ListApplicationContentMetaStatus]]
|-
| 605 || [[#ListApplicationContentMetaStatusWithRightsCheck]]
|-
| 607 || [[#IsAnyApplicationRunning]]
|}


A maximum of 0x100 tasks can be stored in state.
==== CalculateApplicationOccupiedSize ====
Takes an input [[NCM_services#ApplicationId|ApplicationId]], returns an output [[#ApplicationOccupiedSize]].


==== TryCommitCurrentApplicationDownloadTask ====
==== CheckSdCardMountStatus ====
No input/output.
No input/output.


==== EnableAutoCommit ====
==== CountApplicationContentMeta ====
No input/output.
Takes an input [[NCM_services#ApplicationId|ApplicationId]], returns an output s32.


==== DisableAutoCommit ====
==== ListApplicationContentMetaStatusWithRightsCheck ====
No input/output.
Same input/output as [[#ListApplicationContentMetaStatus]].


==== TriggerDynamicCommitEvent ====
==== IsAnyApplicationRunning ====
No input/output.
No input, returns an output u8 bool.


=== IReadOnlyApplicationRecordInterface ===
=== IDocumentInterface ===
This is "nn::ns::detail::IReadOnlyApplicationRecordInterface".
This is "nn::ns::detail::IDocumentInterface".
 
This was added with [5.0.0+].


{| class="wikitable" border="1"
{| class="wikitable" border="1"
|-
|-
! Cmd || Name || Notes
! Cmd || Name
|-
| 21 || GetApplicationContentPath
|-
|-
| 0 || HasApplicationRecord || Same as [[#IApplicationManagerInterface]] cmd 910
| 23 || ResolveApplicationContentPath
|-
|-
| 1 || [10.0.0+] NotifyApplicationFailure ||
| 92 || [5.0.0+] GetRunningApplicationProgramId
|-
|-
| 2 || [10.0.0+] IsDataCorruptedResult ||
| 2524 || [19.0.0+]  
|}
|}


=== IReadOnlyApplicationControlDataInterface ===
=== IDownloadTaskInterface ===
This is "nn::ns::detail::IReadOnlyApplicationControlDataInterface".
This is "nn::ns::detail::IDownloadTaskInterface".
 
This was added with [5.1.0+].


{| class="wikitable" border="1"
{| class="wikitable" border="1"
|-
|-
! Cmd || Name || Notes
! Cmd || Name
|-
| 701 || [[#ClearTaskStatusList]]
|-
| 702 || [[#RequestDownloadTaskList]]
|-
| 703 || [[#RequestEnsureDownloadTask]]
|-
| 704 || [[#ListDownloadTaskStatus]]
|-
| 705 || [[#RequestDownloadTaskListData]]
|-
|-
| 0 || [[#GetApplicationControlData]] || Same as [[#IApplicationManagerInterface]] cmd 400
| 706 || [4.0.0+] [[#TryCommitCurrentApplicationDownloadTask]]
|-
|-
| 1 || [[#GetApplicationDesiredLanguage]] || Same as [[#IApplicationManagerInterface]] cmd 55
| 707 || [4.0.0+] [[#EnableAutoCommit]]
|-
|-
| 2 || ConvertApplicationLanguageToLanguageCode || Same as [[#IApplicationManagerInterface]] cmd 59
| 708 || [4.0.0+] [[#DisableAutoCommit]]
|-
|-
| 3 || [[#ConvertLanguageCodeToApplicationLanguage]] || Same as [[#IApplicationManagerInterface]] cmd 60
| 709 || [4.0.0+] [[#TriggerDynamicCommitEvent]]
|-
|-
| 4 || [9.0.0+] SelectApplicationDesiredLanguage ||
| 710 || [20.0.0+]
|}
|}


=== IDynamicRightsInterface ===
==== ClearTaskStatusList ====
This is "nn::ns::detail::IDynamicRightsInterface".
No input/output.
 
==== RequestDownloadTaskList ====
No input/output.
 
==== RequestEnsureDownloadTask ====
No input, returns an output Event handle and an [[#IAsyncResult]].
 
==== ListDownloadTaskStatus ====
Takes a type-0x6 output buffer containing an array of [[#DownloadTaskStatus]], returns an output s32 total_out.
 
A maximum of 0x100 tasks can be stored in state.
 
==== TryCommitCurrentApplicationDownloadTask ====
No input/output.
 
==== EnableAutoCommit ====
No input/output.
 
==== DisableAutoCommit ====
No input/output.
 
==== TriggerDynamicCommitEvent ====
No input/output.


This was added with [6.0.0+].
=== IReadOnlyApplicationRecordInterface ===
This is "nn::ns::detail::IReadOnlyApplicationRecordInterface".
 
This was added with [5.0.0+].


{| class="wikitable" border="1"
{| class="wikitable" border="1"
|-
|-
! Cmd || Name
! Cmd || Name || Notes
|-
|-
| 0 || [[#RequestApplicationRightsOnServer]]
| 0 || HasApplicationRecord || Same as [[#IApplicationManagerInterface]] cmd 910
|-
|-
| 1 || [[#RequestAssignRights]]
| 1 || [10.0.0+] NotifyApplicationFailure ||
|-
|-
| 4 || [[#DeprecatedRequestAssignRightsToResume]]
| 2 || [10.0.0+] IsDataCorruptedResult ||
|-
|-
| 5 || [[#VerifyActivatedRightsOwners]]
| 3 || [20.0.0+] ||
|}
 
=== IReadOnlyApplicationControlDataInterface ===
This is "nn::ns::detail::IReadOnlyApplicationControlDataInterface".
 
This was added with [5.1.0+].
 
{| class="wikitable" border="1"
|-
|-
| 6 || [[#DeprecatedGetApplicationRightsStatus]]
! Cmd || Name || Notes
|-
|-
| 7 || [[#RequestPrefetchForDynamicRights]]
| 0 || [[#GetApplicationControlData]] || Same as [[#IApplicationManagerInterface]] cmd 400
|-
|-
| 8 || [[#GetDynamicRightsState]]
| 1 || [[#GetApplicationDesiredLanguage]] || Same as [[#IApplicationManagerInterface]] cmd 55
|-
|-
| 9 || [7.0.0+] [[#RequestApplicationRightsOnServerToResume]]
| 2 || ConvertApplicationLanguageToLanguageCode || Same as [[#IApplicationManagerInterface]] cmd 59
|-
|-
| 10 || [7.0.0+] [[#RequestAssignRightsToResume]]
| 3 || [[#ConvertLanguageCodeToApplicationLanguage]] || Same as [[#IApplicationManagerInterface]] cmd 60
|-
|-
| 11 || [7.0.0+] [[#GetActivatedRightsUsers]]
| 4 || [9.0.0+] SelectApplicationDesiredLanguage ||
|-
| 12 || [8.0.0+] [[#GetApplicationRightsStatus]]
|-
|-
| 13 || [8.0.0+] [[#GetRunningApplicationStatus]]
| 5 || [19.0.0+] ||
|-
|-
| 14 || [10.0.0-15.0.1] SelectApplicationLicense
| 6 || [19.0.0+] ||
|-
| 15 || [12.0.0+] [[#RequestContentsAuthorizationToken]]
|-
|-
| 16 || [13.0.0+] QualifyUser
| 7 || [20.0.0+] ||
|-
|-
| 17 || [13.0.0+] QualifyUserWithProcessId
| 8 || [20.0.0+] ||
|-
|-
| 18 || [13.0.0+] NotifyApplicationRightsCheckStart
| 9 || [20.0.0+] ||
|-
|-
| 19 || [13.0.0+] UpdateUserList
| 10 || [20.0.0+] ||
|-
|-
| 20 || [13.0.0+] IsRightsLostUser
| 11 || [20.0.0+] ||
|-
|-
| 21 || [13.1.0+] SetRequiredAddOnContentsOnContentsAvailabilityTransition
| 12 || [20.0.0+] ||
|-
|-
| 22 || [14.0.0+] GetLimitedApplicationLicense
| 13 || [20.0.0+] ||
|-
|-
| 23 || [14.0.0+] GetLimitedApplicationLicenseUpgradableEvent
| 14 || [20.0.0+] ||
|-
|-
| 24 || [14.0.0+] NotifyLimitedApplicationLicenseUpgradableEventForDebug
| 15 || [20.0.0+] ||
|-
|-
| 25 || [14.0.0+] RequestProceedDynamicRightsState
| 16 || [20.0.0+] ||
|-
|-
| 26 || [18.0.0+]  
| 17 || [20.1.0+] ||
|}
|}


==== RequestApplicationRightsOnServer ====
=== IDynamicRightsInterface ===
Takes an input [[NCM_services#ApplicationId|ApplicationId]], an [[Account_services#Uid|Uid]] and an u32. Returns an output Event handle and an [[#IAsyncValue]].
This is "nn::ns::detail::IDynamicRightsInterface".


==== RequestAssignRights ====
This was added with [6.0.0+].
Takes a type-0x5 input buffer containing an array of "nn::ns::ApplicationRightsOnServer". Returns an output Event handle and an [[#IAsyncResult]].
 
==== DeprecatedRequestAssignRightsToResume ====
Takes an input u64 "nn::ns::RightsEnvironmentHandle" and an [[Account_services#Uid|Uid]]. Returns an output Event handle and an [[#IAsyncResult]].
 
==== VerifyActivatedRightsOwners ====
Takes an input u64 "nn::ns::RightsEnvironmentHandle". No output.
 
==== DeprecatedGetApplicationRightsStatus ====
Takes an input u64 "nn::ns::RightsEnvironmentHandle". Returns a bool "nn::ns::ApplicationRightsStatus".
 
==== RequestPrefetchForDynamicRights ====
Takes an input [[Account_services#Uid|Uid]]. Returns an output Event handle and an [[#IAsyncResult]].
 
==== GetDynamicRightsState ====
No input. Returns a bool "nn::ns::DynamicRightsState".
 
==== RequestApplicationRightsOnServerToResume ====
Takes an input u64 "nn::ns::RightsEnvironmentHandle". Returns an output Event handle and an [[#IAsyncValue]].
 
==== RequestAssignRightsToResume ====
Takes an input u64 "nn::ns::RightsEnvironmentHandle". Returns an output Event handle and an [[#IAsyncResult]].
 
==== GetActivatedRightsUsers ====
Takes an input u64 "nn::ns::RightsEnvironmentHandle". Returns a bool, an u32 and a type-0x6 output buffer containing an array of [[Account_services#Uid|Uid]].
 
==== GetApplicationRightsStatus ====
Takes an input "nn::ns::RightsEnvironmentHandle". Returns 2 bools "nn::ns::ApplicationRightsStatus" and "nn::ns::ApplicationLicenseType".
 
==== GetRunningApplicationStatus ====
Takes an input u64 "nn::ns::RightsEnvironmentHandle". Returns an u32 "nn::ns::RunningApplicationStatus".
 
==== RequestContentsAuthorizationToken ====
Takes a total of 0x50-bytes of input, a type-0x5 input buffer. Returns an [[#IAsyncData_2|IAsyncData]] and an output handle.
 
==== IAsyncData ====
This is "nn::ns::detail::IAsyncData".
 
This was added with [12.0.0+].


{| class="wikitable" border="1"
{| class="wikitable" border="1"
Line 2,016: Line 2,182:
! Cmd || Name
! Cmd || Name
|-
|-
| 0 || GetSize
| 0 || [[#RequestApplicationRightsOnServer]]
|-
| 1 || [[#RequestAssignRights]]
|-
| 4 || [[#DeprecatedRequestAssignRightsToResume]]
|-
|-
| 1 || Get
| 5 || [[#VerifyActivatedRightsOwners]]
|-
|-
| 2 || Cancel
| 6 || [[#DeprecatedGetApplicationRightsStatus]]
|-
|-
| 3 || GetErrorContext
| 7 || [[#RequestPrefetchForDynamicRights]]
|}
 
=== IECommerceInterface===
This is "nn::ns::detail::IECommerceInterface".
 
This was added with [4.0.0+].
 
{| class="wikitable" border="1"
|-
|-
! Cmd || Name
| 8 || [[#GetDynamicRightsState]]
|-
|-
| 0 || [[#RequestLinkDevice]]
| 9 || [7.0.0+] [[#RequestApplicationRightsOnServerToResume]]
|-
|-
| 1 || [6.0.0+] [[#RequestCleanupAllPreInstalledApplications]]
| 10 || [7.0.0+] [[#RequestAssignRightsToResume]]
|-
|-
| 2 || [6.0.0+] [[#RequestCleanupPreInstalledApplication]]
| 11 || [7.0.0+] [[#GetActivatedRightsUsers]]
|-
|-
| 3 || [6.0.0+] [[#RequestSyncRights]]
| 12 || [8.0.0+] [[#GetApplicationRightsStatus]]
|-
|-
| 4 || [6.0.0+] [[#RequestUnlinkDevice]]
| 13 || [8.0.0+] [[#GetRunningApplicationStatus]]
|-
|-
| 5 || [6.1.0+] [[#RequestRevokeAllELicense]]
| 14 || [10.0.0-15.0.1] SelectApplicationLicense
|-
|-
| 6 || [9.0.0+] [[#RequestSyncRightsBasedOnAssignedELicenses]]
| 15 || [12.0.0+] [[#RequestContentsAuthorizationToken]]
|-
|-
| 7 || [14.0.0+] RequestOnlineSubscriptionFreeTrialAvailability
| 16 || [13.0.0+] QualifyUser
|}
 
==== RequestLinkDevice ====
Takes an input [[Account_services#Uid|Uid]], returns an output Event handle and an [[#IAsyncResult]].
 
See [[#RequestApplicationUpdateInfo]] regarding nifm.
 
==== RequestCleanupAllPreInstalledApplications ====
No input, returns an output Event handle and an [[#IAsyncResult]].
 
==== RequestCleanupPreInstalledApplication ====
Takes an input [[NCM_services#ApplicationId|ApplicationId]], returns an output Event handle and an [[#IAsyncResult]].
 
==== RequestSyncRights ====
No input, returns an output Event handle and an [[#IAsyncResult]].
 
==== RequestUnlinkDevice ====
Takes an input [[Account_services#Uid|Uid]], returns an output Event handle and an [[#IAsyncResult]].
 
See [[#RequestApplicationUpdateInfo]] regarding nifm.
 
==== RequestRevokeAllELicense ====
Takes an input [[Account_services#Uid|Uid]], returns an output Event handle and an [[#IAsyncResult]].
 
==== RequestSyncRightsBasedOnAssignedELicenses ====
No input, returns an output Event handle and an [[#IAsyncResult]].
 
=== IFactoryResetInterface ===
This is "nn::ns::detail::IFactoryResetInterface".
 
{| class="wikitable" border="1"
|-
|-
! Cmd || Name
| 17 || [13.0.0+] QualifyUserWithProcessId
|-
|-
| 100 || [[#ResetToFactorySettings]]
| 18 || [13.0.0+] NotifyApplicationRightsCheckStart
|-
|-
| 101 || [[#ResetToFactorySettingsWithoutUserSaveData]]
| 19 || [13.0.0+] UpdateUserList
|-
|-
| 102 || [[#ResetToFactorySettingsForRefurbishment]]
| 20 || [13.0.0+] IsRightsLostUser
|-
|-
| 103 || [9.1.0+] [[#ResetToFactorySettingsWithPlatformRegion]]
| 21 || [13.1.0+] SetRequiredAddOnContentsOnContentsAvailabilityTransition
|-
|-
| 104 || [9.1.0+] [[#ResetToFactorySettingsWithPlatformRegionAuthentication]]
| 22 || [14.0.0+] GetLimitedApplicationLicense
|-
| 23 || [14.0.0+] GetLimitedApplicationLicenseUpgradableEvent
|-
| 24 || [14.0.0+] NotifyLimitedApplicationLicenseUpgradableEventForDebug
|-
| 25 || [14.0.0+] RequestProceedDynamicRightsState
|-
| 26 || [18.0.0+] HasAccountRestrictedRightsInRunningApplications
|-
|-
| 105 || [10.0.0+] [[#RequestResetToFactorySettingsSecurely]]
| 27 || [20.0.0+]
|-
|-
| 106 || [10.0.0+] [[#RequestResetToFactorySettingsWithPlatformRegionAuthenticationSecurely]]
| 28 || [20.0.0+]
|}
|}


==== ResetToFactorySettings ====
==== RequestApplicationRightsOnServer ====
No input/output.
Takes an input [[NCM_services#ApplicationId|ApplicationId]], an [[Account_services#Uid|Uid]] and an u32. Returns an output Event handle and an [[#IAsyncValue]].


As of [9.1.0] this is the only [[#IFactoryResetInterface]] cmd used by [[qlaunch]].
==== RequestAssignRights ====
Takes a type-0x5 input buffer containing an array of "nn::ns::ApplicationRightsOnServer". Returns an output Event handle and an [[#IAsyncResult]].


==== ResetToFactorySettingsWithoutUserSaveData ====
==== DeprecatedRequestAssignRightsToResume ====
No input/output.
Takes an input u64 "nn::ns::RightsEnvironmentHandle" and an [[Account_services#Uid|Uid]]. Returns an output Event handle and an [[#IAsyncResult]].


==== ResetToFactorySettingsForRefurbishment ====
==== VerifyActivatedRightsOwners ====
No input/output.
Takes an input u64 "nn::ns::RightsEnvironmentHandle". No output.


==== ResetToFactorySettingsWithPlatformRegion ====
==== DeprecatedGetApplicationRightsStatus ====
No input/output.
Takes an input u64 "nn::ns::RightsEnvironmentHandle". Returns a bool "nn::ns::ApplicationRightsStatus".


==== ResetToFactorySettingsWithPlatformRegionAuthentication ====
==== RequestPrefetchForDynamicRights ====
No input/output.
Takes an input [[Account_services#Uid|Uid]]. Returns an output Event handle and an [[#IAsyncResult]].


==== RequestResetToFactorySettingsSecurely ====
==== GetDynamicRightsState ====
Takes an input u64 tmem_size, a TransferMemory handle, returns an output [[#IAsyncValueAndProgress]] and an Event handle.
No input. Returns a bool "nn::ns::DynamicRightsState".


The TransferMemory uses permissions=0.
==== RequestApplicationRightsOnServerToResume ====
Takes an input u64 "nn::ns::RightsEnvironmentHandle". Returns an output Event handle and an [[#IAsyncValue]].


==== RequestResetToFactorySettingsWithPlatformRegionAuthenticationSecurely ====
==== RequestAssignRightsToResume ====
Takes an input u32 "nn::ae::PlatformRegion", an u64 tmem_size, a TransferMemory handle, returns an output [[#IAsyncValueAndProgress]] and an Event handle.
Takes an input u64 "nn::ns::RightsEnvironmentHandle". Returns an output Event handle and an [[#IAsyncResult]].
 
==== GetActivatedRightsUsers ====
Takes an input u64 "nn::ns::RightsEnvironmentHandle". Returns a bool, an u32 and a type-0x6 output buffer containing an array of [[Account_services#Uid|Uid]].
 
==== GetApplicationRightsStatus ====
Takes an input "nn::ns::RightsEnvironmentHandle". Returns 2 bools "nn::ns::ApplicationRightsStatus" and "nn::ns::ApplicationLicenseType".
 
==== GetRunningApplicationStatus ====
Takes an input u64 "nn::ns::RightsEnvironmentHandle". Returns an u32 "nn::ns::RunningApplicationStatus".


The TransferMemory uses permissions=0.
==== RequestContentsAuthorizationToken ====
Takes a total of 0x50-bytes of input, a type-0x5 input buffer. Returns an [[#IAsyncData_2|IAsyncData]] and an output handle.


===== IAsyncValueAndProgress =====
==== IAsyncData ====
This is "nn::ns::detail::IAsyncValueAndProgress".
This is "nn::ns::detail::IAsyncData".


This was added with [10.0.0+].
This was added with [12.0.0+].


{| class="wikitable" border="1"
{| class="wikitable" border="1"
Line 2,141: Line 2,292:
|-
|-
| 3 || GetErrorContext
| 3 || GetErrorContext
|-
| 4 || GetProgress
|}
|}


=== IApplicationResource ===
=== IECommerceInterface===
This is "nn::ns::detail::IApplicationResource".
This is "nn::ns::detail::IECommerceInterface".


This was added with [9.0.0+].
This was added with [4.0.0+].


{| class="wikitable" border="1"
{| class="wikitable" border="1"
Line 2,154: Line 2,303:
! Cmd || Name
! Cmd || Name
|-
|-
| 0 || Attach
| 0 || [[#RequestLinkDevice]]
|-
|-
| 1 || BoostSystemMemoryResourceLimit
| 1 || [6.0.0+] [[#RequestCleanupAllPreInstalledApplications]]
|}
 
= ns:vm =
This is "nn::ns::detail::IVulnerabilityManagerInterface".
 
{| class="wikitable" border="1"
|-
|-
! Cmd || Name
| 2 || [6.0.0+] [[#RequestCleanupPreInstalledApplication]]
|-
| 3 || [6.0.0+] [[#RequestSyncRights]]
|-
| 4 || [6.0.0+] [[#RequestUnlinkDevice]]
|-
| 5 || [6.1.0+] [[#RequestRevokeAllELicense]]
|-
| 6 || [9.0.0+] [[#RequestSyncRightsBasedOnAssignedELicenses]]
|-
| 7 || [14.0.0+] RequestOnlineSubscriptionFreeTrialAvailability
|-
|-
| 1200 || [3.0.0+] [[#NeedsUpdateVulnerability]]
| 8 || [20.0.0+]
|-
|-
| 1201 || [4.0.0+] [[#UpdateSafeSystemVersionForDebug]]
| 9 || [20.0.0+]
|-
|-
| 1202 || [4.0.0+] [[#GetSafeSystemVersion]]
| 10 || [20.0.0+]
|-
|-
| 3100 || [18.0.0+]  
| 11 || [20.0.0+]
|-
|-
| 3101 || [18.0.0+]  
| 12 || [20.0.0+]
|-
|-
| 3102 || [18.0.0+]  
| 13 || [20.0.0+]
|}
|}


== NeedsUpdateVulnerability ==
==== RequestLinkDevice ====
No input, returns an output u8 bool flag.
Takes an input [[Account_services#Uid|Uid]], returns an output Event handle and an [[#IAsyncResult]].


Web-applets use this command to check if the system needs an update.
See [[#RequestApplicationUpdateInfo]] regarding nifm.


== UpdateSafeSystemVersionForDebug ==
==== RequestCleanupAllPreInstalledApplications ====
Takes an input [[NCM_services#ApplicationId|ApplicationId]] and an u32 '''version'''.
No input, returns an output Event handle and an [[#IAsyncResult]].


This command is not available for retail units. On a debug unit, if the [[System_Settings|system setting]] <code>vulnerability!enable_debug</code> is set, this mounts the system savegame [[Flash_Filesystem#System_Savegames|0x8000000000000049]] as "ns_ssversion:/", opens the file "ns_ssversion:/entry" and writes the supplied [[NCM_services#ApplicationId|ApplicationId]] and '''version''' in it.
==== RequestCleanupPreInstalledApplication ====
Takes an input [[NCM_services#ApplicationId|ApplicationId]], returns an output Event handle and an [[#IAsyncResult]].


Finally, it calls [[NCM_services#ncm|OpenContentMetaDatabase]] with [[NCM_services#StorageId|StorageId]] 3, then calls [[NCM_services#IContentMetaDatabase|GetLatestContentMetaKey]] with the supplied [[NCM_services#ApplicationId|ApplicationId]] and compares the version field from the returned [[CNMT#Content_Meta_Records|Content Meta Record]] with the supplied '''version'''.
==== RequestSyncRights ====
No input, returns an output Event handle and an [[#IAsyncResult]].


If the supplied '''version''' is higher than the one in NCM's database, the value returned by [[NS_Services#NeedsUpdateVulnerability|NeedsUpdateVulnerability]] is set to "true".
==== RequestUnlinkDevice ====
Takes an input [[Account_services#Uid|Uid]], returns an output Event handle and an [[#IAsyncResult]].


== GetSafeSystemVersion ==
See [[#RequestApplicationUpdateInfo]] regarding nifm.
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>).


= ns:su =
==== RequestRevokeAllELicense ====
This is "nn::ns::detail::ISystemUpdateInterface".
Takes an input [[Account_services#Uid|Uid]], returns an output Event handle and an [[#IAsyncResult]].
 
==== RequestSyncRightsBasedOnAssignedELicenses ====
No input, returns an output Event handle and an [[#IAsyncResult]].
 
=== IFactoryResetInterface ===
This is "nn::ns::detail::IFactoryResetInterface".


{| class="wikitable" border="1"
{| class="wikitable" border="1"
Line 2,203: Line 2,364:
! Cmd || Name
! Cmd || Name
|-
|-
| 0 || [[#GetBackgroundNetworkUpdateState]]
| 100 || [[#ResetToFactorySettings]]
|-
|-
| 1 || [[#OpenSystemUpdateControl]]
| 101 || [[#ResetToFactorySettingsWithoutUserSaveData]]
|-
|-
| 2 || [[#NotifyExFatDriverRequired]]
| 102 || [[#ResetToFactorySettingsForRefurbishment]]
|-
|-
| 3 || [[#ClearExFatDriverStatusForDebug]]
| 103 || [9.1.0+] [[#ResetToFactorySettingsWithPlatformRegion]]
|-
|-
| 4 || [[#RequestBackgroundNetworkUpdate]]
| 104 || [9.1.0+] [[#ResetToFactorySettingsWithPlatformRegionAuthentication]]
|-
|-
| 5 || [[#NotifyBackgroundNetworkUpdate]]
| 105 || [10.0.0+] [[#RequestResetToFactorySettingsSecurely]]
|-
|-
| 6 || [[#NotifyExFatDriverDownloadedForDebug]]
| 106 || [10.0.0+] [[#RequestResetToFactorySettingsWithPlatformRegionAuthenticationSecurely]]
|-
|-
| 9 || [[#GetSystemUpdateNotificationEventForContentDelivery]]
| 107 || [20.0.0+]
|-
|-
| 10 || [[#NotifySystemUpdateForContentDelivery]]
| 108 || [20.0.0+]
|-
|}
| 11 || [3.0.0+] [[#PrepareShutdown]]
 
|-
==== ResetToFactorySettings ====
| 12 || [3.0.0-3.0.2]
No input/output.
|-
 
| 13 || [3.0.0-3.0.2]
As of [9.1.0] this is the only [[#IFactoryResetInterface]] cmd used by [[qlaunch]].
|-
 
| 14 || [3.0.0-3.0.2]
==== ResetToFactorySettingsWithoutUserSaveData ====
|-
No input/output.
| 15 || [3.0.0-3.0.2]
|-
| 16 || [4.0.0+] [[#DestroySystemUpdateTask]]
|-
| 17 || [4.0.0+] [[#RequestSendSystemUpdate]]
|-
| 18 || [4.0.0+] [[#GetSendSystemUpdateProgress]]
|}


== GetBackgroundNetworkUpdateState ==
==== ResetToFactorySettingsForRefurbishment ====
No input, returns an output [[#BackgroundNetworkUpdateState]].
No input/output.


This is similar to [[#HasDownloaded]], see [[#BackgroundNetworkUpdateState]].
==== ResetToFactorySettingsWithPlatformRegion ====
No input/output.


== OpenSystemUpdateControl ==
==== ResetToFactorySettingsWithPlatformRegionAuthentication ====
No input, returns an [[#ISystemUpdateControl]].
 
== NotifyExFatDriverRequired ==
No input/output.
No input/output.


Only usable when an [[#ISystemUpdateControl]] isn't open.
==== RequestResetToFactorySettingsSecurely ====
Takes an input u64 tmem_size, a TransferMemory handle, returns an output [[#IAsyncValueAndProgress]] and an Event handle.


This uses [[NIM_services|nim]] ListSystemUpdateTask, then when a task is returned uses it with DestroySystemUpdateTask.
The TransferMemory uses permissions=0.


Then this runs ExFat handling, updates state, and sets the same state flag as [[#RequestBackgroundNetworkUpdate]].
==== RequestResetToFactorySettingsWithPlatformRegionAuthenticationSecurely ====
Takes an input u32 "nn::ae::PlatformRegion", an u64 tmem_size, a TransferMemory handle, returns an output [[#IAsyncValueAndProgress]] and an Event handle.


== ClearExFatDriverStatusForDebug ==
The TransferMemory uses permissions=0.
No input/output.


== RequestBackgroundNetworkUpdate ==
===== IAsyncValueAndProgress =====
No input/output.
This is "nn::ns::detail::IAsyncValueAndProgress".


Only usable when an [[#ISystemUpdateControl]] isn't open.
This was added with [10.0.0+].


This sets a state flag to value 1.
{| class="wikitable" border="1"
|-
! Cmd || Name
|-
| 0 || GetSize
|-
| 1 || Get
|-
| 2 || Cancel
|-
| 3 || GetErrorContext
|-
| 4 || GetProgress
|}


== NotifyBackgroundNetworkUpdate ==
=== IApplicationResource ===
Takes an input [[NCM_services#ContentMetaKey|ContentMetaKey]], no output.
This is "nn::ns::detail::IApplicationResource".


This checks whether a sysupdate is needed with the input ContentMetaKey using [[NCM_services|NCM]] commands, if not this will just return 0. Otherwise, this will then run code which is identical to [[#RequestBackgroundNetworkUpdate]].
This was added with [9.0.0+].


== NotifyExFatDriverDownloadedForDebug ==
{| class="wikitable" border="1"
No input/output.
|-
! Cmd || Name
|-
| 0 || Attach
|-
| 1 || BoostSystemMemoryResourceLimit
|}


== GetSystemUpdateNotificationEventForContentDelivery ==
= ns:vm =
No input, returns an output Event handle with EventClearMode=0.
This is "nn::ns::detail::IVulnerabilityManagerInterface".


== NotifySystemUpdateForContentDelivery ==
{| class="wikitable" border="1"
No input/output.
|-
! Cmd || Name
|-
| 1200 || [3.0.0+] [[#NeedsUpdateVulnerability]]
|-
| 1201 || [4.0.0+] [[#UpdateSafeSystemVersionForDebug]]
|-
| 1202 || [4.0.0+] [[#GetSafeSystemVersion]]
|-
| 3100 || [18.0.0+]
|-
| 3101 || [18.0.0+]
|-
| 3102 || [18.0.0+]
|}


Signals the Event returned by [[#GetSystemUpdateNotificationEventForContentDelivery]].
== NeedsUpdateVulnerability ==
No input, returns an output u8 bool flag.


== PrepareShutdown ==
Web-applets use this command to check if the system needs an update.
No input/output.


This is used by [[AM_services|AM]].
== UpdateSafeSystemVersionForDebug ==
Takes an input [[NCM_services#ApplicationId|ApplicationId]] and an u32 '''version'''.


Just returns 0 when an [[#ISystemUpdateControl]] is open.  
This command is not available for retail units. On a debug unit, if the [[System_Settings|system setting]] <code>vulnerability!enable_debug</code> is set, this mounts the system savegame [[Flash_Filesystem#System_Savegames|0x8000000000000049]] as "ns_ssversion:/", opens the file "ns_ssversion:/entry" and writes the supplied [[NCM_services#ApplicationId|ApplicationId]] and '''version''' in it.


This does various cleanup / uses various service-cmds etc for shutdown preparation.
Finally, it calls [[NCM_services#ncm|OpenContentMetaDatabase]] with [[NCM_services#StorageId|StorageId]] 3, then calls [[NCM_services#IContentMetaDatabase|GetLatestContentMetaKey]] with the supplied [[NCM_services#ApplicationId|ApplicationId]] and compares the version field from the returned [[CNMT#Content_Meta_Records|Content Meta Record]] with the supplied '''version'''.


== DestroySystemUpdateTask ==
If the supplied '''version''' is higher than the one in NCM's database, the value returned by [[NS_Services#NeedsUpdateVulnerability|NeedsUpdateVulnerability]] is set to "true".
No input/output.


Only usable when an [[#ISystemUpdateControl]] isn't open.
== GetSafeSystemVersion ==
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>).


This uses [[NIM_services|nim]] ListSystemUpdateTask, then when a task is returned uses it with DestroySystemUpdateTask.
= ns:su =
This is "nn::ns::detail::ISystemUpdateInterface".


== RequestSendSystemUpdate ==
{| class="wikitable" border="1"
Takes a type-0x15 input buffer containing a [[#SystemDeliveryInfo]], an u16 port, an u32 Ipv4Address, returns an output Event handle and an [[#IAsyncResult]].
|-
 
[[qlaunch]] uses value 55556 for the port. IP is normally a local-WLAN address, however this can be any address. port/addr are little-endian.
 
[[NIM_services|NIM]] will use the input addr/port with [[Sockets_services|bind()]]. During [[Sockets_services|accept()]] handling the addr from there must match the input addr. Hence, addr must be the client addr. [[NIM_services|NIM]] will also eventually verify that the system is not Internet-connected.
 
This validates the [[#SystemDeliveryInfo]] and generates a [[NCM_services#ContentMetaKey|ContentMetaKey]] from that, and creates the [[#IAsyncResult]] + the async thread which handles the [[#IAsyncResult]] operation. Then the thread does:
* Calls a func which does:
** Uses [[NIM_services|nim]] cmd76, returning the Result on failure.
** Uses [[NIM_services|nim]] cmd77, returning the Result on failure. Waits for the IAsyncResult operation from this to finish, then uses the Get cmd to get the output Result.
** Handles cleanup and returns.
* Unlike [[#RequestReceiveSystemUpdate]], this doesn't save a SystemPlayReport.
 
== GetSendSystemUpdateProgress ==
No input, returns an output [[#SystemUpdateProgress]].
 
Same as [[#GetReceiveProgress]] except this uses nim cmd81 and cmd78.
 
== ISystemUpdateControl ==
This is "nn::ns::detail::ISystemUpdateControl".
 
{| class="wikitable" border="1"
|-
! Cmd || Name
! Cmd || Name
|-
|-
| 0 || [[#HasDownloaded]]
| 0 || [[#GetBackgroundNetworkUpdateState]]
|-
|-
| 1 || [[#RequestCheckLatestUpdate]]
| 1 || [[#OpenSystemUpdateControl]]
|-
|-
| 2 || [[#RequestDownloadLatestUpdate]]
| 2 || [[#NotifyExFatDriverRequired]]
|-
|-
| 3 || [[#GetDownloadProgress]]
| 3 || [[#ClearExFatDriverStatusForDebug]]
|-
|-
| 4 || [[#ApplyDownloadedUpdate]]
| 4 || [[#RequestBackgroundNetworkUpdate]]
|-
|-
| 5 || [[#RequestPrepareCardUpdate]]
| 5 || [[#NotifyBackgroundNetworkUpdate]]
|-
|-
| 6 || [[#GetPrepareCardUpdateProgress]]
| 6 || [[#NotifyExFatDriverDownloadedForDebug]]
|-
|-
| 7 || [[#HasPreparedCardUpdate]]
| 9 || [[#GetSystemUpdateNotificationEventForContentDelivery]]
|-
|-
| 8 || [[#ApplyCardUpdate]]
| 10 || [[#NotifySystemUpdateForContentDelivery]]
|-
|-
| 9 || [[#GetDownloadedEulaDataSize]]
| 11 || [3.0.0+] [[#PrepareShutdown]]
|-
|-
| 10 || [[#GetDownloadedEulaData]]
| 12 || [3.0.0-3.0.2]
|-
|-
| 11 || [[#SetupCardUpdate]]
| 13 || [3.0.0-3.0.2]
|-
|-
| 12 || [[#GetPreparedCardUpdateEulaDataSize]]
| 14 || [3.0.0-3.0.2]
|-
|-
| 13 || [[#GetPreparedCardUpdateEulaData]]
| 15 || [3.0.0-3.0.2]
|-
|-
| 14 || [4.0.0+] [[#SetupCardUpdateViaSystemUpdater]]
| 16 || [4.0.0+] [[#DestroySystemUpdateTask]]
|-
|-
| 15 || [4.0.0+] [[#HasReceived]]
| 17 || [4.0.0+] [[#RequestSendSystemUpdate]]
|-
|-
| 16 || [4.0.0+] [[#RequestReceiveSystemUpdate]]
| 18 || [4.0.0+] [[#GetSendSystemUpdateProgress]]
|-
| 17 || [4.0.0+] [[#GetReceiveProgress]]
|-
| 18 || [4.0.0+] [[#ApplyReceivedUpdate]]
|-
| 19 || [4.0.0+] [[#GetReceivedEulaDataSize]]
|-
| 20 || [4.0.0+] [[#GetReceivedEulaData]]
|-
| 21 || [4.0.0+] [[#SetupToReceiveSystemUpdate]]
|-
| 22 || [6.0.0+] [[#RequestCheckLatestUpdateIncludesRebootlessUpdate]]
|}
|}


Only 1 ISystemUpdateControl can be open at a time.
== GetBackgroundNetworkUpdateState ==
No input, returns an output [[#BackgroundNetworkUpdateState]].


All Card cmds except SetupCardUpdate* require [[#SetupCardUpdate]]/[[#SetupCardUpdateViaSystemUpdater]] to be used previously. [[#GetPreparedCardUpdateEulaDataSize]]/[[#GetPreparedCardUpdateEulaData]] checks a different state flag.
This is similar to [[#HasDownloaded]], see [[#BackgroundNetworkUpdateState]].


=== HasDownloaded ===
== OpenSystemUpdateControl ==
No input, returns an output u8 bool flag.
No input, returns an [[#ISystemUpdateControl]].


Gets whether a network sysupdate was downloaded, with install pending.
== NotifyExFatDriverRequired ==
No input/output.


Uses [[NIM_services|nim]] ListSystemUpdateTask and [[NIM_services|nim]] GetSystemUpdateTaskInfo. When ListSystemUpdateTask successfully returns a task and GetSystemUpdateTaskInfo is successful, the output flag is set to: <code>*((u8*)(taskinfo+0) == 0x3</code>. Otherwise, flag=0.
Only usable when an [[#ISystemUpdateControl]] isn't open.
 
This uses [[NIM_services|nim]] ListSystemUpdateTask, then when a task is returned uses it with DestroySystemUpdateTask.
 
Then this runs ExFat handling, updates state, and sets the same state flag as [[#RequestBackgroundNetworkUpdate]].
 
== ClearExFatDriverStatusForDebug ==
No input/output.
 
== RequestBackgroundNetworkUpdate ==
No input/output.


This always returns 0, however this will assert if GetSystemUpdateTaskInfo fails with ret!=0x3C89.
Only usable when an [[#ISystemUpdateControl]] isn't open.


=== RequestCheckLatestUpdate ===
This sets a state flag to value 1.
No input, returns an output Event handle and an [[#IAsyncValue]].


The data that can be read from the [[#IAsyncValue]] is [[#LatestSystemUpdate]].
== NotifyBackgroundNetworkUpdate ==
Takes an input [[NCM_services#ContentMetaKey|ContentMetaKey]], no output.


=== RequestDownloadLatestUpdate ===
This checks whether a sysupdate is needed with the input ContentMetaKey using [[NCM_services|NCM]] commands, if not this will just return 0. Otherwise, this will then run code which is identical to [[#RequestBackgroundNetworkUpdate]].
No input, returns an output Event handle and an [[#IAsyncResult]].


=== GetDownloadProgress ===
== NotifyExFatDriverDownloadedForDebug ==
No input, returns an output [[#SystemUpdateProgress]].
No input/output.


Similar to [[#HasDownloaded]] except instead of a flag, this returns the 0x10-bytes from taskinfo+8. The output struct is cleared when the task(info) isn't available.
== GetSystemUpdateNotificationEventForContentDelivery ==
No input, returns an output Event handle with EventClearMode=0.


=== ApplyDownloadedUpdate ===
== NotifySystemUpdateForContentDelivery ==
No input/output.
No input/output.


Runs code similar to [[#HasDownloaded]], throwing an error if a network sysupdate isn't ready for install. Then the sysupdate is installed:
Signals the Event returned by [[#GetSystemUpdateNotificationEventForContentDelivery]].


* Uses ListSystemUpdateTask again, then [[NIM_services|nim]] IsExFatDriverIncluded. Runs ExFat handling when the output flag is set.
== PrepareShutdown ==
* On newer system-versions, this uses [[NIM_services|nim]] GetSystemUpdateTaskInfo then on success uses data from there to save a SystemPlayReport when the cached [[System_Settings|system-setting]] "systemreport!enabled" is set.
No input/output.
** The EventId is "systemupdate_dl_throughput" with ApplicationId 0100000000001018.
** The following fields are added to the report, see [[NIM_services#SystemUpdateTaskInfo|nim SystemUpdateTaskInfo]]: "ContentMetaId", "Version", "DownloadSize", and "ThroughputKBps".
* On newer system-versions, this saves another SystemPlayReport when a state flag is set (same flag mentioned above).
** The EventId is "systemupdate_pass" with ApplicationId 0100000000001021.
** This report has the following fields:
*** "Type"
*** "SourceSystemUpdateMetaId"
*** "SourceSystemUpdateMetaVersion"
*** "SourceExFatStatus"
*** "DestinationSystemUpdateMetaId"
*** "DestinationSystemUpdateMetaVersion"
*** "DestinationExFatStatus"
*** "Rebootless"
* Since FIRM will be installed later, the two flags in [[Flash_Filesystem#System_Update_Control]] are set to 1.
* Uses [[NIM_services|nim]] CommitSystemUpdateTask and [[NIM_services|nim]] DestroySystemUpdateTask.
* Installs FIRM. After installing each FIRM, the associated flag in [[Flash_Filesystem#System_Update_Control]] is set to 0.
* On newer system versions when an input flag is set, this uses [[Filesystem_services|NotifySystemDataUpdateEvent]], however this doesn't happen with ApplyDownloadedUpdate since that input flag is 0.


=== RequestPrepareCardUpdate ===
This is used by [[AM_services|AM]].
No input, returns an output Event handle and an [[#IAsyncResult]].


=== GetPrepareCardUpdateProgress ===
Just returns 0 when an [[#ISystemUpdateControl]] is open.  
No input, returns an output [[#SystemUpdateProgress]].


=== HasPreparedCardUpdate ===
This does various cleanup / uses various service-cmds etc for shutdown preparation.
No input, returns an output u8 bool flag.


=== ApplyCardUpdate ===
== DestroySystemUpdateTask ==
No input/output.
No input/output.


=== GetDownloadedEulaDataSize ===
Only usable when an [[#ISystemUpdateControl]] isn't open.
Takes a type-0x15 input buffer [[#EulaDataPath]], returns an output u64 '''filesize'''.


Runs code similar to [[#HasDownloaded]], throwing an error if a network sysupdate isn't ready for install.
This uses [[NIM_services|nim]] ListSystemUpdateTask, then when a task is returned uses it with DestroySystemUpdateTask.


Uses ListSystemUpdateTask again. Then [[NIM_services|nim]] GetDownloadedSystemDataPath, with the output ContentPath being used to mount the EULA title with FS.
== RequestSendSystemUpdate ==
Takes a type-0x15 input buffer containing a [[#SystemDeliveryInfo]], an u16 port, an u32 Ipv4Address, returns an output Event handle and an [[#IAsyncResult]].


Then "<mountname>:/<[[#EulaDataPath]]>" is opened, gets the '''filesize''', then runs cleanup.
[[qlaunch]] uses value 55556 for the port. IP is normally a local-WLAN address, however this can be any address. port/addr are little-endian.


=== GetDownloadedEulaData ===
[[NIM_services|NIM]] will use the input addr/port with [[Sockets_services|bind()]]. During [[Sockets_services|accept()]] handling the addr from there must match the input addr. Hence, addr must be the client addr. [[NIM_services|NIM]] will also eventually verify that the system is not Internet-connected.
Takes a type-0x15 input buffer [[#EulaDataPath]] and a type-0x6 output buffer, returns an output u64 '''filesize'''.


Similar to [[#GetDownloadedEulaDataSize]] except this reads the file instead, using the specified output buffer with size=filesize. This will throw an error if the filesize is larger than the buffer size.
This validates the [[#SystemDeliveryInfo]] and generates a [[NCM_services#ContentMetaKey|ContentMetaKey]] from that, and creates the [[#IAsyncResult]] + the async thread which handles the [[#IAsyncResult]] operation. Then the thread does:
* Calls a func which does:
** Uses [[NIM_services|nim]] cmd76, returning the Result on failure.
** Uses [[NIM_services|nim]] cmd77, returning the Result on failure. Waits for the IAsyncResult operation from this to finish, then uses the Get cmd to get the output Result.
** Handles cleanup and returns.
* Unlike [[#RequestReceiveSystemUpdate]], this doesn't save a SystemPlayReport.


=== SetupCardUpdate ===
== GetSendSystemUpdateProgress ==
Takes an input u64 size and a TransferMemory handle, no output.
No input, returns an output [[#SystemUpdateProgress]].


Official sw creates the TransferMemory with an user-specified buffer, with permissions=None.
Same as [[#GetReceiveProgress]] except this uses nim cmd81 and cmd78.


[[qlaunch]] uses size 0x100000 for the TransferMemory buffer.
== ISystemUpdateControl ==
This is "nn::ns::detail::ISystemUpdateControl".


=== GetPreparedCardUpdateEulaDataSize ===
{| class="wikitable" border="1"
Takes a type-0x15 input buffer [[#EulaDataPath]], returns an output u64 '''filesize'''.
|-
 
! Cmd || Name
This is similar to [[#GetDownloadedEulaDataSize]].
|-
 
| 0 || [[#HasDownloaded]]
=== GetPreparedCardUpdateEulaData ===
|-
Takes a type-0x15 input buffer [[#EulaDataPath]] and a type-0x6 output buffer, returns an output u64 '''filesize'''.
| 1 || [[#RequestCheckLatestUpdate]]
 
|-
This is similar to [[#GetDownloadedEulaData]].
| 2 || [[#RequestDownloadLatestUpdate]]
 
|-
=== SetupCardUpdateViaSystemUpdater ===
| 3 || [[#GetDownloadProgress]]
Takes an input u64 size and a TransferMemory handle, no output.
|-
| 4 || [[#ApplyDownloadedUpdate]]
|-
| 5 || [[#RequestPrepareCardUpdate]]
|-
| 6 || [[#GetPrepareCardUpdateProgress]]
|-
| 7 || [[#HasPreparedCardUpdate]]
|-
| 8 || [[#ApplyCardUpdate]]
|-
| 9 || [[#GetDownloadedEulaDataSize]]
|-
| 10 || [[#GetDownloadedEulaData]]
|-
| 11 || [[#SetupCardUpdate]]
|-
| 12 || [[#GetPreparedCardUpdateEulaDataSize]]
|-
| 13 || [[#GetPreparedCardUpdateEulaData]]
|-
| 14 || [4.0.0+] [[#SetupCardUpdateViaSystemUpdater]]
|-
| 15 || [4.0.0+] [[#HasReceived]]
|-
| 16 || [4.0.0+] [[#RequestReceiveSystemUpdate]]
|-
| 17 || [4.0.0+] [[#GetReceiveProgress]]
|-
| 18 || [4.0.0+] [[#ApplyReceivedUpdate]]
|-
| 19 || [4.0.0+] [[#GetReceivedEulaDataSize]]
|-
| 20 || [4.0.0+] [[#GetReceivedEulaData]]
|-
| 21 || [4.0.0+] [[#SetupToReceiveSystemUpdate]]
|-
| 22 || [6.0.0+] [[#RequestCheckLatestUpdateIncludesRebootlessUpdate]]
|}


The permissions for the TransferMemory is None.
Only 1 ISystemUpdateControl can be open at a time.


Same as [[#SetupCardUpdate]], except this doesn't have the code for [[Filesystem_services|GetGameCardHandle/GetGameCardUpdatePartitionInfo]], and uses [[Filesystem_services|OpenRegisteredUpdatePartition]] instead of [[Filesystem_services|OpenGameCardFileSystem]]. This uses the same is_initialized bool state flag.
All Card cmds except SetupCardUpdate* require [[#SetupCardUpdate]]/[[#SetupCardUpdateViaSystemUpdater]] to be used previously. [[#GetPreparedCardUpdateEulaDataSize]]/[[#GetPreparedCardUpdateEulaData]] checks a different state flag.


=== HasReceived ===
=== HasDownloaded ===
No input, returns an output u8 bool.
No input, returns an output u8 bool flag.


Same as [[#HasDownloaded]] except this uses [[NIM_services|nim]] cmd71 and cmd73.
Gets whether a network sysupdate was downloaded, with install pending.


=== RequestReceiveSystemUpdate ===
Uses [[NIM_services|nim]] ListSystemUpdateTask and [[NIM_services|nim]] GetSystemUpdateTaskInfo. When ListSystemUpdateTask successfully returns a task and GetSystemUpdateTaskInfo is successful, the output flag is set to: <code>*((u8*)(taskinfo+0) == 0x3</code>. Otherwise, flag=0.
Takes a type-0x15 input buffer containing a [[#SystemDeliveryInfo]], an u16 port, an u32 Ipv4Address, returns an output Event handle and an [[#IAsyncResult]].


[[qlaunch]] uses the same value for the port as [[#RequestSendSystemUpdate]] (see [[#RequestSendSystemUpdate]] for addr as well).
This always returns 0, however this will assert if GetSystemUpdateTaskInfo fails with ret!=0x3C89.


[[NIM_services|NIM]] will use the input addr/port with [[Sockets_services|connect()]].
=== RequestCheckLatestUpdate ===
No input, returns an output Event handle and an [[#IAsyncValue]].


This validates the [[#SystemDeliveryInfo]] and generates a [[NCM_services#ContentMetaKey|ContentMetaKey]] from that, and creates the [[#IAsyncResult]] + the async thread which handles the [[#IAsyncResult]] operation. Then the thread does:
The data that can be read from the [[#IAsyncValue]] is [[#LatestSystemUpdate]].


* Calls a func which does:
=== RequestDownloadLatestUpdate ===
** Throws an error if [[NIM_services#ListSystemUpdateTask|ListSystemUpdateTask]] returns any task.
No input, returns an output Event handle and an [[#IAsyncResult]].
** Checks whether a sysupdate is actually required using the previously generated [[NCM_services#ContentMetaKey|ContentMetaKey]], throwing an error if not.
** Uses [[NIM_services|nim]] cmd69, returning the Result on failure.
** Uses [[NIM_services|nim]] cmd72, returning the Result on failure. Waits for the IAsyncResult operation from this to finish, then uses the Get cmd to get the output Result.
** Handles cleanup and returns.
* On success, this loads various data which is then used for saving a SystemPlayReport when the cached [[System_Settings|system-setting]] "systemreport!enabled" is set.
** The EventId is "receive_system_update" with ApplicationId <NS ProgramId>.
** This report has the following fields:
*** "SourceSystemUpdateId"
*** "DestinationSystemUpdateId"
*** "SourceSystemUpdateVersion"
*** "DestinationSystemUpdateVersion"
*** "SenderFirmwareVariationId"
*** "ReceiverFirmwareVariationId"
*** "SenderPlatformRegion"
*** "ReceiverPlatformRegion"
*** "SenderHasExFat"
*** "ReceiverHasExFat"
*** "Size"
*** "ThroughputKBps"


=== GetReceiveProgress ===
=== GetDownloadProgress ===
No input, returns an output [[#SystemUpdateProgress]].
No input, returns an output [[#SystemUpdateProgress]].


Same as [[#GetDownloadProgress]] except this uses [[NIM_services|nim]] cmd71 and cmd73.
Similar to [[#HasDownloaded]] except instead of a flag, this returns the 0x10-bytes from taskinfo+8. The output struct is cleared when the task(info) isn't available.


=== ApplyReceivedUpdate ===
=== ApplyDownloadedUpdate ===
No input/output.
No input/output.


=== GetReceivedEulaDataSize ===
Runs code similar to [[#HasDownloaded]], throwing an error if a network sysupdate isn't ready for install. Then the sysupdate is installed:
Takes a type-0x15 input buffer [[#EulaDataPath]], returns an output u64 '''filesize'''.


This is similar to [[#GetDownloadedEulaDataSize]].
* Uses ListSystemUpdateTask again, then [[NIM_services|nim]] IsExFatDriverIncluded. Runs ExFat handling when the output flag is set.
* On newer system-versions, this uses [[NIM_services|nim]] GetSystemUpdateTaskInfo then on success uses data from there to save a SystemPlayReport when the cached [[System_Settings|system-setting]] "systemreport!enabled" is set.
** The EventId is "systemupdate_dl_throughput" with ApplicationId 0100000000001018.
** The following fields are added to the report, see [[NIM_services#SystemUpdateTaskInfo|nim SystemUpdateTaskInfo]]: "ContentMetaId", "Version", "DownloadSize", and "ThroughputKBps".
* On newer system-versions, this saves another SystemPlayReport when a state flag is set (same flag mentioned above).
** The EventId is "systemupdate_pass" with ApplicationId 0100000000001021.
** This report has the following fields:
*** "Type"
*** "SourceSystemUpdateMetaId"
*** "SourceSystemUpdateMetaVersion"
*** "SourceExFatStatus"
*** "DestinationSystemUpdateMetaId"
*** "DestinationSystemUpdateMetaVersion"
*** "DestinationExFatStatus"
*** "Rebootless"
* Since FIRM will be installed later, the two flags in [[Flash_Filesystem#System_Update_Control]] are set to 1.
* Uses [[NIM_services|nim]] CommitSystemUpdateTask and [[NIM_services|nim]] DestroySystemUpdateTask.
* Installs FIRM. After installing each FIRM, the associated flag in [[Flash_Filesystem#System_Update_Control]] is set to 0.
* On newer system versions when an input flag is set, this uses [[Filesystem_services|NotifySystemDataUpdateEvent]], however this doesn't happen with ApplyDownloadedUpdate since that input flag is 0.


=== GetReceivedEulaData ===
=== RequestPrepareCardUpdate ===
Takes a type-0x15 input buffer [[#EulaDataPath]] and a type-0x6 output buffer, returns an output u64 '''filesize'''.
No input, returns an output Event handle and an [[#IAsyncResult]].


This is similar to [[#GetDownloadedEulaData]].
=== GetPrepareCardUpdateProgress ===
No input, returns an output [[#SystemUpdateProgress]].


=== SetupToReceiveSystemUpdate ===
=== HasPreparedCardUpdate ===
No input/output.
No input, returns an output u8 bool flag.


This just uses [[NIM_services|nim]] ListSystemUpdateTask, then when a task is returned uses it with DestroySystemUpdateTask.
=== ApplyCardUpdate ===
No input/output.
 
=== GetDownloadedEulaDataSize ===
Takes a type-0x15 input buffer [[#EulaDataPath]], returns an output u64 '''filesize'''.


[[qlaunch]] uses this before [[#RequestReceiveSystemUpdate]].
Runs code similar to [[#HasDownloaded]], throwing an error if a network sysupdate isn't ready for install.


=== RequestCheckLatestUpdateIncludesRebootlessUpdate ===
Uses ListSystemUpdateTask again. Then [[NIM_services|nim]] GetDownloadedSystemDataPath, with the output ContentPath being used to mount the EULA title with FS.
No input, returns an output Event handle and an [[#IAsyncValue]].


= IAsyncValue =
Then "<mountname>:/<[[#EulaDataPath]]>" is opened, gets the '''filesize''', then runs cleanup.
This is "nn::ns::detail::IAsyncValue".


{| class="wikitable" border="1"
=== GetDownloadedEulaData ===
|-
Takes a type-0x15 input buffer [[#EulaDataPath]] and a type-0x6 output buffer, returns an output u64 '''filesize'''.
! Cmd || Name
|-
| 0 || GetSize
|-
| 1 || Get
|-
| 2 || Cancel
|-
| 3 || [4.0.0+] GetErrorContext
|}


Official sw creates a container object for this using the output from the service commands, which contains the IAsyncValue object, and the Event with EventClearMode=0.
Similar to [[#GetDownloadedEulaDataSize]] except this reads the file instead, using the specified output buffer with size=filesize. This will throw an error if the filesize is larger than the buffer size.


* GetSize: No input, returns an output u64.
=== SetupCardUpdate ===
* Get: Takes a type-0x6 output buffer, no output. Official sw waits on the Event prior to using this cmd.
Takes an input u64 size and a TransferMemory handle, no output.
* Cancel: No input/output. Used by official sw when closing the object, when the serv-obj is initialized (after using the cmd, official sw will also wait on the Event). This cmd is also used in other official sw funcs.
* GetErrorContext: No input/output, takes a type-0x16 output buffer containing an [[Error_Applet#ErrorContext|ErrorContext]].


= IAsyncResult =
Official sw creates the TransferMemory with an user-specified buffer, with permissions=None.
This is "nn::ns::detail::IAsyncResult".


{| class="wikitable" border="1"
[[qlaunch]] uses size 0x100000 for the TransferMemory buffer.
|-
 
! Cmd || Name
=== GetPreparedCardUpdateEulaDataSize ===
|-
Takes a type-0x15 input buffer [[#EulaDataPath]], returns an output u64 '''filesize'''.
| 0 || Get
 
|-
This is similar to [[#GetDownloadedEulaDataSize]].
| 1 || Cancel
 
|-
=== GetPreparedCardUpdateEulaData ===
| 2 || [4.0.0+] GetErrorContext
Takes a type-0x15 input buffer [[#EulaDataPath]] and a type-0x6 output buffer, returns an output u64 '''filesize'''.
|}


Official sw creates a container object for this using the output from the service commands, which contains the IAsyncResult object, and the Event with EventClearMode=0.
This is similar to [[#GetDownloadedEulaData]].


* Get: No input/output. Official sw waits on the Event prior to using this cmd.
=== SetupCardUpdateViaSystemUpdater ===
* Cancel: No input/output. Used by official sw when closing the object, when the serv-obj is initialized (after using the cmd, official sw will also wait on the Event). This cmd is also used in other official sw funcs.
Takes an input u64 size and a TransferMemory handle, no output.
* GetErrorContext: No input/output, takes a type-0x16 output buffer containing an [[Error_Applet#ErrorContext|ErrorContext]].


= ns:dev =
The permissions for the TransferMemory is None.
This is "nn::ns::detail::IDevelopInterface".


[10.0.0+] Some of these cmds were replaced by the [[PGL_services|pgl]] system module.
Same as [[#SetupCardUpdate]], except this doesn't have the code for [[Filesystem_services|GetGameCardHandle/GetGameCardUpdatePartitionInfo]], and uses [[Filesystem_services|OpenRegisteredUpdatePartition]] instead of [[Filesystem_services|OpenGameCardFileSystem]]. This uses the same is_initialized bool state flag.


{| class="wikitable" border="1"
=== HasReceived ===
|-
No input, returns an output u8 bool.
! Cmd || Name
|-
| 0 || [1.0.0-9.2.0] [[#LaunchProgram]]
|-
| 1 || [[#TerminateProcess]]
|-
| 2 || [1.0.0-9.2.0] [[#TerminateProgram]]
|-
| 4 || [1.0.0-9.2.0] [[#GetShellEvent]]
|-
| 5 || [1.0.0-9.2.0] [[#GetShellEventInfo]]
|-
| 6 || [[#TerminateApplication]]
|-
| 7 || [1.0.0-9.2.0] [[#PrepareLaunchProgramFromHost]]
|-
| 8 || [10.0.0-17.0.1] [[#LaunchApplicationFromHost]] ([1.0.0-9.2.0] [[#LaunchApplicationForDevelop]])
|-
| 9 || [1.0.0-17.0.1] [[#LaunchApplicationWithStorageIdForDevelop]]
|-
| 10 || [6.0.0-8.1.0] [[#IsSystemMemoryResourceLimitBoosted]]
|-
| 11 || [6.0.0+] [[#GetRunningApplicationProcessIdForDevelop]]
|-
| 12 || [6.0.0+] [[#SetCurrentApplicationRightsEnvironmentCanBeActiveForDevelop]]
|-
| 13 || [9.0.0+] [[#CreateApplicationResourceForDevelop]]
|-
| 14 || [9.0.0+] [[#IsPreomiaForDevelop]]
|-
| 15 || [10.0.0-17.0.1] [[#GetApplicationProgramIdFromHost]]
|-
| 16 || [12.0.0+] RefreshCachedDebugValues
|-
| 17 || [12.0.0+] [[#PrepareLaunchApplicationFromHost]]
|-
| 18 || [12.0.0+] [[#GetLaunchEvent]]
|-
| 19 || [12.0.0+] [[#GetLaunchResult]]
|-
| 20 || [14.0.0+] GetProgramId
|-
| 21 || [18.0.0+]
|-
| 22 || [18.0.0+]
|-
| 23 || [18.0.0+]
|-
| 24 || [18.0.0+]
|}


== LaunchProgram ==
Same as [[#HasDownloaded]] except this uses [[NIM_services|nim]] cmd71 and cmd73.
Wrapper for "pm:shell" [[Process_Manager_services#pm:shell|LaunchProcess]].


== TerminateProcess ==
=== RequestReceiveSystemUpdate ===
Wrapper for "pm:shell" [[Process_Manager_services#pm:shell|TerminateProcess]].
Takes a type-0x15 input buffer containing a [[#SystemDeliveryInfo]], an u16 port, an u32 Ipv4Address, returns an output Event handle and an [[#IAsyncResult]].


== TerminateProgram ==
[[qlaunch]] uses the same value for the port as [[#RequestSendSystemUpdate]] (see [[#RequestSendSystemUpdate]] for addr as well).
Wrapper for "pm:shell" [[Process_Manager_services#pm:shell|TerminateProgram]].


== GetShellEvent ==
[[NIM_services|NIM]] will use the input addr/port with [[Sockets_services|connect()]].
Wrapper for "pm:shell" [[Process_Manager_services#pm:shell|GetProcessEventHandle]].


== GetShellEventInfo ==
This validates the [[#SystemDeliveryInfo]] and generates a [[NCM_services#ContentMetaKey|ContentMetaKey]] from that, and creates the [[#IAsyncResult]] + the async thread which handles the [[#IAsyncResult]] operation. Then the thread does:
Wrapper for "pm:shell" [[Process_Manager_services#pm:shell|GetProcessEventInfo]].


== TerminateApplication ==
* Calls a func which does:
Calls "pm:shell" [[Process_Manager_services#pm:shell|GetApplicationProcessIdForShell]] and sends the ProcessId to [[Process_Manager_services#pm:shell|TerminateProcess]].
** Throws an error if [[NIM_services#ListSystemUpdateTask|ListSystemUpdateTask]] returns any task.
** Checks whether a sysupdate is actually required using the previously generated [[NCM_services#ContentMetaKey|ContentMetaKey]], throwing an error if not.
** Uses [[NIM_services|nim]] cmd69, returning the Result on failure.
** Uses [[NIM_services|nim]] cmd72, returning the Result on failure. Waits for the IAsyncResult operation from this to finish, then uses the Get cmd to get the output Result.
** Handles cleanup and returns.
* On success, this loads various data which is then used for saving a SystemPlayReport when the cached [[System_Settings|system-setting]] "systemreport!enabled" is set.
** The EventId is "receive_system_update" with ApplicationId <NS ProgramId>.
** This report has the following fields:
*** "SourceSystemUpdateId"
*** "DestinationSystemUpdateId"
*** "SourceSystemUpdateVersion"
*** "DestinationSystemUpdateVersion"
*** "SenderFirmwareVariationId"
*** "ReceiverFirmwareVariationId"
*** "SenderPlatformRegion"
*** "ReceiverPlatformRegion"
*** "SenderHasExFat"
*** "ReceiverHasExFat"
*** "Size"
*** "ThroughputKBps"


== PrepareLaunchProgramFromHost ==
=== GetReceiveProgress ===
Takes a type-0x5 input buffer containing the [[Filesystem_services#FspPath|FspPath]], returns an output 0x10-byte struct.
No input, returns an output [[#SystemUpdateProgress]].


Calls [[NCM_services#IPathResolverForStorage|IPathResolverForStorage]] Set...NcaPath functions.
Same as [[#GetDownloadProgress]] except this uses [[NIM_services|nim]] cmd71 and cmd73.


== LaunchApplicationForDevelop ==
=== ApplyReceivedUpdate ===
Takes an input u32 [[Process_Manager_services#LaunchFlags|LaunchFlags]] and [[NCM_services#ApplicationId|ApplicationId]], returns an output u64 ProcessId.
No input/output.


Same as [[#LaunchApplicationWithStorageIdForDevelop]] except the last two params passed to the internal vtable funcptr call are value 0x6, instead of from the command input.
=== GetReceivedEulaDataSize ===
Takes a type-0x15 input buffer [[#EulaDataPath]], returns an output u64 '''filesize'''.


== LaunchApplicationFromHost ==
This is similar to [[#GetDownloadedEulaDataSize]].
Takes an input u32 [[Process_Manager_services#LaunchFlags|LaunchFlags]] and a type-0x5 input buffer containing the [[Filesystem_services#FspPath|FspPath]]. Returns an output u64 ProcessId.


== LaunchApplicationWithStorageIdForDevelop ==
=== GetReceivedEulaData ===
Takes 2 input u8 [[NCM_services#StorageId|StorageIds]], an u32 [[Process_Manager_services#LaunchFlags|LaunchFlags]], and an [[NCM_services#ApplicationId|ApplicationId]]. Returns an output u64 ProcessId.
Takes a type-0x15 input buffer [[#EulaDataPath]] and a type-0x6 output buffer, returns an output u64 '''filesize'''.


Launches an application title which is registered with NS.
This is similar to [[#GetDownloadedEulaData]].


== IsSystemMemoryResourceLimitBoosted ==
=== SetupToReceiveSystemUpdate ===
No input. Returns a bool.
No input/output.


== GetRunningApplicationProcessIdForDevelop ==
This just uses [[NIM_services|nim]] ListSystemUpdateTask, then when a task is returned uses it with DestroySystemUpdateTask.
Returns an output u64 ProcessId.


== SetCurrentApplicationRightsEnvironmentCanBeActiveForDevelop ==
[[qlaunch]] uses this before [[#RequestReceiveSystemUpdate]].
Takes an input bool. No output.


== CreateApplicationResourceForDevelop ==
=== RequestCheckLatestUpdateIncludesRebootlessUpdate ===
Takes an input u32 (1 = Preomia/MicroApplication). Returns an [[#IApplicationResource]].
No input, returns an output Event handle and an [[#IAsyncValue]].


== IsPreomiaForDevelop ==
= IAsyncValue =
Takes an input u64 [[NCM_services#ProgramId|ProgramId]]. Returns a bool.
This is "nn::ns::detail::IAsyncValue".


== GetApplicationProgramIdFromHost ==
{| class="wikitable" border="1"
Takes a type-0x5 input buffer containing the [[Filesystem_services#FspPath|FspPath]]. Returns an u64 [[NCM_services#ProgramId|ProgramId]].
|-
! Cmd || Name
|-
| 0 || GetSize
|-
| 1 || Get
|-
| 2 || Cancel
|-
| 3 || [4.0.0+] GetErrorContext
|}


== PrepareLaunchApplicationFromHost ==
Official sw creates a container object for this using the output from the service commands, which contains the IAsyncValue object, and the Event with EventClearMode=0.
[18.0.0+] Now returns a total of 0x50 bytes of output.
 
* GetSize: No input, returns an output u64.
* Get: Takes a type-0x6 output buffer, no output. Official sw waits on the Event prior to using this cmd.
* Cancel: No input/output. Used by official sw when closing the object, when the serv-obj is initialized (after using the cmd, official sw will also wait on the Event). This cmd is also used in other official sw funcs.
* GetErrorContext: No input/output, takes a type-0x16 output buffer containing an [[Error_Applet#ErrorContext|ErrorContext]].
 
= IAsyncResult =
This is "nn::ns::detail::IAsyncResult".


== GetLaunchEvent ==
{| class="wikitable" border="1"
[18.0.0+] Now takes a total of 0x50 bytes of input.
|-
! Cmd || Name
|-
| 0 || Get
|-
| 1 || Cancel
|-
| 2 || [4.0.0+] GetErrorContext
|}


== GetLaunchResult ==
Official sw creates a container object for this using the output from the service commands, which contains the IAsyncResult object, and the Event with EventClearMode=0.
[18.0.0+] Now takes a total of 0x50 bytes of input.


= acc:su =
* Get: No input/output. Official sw waits on the Event prior to using this cmd.
This is "nn::account::IAccountServiceForAdministrator".
* Cancel: No input/output. Used by official sw when closing the object, when the serv-obj is initialized (after using the cmd, official sw will also wait on the Event). This cmd is also used in other official sw funcs.
* GetErrorContext: No input/output, takes a type-0x16 output buffer containing an [[Error_Applet#ErrorContext|ErrorContext]].


[13.0.0+] This was moved from [[Account_services|account]].
= ns:dev =
This is "nn::ns::detail::IDevelopInterface".


This is only available when the output from [[Process_Manager_services|pm:bm]] GetBootMode is Normal/Maintenance.
[10.0.0+] Some of these cmds were replaced by the [[PGL_services|pgl]] system module.


{| class="wikitable" border="1"
{| class="wikitable" border="1"
|-
|-
! Cmd || Name || Notes
! Cmd || Name
|-
|-
| 0 || GetUserCount ||
| 0 || [1.0.0-9.2.0] [[#LaunchProgram]]
|-
|-
| 1 || GetUserExistence ||
| 1 || [[#TerminateProcess]]
|-
|-
| 2 || ListAllUsers ||
| 2 || [1.0.0-9.2.0] [[#TerminateProgram]]
|-
|-
| 3 || ListOpenUsers ||
| 4 || [1.0.0-9.2.0] [[#GetShellEvent]]
|-
|-
| 4 || GetLastOpenedUser ||
| 5 || [1.0.0-9.2.0] [[#GetShellEventInfo]]
|-
|-
| 5 || GetProfile || Returns an [[#IProfile]].
| 6 || [[#TerminateApplication]]
|-
|-
| 6 || [3.0.0+] GetProfileDigest ||
| 7 || [1.0.0-9.2.0] [[#PrepareLaunchProgramFromHost]]
|-
|-
| 50 || [[#IsUserRegistrationRequestPermitted]] ||
| 8 || [10.0.0-17.0.1] [[#LaunchApplicationFromHost]] ([1.0.0-9.2.0] LaunchApplication)
|-
|-
| 51 || [[#TrySelectUserWithoutInteraction]] ||
| 9 || [1.0.0-17.0.1] [[#LaunchApplicationWithStorageId]]
|-
|-
| 60 || [5.0.0-5.1.0] ListOpenContextStoredUsers ||
| 10 || [6.0.0-8.1.0] [[#IsSystemMemoryResourceLimitBoosted]]
|-
|-
| 99 || [6.0.0+] DebugActivateOpenContextRetention || No input, returns an [[#ISessionObject]].
| 11 || [6.0.0+] [[#GetRunningApplicationProcessId]]
|-
|-
| 100 || GetUserRegistrationNotifier || Returns an [[#INotifier]].
| 12 || [6.0.0+] [[#SetCurrentApplicationRightsEnvironmentCanBeActive]]
|-
|-
| 101 || GetUserStateChangeNotifier || Returns an [[#INotifier]].
| 13 || [9.0.0+] [[#CreateApplicationResource]]
|-
|-
| 102 || GetBaasAccountManagerForSystemService || Returns an [[#IManagerForSystemService]].
| 14 || [9.0.0+] [[#IsPreomia]]
|-
|-
| 103 || GetBaasUserAvailabilityChangeNotifier || Returns an [[#INotifier]].
| 15 || [10.0.0-17.0.1] [[#GetApplicationProgramIdFromHost]]
|-
|-
| 104 || GetProfileUpdateNotifier || Returns an [[#INotifier]].
| 16 || [12.0.0+] RefreshCachedDebugValues
|-
|-
| 105 || [4.0.0+] CheckNetworkServiceAvailabilityAsync || Returns an [[#IAsyncContext]].
| 17 || [12.0.0+] [[#PrepareLaunchApplicationFromHost]]
|-
|-
| 106 || [9.0.0+] GetProfileSyncNotifier ||
| 18 || [12.0.0+] [[#GetLaunchEvent]]
|-
|-
| 110 || StoreSaveDataThumbnail ||
| 19 || [12.0.0+] [[#GetLaunchResult]]
|-
|-
| 111 || ClearSaveDataThumbnail ||
| 20 || [14.0.0+] GetProgramId
|-
|-
| 112 || LoadSaveDataThumbnail ||
| 21 || [18.0.0+] [[#PrepareLaunchApplication]]
|-
|-
| 113 || [5.0.0+] GetSaveDataThumbnailExistence ||
| 22 || [18.0.0+] [[#LaunchApplication]]
|-
|-
| 120 || [10.0.0+] ListOpenUsersInApplication ||
| 23 || [18.0.0+] [[#GetProgramIdByApplicationLaunchInfo]]
|-
|-
| 130 || [6.0.0+] ActivateOpenContextRetention || Takes a total of 0x8-bytes of input, returns an [[#ISessionObject]].
| 24 || [18.0.0+] DestroyApplicationLaunchPreparation
|-
|}
| 140 || [6.0.0+] ListQualifiedUsers ||
 
|-
== LaunchProgram ==
| 150 || [10.0.0-10.2.0] AuthenticateApplicationAsync ||
Wrapper for "pm:shell" [[Process_Manager_services#pm:shell|LaunchProcess]].
|-
 
| 151 || [12.0.0+] EnsureSignedDeviceIdentifierCacheForNintendoAccountAsync ||
== TerminateProcess ==
|-
Wrapper for "pm:shell" [[Process_Manager_services#pm:shell|TerminateProcess]].
| 152 || [12.0.0+] LoadSignedDeviceIdentifierCacheForNintendoAccount ||
 
|-
== TerminateProgram ==
| 170 || [13.0.0+] GetNasOp2MembershipStateChangeNotifier ||
Wrapper for "pm:shell" [[Process_Manager_services#pm:shell|TerminateProgram]].
|-
 
| 190 || [1.0.0-9.2.0] GetUserLastOpenedApplication ||
== GetShellEvent ==
|-
Wrapper for "pm:shell" [[Process_Manager_services#pm:shell|GetProcessEventHandle]].
| 191 || [7.0.0+] UpdateNotificationReceiverInfo ([5.0.0-5.1.0] ActivateOpenContextHolder) ||
 
|-
== GetShellEventInfo ==
| 200 || BeginUserRegistration ||
Wrapper for "pm:shell" [[Process_Manager_services#pm:shell|GetProcessEventInfo]].
|-
 
| 201 || CompleteUserRegistration ||
== TerminateApplication ==
|-
Calls "pm:shell" [[Process_Manager_services#pm:shell|GetApplicationProcessIdForShell]] and sends the ProcessId to [[Process_Manager_services#pm:shell|TerminateProcess]].
| 202 || CancelUserRegistration ||
 
|-
== PrepareLaunchProgramFromHost ==
| 203 || DeleteUser ||
Takes a type-0x5 input buffer containing the [[Filesystem_services#FspPath|FspPath]], returns an output 0x10-byte struct.
|-
 
| 204 || SetUserPosition ||
Calls [[NCM_services#IPathResolverForStorage|IPathResolverForStorage]] Set...NcaPath functions.
|-
 
| 205 || GetProfileEditor || Takes an input userID and returns an [[#IProfileEditor]].
== LaunchApplicationFromHost ==
|-
Takes an input u32 [[Process_Manager_services#LaunchFlags|LaunchFlags]] and a type-0x5 input buffer containing the [[Filesystem_services#FspPath|FspPath]]. Returns an output u64 ProcessId.
| 206 || CompleteUserRegistrationForcibly ||
 
|-
== LaunchApplicationWithStorageId ==
| 210 || [3.0.0+] CreateFloatingRegistrationRequest || Returns an [[#IFloatingRegistrationRequest]].
Takes 2 input u8 [[NCM_services#StorageId|StorageIds]], an u32 [[Process_Manager_services#LaunchFlags|LaunchFlags]], and an [[NCM_services#ApplicationId|ApplicationId]]. Returns an output u64 ProcessId.
|-
 
| 211 || [8.0.0+] CreateProcedureToRegisterUserWithNintendoAccount || Takes a total of 0x4-bytes of input and a handle, returns an [[#IOAuthProcedureForUserRegistration]].
Launches an application title which is registered with NS.
|-
 
| 212 || [8.0.0+] ResumeProcedureToRegisterUserWithNintendoAccount || Takes a total of 0x14-bytes of input and a handle, returns an [[#IOAuthProcedureForUserRegistration]].
== IsSystemMemoryResourceLimitBoosted ==
|-
No input. Returns a bool.
| 213 || [17.0.0+] CreateProcedureToCreateUserWithNintendoAccount ||
 
|-
== GetRunningApplicationProcessId ==
| 214 || [17.0.0+] ResumeProcedureToCreateUserWithNintendoAccount ||
Returns an output u64 ProcessId.
|-
 
| 215 || [17.0.0+] ResumeProcedureToCreateUserWithNintendoAccountAfterApplyResponse ||
== SetCurrentApplicationRightsEnvironmentCanBeActive ==
|-
Takes an input bool. No output.
| 230 || AuthenticateServiceAsync || Returns an [[#IAsyncContext]].
 
|-
== CreateApplicationResource ==
| 250 || GetBaasAccountAdministrator || Returns an [[#IAdministrator]].
Takes an input u32 (1 = Preomia/MicroApplication). Returns an [[#IApplicationResource]].
 
== IsPreomia ==
Takes an input u64 [[NCM_services#ProgramId|ProgramId]]. Returns a bool.
 
== GetApplicationProgramIdFromHost ==
Takes a type-0x5 input buffer containing the [[Filesystem_services#FspPath|FspPath]]. Returns an u64 [[NCM_services#ProgramId|ProgramId]].
 
== PrepareLaunchApplicationFromHost ==
[18.0.0+] Now returns a total of 0x50 bytes of output.
 
[19.0.0+] Now returns a total of 0x80 bytes of output.
 
== GetLaunchEvent ==
[18.0.0+] Now takes a total of 0x50 bytes of input.
 
[19.0.0+] Now takes a total of 0x80 bytes of input.
 
== GetLaunchResult ==
[18.0.0+] Now takes a total of 0x50 bytes of input.
 
[19.0.0+] Now takes a total of 0x80 bytes of input.
 
== PrepareLaunchApplication ==
Takes a total of 0x10-bytes of input. Returns a total of 0x50-bytes of output.
 
[19.0.0+] Now returns a total of 0x80-bytes of output.
 
== LaunchApplication ==
Takes a total of 0x50-bytes of input. Returns a total of 8-bytes of output.
 
[19.0.0+] Now takes a total of 0x80 bytes of input.
 
== GetProgramIdByApplicationLaunchInfo ==
Takes a total of 0x50-bytes of input. Returns a total of 8-bytes of output.
 
[19.0.0+] Now takes a total of 0x80 bytes of input.
 
= acc:su =
This is "nn::account::IAccountServiceForAdministrator".
 
[13.0.0+] This was moved from [[Account_services|account]].
 
This is only available when the output from [[Process_Manager_services|pm:bm]] GetBootMode is Normal/Maintenance.
 
{| class="wikitable" border="1"
|-
|-
| 290 || ProxyProcedureForGuestLoginWithNintendoAccount || Returns an [[#IOAuthProcedureForExternalNsa]] (formerly [[#IOAuthProcedureForGuestLogin]] with [1.0.0-2.3.0]).
! Cmd || Name || Notes
|-
|-
| 291 || [3.0.0+] ProxyProcedureForFloatingRegistrationWithNintendoAccount || Returns an [[#IOAuthProcedureForExternalNsa]].
| 0 || GetUserCount ||
|-
|-
| 299 || SuspendBackgroundDaemon || Returns an [[#ISessionObject]].
| 1 || GetUserExistence ||
|-
|-
| 400 || [18.0.0+] ||
| 2 || ListAllUsers ||
|-
|-
| 401 || [18.0.0+] ||
| 3 || ListOpenUsers ||
|-
|-
| 402 || [18.0.0+] ||
| 4 || GetLastOpenedUser ||
|-
|-
| 410 || [18.0.0+] ||
| 5 || GetProfile || Returns an [[#IProfile]].
|-
|-
| 411 || [18.0.0+] ||
| 6 || [3.0.0+] GetProfileDigest ||
|-
|-
| 412 || [18.0.0+] ||
| 50 || [[#IsUserRegistrationRequestPermitted]] ||
|-
|-
| 900 || [13.0.0+] SetUserUnqualifiedForDebug ||
| 51 || TrySelectUserWithoutInteractionDeprecated ([1.0.0-18.1.0] [[#TrySelectUserWithoutInteraction]]) ||
|-
|-
| 901 || [13.0.0+] UnsetUserUnqualifiedForDebug ||
| 52 || [19.0.0+] TrySelectUserWithoutInteraction ||
|-
|-
| 902 || [13.0.0+] ListUsersUnqualifiedForDebug ||
| 60 || [5.0.0-5.1.0] ListOpenContextStoredUsers ||
|-
|-
| 910 || [16.0.0+] RefreshFirmwareSettingsForDebug ||
| 99 || [6.0.0+] DebugActivateOpenContextRetention || No input, returns an [[#ISessionObject]].
|-
|-
| 997 || [3.0.0+] DebugInvalidateTokenCacheForUser ||
| 100 || GetUserRegistrationNotifier || Returns an [[#INotifier]].
|-
|-
| 998 || DebugSetUserStateClose ||
| 101 || GetUserStateChangeNotifier || Returns an [[#INotifier]].
|-
|-
| 999 || DebugSetUserStateOpen ||
| 102 || GetBaasAccountManagerForSystemService || Returns an [[#IManagerForSystemService]].
|}
 
[10.0.0+] DebugSetUserStateClose/DebugSetUserStateOpen now takes an additional 8-bytes of input.
 
== IsUserRegistrationRequestPermitted ==
Takes a PID, an input u64 pid_reserved, and returns an output u8 bool.
 
== TrySelectUserWithoutInteraction ==
Takes an input u8 bool isNetworkServiceAccountRequired, returns an output Uid.
 
== IManagerForSystemService ==
This is "nn::account::baas::IManagerForSystemService".
 
{| class="wikitable" border="1"
|-
|-
! Cmd || Name || Notes
| 103 || GetBaasUserAvailabilityChangeNotifier || Returns an [[#INotifier]].
|-
|-
| 0 || CheckAvailability ||
| 104 || GetProfileUpdateNotifier || Returns an [[#INotifier]].
|-
|-
| 1 || GetAccountId ||
| 105 || [4.0.0+] CheckNetworkServiceAvailabilityAsync || Returns an [[#IAsyncContext]].
|-
|-
| 2 || EnsureIdTokenCacheAsync || Returns an [[#IAsyncContext]].
| 106 || [9.0.0+] GetProfileSyncNotifier ||
|-
|-
| 3 || LoadIdTokenCache ||
| 110 || StoreSaveDataThumbnail ||
|-
|-
| 100 || SetSystemProgramIdentification ||
| 111 || ClearSaveDataThumbnail ||
|-
|-
| 101 || [7.0.0+] RefreshNotificationTokenAsync ||  
| 112 || LoadSaveDataThumbnail ||
|-
|-
| 110 || [4.0.0+] GetServiceEntryRequirementCache ||
| 113 || [5.0.0+] GetSaveDataThumbnailExistence ||
|-
| 120 || [10.0.0+] ListOpenUsersInApplication ||
|-
|-
| 111 || [4.0.0+] InvalidateServiceEntryRequirementCache ||
| 130 || [6.0.0+] ActivateOpenContextRetention || Takes a total of 0x8-bytes of input, returns an [[#ISessionObject]].
|-
|-
| 112 || [4.0.0-6.2.0] InvalidateTokenCache ||
| 140 || [6.0.0+] ListQualifiedUsers ||  
|-
|-
| 113 || [6.1.0+] GetServiceEntryRequirementCacheForOnlinePlay || Takes a total of 0x8-bytes of input, returns a total of 0x4-bytes of output.
| 150 || [10.0.0-10.2.0] AuthenticateApplicationAsync ||  
|-
|-
| 120 || GetNintendoAccountId ||
| 151 || [12.0.0+] EnsureSignedDeviceIdentifierCacheForNintendoAccountAsync ||  
|-
|-
| 121 || [9.0.0+] CalculateNintendoAccountAuthenticationFingerprint ||
| 152 || [12.0.0+] LoadSignedDeviceIdentifierCacheForNintendoAccount ||
|-
|-
| 130 || GetNintendoAccountUserResourceCache ||
| 170 || [13.0.0+] GetNasOp2MembershipStateChangeNotifier ||
|-
|-
| 131 || RefreshNintendoAccountUserResourceCacheAsync || Returns an [[#IAsyncContext]].
| 190 || [1.0.0-9.2.0] GetUserLastOpenedApplication ||
|-
|-
| 132 || RefreshNintendoAccountUserResourceCacheAsyncIfSecondsElapsed || Returns an [[#IAsyncContext]].
| 191 || [7.0.0-19.0.1] UpdateNotificationReceiverInfo ([5.0.0-5.1.0] ActivateOpenContextHolder) ||
|-
|-
| 133 || [9.0.0+] GetNintendoAccountVerificationUrlCache ||
| 200 || BeginUserRegistration ||
|-
|-
| 134 || [9.0.0+] RefreshNintendoAccountVerificationUrlCacheAsync ||
| 201 || CompleteUserRegistration ||
|-
|-
| 135 || [9.0.0+] RefreshNintendoAccountVerificationUrlCacheAsyncIfSecondsElapsed ||
| 202 || CancelUserRegistration ||
|-
|-
| 140 || [5.0.0+] GetNetworkServiceLicenseCache ||  
| 203 || DeleteUser ||
|-
|-
| 141 || [5.0.0+] RefreshNetworkServiceLicenseCacheAsync || Returns an [[#IAsyncContext]].
| 204 || SetUserPosition ||
|-
|-
| 142 || [5.0.0+] RefreshNetworkServiceLicenseCacheAsyncIfSecondsElapsed || Returns an [[#IAsyncContext]].
| 205 || GetProfileEditor || Takes an input userID and returns an [[#IProfileEditor]].
|-
|-
| 150 || CreateAuthorizationRequest || Returns an [[#IAuthorizationRequest]].
| 206 || CompleteUserRegistrationForcibly ||
|-
|-
| 160 || [15.0.0+] RequiresUpdateNetworkServiceAccountIdTokenCache ||
| 210 || [3.0.0+] CreateFloatingRegistrationRequest || Returns an [[#IFloatingRegistrationRequest]].
|-
|-
| 161 || [16.0.0+] RequireReauthenticationOfNetworkServiceAccount ||
| 211 || [8.0.0+] CreateProcedureToRegisterUserWithNintendoAccount || Takes a total of 0x4-bytes of input and a handle, returns an [[#IOAuthProcedureForUserRegistration]].
|-
|-
| 170 || [17.0.0+] CreateDeviceHistoryRequest ||
| 212 || [8.0.0+] ResumeProcedureToRegisterUserWithNintendoAccount || Takes a total of 0x14-bytes of input and a handle, returns an [[#IOAuthProcedureForUserRegistration]].
|-
|-
| 180 || [18.0.0+] ||
| 213 || [17.0.0+] CreateProcedureToCreateUserWithNintendoAccount ||
|}
 
== IFloatingRegistrationRequest ==
This is "nn::account::baas::IFloatingRegistrationRequest".
 
Added with [3.0.0+].
 
{| class="wikitable" border="1"
|-
|-
! Cmd || Name || Notes
| 214 || [17.0.0+] ResumeProcedureToCreateUserWithNintendoAccount ||
|-
|-
| 0 || GetSessionId ||
| 215 || [17.0.0+] ResumeProcedureToCreateUserWithNintendoAccountAfterApplyResponse ||
|-
|-
| 12 || GetAccountId ||
| 230 || AuthenticateServiceAsync || Returns an [[#IAsyncContext]].
|-
|-
| 13 || GetLinkedNintendoAccountId ||
| 250 || GetBaasAccountAdministrator || Returns an [[#IAdministrator]].
|-
|-
| 14 || GetNickname ||
| 251 || [20.0.0+] SynchronizeNetworkServiceAccountsSnapshotAsync ||
|-
|-
| 15 || GetProfileImage ||
| 290 || ProxyProcedureForGuestLoginWithNintendoAccount || Returns an [[#IOAuthProcedureForExternalNsa]] (formerly [[#IOAuthProcedureForGuestLogin]] with [1.0.0-2.3.0]).
|-
|-
| 16 || [18.0.0+] ||
| 291 || [3.0.0+] ProxyProcedureForFloatingRegistrationWithNintendoAccount || Returns an [[#IOAuthProcedureForExternalNsa]].
|-
|-
| 21 || LoadIdTokenCache ||
| 292 || [20.0.0+] ProxyProcedureForDeviceMigrationAuthenticatingOperatingUser ||
|-
|-
| 100 || RegisterUser ([1.0.0-3.0.2] RegisterAsync) || [1.0.0-3.0.2] Used to return an [[#IAsyncContext]].
| 293 || [20.0.0+] ProxyProcedureForDeviceMigrationDownload ||
|-
|-
| 101 || RegisterUserWithUid ([1.0.0-3.0.2] RegisterWithUidAsync) || [1.0.0-3.0.2] Used to return an [[#IAsyncContext]].
| 299 || SuspendBackgroundDaemon || Returns an [[#ISessionObject]].
|-
|-
| 102 || [4.0.0+] RegisterNetworkServiceAccountAsync || Returns an [[#IAsyncContext]].
| 350 || [20.0.0+] CreateDeviceMigrationUserExportRequest ||
|-
|-
| 103 || [4.0.0+] RegisterNetworkServiceAccountWithUidAsync || Returns an [[#IAsyncContext]].
| 351 || [20.0.0+] UploadNasCredential ||
|-
|-
| 110 || SetSystemProgramIdentification ||
| 352 || [20.0.0+] CreateDeviceMigrationUserImportRequest ||
|-
|-
| 111 || EnsureIdTokenCacheAsync || Returns an [[#IAsyncContext]].
| 353 || [20.0.0+] DeleteUserMigrationSaveData ||
|}
 
== IAdministrator ==
This is "nn::account::baas::IAdministrator".
 
{| class="wikitable" border="1"
|-
|-
! Cmd || Name || Notes
| 400 || [18.0.0+] SetPinCode ||
|-
|-
| 0 || CheckAvailability ||
| 401 || [18.0.0+] GetPinCodeLength ||
|-
|-
| 1 || GetAccountId ||
| 402 || [18.0.0-19.0.1] GetPinCode ||
|-
|-
| 2 || EnsureIdTokenCacheAsync || Returns an [[#IAsyncContext]].
| 403 || [20.0.0+] GetPinCodeParity ||
|-
|-
| 3 || LoadIdTokenCache ||
| 404 || [20.0.0+] VerifyPinCode ||
|-
|-
| 100 || SetSystemProgramIdentification ||
| 405 || [20.0.0+] IsPinCodeVerificationForbidden ||
|-
|-
| 101 || [7.0.0+] RefreshNotificationTokenAsync
| 410 || [18.0.0+] GetPinCodeErrorCount ||
|-
|-
| 110 || [4.0.0+] GetServiceEntryRequirementCache ||
| 411 || [18.0.0-19.0.1] ResetPinCodeErrorCount ||
|-
|-
| 111 || [4.0.0+] InvalidateServiceEntryRequirementCache ||
| 412 || [18.0.0-19.0.1] IncrementPinCodeErrorCount ||
|-
|-
| 112 || [4.0.0-6.2.0] InvalidateTokenCache ||
| 413 || [20.0.0+] SetPinCodeErrorCount ||
|-
|-
| 113 || [6.1.0+] GetServiceEntryRequirementCacheForOnlinePlay || Takes a total of 0x8-bytes of input, returns a total of 0x4-bytes of output.
| 420 || [19.0.0+] SetStartPenaltyTime ||  
|-
|-
| 120 || GetNintendoAccountId ||
| 421 || [19.0.0+] GetStartPenaltyTime ||  
|-
|-
| 121 || [9.0.0+] CalculateNintendoAccountAuthenticationFingerprint ||
| 900 || [13.0.0+] SetUserUnqualifiedForDebug ||
|-
|-
| 130 || GetNintendoAccountUserResourceCache ||
| 901 || [13.0.0+] UnsetUserUnqualifiedForDebug ||
|-
|-
| 131 || RefreshNintendoAccountUserResourceCacheAsync || Returns an [[#IAsyncContext]].
| 902 || [13.0.0+] ListUsersUnqualifiedForDebug ||
|-
|-
| 132 || RefreshNintendoAccountUserResourceCacheAsyncIfSecondsElapsed || Returns an [[#IAsyncContext]].
| 910 || [16.0.0+] RefreshFirmwareSettingsForDebug ||
|-
|-
| 133 || [9.0.0+] GetNintendoAccountVerificationUrlCache ||
| 997 || [3.0.0+] DebugInvalidateTokenCacheForUser ||
|-
|-
| 134 || [9.0.0+] RefreshNintendoAccountVerificationUrlCacheAsync ||
| 998 || DebugSetUserStateClose ||
|-
|-
| 135 || [9.0.0+] RefreshNintendoAccountVerificationUrlCacheAsyncIfSecondsElapsed ||
| 999 || DebugSetUserStateOpen ||
|}
 
[10.0.0+] DebugSetUserStateClose/DebugSetUserStateOpen now takes an additional 8-bytes of input.
 
== IsUserRegistrationRequestPermitted ==
Takes a PID, an input u64 pid_reserved, and returns an output u8 bool.
 
== TrySelectUserWithoutInteraction ==
Takes an input u8 bool isNetworkServiceAccountRequired, returns an output Uid.
 
== IManagerForSystemService ==
This is "nn::account::baas::IManagerForSystemService".
 
{| class="wikitable" border="1"
|-
|-
| 140 || [5.0.0+] GetNetworkServiceLicenseCache ||
! Cmd || Name || Notes
|-
|-
| 141 || [5.0.0+] RefreshNetworkServiceLicenseCacheAsync ||
| 0 || CheckAvailability ||
|-
|-
| 142 || [5.0.0+] RefreshNetworkServiceLicenseCacheAsyncIfSecondsElapsed ||
| 1 || GetAccountId ||
|-
|-
| 150 || CreateAuthorizationRequest || Returns an [[#IAuthorizationRequest]].
| 2 || EnsureIdTokenCacheAsync || Returns an [[#IAsyncContext]].
|-
|-
| 160 || [15.0.0+] RequiresUpdateNetworkServiceAccountIdTokenCache ||
| 3 || [19.0.0+] LoadIdTokenCacheDeprecated ([1.0.0-18.1.0] LoadIdTokenCache) ||
|-
|-
| 161 || [16.0.0+] RequireReauthenticationOfNetworkServiceAccount ||
| 4 || [19.0.0+] LoadIdTokenCache ||
|-
|-
| 170 || [17.0.0+] CreateDeviceHistoryRequest ||
| 100 || SetSystemProgramIdentification ||
|-
|-
| 180 || [18.0.0+] ||
| 101 || RefreshNotificationTokenAsync ||  
|-
|-
| 200 || IsRegistered ||
| 110 || GetServiceEntryRequirementCacheForLogin ||
|-
|-
| 201 || RegisterAsync || Returns an [[#IAsyncContext]].
| 111 || InvalidateServiceEntryRequirementCache ||
|-
|-
| 202 || UnregisterAsync || Returns an [[#IAsyncContext]].
| 113 || GetServiceEntryRequirementCacheForOnlinePlay || Takes a total of 0x8-bytes of input, returns a total of 0x4-bytes of output.
|-
|-
| 203 || DeleteRegistrationInfoLocally ||
| 120 || GetNintendoAccountId ||
|-
|-
| 220 || SynchronizeProfileAsync || Returns an [[#IAsyncContext]].
| 121 || CalculateNintendoAccountAuthenticationFingerprint ||
|-
|-
| 221 || UploadProfileAsync || Returns an [[#IAsyncContext]].
| 130 || GetNintendoAccountUserResourceCache ||
|-
|-
| 222 || SynchronizeProfileAsyncIfSecondsElapsed || Returns an [[#IAsyncContext]].
| 131 || RefreshNintendoAccountUserResourceCacheAsync || Returns an [[#IAsyncContext]].
|-
|-
| 250 || IsLinkedWithNintendoAccount ||
| 132 || RefreshNintendoAccountUserResourceCacheAsyncIfSecondsElapsed || Returns an [[#IAsyncContext]].
|-
| 251 || CreateProcedureToLinkWithNintendoAccount || Returns an [[#IOAuthProcedureForNintendoAccountLinkage]].
|-
|-
| 252 || ResumeProcedureToLinkWithNintendoAccount || Returns an [[#IOAuthProcedureForNintendoAccountLinkage]].
| 133 || GetNintendoAccountVerificationUrlCache ||
|-
|-
| 255 || CreateProcedureToUpdateLinkageStateOfNintendoAccount || Returns an [[#IOAuthProcedure]].
| 134 || RefreshNintendoAccountVerificationUrlCacheAsync ||
|-
| 256 || ResumeProcedureToUpdateLinkageStateOfNintendoAccount || Returns an [[#IOAuthProcedure]].
|-
|-
| 260 || [3.0.0+] CreateProcedureToLinkNnidWithNintendoAccount || Returns an [[#IOAuthProcedure]].
| 135 || RefreshNintendoAccountVerificationUrlCacheAsyncIfSecondsElapsed ||
|-
|-
| 261 || [3.0.0+] ResumeProcedureToLinkNnidWithNintendoAccount || Returns an [[#IOAuthProcedure]].
| 136 || [19.0.0+] GetNintendoAccountUserResourceCache ||
|-
|-
| 280 || ProxyProcedureToAcquireApplicationAuthorizationForNintendoAccount || Returns an [[#IOAuthProcedure]].
| 140 || GetNetworkServiceLicenseCache ||  
|-
|-
| 290 || [8.0.0+] GetRequestForNintendoAccountUserResourceView ||
| 141 || RefreshNetworkServiceLicenseCacheAsync || Returns an [[#IAsyncContext]].
|-
|-
| 300 || [6.0.0+] TryRecoverNintendoAccountUserStateAsync || Returns an [[#IAsyncContext]].
| 142 || RefreshNetworkServiceLicenseCacheAsyncIfSecondsElapsed || Returns an [[#IAsyncContext]].
|-
|-
| 400 || [6.1.0+] IsServiceEntryRequirementCacheRefreshRequiredForOnlinePlay || Takes a total of 0x8-bytes of input, returns an output u8.
| 143 || [15.0.0+] GetNetworkServiceLicenseCacheEx ||
|-
|-
| 401 || [6.1.0+] RefreshServiceEntryRequirementCacheForOnlinePlayAsync || Takes a total of 0x8-bytes of input, returns an [[#IAsyncContext]].
| 150 || CreateAuthorizationRequest || Returns an [[#IAuthorizationRequest]].
|-
|-
| 410 || [13.1.0+] CheckRequiredLicenseForLexAsync ||
| 160 || [15.0.0+] RequiresUpdateNetworkServiceAccountIdTokenCache ||
|-
|-
| 900 || [9.0.0+] GetAuthenticationInfoForWin ||
| 161 || [16.0.0+] RequireReauthenticationOfNetworkServiceAccount ||
|-
|-
| 901 || [9.0.0+] ImportAsyncForWin ||
| 180 || [18.0.0-19.0.1] GetRequestForNintendoAccountReauthentication ||
|-
|-
| 997 || DebugUnlinkNintendoAccountAsync || Returns an [[#IAsyncContext]].
| 181 || [20.0.0+] CreateProcedureToReauthenticateNintendoAccount ||
|-
|-
| 998 || DebugSetAvailabilityErrorDetail ||
| 182 || [20.0.0+] ResumeProcedureToReauthenticateNintendoAccount ||
|}
|}


== IAuthorizationRequest ==
== IFloatingRegistrationRequest ==
This is "nn::account::nas::IAuthorizationRequest".
This is "nn::account::baas::IFloatingRegistrationRequest".
 
Added with [3.0.0+].


{| class="wikitable" border="1"
{| class="wikitable" border="1"
Line 3,056: Line 3,249:
| 0 || GetSessionId ||
| 0 || GetSessionId ||
|-
|-
| 10 || InvokeWithoutInteractionAsync || Returns an [[#IAsyncContext]].
| 12 || GetAccountId ||
|-
| 13 || GetLinkedNintendoAccountId ||
|-
|-
| 19 || IsAuthorized ||
| 14 || GetNickname ||
|-
|-
| 20 || GetAuthorizationCode ||
| 15 || GetProfileImage ||
|-
|-
| 21 || GetIdToken ||
| 16 || [18.0.0+] GetProfileLargeImage ||
|-
|-
| 22 || GetState ||
| 21 || LoadIdTokenCache ||
|}
 
== IOAuthProcedure ==
This is "nn::account::http::IOAuthProcedure".
 
{| class="wikitable" border="1"
|-
|-
! Cmd || Name || Notes
| 100 || RegisterUser ([1.0.0-3.0.2] RegisterAsync) || [1.0.0-3.0.2] Used to return an [[#IAsyncContext]].
|-
|-
| 0 || PrepareAsync || Returns an [[#IAsyncContext]].
| 101 || RegisterUserWithUid ([1.0.0-3.0.2] RegisterWithUidAsync) || [1.0.0-3.0.2] Used to return an [[#IAsyncContext]].
|-
|-
| 1 || GetRequest ||
| 102 || [4.0.0+] RegisterNetworkServiceAccountAsync || Returns an [[#IAsyncContext]].
|-
|-
| 2 || ApplyResponse ||
| 103 || [4.0.0+] RegisterNetworkServiceAccountWithUidAsync || Returns an [[#IAsyncContext]].
|-
|-
| 3 || ApplyResponseAsync || Returns an [[#IAsyncContext]].
| 110 || SetSystemProgramIdentification ||
|-
|-
| 10 || Suspend ||
| 111 || EnsureIdTokenCacheAsync || Returns an [[#IAsyncContext]].
|}
|}


== IOAuthProcedureForExternalNsa ==
== IAdministrator ==
This is "nn::account::nas::IOAuthProcedureForExternalNsa".
This is "nn::account::baas::IAdministrator".
 
Added with [3.0.0+].


{| class="wikitable" border="1"
{| class="wikitable" border="1"
Line 3,094: Line 3,281:
! Cmd || Name || Notes
! Cmd || Name || Notes
|-
|-
| 0 || PrepareAsync || Returns an [[#IAsyncContext]].
| 0 || CheckAvailability ||
|-
|-
| 1 || GetRequest ||
| 1 || GetAccountId ||
|-
|-
| 2 || ApplyResponse ||
| 2 || EnsureIdTokenCacheAsync || Returns an [[#IAsyncContext]].
|-
| 3 || [19.0.0+] LoadIdTokenCacheDeprecated ([1.0.0-18.1.0] LoadIdTokenCache) ||
|-
|-
| 3 || ApplyResponseAsync || Returns an [[#IAsyncContext]].
| 4 || [19.0.0+] LoadIdTokenCache ||
|-
|-
| 10 || Suspend ||
| 100 || SetSystemProgramIdentification ||
|-
|-
| 100 || GetAccountId ||
| 101 || [7.0.0+] RefreshNotificationTokenAsync
|-
|-
| 101 || GetLinkedNintendoAccountId ||
| 110 || [4.0.0+] GetServiceEntryRequirementCache ||
|-
|-
| 102 || GetNickname ||
| 111 || [4.0.0+] InvalidateServiceEntryRequirementCache ||
|-
|-
| 103 || GetProfileImage ||
| 112 || [4.0.0-6.2.0] InvalidateTokenCache ||
|-
|-
| 104 || [18.0.0+] ||
| 113 || [6.1.0+] GetServiceEntryRequirementCacheForOnlinePlay || Takes a total of 0x8-bytes of input, returns a total of 0x4-bytes of output.
|}
 
== IOAuthProcedureForNintendoAccountLinkage ==
This is "nn::account::nas::IOAuthProcedureForNintendoAccountLinkage".
 
{| class="wikitable" border="1"
|-
|-
! Cmd || Name || Notes
| 120 || GetNintendoAccountId ||
|-
|-
| 0 || PrepareAsync || Returns an [[#IAsyncContext]].
| 121 || [9.0.0+] CalculateNintendoAccountAuthenticationFingerprint ||
|-
|-
| 1 || GetRequest ||
| 130 || GetNintendoAccountUserResourceCache ||
|-
|-
| 2 || ApplyResponse ||
| 131 || RefreshNintendoAccountUserResourceCacheAsync || Returns an [[#IAsyncContext]].
|-
|-
| 3 || ApplyResponseAsync || Returns an [[#IAsyncContext]].
| 132 || RefreshNintendoAccountUserResourceCacheAsyncIfSecondsElapsed || Returns an [[#IAsyncContext]].
|-
|-
| 10 || Suspend ||
| 133 || [9.0.0+] GetNintendoAccountVerificationUrlCache ||
|-
|-
| 100 || GetRequestWithTheme ||
| 134 || [9.0.0+] RefreshNintendoAccountVerificationUrlCacheAsync ||
|-
|-
| 101 || IsNetworkServiceAccountReplaced ||
| 135 || [9.0.0+] RefreshNintendoAccountVerificationUrlCacheAsyncIfSecondsElapsed ||
|-
|-
| 199 || [2.0.0-5.1.0] GetUrlForIntroductionOfExtraMembership ||
| 136 || [19.0.0+] GetNintendoAccountUserResourceCache ||
|-
|-
| 200 || [16.0.0+] ApplyAsyncWithAuthorizedToken ||
| 140 || [5.0.0+] GetNetworkServiceLicenseCache ||
|}
|-
 
| 141 || [5.0.0+] RefreshNetworkServiceLicenseCacheAsync ||
== INotifier ==
|-
This is "nn::account::detail::INotifier".
| 142 || [5.0.0+] RefreshNetworkServiceLicenseCacheAsyncIfSecondsElapsed ||
 
|-
{| class="wikitable" border="1"
| 143 || [15.0.0+] GetNetworkServiceLicenseCacheEx ||
|-
| 150 || CreateAuthorizationRequest || Returns an [[#IAuthorizationRequest]].
|-
| 160 || [15.0.0+] RequiresUpdateNetworkServiceAccountIdTokenCache ||
|-
|-
! Cmd || Name
| 161 || [16.0.0+] RequireReauthenticationOfNetworkServiceAccount ||
|-
|-
| 0 || GetSystemEvent
| 180 || [18.0.0-19.0.1] GetRequestForNintendoAccountReauthentication ||
|}
 
== IProfile ==
This is "nn::account::profile::IProfile".
 
{| class="wikitable" border="1"
|-
|-
! Cmd || Name
| 181 || [20.0.0+] CreateProcedureToReauthenticateNintendoAccount ||
|-
|-
| 0 || [[#Get]]
| 182 || [20.0.0+] ResumeProcedureToReauthenticateNintendoAccount ||
|-
|-
| 1 || [[#GetBase]]
| 200 || IsRegistered ||
|-
|-
| 10 || [[#GetImageSize]]
| 201 || RegisterAsync || Returns an [[#IAsyncContext]].
|-
|-
| 11 || [[#LoadImage]]
| 202 || UnregisterAsync || Returns an [[#IAsyncContext]].
|-
|-
| 20 || [18.0.0+]
| 203 || DeleteRegistrationInfoLocally ||
|-
|-
| 21 || [18.0.0+]
| 204 || [19.0.0-19.0.1] UnregisterDeviceAsync ||
|-
|-
| 30 || [18.0.0+]
| 220 || SynchronizeProfileAsync || Returns an [[#IAsyncContext]].
|}
|-
 
| 221 || UploadProfileAsync || Returns an [[#IAsyncContext]].
=== Get ===
|-
Takes an output type-0x1A buffer for [[#UserData]], returns an output [[#ProfileBase]].
| 222 || SynchronizeProfileAsyncIfSecondsElapsed || Returns an [[#IAsyncContext]].
 
|-
=== GetBase ===
| 223 || [19.0.0+] DownloadProfileAsync ||
No input, returns an output [[#ProfileBase]].
 
=== GetImageSize ===
No input, returns an output u32 for the size of the image buffer.
 
=== LoadImage ===
Takes an output type-0x6 buffer, returns the same output u32 as [[#GetImageSize]].
 
The output buffer contains the JPEG profile image icon. This is valid for both Miis and character icons.
 
== IProfileEditor ==
This is "nn::account::profile::IProfileEditor".
 
{| class="wikitable" border="1"
|-
|-
! Cmd || Name
| 250 || IsLinkedWithNintendoAccount ||
|-
|-
| 0 || [[#Get]]
| 251 || CreateProcedureToLinkWithNintendoAccount || Returns an [[#IOAuthProcedureForNintendoAccountLinkage]].
|-
|-
| 1 || [[#GetBase]]
| 252 || ResumeProcedureToLinkWithNintendoAccount || Returns an [[#IOAuthProcedureForNintendoAccountLinkage]].
|-
|-
| 10 || [[#GetImageSize]]
| 255 || CreateProcedureToUpdateLinkageStateOfNintendoAccount || Returns an [[#IOAuthProcedure]].
|-
|-
| 11 || [[#LoadImage]]
| 256 || ResumeProcedureToUpdateLinkageStateOfNintendoAccount || Returns an [[#IOAuthProcedure]].
|-
|-
| 20 || [18.0.0+]
| 260 || [3.0.0+] CreateProcedureToLinkNnidWithNintendoAccount || Returns an [[#IOAuthProcedure]].
|-
|-
| 21 || [18.0.0+]
| 261 || [3.0.0+] ResumeProcedureToLinkNnidWithNintendoAccount || Returns an [[#IOAuthProcedure]].
|-
|-
| 30 || [18.0.0+]
| 280 || ProxyProcedureToAcquireApplicationAuthorizationForNintendoAccount || Returns an [[#IOAuthProcedure]].
|-
|-
| 100 || [[#Store]]
| 290 || [8.0.0+] GetRequestForNintendoAccountUserResourceView ||
|-
|-
| 101 || [[#StoreWithImage]]
| 300 || [6.0.0+] TryRecoverNintendoAccountUserStateAsync || Returns an [[#IAsyncContext]].
|-
|-
| 110 || [18.0.0+]
| 400 || [6.1.0+] IsServiceEntryRequirementCacheRefreshRequiredForOnlinePlay || Takes a total of 0x8-bytes of input, returns an output u8.
|}
|-
 
| 401 || [6.1.0+] RefreshServiceEntryRequirementCacheForOnlinePlayAsync || Takes a total of 0x8-bytes of input, returns an [[#IAsyncContext]].
=== Store ===
|-
Takes a [[#ProfileBase]] and an input type-0x19 buffer for [[#UserData]].
| 900 || [9.0.0+] GetAuthenticationInfoForWin ||
 
|-
=== StoreWithImage ===
| 901 || [9.0.0+] ImportAsyncForWin ||
Takes a [[#ProfileBase]], an input type-0x19 buffer for [[#UserData]], and an input type-0x5 buffer.
|-
| 997 || DebugUnlinkNintendoAccountAsync || Returns an [[#IAsyncContext]].
|-
| 998 || DebugSetAvailabilityErrorDetail ||
|}


== IAsyncContext ==
== IAuthorizationRequest ==
This is "nn::account::detail::IAsyncContext".
This is "nn::account::nas::IAuthorizationRequest".


{| class="wikitable" border="1"
{| class="wikitable" border="1"
|-
|-
! Cmd || Name
! Cmd || Name || Notes
|-
| 0 || GetSessionId ||
|-
| 10 || InvokeWithoutInteractionAsync || Returns an [[#IAsyncContext]].
|-
|-
| 0 || GetSystemEvent
| 19 || IsAuthorized ||
|-
|-
| 1 || Cancel
| 20 || GetAuthorizationCode ||
|-
|-
| 2 || HasDone
| 21 || GetIdToken ||
|-
|-
| 3 || GetResult
| 22 || GetState ||
|}
|}


== ISessionObject ==
== IOAuthProcedure ==
This is "nn::account::detail::ISessionObject".
This is "nn::account::http::IOAuthProcedure".


{| class="wikitable" border="1"
{| class="wikitable" border="1"
|-
|-
! Cmd || Name
! Cmd || Name || Notes
|-
|-
| 999 || Dummy
| 0 || PrepareAsync || Returns an [[#IAsyncContext]].
|}
|-
| 1 || GetRequest ||
|-
| 2 || ApplyResponse ||
|-
| 3 || ApplyResponseAsync || Returns an [[#IAsyncContext]].
|-
| 10 || Suspend ||
|}


= acc:u0 =
== IOAuthProcedureForExternalNsa ==
This is "nn::account::IAccountServiceForApplication".
This is "nn::account::nas::IOAuthProcedureForExternalNsa".


[13.0.0+] This was moved from [[Account_services|account]].
Added with [3.0.0+].
 
This is only available when the output from [[Process_Manager_services|pm:bm]] GetBootMode is Normal/Maintenance.


{| class="wikitable" border="1"
{| class="wikitable" border="1"
Line 3,258: Line 3,439:
! Cmd || Name || Notes
! Cmd || Name || Notes
|-
|-
| 0 || GetUserCount ||
| 0 || PrepareAsync || Returns an [[#IAsyncContext]].
|-
|-
| 1 || GetUserExistence ||
| 1 || GetRequest ||
|-
|-
| 2 || ListAllUsers ||
| 2 || ApplyResponse ||
|-
|-
| 3 || ListOpenUsers ||
| 3 || ApplyResponseAsync || Returns an [[#IAsyncContext]].
|-
|-
| 4 || GetLastOpenedUser ||
| 10 || Suspend ||
|-
|-
| 5 || GetProfile || Takes an input userID, returns an [[#IProfile]].
| 100 || GetAccountId ||
|-
|-
| 6 || [3.0.0+] GetProfileDigest ||
| 101 || GetLinkedNintendoAccountId ||
|-
|-
| 50 || [[#IsUserRegistrationRequestPermitted]] ||
| 102 || GetNickname ||
|-
|-
| 51 || [[#TrySelectUserWithoutInteraction]] ||
| 103 || GetProfileImage ||
|-
|-
| 60 || [5.0.0-5.1.0] ListOpenContextStoredUsers ||
| 104 || [18.0.0+] GetProfileLargeImage ||
|-
|}
| 99 || [6.0.0+] DebugActivateOpenContextRetention || No input, returns an [[#ISessionObject]].
 
== IOAuthProcedureForNintendoAccountLinkage ==
This is "nn::account::nas::IOAuthProcedureForNintendoAccountLinkage".
 
{| class="wikitable" border="1"
|-
|-
| 100 || [[#InitializeApplicationInfoV0]] ||
! Cmd || Name || Notes
|-
|-
| 101 || GetBaasAccountManagerForApplication || Takes an input userID, returns an [[#IManagerForApplication]].
| 0 || PrepareAsync || Returns an [[#IAsyncContext]].
|-
|-
| 102 || AuthenticateApplicationAsync || Returns an [[#IAsyncContext]].
| 1 || GetRequest ||
|-
|-
| 103 || [4.0.0+] CheckNetworkServiceAvailabilityAsync || Returns an [[#IAsyncContext]].
| 2 || ApplyResponse ||
|-
|-
| 110 || StoreSaveDataThumbnail ||
| 3 || ApplyResponseAsync || Returns an [[#IAsyncContext]].
|-
|-
| 111 || ClearSaveDataThumbnail ||
| 10 || Suspend ||
|-
|-
| 120 || CreateGuestLoginRequest || Returns an [[#IGuestLoginRequest]].
| 100 || GetRequestWithTheme ||
|-
|-
| 130 || [5.0.0+] LoadOpenContext ||
| 101 || IsNetworkServiceAccountReplaced ||
|-
|-
| 131 || [6.0.0+] ListOpenContextStoredUsers ||  
| 199 || [2.0.0-5.1.0] GetUrlForIntroductionOfExtraMembership ||
|-
|-
| 140 || [6.0.0+] [[#InitializeApplicationInfoV1]] ||  
| 200 || [16.0.0+] ApplyAsyncWithAuthorizedToken ||
|}
 
== INotifier ==
This is "nn::account::detail::INotifier".
 
{| class="wikitable" border="1"
|-
|-
| 141 || [6.0.0+] ListQualifiedUsers ||  
! Cmd || Name
|-
|-
| 150 || [6.0.0+] IsUserAccountSwitchLocked ||
| 0 || GetSystemEvent
|-
| 160 || [13.0.0+] InitializeApplicationInfoV2 ||  
|}
|}


InitializeApplicationInfo* is used by the user-process during service init.
== IProfile ==
This is "nn::account::profile::IProfile".


== InitializeApplicationInfoV0 ==
{| class="wikitable" border="1"
Takes a PID and an input u64 pid_placeholder, no output.
 
== InitializeApplicationInfoV1 ==
Takes a PID and an input u64 pid_placeholder, no output.
 
== IGuestLoginRequest ==
This is "nn::account::baas::IGuestLoginRequest".
 
{| class="wikitable" border="1"
|-
|-
! Cmd || Name
! Cmd || Name
|-
|-
| 0 || GetSessionId
| 0 || [[#Get]]
|-
|-
| 11 || [1.0.0-2.3.0]  
| 1 || [[#GetBase]]
|-
|-
| 12 || GetAccountId
| 10 || [[#GetImageSize]]
|-
|-
| 13 || GetLinkedNintendoAccountId
| 11 || [[#LoadImage]]
|-
| 14 || GetNickname
|-
|-
| 15 || GetProfileImage
| 20 || [18.0.0+] GetLargeImageSize
|-
|-
| 16 || [18.0.0+]
| 21 || [18.0.0+] LoadLargeImage
|-
|-
| 21 || [3.0.0+] LoadIdTokenCache
| 30 || [18.0.0+] GetImageId
|}
|}


== IManagerForApplication ==
=== Get ===
This is "nn::account::baas::IManagerForApplication".
Takes an output type-0x1A buffer for [[#UserData]], returns an output [[#ProfileBase]].
 
=== GetBase ===
No input, returns an output [[#ProfileBase]].
 
=== GetImageSize ===
No input, returns an output u32 for the size of the image buffer.
 
=== LoadImage ===
Takes an output type-0x6 buffer, returns the same output u32 as [[#GetImageSize]].
 
The output buffer contains the JPEG profile image icon. This is valid for both Miis and character icons.
 
== IProfileEditor ==
This is "nn::account::profile::IProfileEditor".


{| class="wikitable" border="1"
{| class="wikitable" border="1"
|-
|-
! Cmd || Name || Notes
! Cmd || Name
|-
| 0 || [[#Get]]
|-
| 1 || [[#GetBase]]
|-
|-
| 0 || CheckAvailability ||
| 10 || [[#GetImageSize]]
|-
|-
| 1 || GetAccountId ||
| 11 || [[#LoadImage]]
|-
|-
| 2 || EnsureIdTokenCacheAsync || Returns an [[#IAsyncContext]].
| 20 || [18.0.0+] GetLargeImageSize
|-
|-
| 3 || LoadIdTokenCache ||
| 21 || [18.0.0+] LoadLargeImage
|-
|-
| 130 || GetNintendoAccountUserResourceCacheForApplication ||
| 30 || [18.0.0+] GetImageId
|-
|-
| 150 || CreateAuthorizationRequest || Returns an [[#IAuthorizationRequest]].
| 100 || [[#Store]]
|-
|-
| 160 || [5.0.0+] StoreOpenContext ||
| 101 || [[#StoreWithImage]]
|-
|-
| 170 || [13.0.0+] EnsureIdTokenCacheForOnlinePlayAsync ([6.0.0-12.1.0] LoadNetworkServiceLicenseKindAsync) || No input, returns an [[#IAsyncContextForLoginForOnlinePlay]] ([6.0.0-12.1.0] [[#IAsyncNetworkServiceLicenseKindContext]]).
| 110 || [18.0.0+] StoreWithLargeImage
|}
|}


== IAsyncNetworkServiceLicenseKindContext ==
=== Store ===
This is "nn::account::detail::IAsyncNetworkServiceLicenseKindContext".
Takes a [[#ProfileBase]] and an input type-0x19 buffer for [[#UserData]].
 
=== StoreWithImage ===
Takes a [[#ProfileBase]], an input type-0x19 buffer for [[#UserData]], and an input type-0x5 buffer.


This was added with [6.0.0+].
== IAsyncContext ==
This is "nn::account::detail::IAsyncContext".


{| class="wikitable" border="1"
{| class="wikitable" border="1"
|-
|-
! Cmd || Name || Notes
! Cmd || Name
|-
|-
| 0 || GetSystemEvent ||
| 0 || GetSystemEvent
|-
|-
| 1 || Cancel ||
| 1 || Cancel
|-
|-
| 2 || HasDone ||
| 2 || HasDone
|-
|-
| 3 || GetResult ||
| 3 || GetResult
|-
| 100 || GetNetworkServiceLicenseKind ||
|}
|}


== IAsyncContextForLoginForOnlinePlay ==
== ISessionObject ==
This is "nn::account::baas::IAsyncContextForLoginForOnlinePlay".
This is "nn::account::detail::ISessionObject".
 
This was added with [13.0.0+].


{| class="wikitable" border="1"
{| class="wikitable" border="1"
|-
|-
! Cmd || Name || Notes
! Cmd || Name
|-
|-
| 0 || GetSystemEvent ||
| 999 || Dummy
|-
| 1 || Cancel ||
|-
| 2 || HasDone ||
|-
| 3 || GetResult ||
|-
| 100 || GetNetworkServiceLicenseInfoForOnlinePlay ||  
|}
|}


= acc:u1 =
= acc:u0 =
This is "nn::account::IAccountServiceForSystemService".
This is "nn::account::IAccountServiceForApplication".


[13.0.0+] This was moved from [[Account_services|account]].
[13.0.0+] This was moved from [[Account_services|account]].
Line 3,424: Line 3,613:
| 4 || GetLastOpenedUser ||
| 4 || GetLastOpenedUser ||
|-
|-
| 5 || GetProfile || Returns an [[#IProfile]].
| 5 || GetProfile || Takes an input userID, returns an [[#IProfile]].
|-
|-
| 6 || [3.0.0+] GetProfileDigest ||
| 6 || [3.0.0+] GetProfileDigest ||
Line 3,430: Line 3,619:
| 50 || [[#IsUserRegistrationRequestPermitted]] ||
| 50 || [[#IsUserRegistrationRequestPermitted]] ||
|-
|-
| 51 || [[#TrySelectUserWithoutInteraction]] ||
| 51 || TrySelectUserWithoutInteractionDeprecated ([1.0.0-18.1.0] [[#TrySelectUserWithoutInteraction]]) ||
|-
| 52 || [19.0.0+] TrySelectUserWithoutInteraction ||
|-
|-
| 60 || [5.0.0-5.1.0] ListOpenContextStoredUsers ||
| 60 || [5.0.0-5.1.0] ListOpenContextStoredUsers ||
Line 3,436: Line 3,627:
| 99 || [6.0.0+] DebugActivateOpenContextRetention || No input, returns an [[#ISessionObject]].
| 99 || [6.0.0+] DebugActivateOpenContextRetention || No input, returns an [[#ISessionObject]].
|-
|-
| 100 || GetUserRegistrationNotifier || Returns an [[#INotifier]].
| 100 || [[#InitializeApplicationInfoV0]] ||
|-
|-
| 101 || GetUserStateChangeNotifier || Returns an [[#INotifier]].
| 101 || GetBaasAccountManagerForApplication || Takes an input userID, returns an [[#IManagerForApplication]].
|-
|-
| 102 || GetBaasAccountManagerForSystemService || Returns an [[#IManagerForSystemService]].
| 102 || AuthenticateApplicationAsync || Returns an [[#IAsyncContext]].
|-
|-
| 103 || GetBaasUserAvailabilityChangeNotifier || Returns an [[#INotifier]].
| 103 || [4.0.0+] CheckNetworkServiceAvailabilityAsync || Returns an [[#IAsyncContext]].
|-
| 104 || GetProfileUpdateNotifier || Returns an [[#INotifier]].
|-
| 105 || [4.0.0+] CheckNetworkServiceAvailabilityAsync || Returns an [[#IAsyncContext]].
|-
| 106 || [9.0.0+] GetProfileSyncNotifier ||
|-
|-
| 110 || StoreSaveDataThumbnail ||
| 110 || StoreSaveDataThumbnail ||
Line 3,454: Line 3,639:
| 111 || ClearSaveDataThumbnail ||
| 111 || ClearSaveDataThumbnail ||
|-
|-
| 112 || LoadSaveDataThumbnail ||
| 120 || CreateGuestLoginRequest || Returns an [[#IGuestLoginRequest]].
|-
|-
| 113 || [5.0.0+] GetSaveDataThumbnailExistence ||
| 130 || [5.0.0+] LoadOpenContext ||
|-
|-
| 120 || [10.0.0+] ListOpenUsersInApplication ||
| 131 || [6.0.0+] ListOpenContextStoredUsers ||  
|-
|-
| 130 || [6.0.0+] ActivateOpenContextRetention || Takes a total of 0x8-bytes of input, returns an [[#ISessionObject]].
| 140 || [6.0.0+] [[#InitializeApplicationInfoV1]] ||
|-
|-
| 140 || [6.0.0+] ListQualifiedUsers ||  
| 141 || [6.0.0+] ListQualifiedUsers ||  
|-
|-
| 150 || [10.0.0-10.2.0] AuthenticateApplicationAsync ||
| 150 || [6.0.0+] IsUserAccountSwitchLocked ||  
|-
|-
| 151 || [12.0.0+] EnsureSignedDeviceIdentifierCacheForNintendoAccountAsync ||  
| 160 || [13.0.0+] InitializeApplicationInfoV2 ||  
|}
 
InitializeApplicationInfo* is used by the user-process during service init.
 
== InitializeApplicationInfoV0 ==
Takes a PID and an input u64 pid_placeholder, no output.
 
== InitializeApplicationInfoV1 ==
Takes a PID and an input u64 pid_placeholder, no output.
 
== IGuestLoginRequest ==
This is "nn::account::baas::IGuestLoginRequest".
 
{| class="wikitable" border="1"
|-
|-
| 152 || [12.0.0+] LoadSignedDeviceIdentifierCacheForNintendoAccount ||
! Cmd || Name
|-
|-
| 170 || [13.0.0+] GetNasOp2MembershipStateChangeNotifier ||
| 0 || GetSessionId
|-
|-
| 190 || [1.0.0-9.2.0] GetUserLastOpenedApplication ||
| 11 || [1.0.0-2.3.0]  
|-
|-
| 191 || [7.0.0+] UpdateNotificationReceiverInfo ([5.0.0-5.1.0] ActivateOpenContextHolder) ||
| 12 || GetAccountId
|-
|-
| 400 || [18.0.0+] ||
| 13 || GetLinkedNintendoAccountId
|-
|-
| 401 || [18.0.0+] ||
| 14 || GetNickname
|-
|-
| 997 || [3.0.0+] DebugInvalidateTokenCacheForUser ||
| 15 || GetProfileImage
|-
|-
| 998 || DebugSetUserStateClose ||
| 16 || [18.0.0+] GetProfileLargeImage
|-
|-
| 999 || DebugSetUserStateOpen ||
| 21 || [3.0.0+] LoadIdTokenCache
|}
|}


[10.0.0+] DebugSetUserStateClose/DebugSetUserStateOpen now takes an additional 8-bytes of input.
== IManagerForApplication ==
 
This is "nn::account::baas::IManagerForApplication".
== IOAuthProcedureForUserRegistration ==
This is "nn::account::nas::IOAuthProcedureForUserRegistration".
 
This was added with [8.0.0+].


{| class="wikitable" border="1"
{| class="wikitable" border="1"
Line 3,498: Line 3,693:
! Cmd || Name || Notes
! Cmd || Name || Notes
|-
|-
| 0 || PrepareAsync || No input, returns an [[#IAsyncContext]].
| 0 || CheckAvailability ||
|-
|-
| 1 || GetRequest ||  
| 1 || GetAccountId ||
|-
|-
| 2 || ApplyResponse ||  
| 2 || EnsureIdTokenCacheAsync || Returns an [[#IAsyncContext]].
|-
|-
| 3 || ApplyResponseAsync || Takes a type-0x9 input buffer, returns an [[#IAsyncContext]].
| 3 || LoadIdTokenCache ||
|-
|-
| 10 || Suspend ||  
| 130 || GetNintendoAccountUserResourceCacheForApplication ||
|-
|-
| 100 || GetAccountId ||  
| 150 || CreateAuthorizationRequest || Returns an [[#IAuthorizationRequest]].
|-
|-
| 101 || GetLinkedNintendoAccountId ||  
| 160 || [5.0.0+] StoreOpenContext ||
|-
|-
| 102 || GetNickname ||  
| 170 || [13.0.0+] EnsureIdTokenCacheForOnlinePlayAsync ([6.0.0-12.1.0] LoadNetworkServiceLicenseKindAsync) || No input, returns an [[#IAsyncContextForLoginForOnlinePlay]] ([6.0.0-12.1.0] [[#IAsyncNetworkServiceLicenseKindContext]]).
|}
 
== IAsyncNetworkServiceLicenseKindContext ==
This is "nn::account::detail::IAsyncNetworkServiceLicenseKindContext".
 
This was added with [6.0.0+].
 
{| class="wikitable" border="1"
|-
|-
| 103 || GetProfileImage ||  
! Cmd || Name || Notes
|-
|-
| 104 || [18.0.0+] ||  
| 0 || GetSystemEvent ||  
|-
|-
| 110 || RegisterUserAsync || No input, returns an [[#IAsyncContext]].
| 1 || Cancel ||  
|-
|-
| 111 || GetUid ||  
| 2 || HasDone ||  
|-
|-
| 200 || [17.0.0+] ApplyResponseForUserCreationAsync ||  
| 3 || GetResult ||  
|-
|-
| 205 || [17.0.0+] SuspendAfterApplyResponse ||
| 100 || GetNetworkServiceLicenseKind ||  
|-
| 210 || [17.0.0+] IsProfileAvailable ||
|-
| 220 || [17.0.0+] RegisterUserAsyncWithoutProfile ||
|-
| 221 || [17.0.0+] RegisterUserWithProfileAsync ||
|-
| 230 || [18.0.0+] ||  
|}
|}


= VersionListData =
== IAsyncContextForLoginForOnlinePlay ==
This is "nn::ns::VersionListData".
This is "nn::account::baas::IAsyncContextForLoginForOnlinePlay".


= ApplicationUpdateInfo =
This was added with [13.0.0+].
This is "nn::ns::ApplicationUpdateInfo". This is an u8.


{| class="wikitable" border="1"
{| class="wikitable" border="1"
|-
|-
! Value
! Cmd || Name || Notes
! Description
|-
| 0 || GetSystemEvent ||
|-
| 1 || Cancel ||
|-
| 2 || HasDone ||
|-
|-
| 0 || UpToDate
| 3 || GetResult ||  
|-
|-
| 1 || Updatable
| 100 || GetNetworkServiceLicenseInfoForOnlinePlay ||  
|}
|}


[[qlaunch]] just checks whether this is 0.
= acc:u1 =
This is "nn::account::IAccountServiceForSystemService".


= ApplicationOccupiedSize =
[13.0.0+] This was moved from [[Account_services|account]].
This is "nn::ns::ApplicationOccupiedSize". This is a 0x80-byte struct.
 
This is only available when the output from [[Process_Manager_services|pm:bm]] GetBootMode is Normal/Maintenance.


{| class="wikitable" border="1"
{| class="wikitable" border="1"
|-
|-
! Offset
! Cmd || Name || Notes
! Size
|-
! Description
| 0 || GetUserCount ||
|-
|-
| 0x0 || 0x20 * 4 || Array of [[#ApplicationOccupiedSizeEntity]]
| 1 || GetUserExistence ||
|}
 
= ApplicationOccupiedSizeEntity =
This is "nn::ns::ApplicationOccupiedSizeEntity". This is a 0x20-byte struct.
 
{| class="wikitable" border="1"
|-
|-
! Offset
| 2 || ListAllUsers ||
! Size
! Description
|-
|-
| 0x0 || 0x1 || [[NCM_services#StorageId|StorageId]]
| 3 || ListOpenUsers ||
|-
|-
| 0x1 || 0x7 || Reserved
| 4 || GetLastOpenedUser ||
|-
|-
| 0x8 || 0x8 || AppSize
| 5 || GetProfile || Returns an [[#IProfile]].
|-
|-
| 0x10 || 0x8 || PatchSize
| 6 || [3.0.0+] GetProfileDigest ||
|-
|-
| 0x18 || 0x8 || AocSize
| 50 || [[#IsUserRegistrationRequestPermitted]] ||
|}
 
= ProgressForDeleteUserSaveDataAll =
This is "nn::ns::detail::ProgressForDeleteUserSaveDataAll". This is a 0x28-byte struct.
 
{| class="wikitable" border="1"
|-
|-
! Offset
| 51 || TrySelectUserWithoutInteractionDeprecated ([1.0.0-18.1.0] [[#TrySelectUserWithoutInteraction]]) ||
! Size
! Description
|-
|-
| 0x0 || 0x8 || StartedAt
| 52 || [19.0.0+] TrySelectUserWithoutInteraction ||
|-
|-
| 0x8 || 0x4 || Count
| 60 || [5.0.0-5.1.0] ListOpenContextStoredUsers ||
|-
|-
| 0xC || 0x4 || Reserved
| 99 || [6.0.0+] DebugActivateOpenContextRetention || No input, returns an [[#ISessionObject]].
|-
|-
| 0x10 || 0x8 || SizeInBytes
| 100 || GetUserRegistrationNotifier || Returns an [[#INotifier]].
|-
|-
| 0x18 || 0x1 || IsSystem
| 101 || GetUserStateChangeNotifier || Returns an [[#INotifier]].
|-
|-
| 0x19 || 0x7 || Reserved
| 102 || GetBaasAccountManagerForSystemService || Returns an [[#IManagerForSystemService]].
|-
|-
| 0x20 || 0x8 || ApplicationId
| 103 || GetBaasUserAvailabilityChangeNotifier || Returns an [[#INotifier]].
|}
 
= ApplicationViewDeprecated =
This is "nn::ns::ApplicationViewDeprecated". This is a 0x40-byte struct.
 
{| class="wikitable" border="1"
|-
|-
! Offset
| 104 || GetProfileUpdateNotifier || Returns an [[#INotifier]].
! Size
! Description
|-
|-
| 0x0 || 0x8 || [[NCM_services#ApplicationId|ApplicationId]]
| 105 || [4.0.0+] CheckNetworkServiceAvailabilityAsync || Returns an [[#IAsyncContext]].
|-
|-
| 0x8 || 0x4 || Version
| 106 || [9.0.0+] GetProfileSyncNotifier ||
|-
|-
| 0xC || 0x4 || [[#ApplicationViewFlag|Flag]]
| 110 || StoreSaveDataThumbnail ||
|-
|-
| 0x10 || 0x18 || [[#ApplicationDownloadProgress|Progress]]
| 111 || ClearSaveDataThumbnail ||
|-
|-
| 0x28 || 0x18 || [[#ApplicationApplyDeltaProgress|ApplyProgress]]
| 112 || LoadSaveDataThumbnail ||
|}
 
This is converted from [[#ApplicationView]] by [[#GetApplicationViewDeprecated]] on newer system-versions as follows:
 
{| class="wikitable" border="1"
|-
|-
! Offset
| 113 || [5.0.0+] GetSaveDataThumbnailExistence ||
! Size
! Description
|-
|-
| 0x0 || 0x20 || Same as [[#ApplicationView]] +0x0.
| 120 || [10.0.0+] ListOpenUsersInApplication ||
|-
|-
| 0x20 || 0x4 || Same as [[#ApplicationView]] +0x20.
| 130 || [6.0.0+] ActivateOpenContextRetention || Takes a total of 0x8-bytes of input, returns an [[#ISessionObject]].
|-
|-
| 0x24 || 0x2 || Same as [[#ApplicationView]] +0x24.
| 140 || [6.0.0+] ListQualifiedUsers ||  
|-
|-
| 0x26 || 0x2 || Cleared to 0.
| 150 || [10.0.0-10.2.0] AuthenticateApplicationAsync ||
|-
|-
| 0x28 || 0x10 || Same as [[#ApplicationView]] +0x30.
| 151 || [12.0.0+] EnsureSignedDeviceIdentifierCacheForNintendoAccountAsync ||  
|-
|-
| 0x38 || 0x4 || Same as [[#ApplicationView]] +0x40.
| 152 || [12.0.0+] LoadSignedDeviceIdentifierCacheForNintendoAccount ||
|-
|-
| 0x3C || 0x1 || Same as [[#ApplicationView]] +0x44.
| 170 || [13.0.0+] GetNasOp2MembershipStateChangeNotifier ||
|-
|-
| 0x3D || 0x2 || Cleared to 0.
| 190 || [1.0.0-9.2.0] GetUserLastOpenedApplication ||
|-
|-
| 0x3F || 0x1 || Cleared to 0.
| 191 || [7.0.0-19.0.1] UpdateNotificationReceiverInfo ([5.0.0-5.1.0] ActivateOpenContextHolder) ||
|}
 
= ApplicationViewFlag =
This is "nn::ns::ApplicationViewFlag". This is a 32-bit flag.
 
{| class="wikitable" border="1"
|-
|-
! Bit
| 401 || [18.0.0+] GetPinCodeLength ||
! Description
|-
|-
| 0
| 402 || [18.0.0-19.0.1] GetPinCode ||
|  
|-
|-
| 1
| 403 || [20.0.0+] GetPinCodeParity ||
|  
|-
|-
| 2
| 404 || [20.0.0+] VerifyPinCode ||
|  
|-
|-
| 3
| 405 || [20.0.0+] IsPinCodeVerificationForbidden ||
|  
|-
|-
| 4
| 997 || [3.0.0+] DebugInvalidateTokenCacheForUser ||
|  
|-
|-
| 5
| 998 || DebugSetUserStateClose ||
|  
|-
|-
| 6
| 999 || DebugSetUserStateOpen ||
|  
|}
 
[10.0.0+] DebugSetUserStateClose/DebugSetUserStateOpen now takes an additional 8-bytes of input.
 
== IOAuthProcedureForUserRegistration ==
This is "nn::account::nas::IOAuthProcedureForUserRegistration".
 
This was added with [8.0.0+].
 
{| class="wikitable" border="1"
|-
! Cmd || Name || Notes
|-
|-
| 7
| 0 || PrepareAsync || No input, returns an [[#IAsyncContext]].
|  
|-
|-
| 8
| 1 || GetRequest ||  
|  
|-
|-
| 9
| 2 || ApplyResponse ||  
|  
|-
|-
| 10
| 3 || ApplyResponseAsync || Takes a type-0x9 input buffer, returns an [[#IAsyncContext]].
|  
|-
|-
| 11
| 10 || Suspend ||  
|  
|-
|-
| 12
| 100 || GetAccountId ||  
|  
|-
|-
| 13
| 101 || GetLinkedNintendoAccountId ||  
|  
|-
|-
| 14
| 102 || GetNickname ||  
|  
|-
|-
| 15
| 103 || GetProfileImage ||  
|  
|-
|-
| 16
| 104 || [18.0.0+] GetProfileLargeImage ||  
|  
|-
|-
| 17
| 110 || RegisterUserAsync || No input, returns an [[#IAsyncContext]].
|  
|-
| 111 || GetUid ||
|-
| 200 || [17.0.0+] ApplyResponseForUserCreationAsync ||
|-
| 205 || [17.0.0+] SuspendAfterApplyResponse ||
|-
| 210 || [17.0.0+] IsProfileAvailable ||
|-
| 220 || [17.0.0+] RegisterUserAsyncWithoutProfile ||
|-
| 221 || [17.0.0+] RegisterUserWithProfileAsync ||
|-
| 230 || [18.0.0+] RegisterUserWithLargeImageProfileAsync ||  
|}
|}


= ApplicationDownloadProgress =
= ApplicationRecord =
This is "nn::ns::ApplicationDownloadProgress". This is a 0x18-byte struct.
This is "nn::ns::ApplicationRecord".


{| class="wikitable" border="1"
{| class="wikitable" border="1"
Line 3,728: Line 3,899:
! Description
! Description
|-
|-
| 0x0 || 0x8 || Downloaded
| 0x0
| 0x8
| [[NCM_services#ApplicationId|Id]]
|-
|-
| 0x8 || 0x8 || Total
| 0x8
| 0x1
| [[#ApplicationEvent|LastEvent]]
|-
|-
| 0x10 || 0x4 || LastResult
| 0x9
| 0x1
| Attributes
|-
|-
| 0x14 || 0x1 || [[#ApplicationDownloadState|State]]
| 0xA
| 0x6
| Reserved
|-
|-
| 0x15 || 0x3 || Reserved
| 0x10
| 0x8
| LastUpdated
|}
|}


= ApplicationApplyDeltaProgress =
= ApplicationEvent =
This is "nn::ns::ApplicationApplyDeltaProgress". This is a 0x18-byte struct.
This is "nn::ns::ApplicationEvent".


{| class="wikitable" border="1"
{| class="wikitable" border="1"
|-
|-
! Offset
! Value
! Size
! Description
! Description
|-
|-
| 0x0 || 0x8 || Applied
| 0 || Launched
|-
|-
| 0x8 || 0x8 || Total
| 1 || LocalInstalled
|-
|-
| 0x10 || 0x4 || LastResult
| 2 || DownloadStarted
|-
|-
| 0x14 || 0x1 || [[#ApplicationApplyDeltaState|State]]
| 3 || GameCardInserted
|-
| 4 || Touched
|-
| 5 ||
|-
| 6 ||
|-
| 7 ||
|-
| 8 ||
|-
| 9 ||  
|-
|-
| 0x15 || 0x3 || Reserved
| 10 ||  
|}
 
= ApplicationDownloadState =
This is "nn::ns::ApplicationDownloadState". This is an u8.
 
{| class="wikitable" border="1"
|-
|-
! Value
| 11 ||
! Description
|-
|-
| 0 || Runnable
| 12 ||  
|-
|-
| 1 || Suspended
| 13 ||  
|-
|-
| 2 || NotEnoughSpace
| 14 ||  
|-
|-
| 3 || Fatal
| 15 ||  
|-
|-
| 4 || Finished
| 16 ||  
|}
|}


= ApplicationApplyDeltaState =
= ApplicationControlSource =
This is "nn::ns::ApplicationApplyDeltaState". This is an u8.
This is "nn::ns::ApplicationControlSource".


{| class="wikitable" border="1"
{| class="wikitable" border="1"
Line 3,786: Line 3,971:
! Description
! Description
|-
|-
| 0 || Applying
| 0
| CacheOnly
|-
|-
| 1 || Suspended
| 1
| Storage
|-
|-
| 2 || NotEnoughSpace
| 2
|-
| StorageOnly
| 3 || Fatal
|-
| 4 || NoTask
|-
| 5 || WaitApply
|-
| 6 || Applied
|}
|}


= ApplicationView =
= ApplicationContentMetaStatus =
This is "nn::ns::ApplicationView". This is a 0x50-byte struct.
This is "nn::ns::ApplicationContentMetaStatus".


{| class="wikitable" border="1"
{| class="wikitable" border="1"
Line 3,810: Line 3,990:
! Description
! Description
|-
|-
| 0x0 || 0x8 || [[NCM_services#ApplicationId|ApplicationId]]
| 0x0
| 0x1
| [[NCM_services#ContentMetaType|Type]]
|-
| 0x1
| 0x1
| [[NCM_services#StorageId|InstalledStorage]]
|-
| 0x2
| 0x1
| [[#ContentMetaRightsCheck|RightsCheck]]
|-
|-
| 0x8 || 0x4 || ?
| 0x3
| 0x1
| Reserved
|-
|-
| 0xC || 0x4 || Flags
| 0x4
| 0x4
| Version
|-
|-
| 0x10 || 0x40 || ?
| 0x8
| 0x8
| [[NCM_services#ApplicationId|Id]]
|}
|}


= ApplicationViewWithPromotionInfo =
= ContentMetaRightsCheck =
This is a 0x70-byte struct.
This is "nn::ns::ContentMetaRightsCheck".


{| class="wikitable" border="1"
{| class="wikitable" border="1"
|-
|-
! Offset
! Value
! Size
! Description
! Description
|-
|-
| 0x0 || 0x50 || [[#ApplicationView]]
| 0
| NotChecked
|-
| 1
| NotNeeded
|-
| 2
| CommonRights
|-
| 3
| PersonalizedRights
|-
|-
| 0x50 || 0x20 || [[#PromotionInfo]]
| 4
| NoRights
|}
|}


= PromotionInfo =
= VersionListData =
This is a 0x20-byte struct.
This is "nn::ns::VersionListData".
 
= ApplicationUpdateInfo =
This is "nn::ns::ApplicationUpdateInfo".


{| class="wikitable" border="1"
{| class="wikitable" border="1"
|-
|-
! Offset
! Value
! Size
! Description
! Description
|-
|-
| 0x0 || 0x8 || PosixTime start_timestamp.
| 0 || UpToDate
|-
|-
| 0x8 || 0x8 || PosixTime end_timestamp.
| 1 || Updatable
|-
| 0x10 || 0x8 || Remaining time until the promotion ends, in nanoseconds ({end_timestamp - current_time} converted to nanoseconds).
|-
| 0x18 || 0x4 || Not set, left at zero.
|-
| 0x1C || 0x1 || Flags. Bit0: whether the PromotionInfo is valid (including bit1). Bit1 clear: u64 +0x10 is set.
|-
| 0x1D || 0x3 || Padding
|}
|}


= ApplicationResourceType =
= ApplicationOccupiedSize =
This is "nn::ns::ApplicationResourceType". This is an u8.
This is "nn::ns::ApplicationOccupiedSize". This is a 0x80-byte struct.


{| class="wikitable" border="1"
{| class="wikitable" border="1"
|-
|-
! Value
! Offset
! Size
! Description
! Description
|-
|-
| 0 || ApplicationResource
| 0x0 || 0x20 * 4 || Array of [[#ApplicationOccupiedSizeEntity]]
|-
| 1 || MicroApplicationResource
|}
|}


= ApplicationErrorCodeCategory =
= ApplicationOccupiedSizeEntity =
This is "nn::ns::ApplicationErrorCodeCategory". This is an u64.
This is "nn::ns::ApplicationOccupiedSizeEntity". This is a 0x20-byte struct.
 
= NoDownloadRightsErrorResolution =
This is "nn::ns::NoDownloadRightsErrorResolution".
 
= BackgroundNetworkUpdateState =
This is "nn::ns::BackgroundNetworkUpdateState". This is an u8.


{| class="wikitable" border="1"
{| class="wikitable" border="1"
|-
|-
! Value
! Offset
! Size
! Description
! Description
|-
|-
| 0 || None
| 0x0 || 0x1 || [[NCM_services#StorageId|StorageId]]
|-
|-
| 1 || InProgress
| 0x1 || 0x7 || Reserved
|-
| 0x8 || 0x8 || AppSize
|-
| 0x10 || 0x8 || PatchSize
|-
|-
| 2 || Ready
| 0x18 || 0x8 || AocSize
|}
|}


Similar to [[#HasDownloaded]], [[#GetBackgroundNetworkUpdateState]] uses [[NIM_services|nim]] ListSystemUpdateTask and [[NIM_services|nim]] GetSystemUpdateTaskInfo. When ListSystemUpdateTask successfully returns a task and GetSystemUpdateTaskInfo is successful, the output value is set to: <code>1 + *((u8*)(taskinfo+0) == 0x3</code>. Otherwise, value=0.
= ProgressForDeleteUserSaveDataAll =
This is "nn::ns::detail::ProgressForDeleteUserSaveDataAll". This is a 0x28-byte struct.


[[#GetBackgroundNetworkUpdateState]] always returns Result 0, however this will assert if GetSystemUpdateTaskInfo fails with ret!=0x3C89.
{| class="wikitable" border="1"
|-
! Offset
! Size
! Description
|-
| 0x0 || 0x8 || StartedAt
|-
| 0x8 || 0x4 || Count
|-
| 0xC || 0x4 || Reserved
|-
| 0x10 || 0x8 || SizeInBytes
|-
| 0x18 || 0x1 || IsSystem
|-
| 0x19 || 0x7 || Reserved
|-
| 0x20 || 0x8 || ApplicationId
|}


= SystemUpdateProgress =
= ApplicationViewDeprecated =
This is "nn::ns::SystemUpdateProgress". This is a 0x10-byte struct.
This is "nn::ns::ApplicationViewDeprecated". This is a 0x40-byte struct.


{| class="wikitable" border="1"
{| class="wikitable" border="1"
|-
|-
! Offset
! Offset
! Size
! Size
! Description
! Description
|-
|-
| 0x0 || 0x8 || Loaded (this value can be larger than total_size when the async operation is finishing and when total_size is <=0, this current_size field may contain a progress value for when the total_size is not yet determined)
| 0x0 || 0x8 || [[NCM_services#ApplicationId|ApplicationId]]
|-
|-
| 0x8 || 0x8 || Total (this field is only valid when >0)
| 0x8 || 0x4 || Version
|}
|-
 
| 0xC || 0x4 || [[#ApplicationViewFlag|Flag]]
Commands which have this as output will return 0 with the output cleared, when no task is available.
|-
 
| 0x10 || 0x18 || [[#ApplicationDownloadProgress|Progress]]
= EulaDataPath =
|-
This is "nn::ns::detail::EulaDataPath". This is a 0x100-byte struct.
| 0x28 || 0x18 || [[#ApplicationApplyDeltaProgress|ApplyProgress]]
 
|}
This contains a file path.
 
 
This is converted from [[#ApplicationView]] by [[#GetApplicationViewDeprecated]] on newer system-versions as follows:
= SystemDeliveryInfo =
 
This is "nn::ns::SystemDeliveryInfo". This is a 0x100-byte struct.
{| class="wikitable" border="1"
 
|-
{| class="wikitable" border="1"
! Offset
|-
! Size
! Offset
! Description
! Size
|-
! Description
| 0x0 || 0x20 || Same as [[#ApplicationView]] +0x0.
|-
|-
| 0x0 || 0x4 || SystemDeliveryProtocolVersion. Must be <= to and match [[System_Settings|system-setting]] <code>contents_delivery!system_delivery_protocol_version</code>.
| 0x20 || 0x4 || Same as [[#ApplicationView]] +0x20.
|-
|-
| 0x4 || 0x4 || ApplicationDeliveryProtocolVersion. Loaded from [[System_Settings|system-setting]] <code>contents_delivery!application_delivery_protocol_version</code>. Unused by [[#RequestSendSystemUpdate]]/[[#RequestReceiveSystemUpdate]], besides HMAC validation.
| 0x24 || 0x2 || Same as [[#ApplicationView]] +0x24.
|-
|-
| 0x8 || 0x1 || HasExFat. Unused by [[#RequestSendSystemUpdate]]/[[#RequestReceiveSystemUpdate]], besides HMAC validation.
| 0x26 || 0x2 || Cleared to 0.
|-
|-
| 0x9 || 0x3 || Reserved.
| 0x28 || 0x10 || Same as [[#ApplicationView]] +0x30.
|-
|-
| 0xC || 0x4 || SystemUpdateMetaVersion.
| 0x38 || 0x4 || Same as [[#ApplicationView]] +0x40.
|-
| 0x3C || 0x1 || Same as [[#ApplicationView]] +0x44.
|-
| 0x3D || 0x2 || Cleared to 0.
|-
| 0x3F || 0x1 || Cleared to 0.
|}
 
= ApplicationViewFlag =
This is "nn::ns::ApplicationViewFlag". This is a 32-bit flag.
 
{| class="wikitable" border="1"
|-
! Bit
! Description
|-
| 0
|
|-
| 1
|
|-
| 2
|
|-
| 3
|
|-
| 4
|
|-
| 5
|
|-
| 6
|
|-
| 7
|
|-
| 8
|
|-
| 9
|
|-
| 10
|
|-
| 11
|
|-
| 12
|
|-
| 13
|
|-
| 14
|
|-
| 15
|
|-
| 16
|
|-
| 17
|
|}
 
= ApplicationDownloadProgress =
This is "nn::ns::ApplicationDownloadProgress". This is a 0x18-byte struct.
 
{| class="wikitable" border="1"
|-
! Offset
! Size
! Description
|-
| 0x0 || 0x8 || Downloaded
|-
| 0x8 || 0x8 || Total
|-
| 0x10 || 0x4 || LastResult
|-
| 0x14 || 0x1 || [[#ApplicationDownloadState|State]]
|-
| 0x15 || 0x3 || Reserved
|}
 
= ApplicationApplyDeltaProgress =
This is "nn::ns::ApplicationApplyDeltaProgress". This is a 0x18-byte struct.
 
{| class="wikitable" border="1"
|-
! Offset
! Size
! Description
|-
| 0x0 || 0x8 || Applied
|-
| 0x8 || 0x8 || Total
|-
| 0x10 || 0x4 || LastResult
|-
| 0x14 || 0x1 || [[#ApplicationApplyDeltaState|State]]
|-
| 0x15 || 0x3 || Reserved
|}
 
= ApplicationDownloadState =
This is "nn::ns::ApplicationDownloadState". This is an u8.
 
{| class="wikitable" border="1"
|-
! Value
! Description
|-
| 0 || Runnable
|-
| 1 || Suspended
|-
| 2 || NotEnoughSpace
|-
| 3 || Fatal
|-
| 4 || Finished
|}
 
= ApplicationApplyDeltaState =
This is "nn::ns::ApplicationApplyDeltaState". This is an u8.
 
{| class="wikitable" border="1"
|-
! Value
! Description
|-
| 0 || Applying
|-
| 1 || Suspended
|-
| 2 || NotEnoughSpace
|-
| 3 || Fatal
|-
| 4 || NoTask
|-
| 5 || WaitApply
|-
| 6 || Applied
|}
 
= ApplicationView =
This is "nn::ns::ApplicationView". This is a 0x50-byte struct.
 
{| class="wikitable" border="1"
|-
! Offset
! Size
! Description
|-
| 0x0 || 0x8 || [[NCM_services#ApplicationId|ApplicationId]]
|-
| 0x8 || 0x4 || ?
|-
| 0xC || 0x4 || Flags
|-
| 0x10 || 0x40 || ?
|}
 
= ApplicationViewWithPromotionInfo =
This is a 0x70-byte struct.
 
[20.0.0+] This is a 0x78-byte struct.
 
{| class="wikitable" border="1"
|-
! Offset
! Size
! Description
|-
| 0x0 || 0x50 || [[#ApplicationView]]
|-
| 0x50 || 0x20 || [[#PromotionInfo]]
|}
 
= PromotionInfo =
This is a 0x20-byte struct.
 
{| class="wikitable" border="1"
|-
! Offset
! Size
! Description
|-
| 0x0 || 0x8 || PosixTime start_timestamp.
|-
| 0x8 || 0x8 || PosixTime end_timestamp.
|-
| 0x10 || 0x8 || Remaining time until the promotion ends, in nanoseconds ({end_timestamp - current_time} converted to nanoseconds).
|-
| 0x18 || 0x4 || Not set, left at zero.
|-
| 0x1C || 0x1 || Flags. Bit0: whether the PromotionInfo is valid (including bit1). Bit1 clear: u64 +0x10 is set.
|-
| 0x1D || 0x3 || Padding
|}
 
= ApplicationResourceType =
This is "nn::ns::ApplicationResourceType". This is an u8.
 
{| class="wikitable" border="1"
|-
! Value
! Description
|-
| 0 || ApplicationResource
|-
| 1 || MicroApplicationResource
|}
 
= ApplicationErrorCodeCategory =
This is "nn::ns::ApplicationErrorCodeCategory". This is an u64.
 
= NoDownloadRightsErrorResolution =
This is "nn::ns::NoDownloadRightsErrorResolution".
 
= BackgroundNetworkUpdateState =
This is "nn::ns::BackgroundNetworkUpdateState". This is an u8.
 
{| class="wikitable" border="1"
|-
! Value
! Description
|-
| 0 || None
|-
| 1 || InProgress
|-
| 2 || Ready
|}
 
Similar to [[#HasDownloaded]], [[#GetBackgroundNetworkUpdateState]] uses [[NIM_services|nim]] ListSystemUpdateTask and [[NIM_services|nim]] GetSystemUpdateTaskInfo. When ListSystemUpdateTask successfully returns a task and GetSystemUpdateTaskInfo is successful, the output value is set to: <code>1 + *((u8*)(taskinfo+0) == 0x3</code>. Otherwise, value=0.
 
[[#GetBackgroundNetworkUpdateState]] always returns Result 0, however this will assert if GetSystemUpdateTaskInfo fails with ret!=0x3C89.
 
= SystemUpdateProgress =
This is "nn::ns::SystemUpdateProgress". This is a 0x10-byte struct.
 
{| class="wikitable" border="1"
|-
! Offset
! Size
! Description
|-
| 0x0 || 0x8 || Loaded (this value can be larger than total_size when the async operation is finishing and when total_size is <=0, this current_size field may contain a progress value for when the total_size is not yet determined)
|-
| 0x8 || 0x8 || Total (this field is only valid when >0)
|}
 
Commands which have this as output will return 0 with the output cleared, when no task is available.
 
= EulaDataPath =
This is "nn::ns::detail::EulaDataPath". This is a 0x100-byte struct.
 
This contains a file path.
 
= SystemDeliveryInfo =
This is "nn::ns::SystemDeliveryInfo". This is a 0x100-byte struct.
 
[20.0.0+] The used (New)SystemUpdateMetaId as selected by NewSystemUpdateMetaIdFlag must now match one of the Ids in [[System_Settings|system-setting]] <code>contents_delivery!acceptable_system_update_ids_string</code>.
 
{| class="wikitable" border="1"
|-
! Offset
! Size
! Description
|-
| 0x0 || 0x4 || SystemDeliveryProtocolVersion. Must be <= to and match [[System_Settings|system-setting]] <code>contents_delivery!system_delivery_protocol_version</code>.
|-
| 0x4 || 0x4 || ApplicationDeliveryProtocolVersion. Loaded from [[System_Settings|system-setting]] <code>contents_delivery!application_delivery_protocol_version</code>. Unused by [[#RequestSendSystemUpdate]]/[[#RequestReceiveSystemUpdate]], besides HMAC validation.
|-
| 0x8 || 0x1 || HasExFat. Unused by [[#RequestSendSystemUpdate]]/[[#RequestReceiveSystemUpdate]], besides HMAC validation.
|-
| 0x9 || 0x3 || Reserved.
|-
| 0xC || 0x4 || SystemUpdateMetaVersion.
|-
| 0x10 || 0x8 || SystemUpdateMetaId. Always the NX Id.
|-
| 0x18 || 0x1 || FirmwareVariationId. Used by [[#RequestSendSystemUpdate]]. This is set to 0xC on S2.
|-
| 0x19 || 0x1 || UpdatableFirmwareGroupId. Unused by [[#RequestSendSystemUpdate]]/[[#RequestReceiveSystemUpdate]], besides HMAC validation. This is set to 0x8 on S2.
|-
| 0x1A || 0x1 || PlatformRegion (0x00 = Unknown, 0x01 = Global, 0x02 = China).
|-
| 0x1B || 0x1 || [20.0.0+] SystemDeliveryInfoPlatform. Loaded from [[System_Settings|system-setting]] <code>ns.systemupdate!system_delivery_info_platform</code>. Elsewhere this is compared against the sys-setting, etc.
|-
| 0x1C || 0x1 || [20.0.0+] NewSystemUpdateMetaIdFlag. When non-zero, NewSystemUpdateMetaId is used instead of SystemUpdateMetaId. Always set to 0x1 by [[#GetSystemDeliveryInfo]] with [20.0.0+].
|-
| 0x1D || 0x3 || Padding
|-
|-
| 0x10 || 0x8 || SystemUpdateMetaId.
| 0x20 || 0x8 || [20.0.0+] NewSystemUpdateMetaId. See above. With [20.0.0+] [[#GetSystemDeliveryInfo]] now writes the Id here instead of SystemUpdateMetaId. On S2 this is set to the Ounce Id.
|-
| 0x18 || 0x1 || FirmwareVariationId. Used by [[#RequestSendSystemUpdate]].
|-
| 0x19 || 0x1 || UpdatableFirmwareGroupId. Unused by [[#RequestSendSystemUpdate]]/[[#RequestReceiveSystemUpdate]], besides HMAC validation.
|-
| 0x1A || 0x1 || PlatformRegion (0x00 = Unknown, 0x01 = Global, 0x02 = China).
|-
|-
| 0x1B || 0xC5 || Unused by [[#RequestSendSystemUpdate]]/[[#RequestReceiveSystemUpdate]], besides HMAC validation.
| 0x28 || 0xB8 || Unused by [[#RequestSendSystemUpdate]]/[[#RequestReceiveSystemUpdate]], besides HMAC validation.
|-
|-
| 0xE0 || 0x20 || HMAC-SHA256 over the previous 0xE0-bytes.
| 0xE0 || 0x20 || HMAC-SHA256 over the previous 0xE0-bytes.