NS services: Difference between revisions

No edit summary
(101 intermediate revisions by 4 users not shown)
Line 1: Line 1:
= aoc:u =
= aoc:u =
This is "nn::aocsrv::detail::IAddOnContentManager".
This is "nn::aocsrv::detail::IAddOnContentManager".
This is only available when [[Process_Manager_services|pm:bm]] GetBootMode returns output 0 (Normal).


{| class="wikitable" border="1"
{| class="wikitable" border="1"
Line 23: Line 25:
|-
|-
| 8 || [4.0.0+] GetAddOnContentListChangedEvent
| 8 || [4.0.0+] GetAddOnContentListChangedEvent
|-
| 9 || [10.0.0+] GetAddOnContentLostErrorCode
|-
| 10 || [11.0.0+] GetAddOnContentListChangedEventWithProcessId
|-
| 11 || [13.0.0+] NotifyMountAddOnContent
|-
| 12 || [13.0.0+] NotifyUnmountAddOnContent
|-
| 13 || [13.0.0+] IsAddOnContentMountedForDebug
|-
| 50 || [13.0.0+] CheckAddOnContentMountStatus
|-
|-
| 100 || [7.0.0+] [[#IPurchaseEventManager|CreateEcPurchasedEventManager]]
| 100 || [7.0.0+] [[#IPurchaseEventManager|CreateEcPurchasedEventManager]]
|-
|-
| 101 || [9.0.0+] [[#IPurchaseEventManager|CreatePermanentEcPurchasedEventManager]]
| 101 || [9.0.0+] [[#IPurchaseEventManager|CreatePermanentEcPurchasedEventManager]]
|-
| 110 || [12.0.0+] [[#IContentsServiceManager|CreateContentsServiceManager]]
|-
| 200 || [13.1.0+] SetRequiredAddOnContentsOnContentsAvailabilityTransition
|-
| 300 || [16.0.0+] SetupHostAddOnContent
|-
| 301 || [16.0.0+] GetRegisteredAddOnContentPath
|-
| 302 || [16.0.0+] UpdateCachedList
|}
|}


Line 47: Line 71:
|}
|}


= ns:am =
== IContentsServiceManager ==
This is "nn::ns::detail::IApplicationManagerInterface".
This is "nn::ec::IContentsServiceManager".


[3.0.0+] This service was replaced by [[#ns:am2, ns:ec, ns:rid, ns:rt, ns:web|ns:am2]].
This was added with [12.0.0+].


{| class="wikitable" border="1"
{| class="wikitable" border="1"
Line 56: Line 80:
! Cmd || Name
! Cmd || Name
|-
|-
| 0 || [[#ListApplicationRecord]]
| 0 || [16.0.0+] RequestContentsAuthorizationTokenDeprecated ([12.0.0-15.0.1] [[#RequestContentsAuthorizationToken]])
|-
|-
| 1 || GenerateApplicationRecordCount
| 1 || [16.0.0+] RequestContentsAuthorizationToken
|}
 
=== RequestContentsAuthorizationToken ===
Takes a total of 0x50-bytes of input, a PID, a type-0x5 input buffer. Returns an [[#IAsyncData|IAsyncData]] and an output handle.
 
== IAsyncData ==
This is "nn::ec::detail::IAsyncData".
 
This was added with [12.0.0+].
 
{| class="wikitable" border="1"
|-
|-
| 2 || GetApplicationRecordUpdateSystemEvent
! Cmd || Name
|-
|-
| 3 || GetApplicationViewDeprecated
| 0 || GetSize
|-
|-
| 4 || DeleteApplicationEntity
| 1 || Get
|-
|-
| 5 || DeleteApplicationCompletely
| 2 || Cancel
|-
|}
| 6 || IsAnyApplicationEntityRedundant
 
= ns:am =
This is "nn::ns::detail::IApplicationManagerInterface".
 
[3.0.0+] This service was replaced by [[#ns:am2, ns:ec, ns:rid, ns:rt, ns:web, ns:ro, ns:sweb|ns:am2]].
 
{| class="wikitable" border="1"
|-
! Cmd || Name
|-
| 0 || [[#ListApplicationRecord]]
|-
| 1 || GenerateApplicationRecordCount
|-
| 2 || GetApplicationRecordUpdateSystemEvent
|-
| 3 || GetApplicationView
|-
| 4 || DeleteApplicationEntity
|-
| 5 || DeleteApplicationCompletely
|-
| 6 || IsAnyApplicationEntityRedundant
|-
|-
| 7 || DeleteRedundantApplicationEntity
| 7 || DeleteRedundantApplicationEntity
Line 76: Line 133:
| 9 || MoveApplicationEntity
| 9 || MoveApplicationEntity
|-
|-
| 11 || CalculateApplicationOccupiedSize
| 11 || [[#CalculateApplicationOccupiedSize]]
|-
|-
| 16 || PushApplicationRecord
| 16 || PushApplicationRecord
Line 82: Line 139:
| 17 || ListApplicationRecordContentMeta
| 17 || ListApplicationRecordContentMeta
|-
|-
| 18 ||  
| 18 || CheckLaunchRights
|-
|-
| 19 || [[#LaunchApplication]]
| 19 || [[#LaunchApplication]]
Line 104: Line 161:
| 33 || ResumeApplicationDownload
| 33 || ResumeApplicationDownload
|-
|-
| 34 ||  
| 34 || ClearTaskStatusList
|-
|-
| 35 || UpdateVersionList
| 35 || UpdateVersionList
Line 122: Line 179:
| 42 || CleanupSdCard
| 42 || CleanupSdCard
|-
|-
| 43 || CheckSdCardMountStatus
| 43 || [[#CheckSdCardMountStatus]]
|-
|-
| 44 || GetSdCardMountStatusChangedEvent
| 44 || GetSdCardMountStatusChangedEvent
Line 212: Line 269:
| 504 || [2.0.0+] RequestRegisterGameCard
| 504 || [2.0.0+] RequestRegisterGameCard
|-
|-
| 600 || [2.0.0+] CountApplicationContentMeta
| 600 || [2.0.0+] [[#CountApplicationContentMeta]]
|-
|-
| 601 || [2.0.0+] [[#ListApplicationContentMetaStatus]]
| 601 || [2.0.0+] [[#ListApplicationContentMetaStatus]]
|-
|-
| 602 || [2.0.0+] ListAvailableAddOnContent
| 602 || [2.0.0+] ListOwnedAndInstalledAddOnContent
|-
|-
| 603 || [2.0.0+] GetOwnedApplicationContentMetaStatus
| 603 || [2.0.0+] GetOwnedApplicationContentMetaStatus
Line 226: Line 283:
| 700 || [2.0.0+] PushDownloadTaskList
| 700 || [2.0.0+] PushDownloadTaskList
|-
|-
| 701 || [2.0.0+] ClearTaskStatusList
| 701 || [2.0.0+] [[#ClearTaskStatusList]]
|-
|-
| 702 || [2.0.0+] RequestDownloadTaskList
| 702 || [2.0.0+] [[#RequestDownloadTaskList]]
|-
|-
| 703 || [2.0.0+] RequestEnsureDownloadTask
| 703 || [2.0.0+] [[#RequestEnsureDownloadTask]]
|-
|-
| 704 || [2.0.0+] ListDownloadTaskStatus
| 704 || [2.0.0+] [[#ListDownloadTaskStatus]]
|-
|-
| 705 || [2.0.0+] RequestDownloadTaskListData
| 705 || [2.0.0+] RequestDownloadTaskListData
Line 258: Line 315:
| 908 || [2.0.0+] ListApplicationRecordInstalledContentMeta
| 908 || [2.0.0+] ListApplicationRecordInstalledContentMeta
|-
|-
| 1000 || [2.0.0+] RequestVerifyApplicationDeprecated
| 1000 || [2.0.0+] RequestVerifyApplication
|-
|-
| 1001 || [2.0.0+] CorruptApplicationForDebug
| 1001 || [2.0.0+] CorruptApplicationForDebug
Line 278: Line 335:
| 1502 || [2.0.0+] GetLastSdCardFormatUnexpectedResult
| 1502 || [2.0.0+] GetLastSdCardFormatUnexpectedResult
|-
|-
| 1503 || [2.0.0+]
| 1503 || [2.0.0+] DetachSdCard
|-
|-
| 1600 || [2.0.0+] GetSystemSeedForPseudoDeviceId
| 1600 || [2.0.0+] GetSystemSeedForPseudoDeviceId
Line 426: Line 483:
|}
|}


= ns:am2, ns:ec, ns:rid, ns:rt, ns:web =
= ns:am2, ns:ec, ns:rid, ns:rt, ns:web, ns:ro, ns:sweb =
These services are all, at the top level, "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 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.
 
[11.0.0+] ns:ro was added.
 
[15.0.0+] ns:sweb was added.


{| class="wikitable" border="1"
{| class="wikitable" border="1"
Line 433: Line 496:
! Cmd || Name
! Cmd || Name
|-
|-
| 7988 || [6.0.0+] [[#IDynamicRightsInterface|GetDynamicRightsInterface]].
| 7988 || [6.0.0+] [[#IDynamicRightsInterface|GetDynamicRightsInterface]]
|-
|-
| 7989 || [5.1.0+] [[#IReadOnlyApplicationControlDataInterface|GetReadOnlyApplicationControlDataInterface]].
| 7989 || [5.1.0+] [[#IReadOnlyApplicationControlDataInterface|GetReadOnlyApplicationControlDataInterface]]
|-
|-
| 7991 || [5.0.0+] [[#IReadOnlyApplicationRecordInterface|GetReadOnlyApplicationRecordInterface]].
| 7991 || [5.0.0+] [[#IReadOnlyApplicationRecordInterface|GetReadOnlyApplicationRecordInterface]]
|-
|-
| 7992 || [4.0.0+] [[#IECommerceInterface|GetECommerceInterface]]
| 7992 || [4.0.0+] [[#IECommerceInterface|GetECommerceInterface]]
Line 491: Line 554:
| 8 || [[#IsApplicationEntityMovable]]
| 8 || [[#IsApplicationEntityMovable]]
|-
|-
| 9 || [[#MoveApplicationEntity]]
| 9 || [1.0.0-9.2.0] [[#MoveApplicationEntity]]
|-
|-
| 11 || CalculateApplicationOccupiedSize
| 11 || [[#CalculateApplicationOccupiedSize]]
|-
|-
| 16 || PushApplicationRecord
| 16 || PushApplicationRecord
Line 513: Line 576:
| 30 || [[#RequestApplicationUpdateInfo]]
| 30 || [[#RequestApplicationUpdateInfo]]
|-
|-
| 31 || [1.0.0-3.0.2]  
| 31 || [1.0.0-3.0.2] RequestUpdateApplication
|-
|-
| 32 || [[#CancelApplicationDownload]]
| 32 || [[#CancelApplicationDownload]]
Line 535: Line 598:
| 42 || [[#CleanupSdCard]]
| 42 || [[#CleanupSdCard]]
|-
|-
| 43 || CheckSdCardMountStatus
| 43 || [[#CheckSdCardMountStatus]]
|-
|-
| 44 || [[#GetSdCardMountStatusChangedEvent]]
| 44 || [[#GetSdCardMountStatusChangedEvent]]
Line 597: Line 660:
| 83 || [4.0.0-6.2.0] CheckApplicationResumeRights
| 83 || [4.0.0-6.2.0] CheckApplicationResumeRights
|-
|-
| 84 || [4.0.0+] GetDynamicCommitEvent
| 84 || [4.0.0-16.1.0] GetDynamicCommitEvent
|-
|-
| 85 || [4.0.0+] [[#RequestUpdateApplication2]]
| 85 || [4.0.0+] [[#RequestUpdateApplication2]]
Line 605: Line 668:
| 87 || [4.0.0+] IsApplicationCrashReportEnabled
| 87 || [4.0.0+] IsApplicationCrashReportEnabled
|-
|-
| 90 || [4.0.0-8.1.0] BoostSystemMemoryResourceLimit
| 90 || [15.0.0+] BoostSystemMemoryResourceLimit ([4.0.0-8.1.0] BoostSystemMemoryResourceLimit)
|-
|-
| 91 || [5.0.0+] DeprecatedLaunchApplication
| 91 || [5.0.0+] DeprecatedLaunchApplication
Line 613: Line 676:
| 93 || [5.0.0+] GetMainApplicationProgramIndex
| 93 || [5.0.0+] GetMainApplicationProgramIndex
|-
|-
| 94 || [6.0.0+] LaunchApplication
| 94 || [6.0.0+] [[#LaunchApplication_2|LaunchApplication]]
|-
|-
| 95 || [6.0.0+] GetApplicationLaunchInfo
| 95 || [6.0.0+] [[#GetApplicationLaunchInfo]]
|-
|-
| 96 || [6.0.0+] AcquireApplicationLaunchInfo
| 96 || [6.0.0+] [[#AcquireApplicationLaunchInfo]]
|-
|-
| 97 || [6.0.0+] GetMainApplicationProgramIndexByApplicationLaunchInfo
| 97 || [6.0.0+] [[#GetMainApplicationProgramIndexByApplicationLaunchInfo]]
|-
|-
| 98 || [6.0.0+] EnableApplicationAllThreadDumpOnCrash
| 98 || [6.0.0+] EnableApplicationAllThreadDumpOnCrash
Line 625: Line 688:
| 99 || [8.0.0+] [[#LaunchDevMenu]]
| 99 || [8.0.0+] [[#LaunchDevMenu]]
|-
|-
| 100 || ResetToFactorySettings
| 100 || [[#ResetToFactorySettings]]
|-
| 101 || [[#ResetToFactorySettingsWithoutUserSaveData]]
|-
| 102 || [[#ResetToFactorySettingsForRefurbishment]]
|-
|-
| 101 || ResetToFactorySettingsWithoutUserSaveData
| 103 || [9.1.0+] [[#ResetToFactorySettingsWithPlatformRegion]]
|-
|-
| 102 || ResetToFactorySettingsForRefurbishment
| 104 || [9.1.0+] [[#ResetToFactorySettingsWithPlatformRegionAuthentication]]
|-
|-
| 103 || [9.1.0+] ResetToFactorySettingsWithPlatformRegion
| 105 || [10.0.0+] [[#RequestResetToFactorySettingsSecurely]]
|-
|-
| 104 || [9.1.0+] ResetToFactorySettingsWithPlatformRegionAuthentication
| 106 || [10.0.0+] [[#RequestResetToFactorySettingsWithPlatformRegionAuthenticationSecurely]]
|-
|-
| 200 || CalculateUserSaveDataStatistics
| 200 || CalculateUserSaveDataStatistics
|-
|-
| 201 || DeleteUserSaveDataAll
| 201 || [[#DeleteUserSaveDataAll]]
|-
|-
| 210 || [[#DeleteUserSystemSaveData]]
| 210 || [[#DeleteUserSystemSaveData]]
Line 651: Line 718:
| 301 || PopApplicationShellEventInfo
| 301 || PopApplicationShellEventInfo
|-
|-
| 302 || LaunchLibraryApplet
| 302 || [[#LaunchLibraryApplet]]
|-
|-
| 303 || TerminateLibraryApplet
| 303 || TerminateLibraryApplet
|-
|-
| 304 || LaunchSystemApplet
| 304 || [[#LaunchSystemApplet]]
|-
|-
| 305 || TerminateSystemApplet
| 305 || TerminateSystemApplet
|-
|-
| 306 || LaunchOverlayApplet
| 306 || [[#LaunchOverlayApplet]]
|-
|-
| 307 || TerminateOverlayApplet
| 307 || TerminateOverlayApplet
Line 675: Line 742:
| 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 681: Line 748:
| 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+]
|-
| 415 || [19.0.0+]
|-
| 416 || [19.0.0+]
|-
| 417 || [19.0.0+] InvalidateAllApplicationControlCacheOfTheStage
|-
| 418 || [19.0.0+] InvalidateApplicationControlCacheOfTheStage
|-
| 419 || [19.0.0+] RequestDownloadApplicationControlDataInBackground
|-
| 420 || [19.0.0+] CloneApplicationControlDataCacheForDebug
|-
| 502 || [[#RequestCheckGameCardRegistration]]
|-
| 503 || [[#RequestGameCardRegistrationGoldPoint]]
|-
| 504 || [[#RequestRegisterGameCard]]
|-
| 505 || [3.0.0+] [[#GetGameCardMountFailureEvent]]
|-
|-
| 506 || [3.0.0+] [[#IsGameCardInserted]]
| 506 || [3.0.0+] [[#IsGameCardInserted]]
Line 699: Line 786:
| 510 || [9.0.0+] [[#GetGameCardPlatformRegion]]
| 510 || [9.0.0+] [[#GetGameCardPlatformRegion]]
|-
|-
| 600 || CountApplicationContentMeta
| 511 || [19.0.0+] GetGameCardWakenReadyEvent
|-
| 512 || [19.0.0+] IsGameCardApplicationRunning
|-
| 600 || [[#CountApplicationContentMeta]]
|-
|-
| 601 || [[#ListApplicationContentMetaStatus]]
| 601 || [[#ListApplicationContentMetaStatus]]
Line 707: Line 798:
| 603 || GetOwnedApplicationContentMetaStatus
| 603 || GetOwnedApplicationContentMetaStatus
|-
|-
| 604 || RegisterContentsExternalKey
| 604 || [1.0.0-15.0.1] RegisterContentsExternalKey
|-
|-
| 605 || ListApplicationContentMetaStatusWithRightsCheck
| 605 || ListApplicationContentMetaStatusWithRightsCheck
Line 713: Line 804:
| 606 || [3.0.0+] GetContentMetaStorage
| 606 || [3.0.0+] GetContentMetaStorage
|-
|-
| 607 || [6.0.0+] ListAvailableAddOnContent
| 607 || [6.0.0+] [[#ListAvailableAddOnContent]]
|-
| 609 || [13.0.0+] ListAvailabilityAssuredAddOnContent
|-
| 610 || [14.0.0+] GetInstalledContentMetaStorage
|-
| 611 || [16.0.0+] PrepareAddOnContent
|-
|-
| 700 || PushDownloadTaskList
| 700 || PushDownloadTaskList
|-
|-
| 701 || ClearTaskStatusList
| 701 || [[#ClearTaskStatusList]]
|-
|-
| 702 || RequestDownloadTaskList
| 702 || [[#RequestDownloadTaskList]]
|-
|-
| 703 || RequestEnsureDownloadTask
| 703 || [[#RequestEnsureDownloadTask]]
|-
|-
| 704 || ListDownloadTaskStatus
| 704 || [[#ListDownloadTaskStatus]]
|-
|-
| 705 || [[#RequestDownloadTaskListData]]
| 705 || [[#RequestDownloadTaskListData]]
Line 751: Line 848:
| 908 || ListApplicationRecordInstalledContentMeta
| 908 || ListApplicationRecordInstalledContentMeta
|-
|-
| 909 || [3.0.0+] WithdrawCleanupAddOnContentsWithNoRightsRecommendation
| 909 || [3.0.0-14.1.2] WithdrawCleanupAddOnContentsWithNoRightsRecommendation
|-
|-
| 910 || [5.0.0+] HasApplicationRecord
| 910 || [5.0.0+] HasApplicationRecord
Line 765: Line 862:
| 915 || [9.0.0+] ShowApplicationRecord
| 915 || [9.0.0+] ShowApplicationRecord
|-
|-
| 1000 || RequestVerifyApplicationDeprecated
| 916 || [11.0.0+] IsApplicationAutoDeleteDisabled
|-
| 1000 || [[#RequestVerifyApplicationDeprecated]]
|-
|-
| 1001 || CorruptApplicationForDebug
| 1001 || CorruptApplicationForDebug
|-
|-
| 1002 || [3.0.0+] RequestVerifyAddOnContentsRights
| 1002 || [3.0.0-9.2.0] [[#RequestVerifyAddOnContentsRights]]
|-
|-
| 1003 || [5.0.0+] [[#RequestVerifyApplication]]
| 1003 || [5.0.0+] [[#RequestVerifyApplication]]
Line 783: Line 882:
| 1302 || CleanupUnrecordedApplicationEntity
| 1302 || CleanupUnrecordedApplicationEntity
|-
|-
| 1303 || [3.0.0+] CleanupAddOnContentsWithNoRights
| 1303 || [3.0.0-9.2.0] CleanupAddOnContentsWithNoRights
|-
|-
| 1304 || [3.0.0+] DeleteApplicationContentEntity
| 1304 || [3.0.0+] DeleteApplicationContentEntity
Line 790: Line 889:
|-
|-
| 1309 || [6.0.0+] [[#CleanupUnavailableAddOnContents]]
| 1309 || [6.0.0+] [[#CleanupUnavailableAddOnContents]]
|-
| 1310 || [10.0.0+] [[#RequestMoveApplicationEntity]]
|-
| 1311 || [10.0.0+] [[#EstimateSizeToMove]]
|-
| 1312 || [10.0.0+] HasMovableEntity
|-
| 1313 || [11.0.0+] CleanupOrphanContents
|-
| 1314 || [11.0.0+] CheckPreconditionSatisfiedToMove
|-
|-
| 1400 || PrepareShutdown
| 1400 || PrepareShutdown
Line 818: Line 927:
|-
|-
| 1704 || [8.0.0+] [[#GetApplicationViewWithPromotionInfo]]
| 1704 || [8.0.0+] [[#GetApplicationViewWithPromotionInfo]]
|-
| 1705 || [11.0.0+] [[#IsPatchAutoDeletableApplication]]
|-
|-
| 1800 || IsNotificationSetupCompleted
| 1800 || IsNotificationSetupCompleted
Line 827: Line 938:
| 1803 || [3.0.0+] ListNotificationTask
| 1803 || [3.0.0+] ListNotificationTask
|-
|-
| 1900 || [3.0.0+] IsActiveAccount
| 1900 || [3.0.0-12.1.0] IsActiveAccount
|-
|-
| 1901 || [4.0.0+] [[#RequestDownloadApplicationPrepurchasedRights]]
| 1901 || [4.0.0+] [[#RequestDownloadApplicationPrepurchasedRights]]
|-
|-
| 1902 || [5.0.0+] GetApplicationTicketInfo
| 1902 || [5.0.0+] GetApplicationTicketInfo
|-
| 1903 || [13.1.0+] RequestDownloadApplicationPrepurchasedRightsForAccount
|-
|-
| 2000 || [4.0.0+] [[#GetSystemDeliveryInfo]]
| 2000 || [4.0.0+] [[#GetSystemDeliveryInfo]]
Line 891: Line 1,004:
| 2155 || [7.0.0+] UpdateRightsEnvironmentStatus
| 2155 || [7.0.0+] UpdateRightsEnvironmentStatus
|-
|-
| 2156 || [9.0.0+] CreateRightsEnvironmentForPreomia
| 2156 || [10.0.0-12.1.0] CreateRightsEnvironmentForMicroApplication ([9.0.0-9.2.0] CreateRightsEnvironmentForPreomia)
|-
|-
| 2160 || [6.0.0+] AddTargetApplicationToRightsEnvironment
| 2160 || [6.0.0+] AddTargetApplicationToRightsEnvironment
Line 911: Line 1,024:
| 2199 || [6.0.0+] GetRightsEnvironmentCountForDebug
| 2199 || [6.0.0+] GetRightsEnvironmentCountForDebug
|-
|-
| 2200 || [6.0.0+] GetGameCardApplicationCopyIdentifier
| 2200 || [6.0.0-9.2.0] GetGameCardApplicationCopyIdentifier
|-
|-
| 2201 || [6.0.0+] GetInstalledApplicationCopyIdentifier
| 2201 || [6.0.0-9.2.0] GetInstalledApplicationCopyIdentifier
|-
|-
| 2250 || [6.0.0-6.2.0] RequestReportActiveELicence
| 2250 || [6.0.0-6.2.0] RequestReportActiveELicence
Line 925: Line 1,038:
| 2352 || [9.0.0+] [[#RequestResolveNoDownloadRightsError]]
| 2352 || [9.0.0+] [[#RequestResolveNoDownloadRightsError]]
|-
|-
| 2400 || [8.0.0+] [[#GetPromotionInfo]]
| 2353 || [10.0.0+] GetApplicationDownloadTaskInfo
|-
|-
| 2401 || [8.0.0+] CountPromotionInfo
| 2354 || [11.0.0+] PrioritizeApplicationBackgroundTask
|-
|-
| 2402 || [8.0.0+] ListPromotionInfo
| 2355 || [12.0.0+] PreferStorageEfficientUpdate
|-
|-
| 2403 || [8.0.0+] [[#ImportPromotionJsonForDebug]]
| 2356 || [12.0.0+] RequestStorageEfficientUpdatePreferable
|-
|-
| 2404 || [8.0.0+] [[#ClearPromotionInfoForDebug]]
| 2357 || [15.0.0+] EnableMultiCoreDownload
|-
|-
| 2500 || [8.0.0+] ConfirmAvailableTime
| 2358 || [15.0.0+] DisableMultiCoreDownload
|-
|-
| 2510 || [9.0.0+] [[#CreateApplicationResource]]
| 2359 || [15.0.0+] IsMultiCoreDownloadEnabled
|-
| 2360 || [19.0.0+] GetApplicationDownloadTaskCount
|-
| 2361 || [19.0.0+] GetMaxApplicationDownloadTaskCount
|-
| 2400 || [8.0.0+] [[#GetPromotionInfo]]
|-
| 2401 || [8.0.0+] CountPromotionInfo
|-
| 2402 || [8.0.0+] ListPromotionInfo
|-
| 2403 || [8.0.0+] [[#ImportPromotionJsonForDebug]]
|-
| 2404 || [8.0.0+] [[#ClearPromotionInfoForDebug]]
|-
| 2500 || [8.0.0+] ConfirmAvailableTime
|-
| 2510 || [9.0.0+] [[#CreateApplicationResource]]
|-
|-
| 2511 || [9.0.0+] [[#GetApplicationResource]]
| 2511 || [9.0.0+] [[#GetApplicationResource]]
|-
|-
| 2513 || [9.0.0+] LaunchPreomia
| 2513 || [10.0.0+] [[#LaunchMicroApplication]] ([9.0.0-9.2.0] LaunchPreomia)
|-
|-
| 2514 || [9.0.0+] ClearTaskOfAsyncTaskManager
| 2514 || [9.0.0+] ClearTaskOfAsyncTaskManager
|-
| 2515 || [10.0.0+] CleanupAllPlaceHolderAndFragmentsIfNoTask
|-
| 2516 || [10.0.0-14.1.2] EnsureApplicationCertificate
|-
| 2517 || [13.0.0+] [[#CreateApplicationInstance]]
|-
| 2518 || [13.0.0+] UpdateQualificationForDebug
|-
| 2519 || [13.0.0+] IsQualificationTransitionSupported
|-
| 2520 || [13.0.0+] IsQualificationTransitionSupportedByProcessId
|-
| 2521 || [13.0.0-16.1.0] GetRightsUserChangedEvent
|-
| 2522 || [14.0.0+] IsRomRedirectionAvailable
|-
| 2523 || [17.0.0+] GetProgramId
|-
| 2524 || [19.0.0+]
|-
|-
| 2800 || [9.0.0+] GetApplicationIdOfPreomia
| 2800 || [9.0.0+] GetApplicationIdOfPreomia
|}
|-
 
| 3000 || [11.0.0+] [[#RegisterDeviceLockKey]]
[4.0.0+] RequestDownloadAddOnContent now takes an additional 8-bytes of input.
|-
 
| 3001 || [11.0.0+] [[#UnregisterDeviceLockKey]]
|-
| 3002 || [11.0.0+] [[#VerifyDeviceLockKey]]
|-
| 3003 || [11.0.0+] [[#HideApplicationIcon]]
|-
| 3004 || [11.0.0+] [[#ShowApplicationIcon]]
|-
| 3005 || [11.0.0+] [[#HideApplicationTitle]]
|-
| 3006 || [11.0.0+] [[#ShowApplicationTitle]]
|-
| 3007 || [11.0.0+] [[#EnableGameCard]]
|-
| 3008 || [11.0.0+] [[#DisableGameCard]]
|-
| 3009 || [11.0.0+] [[#EnableLocalContentShare]]
|-
| 3010 || [11.0.0+] [[#DisableLocalContentShare]]
|-
| 3011 || [11.0.0+] [[#IsApplicationIconHidden]]
|-
| 3012 || [11.0.0+] [[#IsApplicationTitleHidden]]
|-
| 3013 || [11.0.0+] [[#IsGameCardEnabled]]
|-
| 3014 || [11.0.0+] [[#IsLocalContentShareEnabled]]
|-
| 3015 || [18.0.0+] GetNetworkUpdateRequiredByGameCardDetectionEvent
|-
| 3050 || [14.0.0+] ListAssignELicenseTaskResult
|-
| 3100 || [17.0.0+] GetSafeSystemVersionCheckInfo
|-
| 3101 || [17.0.0+] RequestUpdateSafeSystemVersionCheckInfo
|-
| 3102 || [17.0.0+] ResetSafeSystemVersionCheckInfo
|-
| 3104 || [18.0.0+] GetApplicationNintendoLogo
|-
| 3105 || [18.0.0+] GetApplicationStartupMovie
|-
| 5000 || [18.0.0+]
|-
| 5001 || [18.0.0+]
|-
| 9999 || [10.0.0-10.2.0] GetApplicationCertificate
|}
 
[4.0.0+] RequestDownloadAddOnContent now takes an additional 8-bytes of input.
 
==== GetApplicationRecordUpdateSystemEvent ====
==== GetApplicationRecordUpdateSystemEvent ====
No input, returns an output Event handle with EventClearMode=1.
No input, returns an output Event handle with EventClearMode=1.
Line 978: Line 1,179:
The data that can be read from the [[#IAsyncValue]] is [[#ApplicationUpdateInfo]].
The data that can be read from the [[#IAsyncValue]] is [[#ApplicationUpdateInfo]].


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


==== CancelApplicationDownload ====
==== CancelApplicationDownload ====
Line 1,041: Line 1,242:
See [[#RequestApplicationUpdateInfo]] regarding nifm.
See [[#RequestApplicationUpdateInfo]] regarding nifm.


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


This is used by AM cmd [[Applet_Manager_services#LaunchDevMenu|LaunchDevMenu]].
[18.0.0+] Now takes a total of 0x58 bytes of input.


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.
[19.0.0+] Now takes a total of 0x88 bytes of input.


[[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.
==== GetApplicationLaunchInfo ====
Takes an input [[NCM_services#ApplicationId|ApplicationId]], returns an output [[#ApplicationLaunchInfo]].


Then if the above succeeds, the above titles are launched with the above StorageId via [[Process_Manager_services|pmshell]] LaunchProgram, with a 0.5s sleep-thread afterwards on success.
[18.0.0+] Now returns a total of 0x50 bytes of output.


==== DeleteUserSystemSaveData ====
[19.0.0+] Now returns a total of 0x80 bytes of output.
Takes an input [[Account_services#Uid|Uid]], an u64 SystemSaveDataId, no output.


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


==== UnregisterNetworkServiceAccount ====
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.
Takes an input [[Account_services#Uid|Uid]], no output.


==== UnregisterNetworkServiceAccountWithUserSaveDataDeletion ====
[18.0.0+] Now returns a total of 0x50 bytes of output.
Takes an input [[Account_services#Uid|Uid]], no output.


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


See [[#RequestApplicationUpdateInfo]] regarding nifm.
==== GetMainApplicationProgramIndexByApplicationLaunchInfo ====
[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 a total of 0x10-bytes of input, a type-0x5 input buffer, an input handle, returns an output Event handle and an [[#IAsyncValue]].


==== ListApplicationIcon ====
==== LaunchDevMenu ====
Takes a total of 0x10-bytes of input, a type-0x5 input buffer, an input handle, returns an output Event handle and an [[#IAsyncValue]].
No input/output.


==== RequestCheckGameCardRegistration ====
This is used by AM cmd [[Applet_Manager_services#LaunchDevMenu|LaunchDevMenu]].
Takes an input [[NCM_services#ApplicationId|ApplicationId]], returns an output Event handle and an [[#IAsyncResult]].


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


==== RequestGameCardRegistrationGoldPoint ====
[[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.
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.
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.


See [[#RequestApplicationUpdateInfo]] regarding nifm.
==== DeleteUserSaveDataAll ====
Takes an input [[Account_services#Uid|Uid]], returns an output [[#IProgressMonitorForDeleteUserSaveDataAll]].


==== RequestRegisterGameCard ====
On success, [[#IProgressMonitorForDeleteUserSaveDataAll]] GetProgress is used with the output being copied into object state.
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.
==== DeleteUserSystemSaveData ====
Takes an input [[Account_services#Uid|Uid]], an u64 SystemSaveDataId, no output.


==== GetGameCardMountFailureEvent ====
==== DeleteSaveData ====
No input, returns an output Event handle with EventClearMode=0.
Takes an input u8 [[Filesystem_services#SaveDataSpaceId|SaveDataSpaceId]], an u64 SaveDataId, no output.


==== IsGameCardInserted ====
==== UnregisterNetworkServiceAccount ====
No input, returns an output u8 bool.
Takes an input [[Account_services#Uid|Uid]], no output.


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


==== GetLastGameCardMountFailureResult ====
==== LaunchLibraryApplet ====
No input/output.
Takes an input u64 [[NCM_services#ProgramId|ProgramId]], returns an output u64.


==== ListApplicationIdOnGameCard ====
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 a type-0x6 output buffer containing an array of u64 [[NCM_services#ApplicationId|ApplicationIds]], returns an output s32 for total output entries.


==== GetGameCardPlatformRegion ====
This is used by [[Applet_Manager_services|AM]].
No input, returns an u8 '''GameCardPlatformRegion''' (0x00 = Global, 0x01 = China).


This calls [[Filesystem_services#IDeviceOperator|fsp-srv IDeviceOperator]] GetGameCardCompatibilityType and returns the result.
==== LaunchSystemApplet ====
No input, returns an output u64.


==== RequestDownloadTaskListData ====
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>.
No input, returns an output Event handle and an [[#IAsyncValue]].


==== TouchApplication ====
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.
Takes an input [[NCM_services#ApplicationId|ApplicationId]], no output.


==== IsApplicationUpdateRequested ====
This is used by [[Applet_Manager_services|AM]].
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.
==== LaunchOverlayApplet ====
No input, returns an output u64.


==== WithdrawApplicationUpdateRequest ====
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>.
Takes an input [[NCM_services#ApplicationId|ApplicationId]], no output.


==== RequestVerifyApplication ====
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.
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 used by [[Applet_Manager_services|AM]].


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]].
==== RequestDownloadApplicationControlData ====
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 ====
==== GetApplicationControlProperty ====
Takes an input u64 [[NCM_services#ApplicationId|ApplicationId]], an [[Account_services#Uid|Uid]], no output.
[18.0.0+] Now takes a total of 0x58 bytes of input.


==== FormatSdCard ====
==== ListApplicationTitle ====
No input/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]].


==== NeedsSystemUpdateToFormatSdCard ====
[[qlaunch]] uses value 0x1 for the u8.
No input, returns an output u8 bool.


==== GetLastSdCardFormatUnexpectedResult ====
The user-process creates the TransferMemory with permissions=R--.
No input/output.


==== GetApplicationView ====
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 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.


==== GetApplicationViewDownloadErrorContext ====
The TransferMemory size must be at least: count*sizeof([[NACP_Format|title-entry]]) + count*sizeof(u64) + count*[[#GetApplicationControlData|0x24000]].
Takes a type-0x16 output buffer containg an [[Error_Applet#ErrorContext|ErrorContext]], an u64 [[NCM_services#ApplicationId|ApplicationId]], no output.


==== GetApplicationViewWithPromotionInfo ====
This is essentially an async wrapper for [[#GetApplicationControlData]], with support for multiple ApplicationIds.
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.


==== RequestDownloadApplicationPrepurchasedRights ====
==== ListApplicationIcon ====
Takes an input [[NCM_services#ApplicationId|ApplicationId]], returns an output Event handle and an [[#IAsyncResult]].
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]].


See [[#RequestApplicationUpdateInfo]] regarding nifm.
The user-process creates the TransferMemory with permissions=R--.


==== GetSystemDeliveryInfo ====
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 a type-0x16 output buffer containing a [[#SystemDeliveryInfo]], no output.


This generates a [[#SystemDeliveryInfo]] using the currently installed SystemUpdate meta title.
The TransferMemory size must be at least: 0x4 + count*sizeof(u64) + count*[[#GetApplicationControlData|0x20000]] + count*sizeof(u64) + [[#GetApplicationControlData|0x24000]].


==== SelectLatestSystemDeliveryInfo ====
This is essentially an async wrapper for [[#GetApplicationControlData]], with support for multiple ApplicationIds.
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.
==== RequestCheckGameCardRegistration ====
Takes an input [[NCM_services#ApplicationId|ApplicationId]], returns an output Event handle and an [[#IAsyncResult]].


==== VerifyDeliveryProtocolVersion ====
See [[#RequestApplicationUpdateInfo]] regarding nifm.
Takes a type-0x15 input buffer containing a [[#SystemDeliveryInfo]], no output.


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.
==== RequestGameCardRegistrationGoldPoint ====
Takes an input [[Account_services#Uid|Uid]], an [[NCM_services#ApplicationId|ApplicationId]], returns an output Event handle and an [[#IAsyncValue]].


==== GetApplicationDeliveryInfo ====
The data that can be read from the [[#IAsyncValue]] is 4-bytes.
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.


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


==== HasAllContentsToDeliver ====
==== RequestRegisterGameCard ====
Takes a type-0x5 input buffer containing an array of [[#ApplicationDeliveryInfo]], returns an output u8 bool.
Takes an input s32, an [[Account_services#Uid|Uid]], an [[NCM_services#ApplicationId|ApplicationId]], returns an output Event handle and an [[#IAsyncResult]].


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


==== CompareApplicationDeliveryInfo ====
==== GetGameCardMountFailureEvent ====
Takes two type-0x5 input buffers containing an array of [[#ApplicationDeliveryInfo]], returns an output s32.
No input, returns an output Event handle with EventClearMode=0.


The array-count for both buffers must be 1, otherwise an error is returned.
==== IsGameCardInserted ====
No input, returns an output u8 bool.


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.
==== EnsureGameCardAccess ====
No input/output.


==== CanDeliverApplication ====
==== GetLastGameCardMountFailureResult ====
Takes two type-0x5 input buffers containing an array of [[#ApplicationDeliveryInfo]], returns an output u8 bool.
No input/output.


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.
==== ListApplicationIdOnGameCard ====
Takes a type-0x6 output buffer containing an array of u64 [[NCM_services#ApplicationId|ApplicationIds]], returns an output s32 for total output entries.


==== ListContentMetaKeyToDeliverApplication ====
==== GetGameCardPlatformRegion ====
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.
No input, returns an u8 '''GameCardPlatformRegion''' (0x00 = Global, 0x01 = China).


The array-count for ContentMetaKey must be at least 1, and for ApplicationDeliveryInfo it must match 1.
This calls [[Filesystem_services#IDeviceOperator|fsp-srv IDeviceOperator]] GetGameCardCompatibilityType and returns the result.


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.
==== ListAvailableAddOnContent ====
[10.0.0+] This now takes a total of 0x10-bytes of input instead of a total of 0x18-bytes of input.


==== NeedsSystemUpdateToDeliverApplication ====
[15.0.0+] This now takes a total of 0x8-bytes of input instead of a total of 0x10-bytes of input.
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.


The array-count must match 1.
==== RequestDownloadTaskListData ====
No input, returns an output Event handle and an [[#IAsyncValue]].


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


==== EstimateRequiredSize ====
==== IsApplicationUpdateRequested ====
Takes a type-0x5 input buffer containing an array of [[NCM_services#ContentMetaKey|ContentMetaKey]], returns an output s64.
Takes an input [[NCM_services#ApplicationId|ApplicationId]], returns an output u8 bool and an u32.


When the array-count is less than 1, this will return 0 with the s64 set to 0.
The output u32 is only valid when the output bool is set.


==== RequestReceiveApplication ====
==== WithdrawApplicationUpdateRequest ====
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]].
Takes an input [[NCM_services#ApplicationId|ApplicationId]], no output.


[[qlaunch]] uses value Any for the StorageId, and value 55556 for the port.
==== RequestVerifyApplicationDeprecated ====
Takes an input TransferMemory handle, an [[NCM_services#ApplicationId|ApplicationId]], an u64 size, returns an output Event handle and an [[#IProgressAsyncResult]].


An error is thrown if a state ref-count is zero. An error is thrown if [[NIM_services|nim]] ListApplicationApplyDeltaTask returns a task.
On newer system-versions this calls the same func as [[#RequestVerifyApplication]], with the u32 value set to 0x7.


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.
==== RequestVerifyAddOnContentsRights ====
Takes an input [[NCM_services#ApplicationId|ApplicationId]], returns an output Event handle and an [[#IProgressAsyncResult]].


This does various setup then creates the [[#IAsyncResult]] + the async thread which handles the [[#IAsyncResult]] operation. Then the thread does:
==== RequestVerifyApplication ====
Takes an input TransferMemory handle, an u32, an [[NCM_services#ApplicationId|ApplicationId]], an u64 size, returns an output Event handle and an [[#IProgressAsyncResult]].


* Calls a func which does:
Official sw creates the TransferMemory with an user-specified buffer with permissions=0. [[qlaunch]] uses buffer size 0x100000.
** 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 a state flag is set.
** The EventId is "receive_app_contents" with ApplicationId <NS ProgramId>.


==== CommitReceiveApplication ====
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]].
Takes an input [[NCM_services#ApplicationId|ApplicationId]], no output.


==== GetReceiveApplicationProgress ====
==== IsAnyApplicationEntityInstalled ====
Takes an input [[NCM_services#ApplicationId|ApplicationId]], returns an output [[#ReceiveApplicationProgress]].
Takes an input [[NCM_services#ApplicationId|ApplicationId]], returns an output u8 bool.


An error is thrown if a state ref-count is zero. An error is thrown if [[NIM_services|nim]] ListApplicationApplyDeltaTask returns a task.
==== CleanupUnavailableAddOnContents ====
Takes an input u64 [[NCM_services#ApplicationId|ApplicationId]], an [[Account_services#Uid|Uid]], no output.
 
==== 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]].


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.
The TransferMemory uses permissions=0.


==== RequestSendApplication ====
==== EstimateSizeToMove ====
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]].
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.


[[qlaunch]] uses value 55556 for the port.
This calls a func also used by [[#RequestMoveApplicationEntity]], then calls another func.


An error is thrown if a state ref-count is zero. An error is thrown if [[NIM_services|nim]] ListApplicationApplyDeltaTask returns a task.
==== FormatSdCard ====
No input/output.


The [[NCM_services#ContentMetaType|ContentMetaType]] must match Patch.
==== NeedsSystemUpdateToFormatSdCard ====
No input, returns an output u8 bool.


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:
==== GetLastSdCardFormatUnexpectedResult ====
No input/output.


* Calls a func which does:
==== GetApplicationView ====
** Throws an error if a state flag is set.
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.
** 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 a state flag is set.
** The EventId is "send_app_contents" with ApplicationId <NS ProgramId>.


==== GetSendApplicationProgress ====
==== GetApplicationViewDownloadErrorContext ====
Takes an input [[NCM_services#ApplicationId|ApplicationId]], returns an output [[#SendApplicationProgress]].
Takes a type-0x16 output buffer containg an [[Error_Applet#ErrorContext|ErrorContext]], an u64 [[NCM_services#ApplicationId|ApplicationId]], no output.


Same as [[#GetReceiveApplicationProgress]] except this is the Send version, and uses [[NIM_services|nim]] cmd68/cmd63 instead.
==== GetApplicationViewWithPromotionInfo ====
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.


==== CompareSystemDeliveryInfo ====
==== IsPatchAutoDeletableApplication ====
Takes two type-0x15 input buffers containing a [[#SystemDeliveryInfo]], returns an output s32.
Takes an input [[NCM_services#ApplicationId|ApplicationId]], returns an output bool.


This is essentially the same as [[#CompareApplicationDeliveryInfo]], except this compares the [[#SystemDeliveryInfo]] SystemUpdate version.
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.


==== ListNotCommittedContentMeta ====
==== RequestDownloadApplicationPrepurchasedRights ====
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 an input [[NCM_services#ApplicationId|ApplicationId]], returns an output Event handle and an [[#IAsyncResult]].


==== RecoverDownloadTask ====
See [[#RequestApplicationUpdateInfo]] regarding nifm.
Takes a type-0x5 input buffer containing an array of {unknown} and an input u64, no output.


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


This extracts data from the input array for hashing with SHA256, with validation being done when handling each entry.
This generates a [[#SystemDeliveryInfo]] using the currently installed SystemUpdate meta title.


==== GetApplicationRightsOnClient ====
==== SelectLatestSystemDeliveryInfo ====
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.
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.


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


For the output array count, [[qlaunch]] uses value 3.
==== VerifyDeliveryProtocolVersion ====
Takes a type-0x15 input buffer containing a [[#SystemDeliveryInfo]], no output.


==== GetApplicationTerminateResult ====
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.
Takes an input [[NCM_services#ApplicationId|ApplicationId]], returns an output u32 Result.


==== GetRightsEnvironmentHandleForApplication ====
==== GetApplicationDeliveryInfo ====
No input, returns a total of 8-bytes of output.
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.


[9.0.0+] Now takes a total of 8-bytes of input, returns a total of 8-bytes of output.
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).


==== RequestNoDownloadRightsErrorResolution ====
==== HasAllContentsToDeliver ====
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 [[#ApplicationDeliveryInfo]], returns an output u8 bool.


The data that can be read from the [[#IAsyncValue]] is [[#NoDownloadRightsErrorResolution]].
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.


See [[#RequestApplicationUpdateInfo]] regarding nifm.
==== CompareApplicationDeliveryInfo ====
Takes two type-0x5 input buffers containing an array of [[#ApplicationDeliveryInfo]], returns an output s32.


==== RequestResolveNoDownloadRightsError ====
The array-count for both buffers must be 1, otherwise an error is returned.
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]].
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.


See [[#RequestApplicationUpdateInfo]] regarding nifm.
==== CanDeliverApplication ====
Takes two type-0x5 input buffers containing an array of [[#ApplicationDeliveryInfo]], returns an output u8 bool.


==== GetPromotionInfo ====
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-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.


Official sw uses hard-coded value 1 for the count with each of these arrays.
==== ListContentMetaKeyToDeliverApplication ====
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.


==== ImportPromotionJsonForDebug ====
The array-count for ContentMetaKey must be at least 1, and for ApplicationDeliveryInfo it must match 1.
Takes a type-0x5 input buffer, no output.


The output from [[Settings_services#GetDebugModeFlag]] must be 1, otherwise an error is returned.
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.


==== ClearPromotionInfoForDebug ====
==== NeedsSystemUpdateToDeliverApplication ====
No input/output.
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.


The output from [[Settings_services#GetDebugModeFlag]] must be 1, otherwise an error is returned.
The array-count must match 1.


This just clears 0xC-bytes in state.
After validation etc, this sets the output bool by comparing system-version fields in the [[#SystemDeliveryInfo]]/[[#ApplicationDeliveryInfo]] and with a state field.


==== CreateApplicationResource ====
==== EstimateRequiredSize ====
Returns an [[#IApplicationResource]].
Takes a type-0x5 input buffer containing an array of [[NCM_services#ContentMetaKey|ContentMetaKey]], returns an output s64.
 
When the array-count is less than 1, this will return 0 with the s64 set to 0.


==== GetApplicationResource ====
==== RequestReceiveApplication ====
Returns an [[#IApplicationResource]].
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]].


=== IGameCardStopper ===
[[qlaunch]] uses value Any for the StorageId, and value 55556 for the port.
This is "nn::ns::detail::IGameCardStopper".


This interface has no commands.
An error is thrown if a state ref-count is zero. An error is thrown if [[NIM_services|nim]] ListApplicationApplyDeltaTask returns a task.


=== IRequestServerStopper ===
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.
This is "nn::ns::detail::IRequestServerStopper".


This interface has no commands.
This does various setup then creates the [[#IAsyncResult]] + the async thread which handles the [[#IAsyncResult]] operation. Then the thread does:


=== IProgressMonitorForDeleteUserSaveDataAll ===
* Calls a func which does:
This is "nn::ns::detail::IProgressMonitorForDeleteUserSaveDataAll".
** 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>.


{| class="wikitable" border="1"
==== CommitReceiveApplication ====
|-
Takes an input [[NCM_services#ApplicationId|ApplicationId]], no output.
! Cmd || Name
 
|-
==== GetReceiveApplicationProgress ====
| 0 || GetSystemEvent
Takes an input [[NCM_services#ApplicationId|ApplicationId]], returns an output [[#ReceiveApplicationProgress]].
|-
| 1 || IsFinished
|-
| 2 || GetResult
|-
| 10 || GetProgress
|}


=== IProgressAsyncResult ===
An error is thrown if a state ref-count is zero. An error is thrown if [[NIM_services|nim]] ListApplicationApplyDeltaTask returns a task.
This is "nn::ns::detail::IProgressAsyncResult".


{| class="wikitable" border="1"
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.
|-
! Cmd || Name
|-
| 0 || Get
|-
| 1 || Cancel
|-
| 2 || GetProgress
|-
| 3 || GetDetailResult
|-
| 4 || [4.0.0+] GetErrorContext
|}


=== IApplicationVersionInterface ===
==== RequestSendApplication ====
This is "nn::ns::detail::IApplicationVersionInterface".
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]].


This was added with [4.0.0+].
[[qlaunch]] uses value 55556 for the port.


{| class="wikitable" border="1"
An error is thrown if a state ref-count is zero. An error is thrown if [[NIM_services|nim]] ListApplicationApplyDeltaTask returns a task.
|-
! Cmd || Name
|-
| 0 || GetLaunchRequiredVersion
|-
| 1 || UpgradeLaunchRequiredVersion
|-
| 35 || UpdateVersionList
|-
| 36 || PushLaunchVersion
|-
| 37 || ListRequiredVersion
|-
| 800 || RequestVersionList
|-
| 801 || ListVersionList
|-
| 802 || [[#RequestVersionListData]]
|-
| 1000 || PerformAutoUpdate
|}


==== RequestVersionListData ====
The [[NCM_services#ContentMetaType|ContentMetaType]] must match Patch.
No input, returns an output Event handle and an [[#IAsyncValue]].


The data that can be read from the [[#IAsyncValue]] is [[#VersionListData]].
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:


=== IContentManagerInterface ===
* Calls a func which does:
This is "nn::ns::detail::IContentManagementInterface".
** 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>.


{| class="wikitable" border="1"
==== GetSendApplicationProgress ====
|-
Takes an input [[NCM_services#ApplicationId|ApplicationId]], returns an output [[#SendApplicationProgress]].
! Cmd || Name
|-
| 11 || CalculateApplicationOccupiedSize
|-
| 43 || CheckSdCardMountStatus
|-
| 47 || GetTotalSpaceSize
|-
| 48 || GetFreeSpaceSize
|-
| 600 || CountApplicationContentMeta
|-
| 601 || ListApplicationContentMetaStatus
|-
| 605 || ListApplicationContentMetaStatusWithRightsCheck
|-
| 607 || IsAnyApplicationRunning
|}


=== IDocumentInterface ===
Same as [[#GetReceiveApplicationProgress]] except this is the Send version, and uses [[NIM_services|nim]] cmd68/cmd63 instead.
This is "nn::ns::detail::IDocumentInterface".


{| class="wikitable" border="1"
==== CompareSystemDeliveryInfo ====
|-
Takes two type-0x15 input buffers containing a [[#SystemDeliveryInfo]], returns an output s32.
! Cmd || Name
|-
| 21 || GetApplicationContentPath
|-
| 23 || ResolveApplicationContentPath
|-
| 92 || [5.0.0+] GetRunningApplicationProgramId
|}


=== IDownloadTaskInterface ===
This is essentially the same as [[#CompareApplicationDeliveryInfo]], except this compares the [[#SystemDeliveryInfo]] SystemUpdate version.
This is "nn::ns::detail::IDownloadTaskInterface".


{| class="wikitable" border="1"
==== ListNotCommittedContentMeta ====
|-
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.
! Cmd || Name
|-
| 701 || ClearTaskStatusList
|-
| 702 || RequestDownloadTaskList
|-
| 703 || RequestEnsureDownloadTask
|-
| 704 || ListDownloadTaskStatus
|-
| 705 || [[#RequestDownloadTaskListData]]
|-
| 706 || [4.0.0+] TryCommitCurrentApplicationDownloadTask
|-
| 707 || [4.0.0+] EnableAutoCommit
|-
| 708 || [4.0.0+] DisableAutoCommit
|-
| 709 || [4.0.0+] TriggerDynamicCommitEvent
|}


=== IReadOnlyApplicationRecordInterface ===
==== RecoverDownloadTask ====
This is "nn::ns::detail::IReadOnlyApplicationRecordInterface".
Takes a type-0x5 input buffer containing an array of {unknown} and an input u64, no output.


This was added with [5.0.0+].
==== GetApplicationDeliveryInfoHash ====
Takes a type-0x5 input buffer containing an array of [[#ApplicationDeliveryInfo]], returns an output 0x20-byte SHA256 hash.


{| class="wikitable" border="1"
This extracts data from the input array for hashing with SHA256, with validation being done when handling each entry.
|-
! Cmd || Name || Notes
|-
| 0 || HasApplicationRecord || Same as [[#IApplicationManagerInterface]] cmd 910
|}


=== IReadOnlyApplicationControlDataInterface ===
==== GetApplicationRightsOnClient ====
This is "nn::ns::detail::IReadOnlyApplicationControlDataInterface".
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.


This was added with [5.1.0+].
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.


{| class="wikitable" border="1"
For the output array count, [[qlaunch]] uses value 3.
|-
 
! Cmd || Name || Notes
==== GetApplicationTerminateResult ====
|-
Takes an input [[NCM_services#ApplicationId|ApplicationId]], returns an output u32 Result.
| 0 || [[#GetApplicationControlData]] || Same as [[#IApplicationManagerInterface]] cmd 400
 
|-
==== GetRightsEnvironmentHandleForApplication ====
| 1 || [[#GetApplicationDesiredLanguage]] || Same as [[#IApplicationManagerInterface]] cmd 55
No input, returns a total of 8-bytes of output.
|-
| 2 || ConvertApplicationLanguageToLanguageCode || Same as [[#IApplicationManagerInterface]] cmd 59
|-
| 3 || [[#ConvertLanguageCodeToApplicationLanguage]] || Same as [[#IApplicationManagerInterface]] cmd 60
|-
| 4 || [9.0.0+] SelectApplicationDesiredLanguage ||
|}


=== IDynamicRightsInterface ===
[9.0.0+] Now takes a total of 8-bytes of input, returns a total of 8-bytes of output.
This is "nn::ns::detail::IDynamicRightsInterface".


This was added with [6.0.0+].
==== RequestNoDownloadRightsErrorResolution ====
Takes an input [[NCM_services#ApplicationId|ApplicationId]], returns an output Event handle and an [[#IAsyncValue]].


{| class="wikitable" border="1"
The data that can be read from the [[#IAsyncValue]] is [[#NoDownloadRightsErrorResolution]].
|-
! Cmd || Name || Notes
|-
| 0 || [[#RequestApplicationRightsOnServer]] ||
|-
| 1 || RequestAssignRights ||
|-
| 4 || DeprecatedRequestAssignRightsToResume ||
|-
| 5 || VerifyActivatedRightsOwners ||
|-
| 6 || DeprecatedGetApplicationRightsStatus ||
|-
| 7 || RequestPrefetchForDynamicRights ||
|-
| 8 || GetDynamicRightsState ||
|-
| 9 || [7.0.0+] [[#RequestApplicationRightsOnServerToResume]] ||
|-
| 10 || [7.0.0+] RequestAssignRightsToResume ||
|-
| 11 || [7.0.0+] GetActivatedRightsUsers ||
|-
| 12 || [8.0.0+] GetApplicationRightsStatus ||
|-
| 13 || [8.0.0+] GetRunningApplicationStatus ||
|}


==== RequestApplicationRightsOnServer ====
See [[#RequestApplicationUpdateInfo]] regarding nifm.
Takes a total of 0x20-bytes of input, returns an output Event handle and an [[#IAsyncValue]].


==== RequestApplicationRightsOnServerToResume ====
==== RequestResolveNoDownloadRightsError ====
Takes a total of 8-bytes of input, returns an output Event handle and an [[#IAsyncValue]].
Takes an input [[NCM_services#ApplicationId|ApplicationId]], returns an output Event handle and an [[#IAsyncValue]].


=== IECommerceInterface===
The data that can be read from the [[#IAsyncValue]] is [[#NoDownloadRightsErrorResolution]].
This is "nn::ns::detail::IECommerceInterface".


This was added with [4.0.0+].
See [[#RequestApplicationUpdateInfo]] regarding nifm.


{| class="wikitable" border="1"
==== GetPromotionInfo ====
|-
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.
! Cmd || Name || Notes
|-
| 0 || RequestLinkDevice || Takes a total of 0x10-bytes of input, returns an [[#IAsyncResult]].
|-
| 1 || [6.0.0+] RequestCleanupAllPreInstalledApplications || No input, returns an [[#IAsyncResult]].
|-
| 2 || [6.0.0+] RequestCleanupPreInstalledApplication || Takes a total of 0x8-bytes of input, returns an [[#IAsyncResult]].
|-
| 3 || [6.0.0+] RequestSyncRights || No input, returns an [[#IAsyncResult]].
|-
| 4 || [6.0.0+] RequestUnlinkDevice || Takes a total of 0x10-bytes of input, returns an [[#IAsyncResult]].
|-
| 5 || [6.1.0+] RequestRevokeAllELicense || Takes a total of 0x10-bytes of input, returns an [[#IAsyncResult]].
|-
| 6 || [9.0.0+] RequestSyncRightsBasedOnAssignedELicenses ||
|}


=== IFactoryResetInterface ===
Official sw uses hard-coded value 1 for the count with each of these arrays.
This is "nn::ns::detail::IFactoryResetInterface".


{| class="wikitable" border="1"
==== ImportPromotionJsonForDebug ====
|-
Takes a type-0x5 input buffer, no output.
! Cmd || Name
|-
| 100 || ResetToFactorySettings
|-
| 101 || ResetToFactorySettingsWithoutUserSaveData
|-
| 102 || ResetToFactorySettingsForRefurbishment
|-
| 103 || [9.1.0+] ResetToFactorySettingsWithPlatformRegion
|-
| 104 || [9.1.0+] ResetToFactorySettingsWithPlatformRegionAuthentication
|}


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


This was added with [9.0.0+].
==== ClearPromotionInfoForDebug ====
No input/output.


{| class="wikitable" border="1"
The output from [[Settings_services#GetDebugModeFlag]] must be 1, otherwise an error is returned.
|-
! Cmd || Name
|-
| 0 || Attach
|-
| 1 || BoostSystemMemoryResourceLimit
|}


= ns:vm =
This just clears 0xC-bytes in state.
This is "nn::ns::detail::IVulnerabilityManagerInterface".


{| class="wikitable" border="1"
==== CreateApplicationResource ====
|-
Takes an input [[#ApplicationResourceType]]. Returns an [[#IApplicationResource]].
! Cmd || Name
 
|-
==== GetApplicationResource ====
| 1200 || [3.0.0+] [[#NeedsUpdateVulnerability]]
Takes an input u64 ProcessId and an input [[#ApplicationResourceType]]. Returns an [[#IApplicationResource]].
|-
 
| 1201 || [4.0.0+] [[#UpdateSafeSystemVersionForDebug]]
==== LaunchMicroApplication ====
|-
[18.0.0+] Now takes a total of 0x50 bytes of input.
| 1202 || [4.0.0+] [[#GetSafeSystemVersion]]
 
|}
[19.0.0+] Now takes a total of 0x80 bytes of input.
 
==== CreateApplicationInstance ====
[18.0.0+] Now takes a total of 0x50 bytes of input.
 
[19.0.0+] Now takes a total of 0x80 bytes of input.


== NeedsUpdateVulnerability ==
==== RegisterDeviceLockKey ====
No input, returns an output u8 bool flag.
Takes a type-0x5 input buffer containing an InArray of u8, no output.


Web-applets use this command to check if the system needs an update.
User-processes expose this with two funcs: one which uses an user-specified u8 array directly, while the other uses [[HID_services#NpadButtonSet|NpadButton]].


== UpdateSafeSystemVersionForDebug ==
This does SHA256 hashing, etc.
Takes an input [[NCM_services#ApplicationId|ApplicationId]] and an u32 '''version'''.


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.
==== UnregisterDeviceLockKey ====
No input/output.


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'''.
Runs code identical to [[#RegisterDeviceLockKey]], except the passed buffer/size are 0.


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".
==== VerifyDeviceLockKey ====
Takes a type-0x5 input buffer containing an InArray of u8, no output.


== GetSafeSystemVersion ==
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 [[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 =
This runs hashing similar to [[#RegisterDeviceLockKey]], with the calculated hash being verified with the one from state.
This is "nn::ns::detail::ISystemUpdateInterface".


{| class="wikitable" border="1"
==== HideApplicationIcon ====
|-
No input/output.
! Cmd || Name
|-
| 0 || [[#GetBackgroundNetworkUpdateState]]
|-
| 1 || [[#OpenSystemUpdateControl]]
|-
| 2 || [[#NotifyExFatDriverRequired]]
|-
| 3 || [[#ClearExFatDriverStatusForDebug]]
|-
| 4 || [[#RequestBackgroundNetworkUpdate]]
|-
| 5 || [[#NotifyBackgroundNetworkUpdate]]
|-
| 6 || [[#NotifyExFatDriverDownloadedForDebug]]
|-
| 9 || [[#GetSystemUpdateNotificationEventForContentDelivery]]
|-
| 10 || [[#NotifySystemUpdateForContentDelivery]]
|-
| 11 || [3.0.0+] [[#PrepareShutdown]]
|-
| 12 || [3.0.0-3.0.2]
|-
| 13 || [3.0.0-3.0.2]
|-
| 14 || [3.0.0-3.0.2]
|-
| 15 || [3.0.0-3.0.2]
|-
| 16 || [4.0.0+] [[#DestroySystemUpdateTask]]
|-
| 17 || [4.0.0+] [[#RequestSendSystemUpdate]]
|-
| 18 || [4.0.0+] [[#GetSendSystemUpdateProgress]]
|}


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


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


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


== NotifyExFatDriverRequired ==
==== EnableGameCard ====
No input/output.
No input/output.


Only usable when an [[#ISystemUpdateControl]] isn't open.
==== DisableGameCard ====
 
No input/output.
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 ==
==== EnableLocalContentShare ====
No input/output.
No input/output.


== RequestBackgroundNetworkUpdate ==
==== DisableLocalContentShare ====
No input/output.
No input/output.


Only usable when an [[#ISystemUpdateControl]] isn't open.
==== IsApplicationIconHidden ====
No input, returns an output bool.


This sets a state flag to value 1.
==== IsApplicationTitleHidden ====
No input, returns an output bool.


== NotifyBackgroundNetworkUpdate ==
==== IsGameCardEnabled ====
Takes an input [[NCM_services#ContentMetaKey|ContentMetaKey]], no output.
No input, returns an output bool.


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]].
==== IsLocalContentShareEnabled ====
No input, returns an output bool.


== NotifyExFatDriverDownloadedForDebug ==
Various Deliver cmds now load the same flag used by this cmd (IsLocalContentShareEnabled), with an error being returned when it's not enabled.
No input/output.


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


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


Signals the Event returned by [[#GetSystemUpdateNotificationEventForContentDelivery]].
=== IRequestServerStopper ===
This is "nn::ns::detail::IRequestServerStopper".


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


This is used by [[AM_services|AM]].
=== IProgressMonitorForDeleteUserSaveDataAll ===
This is "nn::ns::detail::IProgressMonitorForDeleteUserSaveDataAll".


Just returns 0 when an [[#ISystemUpdateControl]] is open.
{| class="wikitable" border="1"
|-
! Cmd || Name
|-
| 0 || GetSystemEvent
|-
| 1 || IsFinished
|-
| 2 || GetResult
|-
| 10 || GetProgress
|}


This does various cleanup / uses various service-cmds etc for shutdown preparation.
When closing the object, official sw uses IsFinished first, asserting when the output bool is false.


== DestroySystemUpdateTask ==
* GetSystemEvent: No input, returns an output Event handle. [[qlaunch]] doesn't use this.
No input/output.


Only usable when an [[#ISystemUpdateControl]] isn't open.
* IsFinished: No input, returns an output u8 bool.


This uses [[NIM_services|nim]] ListSystemUpdateTask, then when a task is returned uses it with DestroySystemUpdateTask.
* GetResult: No input/output.


== RequestSendSystemUpdate ==
* GetProgress: No input, returns an output [[#ProgressForDeleteUserSaveDataAll]]. Official sw writes this struct directly to object state.
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.
=== IProgressAsyncResult ===
This is "nn::ns::detail::IProgressAsyncResult".


[[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.
{| class="wikitable" border="1"
 
|-
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:
! Cmd || Name
* Calls a func which does:
|-
** Uses [[NIM_services|nim]] cmd76, returning the Result on failure.
| 0 || Get
** 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.
| 1 || Cancel
* Unlike [[#RequestReceiveSystemUpdate]], this doesn't save a SystemPlayReport.
|-
| 2 || GetProgress
|-
| 3 || GetDetailResult
|-
| 4 || [4.0.0+] GetErrorContext
|}


== GetSendSystemUpdateProgress ==
=== IApplicationVersionInterface ===
No input, returns an output [[#SystemUpdateProgress]].
This is "nn::ns::detail::IApplicationVersionInterface".


Same as [[#GetReceiveProgress]] except this uses nim cmd81 and cmd78.
This was added with [4.0.0+].


== ISystemUpdateControl ==
{| class="wikitable" border="1"
{| class="wikitable" border="1"
|-
|-
! Cmd || Name
! Cmd || Name
|-
|-
| 0 || [[#HasDownloaded]]
| 0 || GetLaunchRequiredVersion
|-
|-
| 1 || [[#RequestCheckLatestUpdate]]
| 1 || UpgradeLaunchRequiredVersion
|-
|-
| 2 || [[#RequestDownloadLatestUpdate]]
| 35 || UpdateVersionList
|-
|-
| 3 || [[#GetDownloadProgress]]
| 36 || PushLaunchVersion
|-
|-
| 4 || [[#ApplyDownloadedUpdate]]
| 37 || ListRequiredVersion
|-
|-
| 5 || [[#RequestPrepareCardUpdate]]
| 800 || RequestVersionList
|-
|-
| 6 || [[#GetPrepareCardUpdateProgress]]
| 801 || ListVersionList
|-
|-
| 7 || [[#HasPreparedCardUpdate]]
| 802 || [[#RequestVersionListData]]
|-
|-
| 8 || [[#ApplyCardUpdate]]
| 900 || [12.0.0+] ImportAutoUpdatePolicyJsonForDebug
|-
|-
| 9 || [[#GetDownloadedEulaDataSize]]
| 901 || [12.0.0+] ListDefaultAutoUpdatePolicy
|-
|-
| 10 || [[#GetDownloadedEulaData]]
| 902 || [12.0.0+] ListAutoUpdatePolicyForSpecificApplication
|-
|-
| 11 || [[#SetupCardUpdate]]
| 1000 || PerformAutoUpdate
|-
|-
| 12 || [[#GetPreparedCardUpdateEulaDataSize]]
| 1001 || [11.0.0+] ListAutoUpdateSchedule
|}
 
==== RequestVersionListData ====
No input, returns an output Event handle and an [[#IAsyncValue]].
 
The data that can be read from the [[#IAsyncValue]] is [[#VersionListData]].
 
=== IContentManagementInterface ===
This is "nn::ns::detail::IContentManagementInterface".
 
{| class="wikitable" border="1"
|-
|-
| 13 || [[#GetPreparedCardUpdateEulaData]]
! Cmd || Name
|-
|-
| 14 || [4.0.0+] [[#SetupCardUpdateViaSystemUpdater]]
| 11 || [[#CalculateApplicationOccupiedSize]]
|-
|-
| 15 || [4.0.0+] [[#HasReceived]]
| 43 || [[#CheckSdCardMountStatus]]
|-
|-
| 16 || [4.0.0+] [[#RequestReceiveSystemUpdate]]
| 47 || [[#GetTotalSpaceSize]]
|-
|-
| 17 || [4.0.0+] [[#GetReceiveProgress]]
| 48 || [[#GetFreeSpaceSize]]
|-
|-
| 18 || [4.0.0+] [[#ApplyReceivedUpdate]]
| 600 || [[#CountApplicationContentMeta]]
|-
|-
| 19 || [4.0.0+] [[#GetReceivedEulaDataSize]]
| 601 || [[#ListApplicationContentMetaStatus]]
|-
|-
| 20 || [4.0.0+] [[#GetReceivedEulaData]]
| 605 || [[#ListApplicationContentMetaStatusWithRightsCheck]]
|-
|-
| 21 || [4.0.0+] [[#SetupToReceiveSystemUpdate]]
| 607 || [[#IsAnyApplicationRunning]]
|-
| 22 || [6.0.0+] [[#RequestCheckLatestUpdateIncludesRebootlessUpdate]]
|}
|}


Only 1 ISystemUpdateControl can be open at a time.
==== CalculateApplicationOccupiedSize ====
Takes an input [[NCM_services#ApplicationId|ApplicationId]], returns an output [[#ApplicationOccupiedSize]].


All Card cmds except SetupCardUpdate* require [[#SetupCardUpdate]]/[[#SetupCardUpdateViaSystemUpdater]] to be used previously. [[#GetPreparedCardUpdateEulaDataSize]]/[[#GetPreparedCardUpdateEulaData]] checks a different state flag.
==== CheckSdCardMountStatus ====
No input/output.


=== HasDownloaded ===
==== CountApplicationContentMeta ====
No input, returns an output u8 bool flag.
Takes an input [[NCM_services#ApplicationId|ApplicationId]], returns an output s32.


Gets whether a network sysupdate was downloaded, with install pending.
==== ListApplicationContentMetaStatusWithRightsCheck ====
Same input/output as [[#ListApplicationContentMetaStatus]].


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.
==== IsAnyApplicationRunning ====
No input, returns an output u8 bool.


This always returns 0, however this will assert if GetSystemUpdateTaskInfo fails with ret!=0x3C89.
=== IDocumentInterface ===
This is "nn::ns::detail::IDocumentInterface".


=== RequestCheckLatestUpdate ===
{| class="wikitable" border="1"
No input, returns an output Event handle and an [[#IAsyncValue]].
|-
! Cmd || Name
|-
| 21 || GetApplicationContentPath
|-
| 23 || ResolveApplicationContentPath
|-
| 92 || [5.0.0+] GetRunningApplicationProgramId
|-
| 2524 || [19.0.0+]  
|}


The data that can be read from the [[#IAsyncValue]] is [[#LatestSystemUpdate]].
=== IDownloadTaskInterface ===
This is "nn::ns::detail::IDownloadTaskInterface".


=== RequestDownloadLatestUpdate ===
{| class="wikitable" border="1"
No input, returns an output Event handle and an [[#IAsyncResult]].
|-
! Cmd || Name
|-
| 701 || [[#ClearTaskStatusList]]
|-
| 702 || [[#RequestDownloadTaskList]]
|-
| 703 || [[#RequestEnsureDownloadTask]]
|-
| 704 || [[#ListDownloadTaskStatus]]
|-
| 705 || [[#RequestDownloadTaskListData]]
|-
| 706 || [4.0.0+] [[#TryCommitCurrentApplicationDownloadTask]]
|-
| 707 || [4.0.0+] [[#EnableAutoCommit]]
|-
| 708 || [4.0.0+] [[#DisableAutoCommit]]
|-
| 709 || [4.0.0+] [[#TriggerDynamicCommitEvent]]
|}
 
==== ClearTaskStatusList ====
No input/output.
 
==== RequestDownloadTaskList ====
No input/output.
 
==== RequestEnsureDownloadTask ====
No input, returns an output Event handle and an [[#IAsyncResult]].


=== GetDownloadProgress ===
==== ListDownloadTaskStatus ====
No input, returns an output [[#SystemUpdateProgress]].
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.


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.
==== EnableAutoCommit ====
No input/output.


=== ApplyDownloadedUpdate ===
==== DisableAutoCommit ====
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:
==== TriggerDynamicCommitEvent ====
No input/output.


* Uses ListSystemUpdateTask again, then [[NIM_services|nim]] IsExFatDriverIncluded. Runs ExFat handling when the output flag is set.
=== IReadOnlyApplicationRecordInterface ===
* On newer system-versions, this uses [[NIM_services|nim]] GetSystemUpdateTaskInfo then on success uses data from there to save a SystemPlayReport when a state flag is set (by default it's not set).
This is "nn::ns::detail::IReadOnlyApplicationRecordInterface".
** 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 was added with [5.0.0+].
No input, returns an output Event handle and an [[#IAsyncResult]].


=== GetPrepareCardUpdateProgress ===
{| class="wikitable" border="1"
No input, returns an output [[#SystemUpdateProgress]].
|-
! Cmd || Name || Notes
|-
| 0 || HasApplicationRecord || Same as [[#IApplicationManagerInterface]] cmd 910
|-
| 1 || [10.0.0+] NotifyApplicationFailure ||
|-
| 2 || [10.0.0+] IsDataCorruptedResult ||
|}


=== HasPreparedCardUpdate ===
=== IReadOnlyApplicationControlDataInterface ===
No input, returns an output u8 bool flag.
This is "nn::ns::detail::IReadOnlyApplicationControlDataInterface".


=== ApplyCardUpdate ===
This was added with [5.1.0+].
No input/output.


=== GetDownloadedEulaDataSize ===
{| class="wikitable" border="1"
Takes a type-0x15 input buffer [[#EulaDataPath]], returns an output u64 '''filesize'''.
|-
! Cmd || Name || Notes
|-
| 0 || [[#GetApplicationControlData]] || Same as [[#IApplicationManagerInterface]] cmd 400
|-
| 1 || [[#GetApplicationDesiredLanguage]] || Same as [[#IApplicationManagerInterface]] cmd 55
|-
| 2 || ConvertApplicationLanguageToLanguageCode || Same as [[#IApplicationManagerInterface]] cmd 59
|-
| 3 || [[#ConvertLanguageCodeToApplicationLanguage]] || Same as [[#IApplicationManagerInterface]] cmd 60
|-
| 4 || [9.0.0+] SelectApplicationDesiredLanguage ||
|-
| 5 || [19.0.0+] ||
|-
| 6 || [19.0.0+] ||
|}


Runs code similar to [[#HasDownloaded]], throwing an error if a network sysupdate isn't ready for install.
=== IDynamicRightsInterface ===
This is "nn::ns::detail::IDynamicRightsInterface".


Uses ListSystemUpdateTask again. Then [[NIM_services|nim]] GetDownloadedSystemDataPath, with the output ContentPath being used to mount the EULA title with FS.
This was added with [6.0.0+].


Then "<mountname>:/<[[#EulaDataPath]]>" is opened, gets the '''filesize''', then runs cleanup.
{| class="wikitable" border="1"
 
|-
=== GetDownloadedEulaData ===
! Cmd || Name
Takes a type-0x15 input buffer [[#EulaDataPath]] and a type-0x6 output buffer, returns an output u64 '''filesize'''.
|-
 
| 0 || [[#RequestApplicationRightsOnServer]]
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.
|-
| 1 || [[#RequestAssignRights]]
|-
| 4 || [[#DeprecatedRequestAssignRightsToResume]]
|-
| 5 || [[#VerifyActivatedRightsOwners]]
|-
| 6 || [[#DeprecatedGetApplicationRightsStatus]]
|-
| 7 || [[#RequestPrefetchForDynamicRights]]
|-
| 8 || [[#GetDynamicRightsState]]
|-
| 9 || [7.0.0+] [[#RequestApplicationRightsOnServerToResume]]
|-
| 10 || [7.0.0+] [[#RequestAssignRightsToResume]]
|-
| 11 || [7.0.0+] [[#GetActivatedRightsUsers]]
|-
| 12 || [8.0.0+] [[#GetApplicationRightsStatus]]
|-
| 13 || [8.0.0+] [[#GetRunningApplicationStatus]]
|-
| 14 || [10.0.0-15.0.1] SelectApplicationLicense
|-
| 15 || [12.0.0+] [[#RequestContentsAuthorizationToken]]
|-
| 16 || [13.0.0+] QualifyUser
|-
| 17 || [13.0.0+] QualifyUserWithProcessId
|-
| 18 || [13.0.0+] NotifyApplicationRightsCheckStart
|-
| 19 || [13.0.0+] UpdateUserList
|-
| 20 || [13.0.0+] IsRightsLostUser
|-
| 21 || [13.1.0+] SetRequiredAddOnContentsOnContentsAvailabilityTransition
|-
| 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
|}


=== SetupCardUpdate ===
==== RequestApplicationRightsOnServer ====
Takes an input u64 size and a TransferMemory handle, no output.
Takes an input [[NCM_services#ApplicationId|ApplicationId]], an [[Account_services#Uid|Uid]] and an u32. Returns an output Event handle and an [[#IAsyncValue]].


Official sw creates the TransferMemory with an user-specified buffer, with permissions=None.
==== RequestAssignRights ====
Takes a type-0x5 input buffer containing an array of "nn::ns::ApplicationRightsOnServer". Returns an output Event handle and an [[#IAsyncResult]].


[[qlaunch]] uses size 0x100000 for the TransferMemory buffer.
==== DeprecatedRequestAssignRightsToResume ====
Takes an input u64 "nn::ns::RightsEnvironmentHandle" and an [[Account_services#Uid|Uid]]. Returns an output Event handle and an [[#IAsyncResult]].


=== GetPreparedCardUpdateEulaDataSize ===
==== VerifyActivatedRightsOwners ====
Takes a type-0x15 input buffer [[#EulaDataPath]], returns an output u64 '''filesize'''.
Takes an input u64 "nn::ns::RightsEnvironmentHandle". No output.


This is similar to [[#GetDownloadedEulaDataSize]].
==== DeprecatedGetApplicationRightsStatus ====
Takes an input u64 "nn::ns::RightsEnvironmentHandle". Returns a bool "nn::ns::ApplicationRightsStatus".


=== GetPreparedCardUpdateEulaData ===
==== RequestPrefetchForDynamicRights ====
Takes a type-0x15 input buffer [[#EulaDataPath]] and a type-0x6 output buffer, returns an output u64 '''filesize'''.
Takes an input [[Account_services#Uid|Uid]]. Returns an output Event handle and an [[#IAsyncResult]].


This is similar to [[#GetDownloadedEulaData]].
==== GetDynamicRightsState ====
No input. Returns a bool "nn::ns::DynamicRightsState".


=== SetupCardUpdateViaSystemUpdater ===
==== RequestApplicationRightsOnServerToResume ====
Takes an input u64 size and a TransferMemory handle, no output.
Takes an input u64 "nn::ns::RightsEnvironmentHandle". Returns an output Event handle and an [[#IAsyncValue]].


The permissions for the TransferMemory is None.
==== RequestAssignRightsToResume ====
Takes an input u64 "nn::ns::RightsEnvironmentHandle". Returns an output Event handle and an [[#IAsyncResult]].


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.
==== 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]].


=== HasReceived ===
==== GetApplicationRightsStatus ====
No input, returns an output u8 bool.
Takes an input "nn::ns::RightsEnvironmentHandle". Returns 2 bools "nn::ns::ApplicationRightsStatus" and "nn::ns::ApplicationLicenseType".


Same as [[#HasDownloaded]] except this uses [[NIM_services|nim]] cmd71 and cmd73.
==== GetRunningApplicationStatus ====
Takes an input u64 "nn::ns::RightsEnvironmentHandle". Returns an u32 "nn::ns::RunningApplicationStatus".


=== RequestReceiveSystemUpdate ===
==== RequestContentsAuthorizationToken ====
Takes a type-0x15 input buffer containing a [[#SystemDeliveryInfo]], an u16 port, an u32 Ipv4Address, returns an output Event handle and an [[#IAsyncResult]].
Takes a total of 0x50-bytes of input, a type-0x5 input buffer. Returns an [[#IAsyncData_2|IAsyncData]] and an output handle.


[[qlaunch]] uses the same value for the port as [[#RequestSendSystemUpdate]] (see [[#RequestSendSystemUpdate]] for addr as well).
==== IAsyncData ====
This is "nn::ns::detail::IAsyncData".


[[NIM_services|NIM]] will use the input addr/port with [[Sockets_services|connect()]].
This was added with [12.0.0+].


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:
{| class="wikitable" border="1"
|-
! Cmd || Name
|-
| 0 || GetSize
|-
| 1 || Get
|-
| 2 || Cancel
|-
| 3 || GetErrorContext
|}


* Calls a func which does:
=== IECommerceInterface===
** Throws an error if [[NIM_services#ListSystemUpdateTask|ListSystemUpdateTask]] returns any task.
This is "nn::ns::detail::IECommerceInterface".
** 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 a state flag is set.
** The EventId is "receive_system_update" with ApplicationId <NS ProgramId>.


=== GetReceiveProgress ===
This was added with [4.0.0+].
No input, returns an output [[#SystemUpdateProgress]].


Same as [[#GetDownloadProgress]] except this uses [[NIM_services|nim]] cmd71 and cmd73.
{| class="wikitable" border="1"
|-
! Cmd || Name
|-
| 0 || [[#RequestLinkDevice]]
|-
| 1 || [6.0.0+] [[#RequestCleanupAllPreInstalledApplications]]
|-
| 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
|}


=== ApplyReceivedUpdate ===
==== RequestLinkDevice ====
No input/output.
Takes an input [[Account_services#Uid|Uid]], returns an output Event handle and an [[#IAsyncResult]].


=== GetReceivedEulaDataSize ===
See [[#RequestApplicationUpdateInfo]] regarding nifm.
Takes a type-0x15 input buffer [[#EulaDataPath]], returns an output u64 '''filesize'''.


This is similar to [[#GetDownloadedEulaDataSize]].
==== RequestCleanupAllPreInstalledApplications ====
No input, returns an output Event handle and an [[#IAsyncResult]].


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


This is similar to [[#GetDownloadedEulaData]].
==== RequestSyncRights ====
No input, returns an output Event handle and an [[#IAsyncResult]].


=== SetupToReceiveSystemUpdate ===
==== RequestUnlinkDevice ====
No input/output.
Takes an input [[Account_services#Uid|Uid]], returns an output Event handle and an [[#IAsyncResult]].


This just uses [[NIM_services|nim]] ListSystemUpdateTask, then when a task is returned uses it with DestroySystemUpdateTask.
See [[#RequestApplicationUpdateInfo]] regarding nifm.


[[qlaunch]] uses this before [[#RequestReceiveSystemUpdate]].
==== RequestRevokeAllELicense ====
Takes an input [[Account_services#Uid|Uid]], returns an output Event handle and an [[#IAsyncResult]].


=== RequestCheckLatestUpdateIncludesRebootlessUpdate ===
==== RequestSyncRightsBasedOnAssignedELicenses ====
No input, returns an output Event handle and an [[#IAsyncValue]].
No input, returns an output Event handle and an [[#IAsyncResult]].


= IAsyncValue =
=== IFactoryResetInterface ===
This is "nn::ns::detail::IAsyncValue".
This is "nn::ns::detail::IFactoryResetInterface".


{| class="wikitable" border="1"
{| class="wikitable" border="1"
Line 1,970: Line 2,131:
! Cmd || Name
! Cmd || Name
|-
|-
| 0 || GetSize
| 100 || [[#ResetToFactorySettings]]
|-
| 101 || [[#ResetToFactorySettingsWithoutUserSaveData]]
|-
| 102 || [[#ResetToFactorySettingsForRefurbishment]]
|-
| 103 || [9.1.0+] [[#ResetToFactorySettingsWithPlatformRegion]]
|-
|-
| 1 || Get
| 104 || [9.1.0+] [[#ResetToFactorySettingsWithPlatformRegionAuthentication]]
|-
|-
| 2 || Cancel
| 105 || [10.0.0+] [[#RequestResetToFactorySettingsSecurely]]
|-
|-
| 3 || [4.0.0+] GetErrorContext
| 106 || [10.0.0+] [[#RequestResetToFactorySettingsWithPlatformRegionAuthenticationSecurely]]
|}
|}


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.
==== ResetToFactorySettings ====
No input/output.
 
As of [9.1.0] this is the only [[#IFactoryResetInterface]] cmd used by [[qlaunch]].
 
==== ResetToFactorySettingsWithoutUserSaveData ====
No input/output.
 
==== ResetToFactorySettingsForRefurbishment ====
No input/output.
 
==== ResetToFactorySettingsWithPlatformRegion ====
No input/output.
 
==== ResetToFactorySettingsWithPlatformRegionAuthentication ====
No input/output.
 
==== RequestResetToFactorySettingsSecurely ====
Takes an input u64 tmem_size, a TransferMemory handle, returns an output [[#IAsyncValueAndProgress]] and an Event handle.
 
The TransferMemory uses permissions=0.
 
==== RequestResetToFactorySettingsWithPlatformRegionAuthenticationSecurely ====
Takes an input u32 "nn::ae::PlatformRegion", an u64 tmem_size, a TransferMemory handle, returns an output [[#IAsyncValueAndProgress]] and an Event handle.
 
The TransferMemory uses permissions=0.


* GetSize: No input, returns an output u64.
===== IAsyncValueAndProgress =====
* Get: Takes a type-0x6 output buffer, no output. Official sw waits on the Event prior to using this cmd.
This is "nn::ns::detail::IAsyncValueAndProgress".
* 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 was added with [10.0.0+].
This is "nn::ns::detail::IAsyncResult".


{| class="wikitable" border="1"
{| class="wikitable" border="1"
Line 1,993: Line 2,182:
! Cmd || Name
! Cmd || Name
|-
|-
| 0 || Get
| 0 || GetSize
|-
| 1 || Get
|-
| 2 || Cancel
|-
|-
| 1 || Cancel
| 3 || GetErrorContext
|-
|-
| 2 || [4.0.0+] GetErrorContext
| 4 || GetProgress
|}
|}


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.
=== IApplicationResource ===
This is "nn::ns::detail::IApplicationResource".


* Get: No input/output. Official sw waits on the Event prior to using this cmd.
This was added with [9.0.0+].
* 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]].
 
= ns:dev =
This is "nn::ns::detail::IDevelopInterface".


{| class="wikitable" border="1"
{| class="wikitable" border="1"
Line 2,013: Line 2,202:
! Cmd || Name
! Cmd || Name
|-
|-
| 0 || [[#LaunchProgram]]
| 0 || Attach
|-
|-
| 1 || [[#TerminateProcess]]
| 1 || BoostSystemMemoryResourceLimit
|}
 
= ns:vm =
This is "nn::ns::detail::IVulnerabilityManagerInterface".
 
{| class="wikitable" border="1"
|-
|-
| 2 || [[#TerminateProgram]]
! Cmd || Name
|-
|-
| 4 || [[#GetShellEvent]]
| 1200 || [3.0.0+] [[#NeedsUpdateVulnerability]]
|-
|-
| 5 || [[#GetShellEventInfo]]
| 1201 || [4.0.0+] [[#UpdateSafeSystemVersionForDebug]]
|-
|-
| 6 || [[#TerminateApplication]]
| 1202 || [4.0.0+] [[#GetSafeSystemVersion]]
|-
|-
| 7 || [[#PrepareLaunchProgramFromHost]]
| 3100 || [18.0.0+]  
|-
|-
| 8 || [[#LaunchApplicationForDevelop]]
| 3101 || [18.0.0+]  
|-
|-
| 9 || [[#LaunchApplicationWithStorageIdForDevelop]]
| 3102 || [18.0.0+]  
|-
|}
| 10 || [6.0.0-8.1.0] IsSystemMemoryResourceLimitBoosted
 
|-
== NeedsUpdateVulnerability ==
| 11 || [6.0.0+] GetRunningApplicationProcessIdForDevelop
No input, returns an output u8 bool flag.
|-
| 12 || [6.0.0+] SetCurrentApplicationRightsEnvironmentCanBeActiveForDevelop
|-
| 13 || [9.0.0+] [[#CreateApplicationResourceForDevelop]]
|-
| 14 || [9.0.0+] [[#IsPreomiaForDevelop]]
|}


== LaunchProgram ==
Web-applets use this command to check if the system needs an update.
Wrapper for "pm:shell" [[Process_Manager_services#pm:shell|LaunchProcess]].


== TerminateProcess ==
== UpdateSafeSystemVersionForDebug ==
Wrapper for "pm:shell" [[Process_Manager_services#pm:shell|TerminateProcess]].
Takes an input [[NCM_services#ApplicationId|ApplicationId]] and an u32 '''version'''.


== TerminateProgram ==
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.
Wrapper for "pm:shell" [[Process_Manager_services#pm:shell|TerminateProgram]].


== GetShellEvent ==
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'''.
Wrapper for "pm:shell" [[Process_Manager_services#pm:shell|GetProcessEventHandle]].


== GetShellEventInfo ==
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".
Wrapper for "pm:shell" [[Process_Manager_services#pm:shell|GetProcessEventInfo]].


== TerminateApplication ==
== GetSafeSystemVersion ==
Calls "pm:shell" [[Process_Manager_services#pm:shell|GetApplicationProcessIdForShell]] and sends PID to [[Process_Manager_services#pm:shell|TerminateProcess]].
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>).


== PrepareLaunchProgramFromHost ==
= ns:su =
Takes a type-0x5 input buffer containing the [[Filesystem_services|ContentPath]], returns an output 0x10-byte struct.
This is "nn::ns::detail::ISystemUpdateInterface".


Calls [[NCM_services#IPathResolverForStorage|IPathResolverForStorage]] Set...NcaPath functions.
{| class="wikitable" border="1"
 
|-
== LaunchApplicationForDevelop ==
! Cmd || Name
Takes an input u32 [[Process_Manager_services#LaunchFlags|LaunchFlags]] and [[NCM_services#ApplicationId|ApplicationId]], returns an output u64 PID.
 
Same as LaunchApplicationWithStorageId except the last two params passed to the internal vtable funcptr call are value 0x6, instead of from the command input.
 
== LaunchApplicationWithStorageIdForDevelop ==
Takes 2 input u8s, an u32 [[Process_Manager_services#LaunchFlags|LaunchFlags]], and an [[NCM_services#ApplicationId|ApplicationId]]. Returns an output u64 PID.
 
Launches an application title which is registered with NS.
 
== CreateApplicationResourceForDevelop ==
Takes an input u32 (1 = Preomia). Returns an [[#IApplicationResource]].
 
== IsPreomiaForDevelop ==
Takes an u64 [[NCM_services#ProgramId|ProgramId]]. Returns a bool.
 
= VersionListData =
This is "nn::ns::VersionListData".
 
= ApplicationUpdateInfo =
This is "nn::ns::ApplicationUpdateInfo".
 
This is an u8. [[qlaunch]] just checks whether this is 0.
 
= ApplicationViewDeprecated =
This is "nn::ns::ApplicationViewDeprecated". This is a 0x40-byte struct.
 
This is converted from [[#ApplicationView]] by [[#GetApplicationViewDeprecated]] on newer system-versions as follows:
 
{| class="wikitable" border="1"
|-
|-
! Offset
| 0 || [[#GetBackgroundNetworkUpdateState]]
! Size
! Description
|-
|-
| 0x0 || 0x20 || Same as [[#ApplicationView]] +0x0.
| 1 || [[#OpenSystemUpdateControl]]
|-
|-
| 0x20 || 0x4 || Same as [[#ApplicationView]] +0x20.
| 2 || [[#NotifyExFatDriverRequired]]
|-
|-
| 0x24 || 0x2 || Same as [[#ApplicationView]] +0x24.
| 3 || [[#ClearExFatDriverStatusForDebug]]
|-
| 4 || [[#RequestBackgroundNetworkUpdate]]
|-
|-
| 0x26 || 0x2 || Cleared to 0.
| 5 || [[#NotifyBackgroundNetworkUpdate]]
|-
|-
| 0x28 || 0x10 || Same as [[#ApplicationView]] +0x30.
| 6 || [[#NotifyExFatDriverDownloadedForDebug]]
|-
|-
| 0x38 || 0x4 || Same as [[#ApplicationView]] +0x40.
| 9 || [[#GetSystemUpdateNotificationEventForContentDelivery]]
|-
|-
| 0x3C || 0x1 || Same as [[#ApplicationView]] +0x44.
| 10 || [[#NotifySystemUpdateForContentDelivery]]
|-
|-
| 0x3D || 0x2 || Cleared to 0.
| 11 || [3.0.0+] [[#PrepareShutdown]]
|-
|-
| 0x3F || 0x1 || Cleared to 0.
| 12 || [3.0.0-3.0.2]
|}
 
= ApplicationView =
This is "nn::ns::ApplicationView". This is a 0x50-byte struct.
 
{| class="wikitable" border="1"
|-
|-
! Offset
| 13 || [3.0.0-3.0.2]
! Size
! Description
|-
|-
| 0x0 || 0x8 || [[NCM_services#ApplicationId|ApplicationId]]
| 14 || [3.0.0-3.0.2]
|-
|-
| 0x8 || 0x4 || ?
| 15 || [3.0.0-3.0.2]
|-
|-
| 0xC || 0x4 || Flags
| 16 || [4.0.0+] [[#DestroySystemUpdateTask]]
|-
|-
| 0x10 || 0x40 || ?
| 17 || [4.0.0+] [[#RequestSendSystemUpdate]]
|}
|-
| 18 || [4.0.0+] [[#GetSendSystemUpdateProgress]]
|}


= ApplicationViewWithPromotionInfo =
== GetBackgroundNetworkUpdateState ==
This is a 0x70-byte struct.
No input, returns an output [[#BackgroundNetworkUpdateState]].
 
This is similar to [[#HasDownloaded]], see [[#BackgroundNetworkUpdateState]].


{| class="wikitable" border="1"
== OpenSystemUpdateControl ==
|-
No input, returns an [[#ISystemUpdateControl]].
! Offset
! Size
! Description
|-
| 0x0 || 0x50 || [[#ApplicationView]]
|-
| 0x50 || 0x20 || [[#PromotionInfo]]
|}


= PromotionInfo =
== NotifyExFatDriverRequired ==
This is a 0x20-byte struct.
No input/output.


{| class="wikitable" border="1"
Only usable when an [[#ISystemUpdateControl]] isn't open.
|-
 
! Offset
This uses [[NIM_services|nim]] ListSystemUpdateTask, then when a task is returned uses it with DestroySystemUpdateTask.
! Size
 
! Description
Then this runs ExFat handling, updates state, and sets the same state flag as [[#RequestBackgroundNetworkUpdate]].
|-
 
| 0x0 || 0x8 || PosixTime start_timestamp.
== ClearExFatDriverStatusForDebug ==
|-
No input/output.
| 0x8 || 0x8 || PosixTime end_timestamp.
 
|-
== RequestBackgroundNetworkUpdate ==
| 0x10 || 0x8 || Remaining time until the promotion ends, in nanoseconds ({end_timestamp - current_time} converted to nanoseconds).
No input/output.
|-
 
| 0x18 || 0x4 || Not set, left at zero.
Only usable when an [[#ISystemUpdateControl]] isn't open.
|-
 
| 0x1C || 0x1 || Flags. Bit0: whether the PromotionInfo is valid (including bit1). Bit1 clear: u64 +0x10 is set.
This sets a state flag to value 1.
|-
 
| 0x1D || 0x3 || Padding
== NotifyBackgroundNetworkUpdate ==
|}
Takes an input [[NCM_services#ContentMetaKey|ContentMetaKey]], no output.
 
 
= NoDownloadRightsErrorResolution =
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 is "nn::ns::NoDownloadRightsErrorResolution".
 
 
== NotifyExFatDriverDownloadedForDebug ==
= BackgroundNetworkUpdateState =
No input/output.
{| class="wikitable" border="1"
 
|-
== GetSystemUpdateNotificationEventForContentDelivery ==
!  Value
No input, returns an output Event handle with EventClearMode=0.
!  Description
 
|-
== NotifySystemUpdateForContentDelivery ==
| 0 || No sysupdate task exists.
No input/output.
|-
 
| 1 || Sysupdate download in progress.
Signals the Event returned by [[#GetSystemUpdateNotificationEventForContentDelivery]].
|-
 
| 2 || Sysupdate ready, pending install.
== PrepareShutdown ==
No input/output.
 
This is used by [[AM_services|AM]].
 
Just returns 0 when an [[#ISystemUpdateControl]] is open.
 
This does various cleanup / uses various service-cmds etc for shutdown preparation.
 
== DestroySystemUpdateTask ==
No input/output.
 
Only usable when an [[#ISystemUpdateControl]] isn't open.
 
This uses [[NIM_services|nim]] ListSystemUpdateTask, then when a task is returned uses it with DestroySystemUpdateTask.
 
== RequestSendSystemUpdate ==
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
|-
| 0 || [[#HasDownloaded]]
|-
| 1 || [[#RequestCheckLatestUpdate]]
|-
| 2 || [[#RequestDownloadLatestUpdate]]
|-
| 3 || [[#GetDownloadProgress]]
|-
| 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]]
|}
 
Only 1 ISystemUpdateControl can be open at a time.
 
All Card cmds except SetupCardUpdate* require [[#SetupCardUpdate]]/[[#SetupCardUpdateViaSystemUpdater]] to be used previously. [[#GetPreparedCardUpdateEulaDataSize]]/[[#GetPreparedCardUpdateEulaData]] checks a different state flag.
 
=== HasDownloaded ===
No input, returns an output u8 bool flag.
 
Gets whether a network sysupdate was downloaded, with install pending.
 
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.
 
This always returns 0, however this will assert if GetSystemUpdateTaskInfo fails with ret!=0x3C89.
 
=== RequestCheckLatestUpdate ===
No input, returns an output Event handle and an [[#IAsyncValue]].
 
The data that can be read from the [[#IAsyncValue]] is [[#LatestSystemUpdate]].
 
=== RequestDownloadLatestUpdate ===
No input, returns an output Event handle and an [[#IAsyncResult]].
 
=== GetDownloadProgress ===
No input, returns an output [[#SystemUpdateProgress]].
 
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.
 
=== ApplyDownloadedUpdate ===
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:
 
* 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.
 
=== RequestPrepareCardUpdate ===
No input, returns an output Event handle and an [[#IAsyncResult]].
 
=== GetPrepareCardUpdateProgress ===
No input, returns an output [[#SystemUpdateProgress]].
 
=== HasPreparedCardUpdate ===
No input, returns an output u8 bool flag.
 
=== ApplyCardUpdate ===
No input/output.
 
=== GetDownloadedEulaDataSize ===
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.
 
Uses ListSystemUpdateTask again. Then [[NIM_services|nim]] GetDownloadedSystemDataPath, with the output ContentPath being used to mount the EULA title with FS.
 
Then "<mountname>:/<[[#EulaDataPath]]>" is opened, gets the '''filesize''', then runs cleanup.
 
=== GetDownloadedEulaData ===
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.
 
=== SetupCardUpdate ===
Takes an input u64 size and a TransferMemory handle, no output.
 
Official sw creates the TransferMemory with an user-specified buffer, with permissions=None.
 
[[qlaunch]] uses size 0x100000 for the TransferMemory buffer.
 
=== GetPreparedCardUpdateEulaDataSize ===
Takes a type-0x15 input buffer [[#EulaDataPath]], returns an output u64 '''filesize'''.
 
This is similar to [[#GetDownloadedEulaDataSize]].
 
=== GetPreparedCardUpdateEulaData ===
Takes a type-0x15 input buffer [[#EulaDataPath]] and a type-0x6 output buffer, returns an output u64 '''filesize'''.
 
This is similar to [[#GetDownloadedEulaData]].
 
=== SetupCardUpdateViaSystemUpdater ===
Takes an input u64 size and a TransferMemory handle, no output.
 
The permissions for the TransferMemory is None.
 
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.
 
=== HasReceived ===
No input, returns an output u8 bool.
 
Same as [[#HasDownloaded]] except this uses [[NIM_services|nim]] cmd71 and cmd73.
 
=== RequestReceiveSystemUpdate ===
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).
 
[[NIM_services|NIM]] will use the input addr/port with [[Sockets_services|connect()]].
 
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:
** 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"
 
=== GetReceiveProgress ===
No input, returns an output [[#SystemUpdateProgress]].
 
Same as [[#GetDownloadProgress]] except this uses [[NIM_services|nim]] cmd71 and cmd73.
 
=== ApplyReceivedUpdate ===
No input/output.
 
=== GetReceivedEulaDataSize ===
Takes a type-0x15 input buffer [[#EulaDataPath]], returns an output u64 '''filesize'''.
 
This is similar to [[#GetDownloadedEulaDataSize]].
 
=== GetReceivedEulaData ===
Takes a type-0x15 input buffer [[#EulaDataPath]] and a type-0x6 output buffer, returns an output u64 '''filesize'''.
 
This is similar to [[#GetDownloadedEulaData]].
 
=== SetupToReceiveSystemUpdate ===
No input/output.
 
This just uses [[NIM_services|nim]] ListSystemUpdateTask, then when a task is returned uses it with DestroySystemUpdateTask.
 
[[qlaunch]] uses this before [[#RequestReceiveSystemUpdate]].
 
=== RequestCheckLatestUpdateIncludesRebootlessUpdate ===
No input, returns an output Event handle and an [[#IAsyncValue]].
 
= IAsyncValue =
This is "nn::ns::detail::IAsyncValue".
 
{| class="wikitable" border="1"
|-
! 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.
 
* 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".
 
{| class="wikitable" border="1"
|-
! Cmd || Name
|-
| 0 || Get
|-
| 1 || Cancel
|-
| 2 || [4.0.0+] GetErrorContext
|}
 
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.
 
* Get: No input/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]].
 
= ns:dev =
This is "nn::ns::detail::IDevelopInterface".
 
[10.0.0+] Some of these cmds were replaced by the [[PGL_services|pgl]] system module.
 
{| class="wikitable" border="1"
|-
! 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+] PrepareLaunchApplication
|-
| 22 || [18.0.0+] LaunchApplicationForDevelop
|-
| 23 || [18.0.0+] GetProgramIdByApplicationLaunchInfo
|-
| 24 || [18.0.0+] DestroyApplicationLaunchPreparation
|}
 
== LaunchProgram ==
Wrapper for "pm:shell" [[Process_Manager_services#pm:shell|LaunchProcess]].
 
== TerminateProcess ==
Wrapper for "pm:shell" [[Process_Manager_services#pm:shell|TerminateProcess]].
 
== TerminateProgram ==
Wrapper for "pm:shell" [[Process_Manager_services#pm:shell|TerminateProgram]].
 
== GetShellEvent ==
Wrapper for "pm:shell" [[Process_Manager_services#pm:shell|GetProcessEventHandle]].
 
== GetShellEventInfo ==
Wrapper for "pm:shell" [[Process_Manager_services#pm:shell|GetProcessEventInfo]].
 
== TerminateApplication ==
Calls "pm:shell" [[Process_Manager_services#pm:shell|GetApplicationProcessIdForShell]] and sends the ProcessId to [[Process_Manager_services#pm:shell|TerminateProcess]].
 
== PrepareLaunchProgramFromHost ==
Takes a type-0x5 input buffer containing the [[Filesystem_services#FspPath|FspPath]], returns an output 0x10-byte struct.
 
Calls [[NCM_services#IPathResolverForStorage|IPathResolverForStorage]] Set...NcaPath functions.
 
== LaunchApplicationForDevelop ==
Takes an input u32 [[Process_Manager_services#LaunchFlags|LaunchFlags]] and [[NCM_services#ApplicationId|ApplicationId]], returns an output u64 ProcessId.
 
Same as [[#LaunchApplicationWithStorageIdForDevelop]] except the last two params passed to the internal vtable funcptr call are value 0x6, instead of from the command input.
 
== 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.
 
== LaunchApplicationWithStorageIdForDevelop ==
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.
 
Launches an application title which is registered with NS.
 
== IsSystemMemoryResourceLimitBoosted ==
No input. Returns a bool.
 
== GetRunningApplicationProcessIdForDevelop ==
Returns an output u64 ProcessId.
 
== SetCurrentApplicationRightsEnvironmentCanBeActiveForDevelop ==
Takes an input bool. No output.
 
== CreateApplicationResourceForDevelop ==
Takes an input u32 (1 = Preomia/MicroApplication). Returns an [[#IApplicationResource]].
 
== IsPreomiaForDevelop ==
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.
 
= 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"
|-
! Cmd || Name || Notes
|-
| 0 || GetUserCount ||
|-
| 1 || GetUserExistence ||
|-
| 2 || ListAllUsers ||
|-
| 3 || ListOpenUsers ||
|-
| 4 || GetLastOpenedUser ||
|-
| 5 || GetProfile || Returns an [[#IProfile]].
|-
| 6 || [3.0.0+] GetProfileDigest ||
|-
| 50 || [[#IsUserRegistrationRequestPermitted]] ||
|-
| 51 || TrySelectUserWithoutInteractionDeprecated ([1.0.0-18.1.0] [[#TrySelectUserWithoutInteraction]]) ||
|-
| 52 || [19.0.0+] TrySelectUserWithoutInteraction ||
|-
| 60 || [5.0.0-5.1.0] ListOpenContextStoredUsers ||
|-
| 99 || [6.0.0+] DebugActivateOpenContextRetention || No input, returns an [[#ISessionObject]].
|-
| 100 || GetUserRegistrationNotifier || Returns an [[#INotifier]].
|-
| 101 || GetUserStateChangeNotifier || Returns an [[#INotifier]].
|-
| 102 || GetBaasAccountManagerForSystemService || Returns an [[#IManagerForSystemService]].
|-
| 103 || GetBaasUserAvailabilityChangeNotifier || Returns an [[#INotifier]].
|-
| 104 || GetProfileUpdateNotifier || Returns an [[#INotifier]].
|-
| 105 || [4.0.0+] CheckNetworkServiceAvailabilityAsync || Returns an [[#IAsyncContext]].
|-
| 106 || [9.0.0+] GetProfileSyncNotifier ||
|-
| 110 || StoreSaveDataThumbnail ||
|-
| 111 || ClearSaveDataThumbnail ||
|-
| 112 || LoadSaveDataThumbnail ||
|-
| 113 || [5.0.0+] GetSaveDataThumbnailExistence ||
|-
| 120 || [10.0.0+] ListOpenUsersInApplication ||
|-
| 130 || [6.0.0+] ActivateOpenContextRetention || Takes a total of 0x8-bytes of input, returns an [[#ISessionObject]].
|-
| 140 || [6.0.0+] ListQualifiedUsers ||
|-
| 150 || [10.0.0-10.2.0] AuthenticateApplicationAsync ||
|-
| 151 || [12.0.0+] EnsureSignedDeviceIdentifierCacheForNintendoAccountAsync ||
|-
| 152 || [12.0.0+] LoadSignedDeviceIdentifierCacheForNintendoAccount ||
|-
| 170 || [13.0.0+] GetNasOp2MembershipStateChangeNotifier ||
|-
| 190 || [1.0.0-9.2.0] GetUserLastOpenedApplication ||
|-
| 191 || [7.0.0+] UpdateNotificationReceiverInfo ([5.0.0-5.1.0] ActivateOpenContextHolder) ||
|-
| 200 || BeginUserRegistration ||
|-
| 201 || CompleteUserRegistration ||
|-
| 202 || CancelUserRegistration ||
|-
| 203 || DeleteUser ||
|-
| 204 || SetUserPosition ||
|-
| 205 || GetProfileEditor || Takes an input userID and returns an [[#IProfileEditor]].
|-
| 206 || CompleteUserRegistrationForcibly ||
|-
| 210 || [3.0.0+] CreateFloatingRegistrationRequest || Returns an [[#IFloatingRegistrationRequest]].
|-
| 211 || [8.0.0+] CreateProcedureToRegisterUserWithNintendoAccount || Takes a total of 0x4-bytes of input and a handle, returns an [[#IOAuthProcedureForUserRegistration]].
|-
| 212 || [8.0.0+] ResumeProcedureToRegisterUserWithNintendoAccount || Takes a total of 0x14-bytes of input and a handle, returns an [[#IOAuthProcedureForUserRegistration]].
|-
| 213 || [17.0.0+] CreateProcedureToCreateUserWithNintendoAccount ||
|-
| 214 || [17.0.0+] ResumeProcedureToCreateUserWithNintendoAccount ||
|-
| 215 || [17.0.0+] ResumeProcedureToCreateUserWithNintendoAccountAfterApplyResponse ||
|-
| 230 || AuthenticateServiceAsync || Returns an [[#IAsyncContext]].
|-
| 250 || GetBaasAccountAdministrator || Returns an [[#IAdministrator]].
|-
| 290 || ProxyProcedureForGuestLoginWithNintendoAccount || Returns an [[#IOAuthProcedureForExternalNsa]] (formerly [[#IOAuthProcedureForGuestLogin]] with [1.0.0-2.3.0]).
|-
| 291 || [3.0.0+] ProxyProcedureForFloatingRegistrationWithNintendoAccount || Returns an [[#IOAuthProcedureForExternalNsa]].
|-
| 299 || SuspendBackgroundDaemon || Returns an [[#ISessionObject]].
|-
| 400 || [18.0.0+] SetPinCode ||
|-
| 401 || [18.0.0+] GetPinCodeLength ||
|-
| 402 || [18.0.0+] GetPinCode ||
|-
| 410 || [18.0.0+] GetPinCodeErrorCount ||
|-
| 411 || [18.0.0+] ResetPinCodeErrorCount ||
|-
| 412 || [18.0.0+] IncrementPinCodeErrorCount ||
|-
| 420 || [19.0.0+] SetStartPenaltyTime ||
|-
| 421 || [19.0.0+] GetStartPenaltyTime ||
|-
| 900 || [13.0.0+] SetUserUnqualifiedForDebug ||
|-
| 901 || [13.0.0+] UnsetUserUnqualifiedForDebug ||
|-
| 902 || [13.0.0+] ListUsersUnqualifiedForDebug ||
|-
| 910 || [16.0.0+] RefreshFirmwareSettingsForDebug ||
|-
| 997 || [3.0.0+] DebugInvalidateTokenCacheForUser ||
|-
| 998 || DebugSetUserStateClose ||
|-
| 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"
|-
! Cmd || Name || Notes
|-
| 0 || CheckAvailability ||
|-
| 1 || GetAccountId ||
|-
| 2 || EnsureIdTokenCacheAsync || Returns an [[#IAsyncContext]].
|-
| 3 || LoadIdTokenCache ||
|-
| 100 || SetSystemProgramIdentification ||
|-
| 101 || [7.0.0+] RefreshNotificationTokenAsync ||
|-
| 110 || [4.0.0+] GetServiceEntryRequirementCache ||
|-
| 111 || [4.0.0+] InvalidateServiceEntryRequirementCache ||
|-
| 112 || [4.0.0-6.2.0] InvalidateTokenCache ||
|-
| 113 || [6.1.0+] GetServiceEntryRequirementCacheForOnlinePlay || Takes a total of 0x8-bytes of input, returns a total of 0x4-bytes of output.
|-
| 120 || GetNintendoAccountId ||
|-
| 121 || [9.0.0+] CalculateNintendoAccountAuthenticationFingerprint ||
|-
| 130 || GetNintendoAccountUserResourceCache ||
|-
| 131 || RefreshNintendoAccountUserResourceCacheAsync || Returns an [[#IAsyncContext]].
|-
| 132 || RefreshNintendoAccountUserResourceCacheAsyncIfSecondsElapsed || Returns an [[#IAsyncContext]].
|-
| 133 || [9.0.0+] GetNintendoAccountVerificationUrlCache ||
|-
| 134 || [9.0.0+] RefreshNintendoAccountVerificationUrlCacheAsync ||
|-
| 135 || [9.0.0+] RefreshNintendoAccountVerificationUrlCacheAsyncIfSecondsElapsed ||
|-
| 140 || [5.0.0+] GetNetworkServiceLicenseCache ||
|-
| 141 || [5.0.0+] RefreshNetworkServiceLicenseCacheAsync || Returns an [[#IAsyncContext]].
|-
| 142 || [5.0.0+] RefreshNetworkServiceLicenseCacheAsyncIfSecondsElapsed || Returns an [[#IAsyncContext]].
|-
| 150 || CreateAuthorizationRequest || Returns an [[#IAuthorizationRequest]].
|-
| 160 || [15.0.0+] RequiresUpdateNetworkServiceAccountIdTokenCache ||
|-
| 161 || [16.0.0+] RequireReauthenticationOfNetworkServiceAccount ||
|-
| 170 || [17.0.0+] CreateDeviceHistoryRequest ||
|-
| 180 || [18.0.0+] GetRequestForNintendoAccountReauthentication ||
|}
 
== IFloatingRegistrationRequest ==
This is "nn::account::baas::IFloatingRegistrationRequest".
 
Added with [3.0.0+].
 
{| class="wikitable" border="1"
|-
! Cmd || Name || Notes
|-
| 0 || GetSessionId ||
|-
| 12 || GetAccountId ||
|-
| 13 || GetLinkedNintendoAccountId ||
|-
| 14 || GetNickname ||
|-
| 15 || GetProfileImage ||
|-
| 16 || [18.0.0+] GetProfileLargeImage ||
|-
| 21 || LoadIdTokenCache ||
|-
| 100 || RegisterUser ([1.0.0-3.0.2] RegisterAsync) || [1.0.0-3.0.2] Used to return an [[#IAsyncContext]].
|-
| 101 || RegisterUserWithUid ([1.0.0-3.0.2] RegisterWithUidAsync) || [1.0.0-3.0.2] Used to return an [[#IAsyncContext]].
|-
| 102 || [4.0.0+] RegisterNetworkServiceAccountAsync || Returns an [[#IAsyncContext]].
|-
| 103 || [4.0.0+] RegisterNetworkServiceAccountWithUidAsync || Returns an [[#IAsyncContext]].
|-
| 110 || SetSystemProgramIdentification ||
|-
| 111 || EnsureIdTokenCacheAsync || Returns an [[#IAsyncContext]].
|}
 
== IAdministrator ==
This is "nn::account::baas::IAdministrator".
 
{| class="wikitable" border="1"
|-
! Cmd || Name || Notes
|-
| 0 || CheckAvailability ||
|-
| 1 || GetAccountId ||
|-
| 2 || EnsureIdTokenCacheAsync || Returns an [[#IAsyncContext]].
|-
| 3 || LoadIdTokenCache ||
|-
| 100 || SetSystemProgramIdentification ||
|-
| 101 || [7.0.0+] RefreshNotificationTokenAsync
|-
| 110 || [4.0.0+] GetServiceEntryRequirementCache ||
|-
| 111 || [4.0.0+] InvalidateServiceEntryRequirementCache ||
|-
| 112 || [4.0.0-6.2.0] InvalidateTokenCache ||
|-
| 113 || [6.1.0+] GetServiceEntryRequirementCacheForOnlinePlay || Takes a total of 0x8-bytes of input, returns a total of 0x4-bytes of output.
|-
| 120 || GetNintendoAccountId ||
|-
| 121 || [9.0.0+] CalculateNintendoAccountAuthenticationFingerprint ||
|-
| 130 || GetNintendoAccountUserResourceCache ||
|-
| 131 || RefreshNintendoAccountUserResourceCacheAsync || Returns an [[#IAsyncContext]].
|-
| 132 || RefreshNintendoAccountUserResourceCacheAsyncIfSecondsElapsed || Returns an [[#IAsyncContext]].
|-
| 133 || [9.0.0+] GetNintendoAccountVerificationUrlCache ||
|-
| 134 || [9.0.0+] RefreshNintendoAccountVerificationUrlCacheAsync ||
|-
| 135 || [9.0.0+] RefreshNintendoAccountVerificationUrlCacheAsyncIfSecondsElapsed ||
|-
| 140 || [5.0.0+] GetNetworkServiceLicenseCache ||
|-
| 141 || [5.0.0+] RefreshNetworkServiceLicenseCacheAsync ||
|-
| 142 || [5.0.0+] RefreshNetworkServiceLicenseCacheAsyncIfSecondsElapsed ||
|-
| 150 || CreateAuthorizationRequest || Returns an [[#IAuthorizationRequest]].
|-
| 160 || [15.0.0+] RequiresUpdateNetworkServiceAccountIdTokenCache ||
|-
| 161 || [16.0.0+] RequireReauthenticationOfNetworkServiceAccount ||
|-
| 170 || [17.0.0+] CreateDeviceHistoryRequest ||
|-
| 180 || [18.0.0+] GetRequestForNintendoAccountReauthentication ||
|-
| 200 || IsRegistered ||
|-
| 201 || RegisterAsync || Returns an [[#IAsyncContext]].
|-
| 202 || UnregisterAsync || Returns an [[#IAsyncContext]].
|-
| 203 || DeleteRegistrationInfoLocally ||
|-
| 220 || SynchronizeProfileAsync || Returns an [[#IAsyncContext]].
|-
| 221 || UploadProfileAsync || Returns an [[#IAsyncContext]].
|-
| 222 || SynchronizeProfileAsyncIfSecondsElapsed || Returns an [[#IAsyncContext]].
|-
| 250 || IsLinkedWithNintendoAccount ||
|-
| 251 || CreateProcedureToLinkWithNintendoAccount || Returns an [[#IOAuthProcedureForNintendoAccountLinkage]].
|-
| 252 || ResumeProcedureToLinkWithNintendoAccount || Returns an [[#IOAuthProcedureForNintendoAccountLinkage]].
|-
| 255 || CreateProcedureToUpdateLinkageStateOfNintendoAccount || Returns an [[#IOAuthProcedure]].
|-
| 256 || ResumeProcedureToUpdateLinkageStateOfNintendoAccount || Returns an [[#IOAuthProcedure]].
|-
| 260 || [3.0.0+] CreateProcedureToLinkNnidWithNintendoAccount || Returns an [[#IOAuthProcedure]].
|-
| 261 || [3.0.0+] ResumeProcedureToLinkNnidWithNintendoAccount || Returns an [[#IOAuthProcedure]].
|-
| 280 || ProxyProcedureToAcquireApplicationAuthorizationForNintendoAccount || Returns an [[#IOAuthProcedure]].
|-
| 290 || [8.0.0+] GetRequestForNintendoAccountUserResourceView ||
|-
| 300 || [6.0.0+] TryRecoverNintendoAccountUserStateAsync || Returns an [[#IAsyncContext]].
|-
| 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]].
|-
| 410 || [13.1.0+] CheckRequiredLicenseForLexAsync ||
|-
| 900 || [9.0.0+] GetAuthenticationInfoForWin ||
|-
| 901 || [9.0.0+] ImportAsyncForWin ||
|-
| 997 || DebugUnlinkNintendoAccountAsync || Returns an [[#IAsyncContext]].
|-
| 998 || DebugSetAvailabilityErrorDetail ||
|}
 
== IAuthorizationRequest ==
This is "nn::account::nas::IAuthorizationRequest".
 
{| class="wikitable" border="1"
|-
! Cmd || Name || Notes
|-
| 0 || GetSessionId ||
|-
| 10 || InvokeWithoutInteractionAsync || Returns an [[#IAsyncContext]].
|-
| 19 || IsAuthorized ||
|-
| 20 || GetAuthorizationCode ||
|-
| 21 || GetIdToken ||
|-
| 22 || GetState ||
|}
 
== IOAuthProcedure ==
This is "nn::account::http::IOAuthProcedure".
 
{| class="wikitable" border="1"
|-
! Cmd || Name || Notes
|-
| 0 || PrepareAsync || Returns an [[#IAsyncContext]].
|-
| 1 || GetRequest ||
|-
| 2 || ApplyResponse ||
|-
| 3 || ApplyResponseAsync || Returns an [[#IAsyncContext]].
|-
| 10 || Suspend ||
|}
 
== IOAuthProcedureForExternalNsa ==
This is "nn::account::nas::IOAuthProcedureForExternalNsa".
 
Added with [3.0.0+].
 
{| class="wikitable" border="1"
|-
! Cmd || Name || Notes
|-
| 0 || PrepareAsync || Returns an [[#IAsyncContext]].
|-
| 1 || GetRequest ||
|-
| 2 || ApplyResponse ||
|-
| 3 || ApplyResponseAsync || Returns an [[#IAsyncContext]].
|-
| 10 || Suspend ||
|-
| 100 || GetAccountId ||
|-
| 101 || GetLinkedNintendoAccountId ||
|-
| 102 || GetNickname ||
|-
| 103 || GetProfileImage ||
|-
| 104 || [18.0.0+] GetProfileLargeImage ||
|}
 
== IOAuthProcedureForNintendoAccountLinkage ==
This is "nn::account::nas::IOAuthProcedureForNintendoAccountLinkage".
 
{| class="wikitable" border="1"
|-
! Cmd || Name || Notes
|-
| 0 || PrepareAsync || Returns an [[#IAsyncContext]].
|-
| 1 || GetRequest ||
|-
| 2 || ApplyResponse ||
|-
| 3 || ApplyResponseAsync || Returns an [[#IAsyncContext]].
|-
| 10 || Suspend ||
|-
| 100 || GetRequestWithTheme ||
|-
| 101 || IsNetworkServiceAccountReplaced ||
|-
| 199 || [2.0.0-5.1.0] GetUrlForIntroductionOfExtraMembership ||
|-
| 200 || [16.0.0+] ApplyAsyncWithAuthorizedToken ||
|}
 
== INotifier ==
This is "nn::account::detail::INotifier".
 
{| class="wikitable" border="1"
|-
! Cmd || Name
|-
| 0 || GetSystemEvent
|}
 
== IProfile ==
This is "nn::account::profile::IProfile".
 
{| class="wikitable" border="1"
|-
! Cmd || Name
|-
| 0 || [[#Get]]
|-
| 1 || [[#GetBase]]
|-
| 10 || [[#GetImageSize]]
|-
| 11 || [[#LoadImage]]
|-
| 20 || [18.0.0+] GetLargeImageSize
|-
| 21 || [18.0.0+] LoadLargeImage
|-
| 30 || [18.0.0+] GetImageId
|}
 
=== Get ===
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"
|-
! Cmd || Name
|-
| 0 || [[#Get]]
|-
| 1 || [[#GetBase]]
|-
| 10 || [[#GetImageSize]]
|-
| 11 || [[#LoadImage]]
|-
| 20 || [18.0.0+] GetLargeImageSize
|-
| 21 || [18.0.0+] LoadLargeImage
|-
| 30 || [18.0.0+] GetImageId
|-
| 100 || [[#Store]]
|-
| 101 || [[#StoreWithImage]]
|-
| 110 || [18.0.0+] StoreWithLargeImage
|}
 
=== Store ===
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.
 
== IAsyncContext ==
This is "nn::account::detail::IAsyncContext".
 
{| class="wikitable" border="1"
|-
! Cmd || Name
|-
| 0 || GetSystemEvent
|-
| 1 || Cancel
|-
| 2 || HasDone
|-
| 3 || GetResult
|}
 
== ISessionObject ==
This is "nn::account::detail::ISessionObject".
 
{| class="wikitable" border="1"
|-
! Cmd || Name
|-
| 999 || Dummy
|}
 
= acc:u0 =
This is "nn::account::IAccountServiceForApplication".
 
[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"
|-
! Cmd || Name || Notes
|-
| 0 || GetUserCount ||
|-
| 1 || GetUserExistence ||
|-
| 2 || ListAllUsers ||
|-
| 3 || ListOpenUsers ||
|-
| 4 || GetLastOpenedUser ||
|-
| 5 || GetProfile || Takes an input userID, returns an [[#IProfile]].
|-
| 6 || [3.0.0+] GetProfileDigest ||
|-
| 50 || [[#IsUserRegistrationRequestPermitted]] ||
|-
| 51 || TrySelectUserWithoutInteractionDeprecated ([1.0.0-18.1.0] [[#TrySelectUserWithoutInteraction]]) ||
|-
| 52 || [19.0.0+] TrySelectUserWithoutInteraction ||
|-
| 60 || [5.0.0-5.1.0] ListOpenContextStoredUsers ||
|-
| 99 || [6.0.0+] DebugActivateOpenContextRetention || No input, returns an [[#ISessionObject]].
|-
| 100 || [[#InitializeApplicationInfoV0]] ||
|-
| 101 || GetBaasAccountManagerForApplication || Takes an input userID, returns an [[#IManagerForApplication]].
|-
| 102 || AuthenticateApplicationAsync || Returns an [[#IAsyncContext]].
|-
| 103 || [4.0.0+] CheckNetworkServiceAvailabilityAsync || Returns an [[#IAsyncContext]].
|-
| 110 || StoreSaveDataThumbnail ||
|-
| 111 || ClearSaveDataThumbnail ||
|-
| 120 || CreateGuestLoginRequest || Returns an [[#IGuestLoginRequest]].
|-
| 130 || [5.0.0+] LoadOpenContext ||
|-
| 131 || [6.0.0+] ListOpenContextStoredUsers ||
|-
| 140 || [6.0.0+] [[#InitializeApplicationInfoV1]] ||
|-
| 141 || [6.0.0+] ListQualifiedUsers ||
|-
| 150 || [6.0.0+] IsUserAccountSwitchLocked ||
|-
| 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"
|-
! Cmd || Name
|-
| 0 || GetSessionId
|-
| 11 || [1.0.0-2.3.0]
|-
| 12 || GetAccountId
|-
| 13 || GetLinkedNintendoAccountId
|-
| 14 || GetNickname
|-
| 15 || GetProfileImage
|-
| 16 || [18.0.0+] GetProfileLargeImage
|-
| 21 || [3.0.0+] LoadIdTokenCache
|}
 
== IManagerForApplication ==
This is "nn::account::baas::IManagerForApplication".
 
{| class="wikitable" border="1"
|-
! Cmd || Name || Notes
|-
| 0 || CheckAvailability ||
|-
| 1 || GetAccountId ||
|-
| 2 || EnsureIdTokenCacheAsync || Returns an [[#IAsyncContext]].
|-
| 3 || LoadIdTokenCache ||
|-
| 130 || GetNintendoAccountUserResourceCacheForApplication ||
|-
| 150 || CreateAuthorizationRequest || Returns an [[#IAuthorizationRequest]].
|-
| 160 || [5.0.0+] StoreOpenContext ||
|-
| 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"
|-
! Cmd || Name || Notes
|-
| 0 || GetSystemEvent ||
|-
| 1 || Cancel ||
|-
| 2 || HasDone ||
|-
| 3 || GetResult ||
|-
| 100 || GetNetworkServiceLicenseKind ||
|}
 
== IAsyncContextForLoginForOnlinePlay ==
This is "nn::account::baas::IAsyncContextForLoginForOnlinePlay".
 
This was added with [13.0.0+].
 
{| class="wikitable" border="1"
|-
! Cmd || Name || Notes
|-
| 0 || GetSystemEvent ||
|-
| 1 || Cancel ||
|-
| 2 || HasDone ||
|-
| 3 || GetResult ||
|-
| 100 || GetNetworkServiceLicenseInfoForOnlinePlay ||
|}
 
= acc:u1 =
This is "nn::account::IAccountServiceForSystemService".
 
[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"
|-
! Cmd || Name || Notes
|-
| 0 || GetUserCount ||
|-
| 1 || GetUserExistence ||
|-
| 2 || ListAllUsers ||
|-
| 3 || ListOpenUsers ||
|-
| 4 || GetLastOpenedUser ||
|-
| 5 || GetProfile || Returns an [[#IProfile]].
|-
| 6 || [3.0.0+] GetProfileDigest ||
|-
| 50 || [[#IsUserRegistrationRequestPermitted]] ||
|-
| 51 || TrySelectUserWithoutInteractionDeprecated ([1.0.0-18.1.0] [[#TrySelectUserWithoutInteraction]]) ||
|-
| 52 || [19.0.0+] TrySelectUserWithoutInteraction ||
|-
| 60 || [5.0.0-5.1.0] ListOpenContextStoredUsers ||
|-
| 99 || [6.0.0+] DebugActivateOpenContextRetention || No input, returns an [[#ISessionObject]].
|-
| 100 || GetUserRegistrationNotifier || Returns an [[#INotifier]].
|-
| 101 || GetUserStateChangeNotifier || Returns an [[#INotifier]].
|-
| 102 || GetBaasAccountManagerForSystemService || Returns an [[#IManagerForSystemService]].
|-
| 103 || GetBaasUserAvailabilityChangeNotifier || Returns an [[#INotifier]].
|-
| 104 || GetProfileUpdateNotifier || Returns an [[#INotifier]].
|-
| 105 || [4.0.0+] CheckNetworkServiceAvailabilityAsync || Returns an [[#IAsyncContext]].
|-
| 106 || [9.0.0+] GetProfileSyncNotifier ||
|-
| 110 || StoreSaveDataThumbnail ||
|-
| 111 || ClearSaveDataThumbnail ||
|-
| 112 || LoadSaveDataThumbnail ||
|-
| 113 || [5.0.0+] GetSaveDataThumbnailExistence ||
|-
| 120 || [10.0.0+] ListOpenUsersInApplication ||
|-
| 130 || [6.0.0+] ActivateOpenContextRetention || Takes a total of 0x8-bytes of input, returns an [[#ISessionObject]].
|-
| 140 || [6.0.0+] ListQualifiedUsers ||
|-
| 150 || [10.0.0-10.2.0] AuthenticateApplicationAsync ||
|-
| 151 || [12.0.0+] EnsureSignedDeviceIdentifierCacheForNintendoAccountAsync ||
|-
| 152 || [12.0.0+] LoadSignedDeviceIdentifierCacheForNintendoAccount ||
|-
| 170 || [13.0.0+] GetNasOp2MembershipStateChangeNotifier ||
|-
| 190 || [1.0.0-9.2.0] GetUserLastOpenedApplication ||
|-
| 191 || [7.0.0+] UpdateNotificationReceiverInfo ([5.0.0-5.1.0] ActivateOpenContextHolder) ||
|-
| 401 || [18.0.0+] GetPinCodeLength ||
|-
| 402 || [18.0.0+] GetPinCode ||
|-
| 997 || [3.0.0+] DebugInvalidateTokenCacheForUser ||
|-
| 998 || DebugSetUserStateClose ||
|-
| 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
|-
| 0 || PrepareAsync || No input, returns an [[#IAsyncContext]].
|-
| 1 || GetRequest ||
|-
| 2 || ApplyResponse ||
|-
| 3 || ApplyResponseAsync || Takes a type-0x9 input buffer, returns an [[#IAsyncContext]].
|-
| 10 || Suspend ||
|-
| 100 || GetAccountId ||
|-
| 101 || GetLinkedNintendoAccountId ||
|-
| 102 || GetNickname ||
|-
| 103 || GetProfileImage ||
|-
| 104 || [18.0.0+] GetProfileLargeImage ||
|-
| 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 ||
|}
 
= VersionListData =
This is "nn::ns::VersionListData".
 
= ApplicationUpdateInfo =
This is "nn::ns::ApplicationUpdateInfo". This is an u8.
 
{| class="wikitable" border="1"
|-
! Value
! Description
|-
| 0 || UpToDate
|-
| 1 || Updatable
|}
 
[[qlaunch]] just checks whether this is 0.
 
= ApplicationOccupiedSize =
This is "nn::ns::ApplicationOccupiedSize". This is a 0x80-byte struct.
 
{| class="wikitable" border="1"
|-
! Offset
! Size
! Description
|-
| 0x0 || 0x20 * 4 || Array of [[#ApplicationOccupiedSizeEntity]]
|}
 
= ApplicationOccupiedSizeEntity =
This is "nn::ns::ApplicationOccupiedSizeEntity". This is a 0x20-byte struct.
 
{| class="wikitable" border="1"
|-
! Offset
! Size
! Description
|-
| 0x0 || 0x1 || [[NCM_services#StorageId|StorageId]]
|-
| 0x1 || 0x7 || Reserved
|-
| 0x8 || 0x8 || AppSize
|-
| 0x10 || 0x8 || PatchSize
|-
| 0x18 || 0x8 || AocSize
|}
 
= ProgressForDeleteUserSaveDataAll =
This is "nn::ns::detail::ProgressForDeleteUserSaveDataAll". This is a 0x28-byte struct.
 
{| 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
|}
 
= ApplicationViewDeprecated =
This is "nn::ns::ApplicationViewDeprecated". This is a 0x40-byte struct.
 
{| class="wikitable" border="1"
|-
! Offset
! Size
! Description
|-
| 0x0 || 0x8 || [[NCM_services#ApplicationId|ApplicationId]]
|-
| 0x8 || 0x4 || Version
|-
| 0xC || 0x4 || [[#ApplicationViewFlag|Flag]]
|-
| 0x10 || 0x18 || [[#ApplicationDownloadProgress|Progress]]
|-
| 0x28 || 0x18 || [[#ApplicationApplyDeltaProgress|ApplyProgress]]
|}
 
This is converted from [[#ApplicationView]] by [[#GetApplicationViewDeprecated]] on newer system-versions as follows:
 
{| class="wikitable" border="1"
|-
! Offset
! Size
! Description
|-
| 0x0 || 0x20 || Same as [[#ApplicationView]] +0x0.
|-
| 0x20 || 0x4 || Same as [[#ApplicationView]] +0x20.
|-
| 0x24 || 0x2 || Same as [[#ApplicationView]] +0x24.
|-
| 0x26 || 0x2 || Cleared to 0.
|-
| 0x28 || 0x10 || Same as [[#ApplicationView]] +0x30.
|-
| 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.
 
{| 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.
 
{| 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.
|-
| 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.
|-
| 0xE0 || 0x20 || HMAC-SHA256 over the previous 0xE0-bytes.
|}
 
= ApplicationDeliveryInfo =
This is "nn::ns::ApplicationDeliveryInfo". This is a 0x100-byte struct.
 
{| class="wikitable" border="1"
|-
! Offset
! Size
! Description
|-
| 0x0 || 0x8 || ?
|-
| 0x8 || 0x8 || ApplicationId.
|-
| 0x10 || 0x4 || ApplicationVersion.
|-
| 0x14 || 0x4 || ?
|-
| 0x18 || 0x4 || RequiredSystemVersion.
|-
| 0x1C || 0x4 || ?
|-
| 0x20 || 0xC0 || ?
|-
| 0xE0 || 0x20 || HMAC-SHA256 over the previous 0xE0-bytes. Uses a different key than [[#SystemDeliveryInfo]].
|}
 
= LatestSystemUpdate =
This is "nn::ns::LatestSystemUpdate". This is an u8.
 
{| class="wikitable" border="1"
|-
! Value
! Description
|-
| 0 || UpToDate
|-
| 1 || Downloaded
|-
| 2 || NeedsDownload
|}
 
= ReceiveApplicationProgress =
This is "nn::ns::ReceiveApplicationProgress". This is a 0x10-byte struct.
 
= SendApplicationProgress =
This is "nn::ns::SendApplicationProgress". This is a 0x10-byte struct.
 
= ApplicationRightsOnClient =
This is a 0x20-byte struct.
 
{| class="wikitable" border="1"
|-
! Offset
! Size
! Description
|-
| 0x0 || 0x8 || [[NCM_services#ApplicationId|ApplicationId]]
|-
| 0x8 || 0x10 || [[Account_services#Uid|Uid]]
|-
| 0x18 || 0x1 || Flags, [[qlaunch]] only uses bit0-bit4 and bit7.
|-
| 0x19 || 0x1 || Flags, [[qlaunch]] only uses bit0.
|-
| 0x1A || 0x6 || Unknown
|}
 
[[qlaunch]] only uses +0x18/+0x19 in this struct.
 
= DownloadTaskStatus =
This is "nn::ns::DownloadTaskStatus". This is a 0x20-byte struct.
 
{| class="wikitable" border="1"
|-
! Offset
! Size
! Description
|-
| 0x0 || 0x10 || Uuid
|-
| 0x10 || 0x8 || [[NCM_services#ApplicationId|ApplicationId]]
|-
| 0x18 || 0x1 || [[#DownloadTaskStatusDetail|Detail]]
|-
| 0x19 || 0x1 || NeedsCleanup
|-
| 0x1A || 0x2 || Reserved
|-
| 0x1C || 0x4 || Result
|}
 
= DownloadTaskStatusDetail =
This is "nn::ns::DownloadTaskStatusDetail". This is an u8.
 
{| class="wikitable" border="1"
|-
! Value
! Description
|-
| 0 || Created
|-
| 1 || Added
|-
| 2 || AlreadyExists
|-
| 3 || Failed
|}
|}


This is "nn::ns::BackgroundNetworkUpdateState". This is an u8.
= ApplicationLaunchInfo =
This is a 0x40-byte struct.


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 =
{| class="wikitable" border="1"
{| class="wikitable" border="1"
|-
|-
Line 2,202: Line 4,127:
! Description
! Description
|-
|-
| 0x0 || 0x8 || s64 Current size. This value can be larger than total_size when the async operation is finishing. 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 || s64 Total size, this field is only valid when >0.
|}
 
This is "nn::ns::SystemUpdateProgress". This is a 0x10-byte struct.
 
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 =
{| 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.
| 0x8 || 0x4 || Application version
|-
|-
| 0x10 || 0x8 || SystemUpdateMetaId.
| 0xC || 0x4 || [[Process_Manager_services#LaunchFlags|LaunchFlags]], set to hard-coded value 0xB by [[#GetApplicationLaunchInfo]].
|-
|-
| 0x18 || 0x1 || FirmwareVariationId. Used by [[#RequestSendSystemUpdate]].
| 0x10 || 0x1 || Application [[NCM_services#StorageId|StorageId]]
|-
|-
| 0x19 || 0x1 || UpdatableFirmwareGroupId. Unused by [[#RequestSendSystemUpdate]]/[[#RequestReceiveSystemUpdate]], besides HMAC validation.
| 0x11 || 0x1 || Update [[NCM_services#StorageId|StorageId]]
|-
|-
| 0x1A || 0x1 || PlatformRegion (0x00 = Unknown, 0x01 = Global, 0x02 = China).
| 0x12 || 0x2E ||  
|-
| 0x1B || 0xC5 || Unused by [[#RequestSendSystemUpdate]]/[[#RequestReceiveSystemUpdate]], besides HMAC validation.
|-
| 0xE0 || 0x20 || HMAC-SHA256 over the previous 0xE0-bytes.
|}
|}


This is "nn::ns::SystemDeliveryInfo". This is a 0x100-byte struct.
= UserData =
This is a 0x80-byte struct.


= ApplicationDeliveryInfo =
{| class="wikitable" border="1"
{| class="wikitable" border="1"
|-
|-
! Offset
! Offset || Size || Description
! Size
! Description
|-
| 0x0 || 0x8 || ?
|-
| 0x8 || 0x8 || ApplicationId.
|-
|-
| 0x10 || 0x4 || ApplicationVersion.
| 0x0 || 0x4? || ?
|-
|-
| 0x14 || 0x4 || ?
| 0x4 || 0x4? || Icon ID. 0 = Mii, the rest are character icon IDs.
|-
|-
| 0x18 || 0x4 || RequiredSystemVersion.
| 0x8 || 0x1? || Profile icon background color ID
|-
|-
| 0x1C || 0x4 || ?
| 0x9 || 0x7 || ?
|-
|-
| 0x20 || 0xC0 || ?
| 0x10 || 0x10 || Some ID related to the Mii? All zeros when a character icon is used.
|-
|-
| 0xE0 || 0x20 || HMAC-SHA256 over the previous 0xE0-bytes. Uses a different key than [[#SystemDeliveryInfo]].
| 0x20 || 0x60 || Usually zeros?
|}
|}


This is "nn::ns::ApplicationDeliveryInfo". This is a 0x100-byte struct.
= ProfileBase =
This is a 0x38-byte struct.


= LatestSystemUpdate =
{| class="wikitable" border="1"
{| class="wikitable" border="1"
|-
|-
! Value
! Offset || Size || Description
Description
|-
|-
| 1 || Unknown.
| 0x0 || 0x10 || userID
|-
|-
| 2 || Unknown.
| 0x10 || 0x8 || POSIX UTC timestamp, for last account edit.
|-
|-
| Other values || Unknown.
| 0x18 || 0x20 || UTF-8 Nickname. Official sw uses strncpy to copy this into another struct (<code>nn::account::Nickname</code>), with a NUL-byte written after the copied data.
|}
|}


This is "nn::ns::LatestSystemUpdate". This is an u8.
= Uid =
 
This is "nn::account::Uid". This is a 0x10-byte struct. This contains 2 u64s for the UserId.
= ReceiveApplicationProgress =
This is "nn::ns::ReceiveApplicationProgress". This is a 0x10-byte struct.


= SendApplicationProgress =
= Notes =
This is "nn::ns::SendApplicationProgress". This is a 0x10-byte struct.
[[Process_Manager_services|pm:bm]] GetBootMode is used to determine whether aoc:u is available (see above). This value is also passed to thread "nn.ns.DelayedInitialization", which calls various funcs depending on the BootMode in various cases.


= ApplicationRightsOnClient =
The "nn.ns.DelayedInitialization" thread uses BootMode as follows (this also handles various other initialization):
This is a 0x20-byte struct.
* Initializes [[NPNS_services|npns:s]] only for BootMode Normal/Maintenance.
* Initializes the hosted acc:* services and service [[Account_services|acc:su]] only for BootMode Normal/Maintenance.
* Calls a func only for BootMode Normal.
* Initializes [[ETicket_services|es]] and [[Shared_Database_services|avm]] only for BootMode Normal/Maintenance.


[[qlaunch]] only uses +0x18/+0x19 in this struct.
The output of GetBootMode is also written into state. This same func later enters a code block when BootMode is Maintenance/SafeMode: various [[NCM_services|ncm]] cmds are used with input StorageId=BuiltInUser (VerifyContentMetaDatabase, VerifyContentStorage, ActivateContentMetaDatabase, ActivateContentStorage, InactivateContentMetaDatabase, InactivateContentStorage) and state fields are written. Then if the BootMode is Maintenance the savedata for [[Flash_Filesystem|ns_rightsid]] (0x800000000000004A) is deleted. Then 0 is returned. Otherwise for BootMode Normal it continues with various initialization, including gamecard handling which handles launching the gamecard title in certain conditions (this is the only time ns launches anything with pgl outside of service cmds).


{| class="wikitable" border="1"
In the above block, InactivateContentMetaDatabase/InactivateContentStorage are only used if using ActivateContentMetaDatabase/ActivateContentStorage failed (error is only checked after using both cmds). If any of the ncm cmds prior to this fail, it will skip using the rest of the ncm cmds.
|-
! Offset
! Size
! Description
|-
| 0x0 || 0x8 || [[NCM_services#ApplicationId|ApplicationId]]
|-
| 0x8 || 0x10 || [[Account_services#Uid|Uid]]
|-
| 0x18 || 0x1 || Flags, [[qlaunch]] only uses bit0-bit4 and bit7.
|-
| 0x19 || 0x1 || Flags, [[qlaunch]] only uses bit0.
|-
| 0x1A || 0x6 || Unknown
|}


[[Category:Services]]
[[Category:Services]]