Line 25: |
Line 25: |
| |- | | |- |
| | 9 || [10.0.0+] GetAddOnContentLostErrorCode | | | 9 || [10.0.0+] GetAddOnContentLostErrorCode |
| + | |- |
| + | | 10 || [11.0.0+] GetAddOnContentListChangedEventWithProcessId |
| |- | | |- |
| | 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]] |
| |} | | |} |
| | | |
Line 47: |
Line 51: |
| |- | | |- |
| | 4 || [9.0.0+] PopPurchasedProductInfoWithUid | | | 4 || [9.0.0+] PopPurchasedProductInfoWithUid |
| + | |} |
| + | |
| + | == IContentsServiceManager == |
| + | This is "nn::ec::IContentsServiceManager". |
| + | |
| + | This was added with [12.0.0+]. |
| + | |
| + | {| class="wikitable" border="1" |
| + | |- |
| + | ! Cmd || Name |
| + | |- |
| + | | 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" |
| + | |- |
| + | ! Cmd || Name |
| + | |- |
| + | | 0 || GetSize |
| + | |- |
| + | | 1 || Get |
| + | |- |
| + | | 2 || Cancel |
| |} | | |} |
| | | |
Line 84: |
Line 119: |
| | 17 || ListApplicationRecordContentMeta | | | 17 || ListApplicationRecordContentMeta |
| |- | | |- |
− | | 18 || | + | | 18 || CheckLaunchRights |
| |- | | |- |
| | 19 || [[#LaunchApplication]] | | | 19 || [[#LaunchApplication]] |
Line 106: |
Line 141: |
| | 33 || ResumeApplicationDownload | | | 33 || ResumeApplicationDownload |
| |- | | |- |
− | | 34 || | + | | 34 || ClearTaskStatusList |
| |- | | |- |
| | 35 || UpdateVersionList | | | 35 || UpdateVersionList |
Line 428: |
Line 463: |
| |} | | |} |
| | | |
− | = ns:am2, ns:ec, ns:rid, ns:rt, ns:web = | + | = ns:am2, ns:ec, ns:rid, ns:rt, ns:web, ns:ro = |
| 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 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. |
| + | |
| + | [11.0.0+] ns:ro was added. |
| | | |
| {| class="wikitable" border="1" | | {| class="wikitable" border="1" |
Line 435: |
Line 472: |
| ! 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 515: |
Line 552: |
| | 30 || [[#RequestApplicationUpdateInfo]] | | | 30 || [[#RequestApplicationUpdateInfo]] |
| |- | | |- |
− | | 31 || [1.0.0-3.0.2] | + | | 31 || [1.0.0-3.0.2] RequestUpdateApplication |
| |- | | |- |
| | 32 || [[#CancelApplicationDownload]] | | | 32 || [[#CancelApplicationDownload]] |
Line 615: |
Line 652: |
| | 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 |
Line 657: |
Line 694: |
| | 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 770: |
Line 807: |
| |- | | |- |
| | 915 || [9.0.0+] ShowApplicationRecord | | | 915 || [9.0.0+] ShowApplicationRecord |
| + | |- |
| + | | 916 || [11.0.0+] IsApplicationAutoDeleteDisabled |
| |- | | |- |
| | 1000 || [[#RequestVerifyApplicationDeprecated]] | | | 1000 || [[#RequestVerifyApplicationDeprecated]] |
Line 802: |
Line 841: |
| |- | | |- |
| | 1312 || [10.0.0+] HasMovableEntity | | | 1312 || [10.0.0+] HasMovableEntity |
| + | |- |
| + | | 1313 || [11.0.0+] CleanupOrphanContents |
| + | |- |
| + | | 1314 || [11.0.0+] CheckPreconditionSatisfiedToMove |
| |- | | |- |
| | 1400 || PrepareShutdown | | | 1400 || PrepareShutdown |
Line 830: |
Line 873: |
| |- | | |- |
| | 1704 || [8.0.0+] [[#GetApplicationViewWithPromotionInfo]] | | | 1704 || [8.0.0+] [[#GetApplicationViewWithPromotionInfo]] |
| + | |- |
| + | | 1705 || [11.0.0+] [[#IsPatchAutoDeletableApplication]] |
| |- | | |- |
| | 1800 || IsNotificationSetupCompleted | | | 1800 || IsNotificationSetupCompleted |
Line 939: |
Line 984: |
| | 2353 || [10.0.0+] GetApplicationDownloadTaskInfo | | | 2353 || [10.0.0+] GetApplicationDownloadTaskInfo |
| |- | | |- |
− | | 2400 || [8.0.0+] [[#GetPromotionInfo]] | + | | 2354 || [11.0.0+] PrioritizeApplicationBackgroundTask |
| |- | | |- |
− | | 2401 || [8.0.0+] CountPromotionInfo | + | | 2355 || [12.0.0+] PreferStorageEfficientUpdate |
| + | |- |
| + | | 2356 || [12.0.0+] RequestStorageEfficientUpdatePreferable |
| + | |- |
| + | | 2400 || [8.0.0+] [[#GetPromotionInfo]] |
| + | |- |
| + | | 2401 || [8.0.0+] CountPromotionInfo |
| |- | | |- |
| | 2402 || [8.0.0+] ListPromotionInfo | | | 2402 || [8.0.0+] ListPromotionInfo |
Line 965: |
Line 1,016: |
| | 2800 || [9.0.0+] GetApplicationIdOfPreomia | | | 2800 || [9.0.0+] GetApplicationIdOfPreomia |
| |- | | |- |
− | | 9999 || [10.0.0+] GetApplicationCertificate | + | | 3000 || [11.0.0+] [[#RegisterDeviceLockKey]] |
| + | |- |
| + | | 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]] |
| + | |- |
| + | | 9999 || [10.0.0-10.2.0] GetApplicationCertificate |
| |} | | |} |
| | | |
Line 1,060: |
Line 1,141: |
| | | |
| See [[#RequestApplicationUpdateInfo]] regarding nifm. | | See [[#RequestApplicationUpdateInfo]] regarding nifm. |
| + | |
| + | ==== LaunchApplication ==== |
| + | Takes an input u8 ProgramIndex, an input [[#ApplicationLaunchInfo]], returns an output u64. |
| + | |
| + | ==== GetApplicationLaunchInfo ==== |
| + | Takes an input [[NCM_services#ApplicationId|ApplicationId]], returns an output [[#ApplicationLaunchInfo]]. |
| + | |
| + | ==== AcquireApplicationLaunchInfo ==== |
| + | Takes an input [[NCM_services#ApplicationId|ApplicationId]], returns an output [[#ApplicationLaunchInfo]]. |
| + | |
| + | 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. |
| | | |
| ==== LaunchDevMenu ==== | | ==== LaunchDevMenu ==== |
Line 1,070: |
Line 1,162: |
| [[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. | | [[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. |
| | | |
− | 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. | + | 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. |
| | | |
| ==== DeleteUserSaveDataAll ==== | | ==== DeleteUserSaveDataAll ==== |
Line 1,089: |
Line 1,181: |
| Takes an input [[Account_services#Uid|Uid]], no output. | | Takes an input [[Account_services#Uid|Uid]], no output. |
| | | |
− | ==== RequestDownloadApplicationControlData ==== | + | ==== LaunchLibraryApplet ==== |
− | Takes an input [[NCM_services#ApplicationId|ApplicationId]], returns an output Event handle and an [[#IAsyncResult]]. | + | Takes an input u64 [[NCM_services#ProgramId|ProgramId]], returns an output u64. |
| | | |
− | See [[#RequestApplicationUpdateInfo]] regarding nifm.
| + | 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. |
| | | |
− | ==== ListApplicationTitle ====
| + | This is used by [[Applet_Manager_services|AM]]. |
− | Takes an input TransferMemory handle, a type-0x5 input buffer containing an array of u64 [[NCM_services#ApplicationId|ApplicationIds]], an u8 [[#ApplicationControlSource]], an u64 size, returns an output Event handle and an [[#IAsyncValue]].
| |
| | | |
− | [[qlaunch]] uses value 0x1 for the u8.
| + | ==== LaunchSystemApplet ==== |
| + | No input, returns an output u64. |
| | | |
− | The user-process creates the TransferMemory with permissions=R--.
| + | A state flag must be 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>. |
| | | |
− | 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. | + | 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. |
| | | |
− | The TransferMemory size must be at least: count*sizeof([[NACP_Format|title-entry]]) + count*sizeof(u64) + count*[[#GetApplicationControlData|0x24000]].
| + | This is used by [[Applet_Manager_services|AM]]. |
| | | |
− | This is essentially an async wrapper for [[#GetApplicationControlData]], with support for multiple ApplicationIds. | + | ==== LaunchOverlayApplet ==== |
| + | No input, returns an output u64. |
| + | |
| + | A state flag must be zero, otherwise an error is thrown. The ProgramId is loaded from [[System_Settings|system-setting]] <code>ns.applet!overlay_applet_id</code>. |
| + | |
| + | 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. |
| + | |
| + | This is used by [[Applet_Manager_services|AM]]. |
| + | |
| + | ==== RequestDownloadApplicationControlData ==== |
| + | Takes an input [[NCM_services#ApplicationId|ApplicationId]], returns an output Event handle and an [[#IAsyncResult]]. |
| + | |
| + | See [[#RequestApplicationUpdateInfo]] regarding nifm. |
| + | |
| + | ==== ListApplicationTitle ==== |
| + | Takes an input TransferMemory handle, a type-0x5 input buffer containing an array of u64 [[NCM_services#ApplicationId|ApplicationIds]], an u8 [[#ApplicationControlSource]], an u64 size, returns an output Event handle and an [[#IAsyncValue]]. |
| + | |
| + | [[qlaunch]] uses value 0x1 for the u8. |
| + | |
| + | The user-process creates the TransferMemory with permissions=R--. |
| + | |
| + | 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. |
| + | |
| + | The TransferMemory size must be at least: count*sizeof([[NACP_Format|title-entry]]) + count*sizeof(u64) + count*[[#GetApplicationControlData|0x24000]]. |
| + | |
| + | This is essentially an async wrapper for [[#GetApplicationControlData]], with support for multiple ApplicationIds. |
| | | |
| ==== ListApplicationIcon ==== | | ==== ListApplicationIcon ==== |
Line 1,210: |
Line 1,327: |
| ==== GetApplicationViewWithPromotionInfo ==== | | ==== 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. | | 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. |
| + | |
| + | ==== IsPatchAutoDeletableApplication ==== |
| + | Takes an input [[NCM_services#ApplicationId|ApplicationId]], returns an output bool. |
| + | |
| + | Compares the input ApplicationId with the value of [[System_Settings|system-setting]] <code>ns.application!auto_deletable_application_id_on_not_enough_space</code>, with the bool being set to the comparsion result. |
| | | |
| ==== RequestDownloadApplicationPrepurchasedRights ==== | | ==== RequestDownloadApplicationPrepurchasedRights ==== |
Line 1,288: |
Line 1,410: |
| ** 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. | | ** 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. | | ** Handles cleanup and returns. |
− | * On success, this loads various data which is then used for saving a SystemPlayReport when a state flag is set. | + | * 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>. | | ** The EventId is "receive_app_contents" with ApplicationId <NS ProgramId>. |
| | | |
Line 1,317: |
Line 1,439: |
| ** 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. | | ** 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. | | ** Handles cleanup and returns. |
− | * On success, this loads various data which is then used for saving a SystemPlayReport when a state flag is set. | + | * 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>. | | ** The EventId is "send_app_contents" with ApplicationId <NS ProgramId>. |
| | | |
Line 1,393: |
Line 1,515: |
| Returns an [[#IApplicationResource]]. | | Returns an [[#IApplicationResource]]. |
| | | |
− | === IGameCardStopper === | + | ==== RegisterDeviceLockKey ==== |
− | This is "nn::ns::detail::IGameCardStopper".
| + | Takes a type-0x5 input buffer containing an InArray of u8, no output. |
| + | |
| + | User-processes expose this with two funcs: one which uses an user-specified u8 array directly, while the other uses [[HID_services#NpadButtonSet|NpadButton]]. |
| | | |
− | This interface has no commands. | + | This does SHA256 hashing, etc. |
| | | |
− | === IRequestServerStopper === | + | ==== UnregisterDeviceLockKey ==== |
− | This is "nn::ns::detail::IRequestServerStopper".
| + | No input/output. |
| | | |
− | This interface has no commands.
| + | Runs code identical to [[#RegisterDeviceLockKey]], except the passed buffer/size are 0. |
| | | |
− | === IProgressMonitorForDeleteUserSaveDataAll === | + | ==== VerifyDeviceLockKey ==== |
− | This is "nn::ns::detail::IProgressMonitorForDeleteUserSaveDataAll".
| + | Takes a type-0x5 input buffer containing an InArray of u8, no output. |
| | | |
− | {| class="wikitable" border="1"
| + | User-processes expose this with two funcs: one which uses an user-specified u8 array directly, while the other uses [[HID_services#NpadButtonSet|NpadButton]]. |
− | |-
| + | |
− | ! Cmd || Name
| + | This runs hashing similar to [[#RegisterDeviceLockKey]], with the calculated hash being verified with the one from state. |
− | |-
| + | |
− | | 0 || GetSystemEvent
| + | ==== HideApplicationIcon ==== |
− | |-
| + | No input/output. |
− | | 1 || IsFinished
| + | |
− | |-
| + | ==== ShowApplicationIcon ==== |
− | | 2 || GetResult
| + | No input/output. |
− | |-
| |
− | | 10 || GetProgress
| |
− | |}
| |
| | | |
− | When closing the object, official sw uses IsFinished first, asserting when the output bool is false.
| + | ==== HideApplicationTitle ==== |
| + | No input/output. |
| | | |
− | * GetSystemEvent: No input, returns an output Event handle. [[qlaunch]] doesn't use this.
| + | ==== ShowApplicationTitle ==== |
| + | No input/output. |
| | | |
− | * IsFinished: No input, returns an output u8 bool.
| + | ==== EnableGameCard ==== |
| + | No input/output. |
| | | |
− | * GetResult: No input/output.
| + | ==== DisableGameCard ==== |
| + | No input/output. |
| | | |
− | * GetProgress: No input, returns an output [[#ProgressForDeleteUserSaveDataAll]]. Official sw writes this struct directly to object state.
| + | ==== EnableLocalContentShare ==== |
| + | No input/output. |
| | | |
− | === IProgressAsyncResult === | + | ==== DisableLocalContentShare ==== |
− | This is "nn::ns::detail::IProgressAsyncResult".
| + | No input/output. |
| | | |
− | {| class="wikitable" border="1"
| + | ==== IsApplicationIconHidden ==== |
− | |-
| + | No input, returns an output bool. |
− | ! Cmd || Name
| + | |
− | |-
| + | ==== IsApplicationTitleHidden ==== |
− | | 0 || Get
| + | No input, returns an output bool. |
− | |-
| + | |
− | | 1 || Cancel
| + | ==== IsGameCardEnabled ==== |
− | |-
| + | No input, returns an output bool. |
− | | 2 || GetProgress
| + | |
− | |-
| + | ==== IsLocalContentShareEnabled ==== |
− | | 3 || GetDetailResult
| + | No input, returns an output bool. |
− | |-
| + | |
− | | 4 || [4.0.0+] GetErrorContext
| + | Various Deliver cmds now load the same flag used by this cmd (IsLocalContentShareEnabled), with an error being returned when it's not enabled. |
− | |}
| + | |
| + | === IGameCardStopper === |
| + | This is "nn::ns::detail::IGameCardStopper". |
| + | |
| + | This interface has no commands. |
| + | |
| + | === IRequestServerStopper === |
| + | This is "nn::ns::detail::IRequestServerStopper". |
| | | |
− | === IApplicationVersionInterface ===
| + | This interface has no commands. |
− | This is "nn::ns::detail::IApplicationVersionInterface". | |
| | | |
− | This was added with [4.0.0+]. | + | === IProgressMonitorForDeleteUserSaveDataAll === |
| + | This is "nn::ns::detail::IProgressMonitorForDeleteUserSaveDataAll". |
| | | |
| {| class="wikitable" border="1" | | {| class="wikitable" border="1" |
Line 1,456: |
Line 1,589: |
| ! Cmd || Name | | ! Cmd || Name |
| |- | | |- |
− | | 0 || GetLaunchRequiredVersion | + | | 0 || GetSystemEvent |
| |- | | |- |
− | | 1 || UpgradeLaunchRequiredVersion | + | | 1 || IsFinished |
| |- | | |- |
− | | 35 || UpdateVersionList | + | | 2 || GetResult |
| |- | | |- |
− | | 36 || PushLaunchVersion | + | | 10 || GetProgress |
− | |-
| |
− | | 37 || ListRequiredVersion
| |
− | |-
| |
− | | 800 || RequestVersionList
| |
− | |-
| |
− | | 801 || ListVersionList
| |
− | |-
| |
− | | 802 || [[#RequestVersionListData]]
| |
− | |-
| |
− | | 1000 || PerformAutoUpdate
| |
| |} | | |} |
| | | |
− | ==== RequestVersionListData ====
| + | When closing the object, official sw uses IsFinished first, asserting when the output bool is false. |
− | No input, returns an output Event handle and an [[#IAsyncValue]]. | + | |
| + | * GetSystemEvent: No input, returns an output Event handle. [[qlaunch]] doesn't use this. |
| + | |
| + | * IsFinished: No input, returns an output u8 bool. |
| + | |
| + | * GetResult: No input/output. |
| | | |
− | The data that can be read from the [[#IAsyncValue]] is [[#VersionListData]].
| + | * GetProgress: No input, returns an output [[#ProgressForDeleteUserSaveDataAll]]. Official sw writes this struct directly to object state. |
| | | |
− | === IContentManagementInterface === | + | === IProgressAsyncResult === |
− | This is "nn::ns::detail::IContentManagementInterface". | + | This is "nn::ns::detail::IProgressAsyncResult". |
| | | |
| {| class="wikitable" border="1" | | {| class="wikitable" border="1" |
Line 1,487: |
Line 1,615: |
| ! Cmd || Name | | ! Cmd || Name |
| |- | | |- |
− | | 11 || [[#CalculateApplicationOccupiedSize]] | + | | 0 || Get |
| |- | | |- |
− | | 43 || [[#CheckSdCardMountStatus]] | + | | 1 || Cancel |
| |- | | |- |
− | | 47 || [[#GetTotalSpaceSize]] | + | | 2 || GetProgress |
| |- | | |- |
− | | 48 || [[#GetFreeSpaceSize]] | + | | 3 || GetDetailResult |
| |- | | |- |
− | | 600 || [[#CountApplicationContentMeta]] | + | | 4 || [4.0.0+] GetErrorContext |
− | |-
| |
− | | 601 || [[#ListApplicationContentMetaStatus]]
| |
− | |-
| |
− | | 605 || [[#ListApplicationContentMetaStatusWithRightsCheck]]
| |
− | |-
| |
− | | 607 || [[#IsAnyApplicationRunning]]
| |
| |} | | |} |
| | | |
− | ==== CalculateApplicationOccupiedSize ==== | + | === IApplicationVersionInterface === |
− | Takes an input [[NCM_services#ApplicationId|ApplicationId]], returns an output [[#ApplicationOccupiedSize]].
| + | This is "nn::ns::detail::IApplicationVersionInterface". |
| | | |
− | ==== CheckSdCardMountStatus ====
| + | This was added with [4.0.0+]. |
− | No input/output.
| |
− | | |
− | ==== CountApplicationContentMeta ====
| |
− | Takes an input [[NCM_services#ApplicationId|ApplicationId]], returns an output s32.
| |
− | | |
− | ==== ListApplicationContentMetaStatusWithRightsCheck ====
| |
− | Same input/output as [[#ListApplicationContentMetaStatus]].
| |
− | | |
− | ==== IsAnyApplicationRunning ====
| |
− | No input, returns an output u8 bool.
| |
− | | |
− | === IDocumentInterface ===
| |
− | This is "nn::ns::detail::IDocumentInterface".
| |
| | | |
| {| class="wikitable" border="1" | | {| class="wikitable" border="1" |
Line 1,526: |
Line 1,635: |
| ! Cmd || Name | | ! Cmd || Name |
| |- | | |- |
− | | 21 || GetApplicationContentPath | + | | 0 || GetLaunchRequiredVersion |
| + | |- |
| + | | 1 || UpgradeLaunchRequiredVersion |
| |- | | |- |
− | | 23 || ResolveApplicationContentPath | + | | 35 || UpdateVersionList |
| |- | | |- |
− | | 92 || [5.0.0+] GetRunningApplicationProgramId | + | | 36 || PushLaunchVersion |
− | |}
| |
− | | |
− | === IDownloadTaskInterface ===
| |
− | This is "nn::ns::detail::IDownloadTaskInterface".
| |
− | | |
− | {| class="wikitable" border="1"
| |
| |- | | |- |
− | ! Cmd || Name
| + | | 37 || ListRequiredVersion |
| |- | | |- |
− | | 701 || [[#ClearTaskStatusList]] | + | | 800 || RequestVersionList |
| |- | | |- |
− | | 702 || [[#RequestDownloadTaskList]] | + | | 801 || ListVersionList |
| |- | | |- |
− | | 703 || [[#RequestEnsureDownloadTask]] | + | | 802 || [[#RequestVersionListData]] |
− | |-
| |
− | | 704 || [[#ListDownloadTaskStatus]]
| |
| |- | | |- |
− | | 705 || [[#RequestDownloadTaskListData]] | + | | 900 || [12.0.0+] ImportAutoUpdatePolicyJsonForDebug |
| |- | | |- |
− | | 706 || [4.0.0+] [[#TryCommitCurrentApplicationDownloadTask]] | + | | 901 || [12.0.0+] ListDefaultAutoUpdatePolicy |
| |- | | |- |
− | | 707 || [4.0.0+] [[#EnableAutoCommit]] | + | | 902 || [12.0.0+] ListAutoUpdatePolicyForSpecificApplication |
| |- | | |- |
− | | 708 || [4.0.0+] [[#DisableAutoCommit]] | + | | 1000 || PerformAutoUpdate |
| |- | | |- |
− | | 709 || [4.0.0+] [[#TriggerDynamicCommitEvent]] | + | | 1001 || [11.0.0+] ListAutoUpdateSchedule |
| |} | | |} |
| | | |
− | ==== ClearTaskStatusList ==== | + | ==== RequestVersionListData ==== |
− | No input/output. | + | No input, returns an output Event handle and an [[#IAsyncValue]]. |
| | | |
− | ==== RequestDownloadTaskList ====
| + | The data that can be read from the [[#IAsyncValue]] is [[#VersionListData]]. |
− | No input/output.
| |
| | | |
− | ==== RequestEnsureDownloadTask ==== | + | === IContentManagementInterface === |
− | No input, returns an output Event handle and an [[#IAsyncResult]].
| + | This is "nn::ns::detail::IContentManagementInterface". |
− | | |
− | ==== ListDownloadTaskStatus ====
| |
− | Takes a type-0x6 output buffer containing an array of [[#DownloadTaskStatus]], returns an output s32 total_out.
| |
− | | |
− | A maximum of 0x100 tasks can be stored in state.
| |
− | | |
− | ==== TryCommitCurrentApplicationDownloadTask ====
| |
− | No input/output.
| |
− | | |
− | ==== EnableAutoCommit ====
| |
− | No input/output.
| |
− | | |
− | ==== DisableAutoCommit ====
| |
− | No input/output.
| |
− | | |
− | ==== TriggerDynamicCommitEvent ====
| |
− | No input/output.
| |
− | | |
− | === IReadOnlyApplicationRecordInterface ===
| |
− | This is "nn::ns::detail::IReadOnlyApplicationRecordInterface". | |
− | | |
− | This was added with [5.0.0+].
| |
| | | |
| {| class="wikitable" border="1" | | {| class="wikitable" border="1" |
| |- | | |- |
− | ! Cmd || Name || Notes | + | ! Cmd || Name |
| + | |- |
| + | | 11 || [[#CalculateApplicationOccupiedSize]] |
| + | |- |
| + | | 43 || [[#CheckSdCardMountStatus]] |
| |- | | |- |
− | | 0 || HasApplicationRecord || Same as [[#IApplicationManagerInterface]] cmd 910 | + | | 47 || [[#GetTotalSpaceSize]] |
| |- | | |- |
− | | 1 || [10.0.0+] NotifyApplicationFailure || | + | | 48 || [[#GetFreeSpaceSize]] |
| |- | | |- |
− | | 2 || [10.0.0+] IsDataCorruptedResult || | + | | 600 || [[#CountApplicationContentMeta]] |
| + | |- |
| + | | 601 || [[#ListApplicationContentMetaStatus]] |
| + | |- |
| + | | 605 || [[#ListApplicationContentMetaStatusWithRightsCheck]] |
| + | |- |
| + | | 607 || [[#IsAnyApplicationRunning]] |
| |} | | |} |
| | | |
− | === IReadOnlyApplicationControlDataInterface === | + | ==== CalculateApplicationOccupiedSize ==== |
− | This is "nn::ns::detail::IReadOnlyApplicationControlDataInterface".
| + | Takes an input [[NCM_services#ApplicationId|ApplicationId]], returns an output [[#ApplicationOccupiedSize]]. |
| + | |
| + | ==== CheckSdCardMountStatus ==== |
| + | No input/output. |
| + | |
| + | ==== CountApplicationContentMeta ==== |
| + | Takes an input [[NCM_services#ApplicationId|ApplicationId]], returns an output s32. |
| + | |
| + | ==== ListApplicationContentMetaStatusWithRightsCheck ==== |
| + | Same input/output as [[#ListApplicationContentMetaStatus]]. |
| + | |
| + | ==== IsAnyApplicationRunning ==== |
| + | No input, returns an output u8 bool. |
| | | |
− | This was added with [5.1.0+]. | + | === IDocumentInterface === |
| + | This is "nn::ns::detail::IDocumentInterface". |
| | | |
| {| class="wikitable" border="1" | | {| class="wikitable" border="1" |
| |- | | |- |
− | ! Cmd || Name || Notes | + | ! Cmd || Name |
| |- | | |- |
− | | 0 || [[#GetApplicationControlData]] || Same as [[#IApplicationManagerInterface]] cmd 400 | + | | 21 || GetApplicationContentPath |
| |- | | |- |
− | | 1 || [[#GetApplicationDesiredLanguage]] || Same as [[#IApplicationManagerInterface]] cmd 55 | + | | 23 || ResolveApplicationContentPath |
| |- | | |- |
− | | 2 || ConvertApplicationLanguageToLanguageCode || Same as [[#IApplicationManagerInterface]] cmd 59 | + | | 92 || [5.0.0+] GetRunningApplicationProgramId |
− | |-
| + | |} |
− | | 3 || [[#ConvertLanguageCodeToApplicationLanguage]] || Same as [[#IApplicationManagerInterface]] cmd 60
| |
− | |-
| |
− | | 4 || [9.0.0+] SelectApplicationDesiredLanguage ||
| |
− | |} | |
| | | |
− | === IDynamicRightsInterface === | + | === IDownloadTaskInterface === |
− | This is "nn::ns::detail::IDynamicRightsInterface". | + | This is "nn::ns::detail::IDownloadTaskInterface". |
− | | |
− | This was added with [6.0.0+].
| |
| | | |
| {| class="wikitable" border="1" | | {| class="wikitable" border="1" |
Line 1,630: |
Line 1,727: |
| ! Cmd || Name | | ! Cmd || Name |
| |- | | |- |
− | | 0 || [[#RequestApplicationRightsOnServer]] | + | | 701 || [[#ClearTaskStatusList]] |
| |- | | |- |
− | | 1 || [[#RequestAssignRights]] | + | | 702 || [[#RequestDownloadTaskList]] |
| |- | | |- |
− | | 4 || [[#DeprecatedRequestAssignRightsToResume]] | + | | 703 || [[#RequestEnsureDownloadTask]] |
| |- | | |- |
− | | 5 || [[#VerifyActivatedRightsOwners]] | + | | 704 || [[#ListDownloadTaskStatus]] |
| |- | | |- |
− | | 6 || [[#DeprecatedGetApplicationRightsStatus]] | + | | 705 || [[#RequestDownloadTaskListData]] |
| |- | | |- |
− | | 7 || [[#RequestPrefetchForDynamicRights]] | + | | 706 || [4.0.0+] [[#TryCommitCurrentApplicationDownloadTask]] |
| |- | | |- |
− | | 8 || [[#GetDynamicRightsState]] | + | | 707 || [4.0.0+] [[#EnableAutoCommit]] |
| |- | | |- |
− | | 9 || [7.0.0+] [[#RequestApplicationRightsOnServerToResume]] | + | | 708 || [4.0.0+] [[#DisableAutoCommit]] |
| |- | | |- |
− | | 10 || [7.0.0+] [[#RequestAssignRightsToResume]] | + | | 709 || [4.0.0+] [[#TriggerDynamicCommitEvent]] |
− | |- | + | |} |
− | | 11 || [7.0.0+] [[#GetActivatedRightsUsers]]
| + | |
− | |-
| + | ==== ClearTaskStatusList ==== |
− | | 12 || [8.0.0+] [[#GetApplicationRightsStatus]]
| + | No input/output. |
− | |-
| |
− | | 13 || [8.0.0+] [[#GetRunningApplicationStatus]]
| |
− | |-
| |
− | | 14 || [10.0.0+] SelectApplicationLicense
| |
− | |}
| |
| | | |
− | ==== RequestApplicationRightsOnServer ==== | + | ==== RequestDownloadTaskList ==== |
− | Takes an input [[NCM_services#ApplicationId|ApplicationId]], an [[Account_services#Uid|Uid]] and an u32. Returns an output Event handle and an [[#IAsyncValue]].
| + | No input/output. |
| | | |
− | ==== RequestAssignRights ==== | + | ==== RequestEnsureDownloadTask ==== |
− | Takes a type-0x5 input buffer containing an array of "nn::ns::ApplicationRightsOnServer". Returns an output Event handle and an [[#IAsyncResult]].
| + | No input, returns an output Event handle and an [[#IAsyncResult]]. |
| | | |
− | ==== DeprecatedRequestAssignRightsToResume ==== | + | ==== ListDownloadTaskStatus ==== |
− | Takes an input u64 "nn::ns::RightsEnvironmentHandle" and an [[Account_services#Uid|Uid]]. Returns an output Event handle and an [[#IAsyncResult]]. | + | Takes a type-0x6 output buffer containing an array of [[#DownloadTaskStatus]], returns an output s32 total_out. |
| | | |
− | ==== VerifyActivatedRightsOwners ====
| + | A maximum of 0x100 tasks can be stored in state. |
− | Takes an input u64 "nn::ns::RightsEnvironmentHandle". No output.
| |
| | | |
− | ==== DeprecatedGetApplicationRightsStatus ==== | + | ==== TryCommitCurrentApplicationDownloadTask ==== |
− | Takes an input u64 "nn::ns::RightsEnvironmentHandle". Returns a bool "nn::ns::ApplicationRightsStatus".
| + | No input/output. |
| | | |
− | ==== RequestPrefetchForDynamicRights ==== | + | ==== EnableAutoCommit ==== |
− | Takes an input [[Account_services#Uid|Uid]]. Returns an output Event handle and an [[#IAsyncResult]].
| + | No input/output. |
| | | |
− | ==== GetDynamicRightsState ==== | + | ==== DisableAutoCommit ==== |
− | No input. Returns a bool "nn::ns::DynamicRightsState". | + | No input/output. |
| | | |
− | ==== RequestApplicationRightsOnServerToResume ==== | + | ==== TriggerDynamicCommitEvent ==== |
− | Takes an input u64 "nn::ns::RightsEnvironmentHandle". Returns an output Event handle and an [[#IAsyncValue]].
| + | No input/output. |
| | | |
− | ==== RequestAssignRightsToResume ==== | + | === IReadOnlyApplicationRecordInterface === |
− | Takes an input u64 "nn::ns::RightsEnvironmentHandle". Returns an output Event handle and an [[#IAsyncResult]].
| + | This is "nn::ns::detail::IReadOnlyApplicationRecordInterface". |
| | | |
− | ==== GetActivatedRightsUsers ====
| + | This was added with [5.0.0+]. |
− | Takes an input u64 "nn::ns::RightsEnvironmentHandle". Returns a bool, an u32 and a type-0x6 output buffer containing an array of [[Account_services#Uid|Uid]].
| |
− | | |
− | ==== GetApplicationRightsStatus ====
| |
− | Takes an input "nn::ns::RightsEnvironmentHandle". Returns 2 bools "nn::ns::ApplicationRightsStatus" and "nn::ns::ApplicationLicenseType".
| |
− | | |
− | ==== GetRunningApplicationStatus ====
| |
− | Takes an input u64 "nn::ns::RightsEnvironmentHandle". Returns an u32 "nn::ns::RunningApplicationStatus".
| |
− | | |
− | === IECommerceInterface===
| |
− | This is "nn::ns::detail::IECommerceInterface".
| |
− | | |
− | This was added with [4.0.0+]. | |
| | | |
| {| class="wikitable" border="1" | | {| class="wikitable" border="1" |
| |- | | |- |
− | ! Cmd || Name | + | ! Cmd || Name || Notes |
| |- | | |- |
− | | 0 || [[#RequestLinkDevice]] | + | | 0 || HasApplicationRecord || Same as [[#IApplicationManagerInterface]] cmd 910 |
| |- | | |- |
− | | 1 || [6.0.0+] [[#RequestCleanupAllPreInstalledApplications]] | + | | 1 || [10.0.0+] NotifyApplicationFailure || |
| |- | | |- |
− | | 2 || [6.0.0+] [[#RequestCleanupPreInstalledApplication]] | + | | 2 || [10.0.0+] IsDataCorruptedResult || |
| + | |} |
| + | |
| + | === IReadOnlyApplicationControlDataInterface === |
| + | This is "nn::ns::detail::IReadOnlyApplicationControlDataInterface". |
| + | |
| + | This was added with [5.1.0+]. |
| + | |
| + | {| class="wikitable" border="1" |
| |- | | |- |
− | | 3 || [6.0.0+] [[#RequestSyncRights]] | + | ! Cmd || Name || Notes |
| + | |- |
| + | | 0 || [[#GetApplicationControlData]] || Same as [[#IApplicationManagerInterface]] cmd 400 |
| + | |- |
| + | | 1 || [[#GetApplicationDesiredLanguage]] || Same as [[#IApplicationManagerInterface]] cmd 55 |
| |- | | |- |
− | | 4 || [6.0.0+] [[#RequestUnlinkDevice]] | + | | 2 || ConvertApplicationLanguageToLanguageCode || Same as [[#IApplicationManagerInterface]] cmd 59 |
| |- | | |- |
− | | 5 || [6.1.0+] [[#RequestRevokeAllELicense]] | + | | 3 || [[#ConvertLanguageCodeToApplicationLanguage]] || Same as [[#IApplicationManagerInterface]] cmd 60 |
| |- | | |- |
− | | 6 || [9.0.0+] [[#RequestSyncRightsBasedOnAssignedELicenses]] | + | | 4 || [9.0.0+] SelectApplicationDesiredLanguage || |
| |} | | |} |
| | | |
− | ==== RequestLinkDevice ==== | + | === IDynamicRightsInterface === |
− | Takes an input [[Account_services#Uid|Uid]], returns an output Event handle and an [[#IAsyncResult]].
| + | This is "nn::ns::detail::IDynamicRightsInterface". |
| | | |
− | See [[#RequestApplicationUpdateInfo]] regarding nifm.
| + | This was added with [6.0.0+]. |
| | | |
− | ==== RequestCleanupAllPreInstalledApplications ==== | + | {| class="wikitable" border="1" |
− | No input, returns an output Event handle and an [[#IAsyncResult]].
| + | |- |
− | | + | ! Cmd || Name |
− | ==== RequestCleanupPreInstalledApplication ====
| + | |- |
− | Takes an input [[NCM_services#ApplicationId|ApplicationId]], returns an output Event handle and an [[#IAsyncResult]].
| + | | 0 || [[#RequestApplicationRightsOnServer]] |
− | | + | |- |
− | ==== RequestSyncRights ====
| + | | 1 || [[#RequestAssignRights]] |
− | No input, returns an output Event handle and an [[#IAsyncResult]].
| |
− | | |
− | ==== RequestUnlinkDevice ====
| |
− | Takes an input [[Account_services#Uid|Uid]], returns an output Event handle and an [[#IAsyncResult]].
| |
− | | |
− | See [[#RequestApplicationUpdateInfo]] regarding nifm.
| |
− | | |
− | ==== RequestRevokeAllELicense ====
| |
− | Takes an input [[Account_services#Uid|Uid]], returns an output Event handle and an [[#IAsyncResult]].
| |
− | | |
− | ==== RequestSyncRightsBasedOnAssignedELicenses ====
| |
− | No input, returns an output Event handle and an [[#IAsyncResult]].
| |
− | | |
− | === IFactoryResetInterface ===
| |
− | This is "nn::ns::detail::IFactoryResetInterface".
| |
− | | |
− | {| class="wikitable" border="1"
| |
| |- | | |- |
− | ! Cmd || Name
| + | | 4 || [[#DeprecatedRequestAssignRightsToResume]] |
| |- | | |- |
− | | 100 || [[#ResetToFactorySettings]] | + | | 5 || [[#VerifyActivatedRightsOwners]] |
| |- | | |- |
− | | 101 || [[#ResetToFactorySettingsWithoutUserSaveData]] | + | | 6 || [[#DeprecatedGetApplicationRightsStatus]] |
| |- | | |- |
− | | 102 || [[#ResetToFactorySettingsForRefurbishment]] | + | | 7 || [[#RequestPrefetchForDynamicRights]] |
| |- | | |- |
− | | 103 || [9.1.0+] [[#ResetToFactorySettingsWithPlatformRegion]] | + | | 8 || [[#GetDynamicRightsState]] |
| |- | | |- |
− | | 104 || [9.1.0+] [[#ResetToFactorySettingsWithPlatformRegionAuthentication]] | + | | 9 || [7.0.0+] [[#RequestApplicationRightsOnServerToResume]] |
| |- | | |- |
− | | 105 || [10.0.0+] [[#RequestResetToFactorySettingsSecurely]] | + | | 10 || [7.0.0+] [[#RequestAssignRightsToResume]] |
| |- | | |- |
− | | 106 || [10.0.0+] [[#RequestResetToFactorySettingsWithPlatformRegionAuthenticationSecurely]] | + | | 11 || [7.0.0+] [[#GetActivatedRightsUsers]] |
| + | |- |
| + | | 12 || [8.0.0+] [[#GetApplicationRightsStatus]] |
| + | |- |
| + | | 13 || [8.0.0+] [[#GetRunningApplicationStatus]] |
| + | |- |
| + | | 14 || [10.0.0+] SelectApplicationLicense |
| + | |- |
| + | | 15 || [12.0.0+] [[#RequestContentsAuthorizationToken]] |
| |} | | |} |
| | | |
− | ==== ResetToFactorySettings ==== | + | ==== RequestApplicationRightsOnServer ==== |
− | No input/output.
| + | Takes an input [[NCM_services#ApplicationId|ApplicationId]], an [[Account_services#Uid|Uid]] and an u32. Returns an output Event handle and an [[#IAsyncValue]]. |
| | | |
− | As of [9.1.0] this is the only [[#IFactoryResetInterface]] cmd used by [[qlaunch]].
| + | ==== RequestAssignRights ==== |
| + | Takes a type-0x5 input buffer containing an array of "nn::ns::ApplicationRightsOnServer". Returns an output Event handle and an [[#IAsyncResult]]. |
| | | |
− | ==== ResetToFactorySettingsWithoutUserSaveData ==== | + | ==== DeprecatedRequestAssignRightsToResume ==== |
− | No input/output.
| + | Takes an input u64 "nn::ns::RightsEnvironmentHandle" and an [[Account_services#Uid|Uid]]. Returns an output Event handle and an [[#IAsyncResult]]. |
| | | |
− | ==== ResetToFactorySettingsForRefurbishment ==== | + | ==== VerifyActivatedRightsOwners ==== |
− | No input/output. | + | Takes an input u64 "nn::ns::RightsEnvironmentHandle". No output. |
| | | |
− | ==== ResetToFactorySettingsWithPlatformRegion ==== | + | ==== DeprecatedGetApplicationRightsStatus ==== |
− | No input/output.
| + | Takes an input u64 "nn::ns::RightsEnvironmentHandle". Returns a bool "nn::ns::ApplicationRightsStatus". |
| | | |
− | ==== ResetToFactorySettingsWithPlatformRegionAuthentication ==== | + | ==== RequestPrefetchForDynamicRights ==== |
− | No input/output.
| + | Takes an input [[Account_services#Uid|Uid]]. Returns an output Event handle and an [[#IAsyncResult]]. |
| | | |
− | ==== RequestResetToFactorySettingsSecurely ==== | + | ==== GetDynamicRightsState ==== |
− | Takes a total of 8-bytes of input, a handle, returns an output [[#IAsyncValueAndProgress]] and a handle. | + | No input. Returns a bool "nn::ns::DynamicRightsState". |
| + | |
| + | ==== RequestApplicationRightsOnServerToResume ==== |
| + | Takes an input u64 "nn::ns::RightsEnvironmentHandle". Returns an output Event handle and an [[#IAsyncValue]]. |
| + | |
| + | ==== RequestAssignRightsToResume ==== |
| + | Takes an input u64 "nn::ns::RightsEnvironmentHandle". Returns an output Event handle and an [[#IAsyncResult]]. |
| + | |
| + | ==== GetActivatedRightsUsers ==== |
| + | Takes an input u64 "nn::ns::RightsEnvironmentHandle". Returns a bool, an u32 and a type-0x6 output buffer containing an array of [[Account_services#Uid|Uid]]. |
| + | |
| + | ==== GetApplicationRightsStatus ==== |
| + | Takes an input "nn::ns::RightsEnvironmentHandle". Returns 2 bools "nn::ns::ApplicationRightsStatus" and "nn::ns::ApplicationLicenseType". |
| + | |
| + | ==== GetRunningApplicationStatus ==== |
| + | Takes an input u64 "nn::ns::RightsEnvironmentHandle". Returns an u32 "nn::ns::RunningApplicationStatus". |
| | | |
− | ==== RequestResetToFactorySettingsWithPlatformRegionAuthenticationSecurely ==== | + | ==== RequestContentsAuthorizationToken ==== |
− | Takes a total of 0x10-bytes of input, a handle, returns an output [[#IAsyncValueAndProgress]] and a handle. | + | Takes a total of 0x50-bytes of input, a type-0x5 input buffer. Returns an [[#IAsyncData_2|IAsyncData]] and an output handle. |
| | | |
− | ===== IAsyncValueAndProgress ===== | + | ==== IAsyncData ==== |
− | This is "nn::ns::detail::IAsyncValueAndProgress". | + | This is "nn::ns::detail::IAsyncData". |
| | | |
− | This was added with [10.0.0+]. | + | This was added with [12.0.0+]. |
| | | |
| {| class="wikitable" border="1" | | {| class="wikitable" border="1" |
Line 1,803: |
Line 1,901: |
| |- | | |- |
| | 3 || GetErrorContext | | | 3 || GetErrorContext |
− | |-
| |
− | | 4 || GetProgress
| |
| |} | | |} |
| | | |
− | === IApplicationResource === | + | === IECommerceInterface=== |
− | This is "nn::ns::detail::IApplicationResource". | + | This is "nn::ns::detail::IECommerceInterface". |
| | | |
− | This was added with [9.0.0+]. | + | This was added with [4.0.0+]. |
| | | |
| {| class="wikitable" border="1" | | {| class="wikitable" border="1" |
Line 1,816: |
Line 1,912: |
| ! Cmd || Name | | ! Cmd || Name |
| |- | | |- |
− | | 0 || Attach | + | | 0 || [[#RequestLinkDevice]] |
| |- | | |- |
− | | 1 || BoostSystemMemoryResourceLimit | + | | 1 || [6.0.0+] [[#RequestCleanupAllPreInstalledApplications]] |
− | |} | + | |- |
− | | + | | 2 || [6.0.0+] [[#RequestCleanupPreInstalledApplication]] |
− | = ns:vm =
| |
− | This is "nn::ns::detail::IVulnerabilityManagerInterface".
| |
− | | |
− | {| class="wikitable" border="1"
| |
| |- | | |- |
− | ! Cmd || Name
| + | | 3 || [6.0.0+] [[#RequestSyncRights]] |
| |- | | |- |
− | | 1200 || [3.0.0+] [[#NeedsUpdateVulnerability]] | + | | 4 || [6.0.0+] [[#RequestUnlinkDevice]] |
| |- | | |- |
− | | 1201 || [4.0.0+] [[#UpdateSafeSystemVersionForDebug]] | + | | 5 || [6.1.0+] [[#RequestRevokeAllELicense]] |
| |- | | |- |
− | | 1202 || [4.0.0+] [[#GetSafeSystemVersion]] | + | | 6 || [9.0.0+] [[#RequestSyncRightsBasedOnAssignedELicenses]] |
| |} | | |} |
| | | |
− | == NeedsUpdateVulnerability == | + | ==== RequestLinkDevice ==== |
− | No input, returns an output u8 bool flag.
| + | Takes an input [[Account_services#Uid|Uid]], returns an output Event handle and an [[#IAsyncResult]]. |
| | | |
− | Web-applets use this command to check if the system needs an update.
| + | See [[#RequestApplicationUpdateInfo]] regarding nifm. |
| | | |
− | == UpdateSafeSystemVersionForDebug == | + | ==== RequestCleanupAllPreInstalledApplications ==== |
− | Takes an input [[NCM_services#ApplicationId|ApplicationId]] and an u32 '''version'''.
| + | No input, returns an output Event handle and an [[#IAsyncResult]]. |
| | | |
− | This command is not available for retail units. On a debug unit, if the [[System_Settings|system setting]] <code>vulnerability!enable_debug</code> is set, this mounts the system savegame [[Flash_Filesystem#System_Savegames|0x8000000000000049]] as "ns_ssversion:/", opens the file "ns_ssversion:/entry" and writes the supplied [[NCM_services#ApplicationId|ApplicationId]] and '''version''' in it.
| + | ==== RequestCleanupPreInstalledApplication ==== |
| + | Takes an input [[NCM_services#ApplicationId|ApplicationId]], returns an output Event handle and an [[#IAsyncResult]]. |
| | | |
− | Finally, it calls [[NCM_services#ncm|OpenContentMetaDatabase]] with [[NCM_services#StorageId|StorageId]] 3, then calls [[NCM_services#IContentMetaDatabase|GetLatestContentMetaKey]] with the supplied [[NCM_services#ApplicationId|ApplicationId]] and compares the version field from the returned [[CNMT#Content_Meta_Records|Content Meta Record]] with the supplied '''version'''.
| + | ==== RequestSyncRights ==== |
| + | No input, returns an output Event handle and an [[#IAsyncResult]]. |
| | | |
− | If the supplied '''version''' is higher than the one in NCM's database, the value returned by [[NS_Services#NeedsUpdateVulnerability|NeedsUpdateVulnerability]] is set to "true".
| + | ==== RequestUnlinkDevice ==== |
| + | Takes an input [[Account_services#Uid|Uid]], returns an output Event handle and an [[#IAsyncResult]]. |
| | | |
− | == GetSafeSystemVersion == | + | See [[#RequestApplicationUpdateInfo]] regarding nifm. |
− | No input, returns an output [[NCM_services#ContentMetaKey|ContentMetaKey]] with the cached contents of "ns_ssversion:/entry" ([[NCM_services#ApplicationId|ApplicationId]], u32 '''version''' and u32 '''policy''' from <code>vulnerability!needs_update_vulnerability_policy</code>).
| + | |
| + | ==== RequestRevokeAllELicense ==== |
| + | Takes an input [[Account_services#Uid|Uid]], returns an output Event handle and an [[#IAsyncResult]]. |
| + | |
| + | ==== RequestSyncRightsBasedOnAssignedELicenses ==== |
| + | No input, returns an output Event handle and an [[#IAsyncResult]]. |
| | | |
− | = ns:su = | + | === IFactoryResetInterface === |
− | This is "nn::ns::detail::ISystemUpdateInterface". | + | This is "nn::ns::detail::IFactoryResetInterface". |
| | | |
| {| class="wikitable" border="1" | | {| class="wikitable" border="1" |
Line 1,859: |
Line 1,959: |
| ! Cmd || Name | | ! Cmd || Name |
| |- | | |- |
− | | 0 || [[#GetBackgroundNetworkUpdateState]] | + | | 100 || [[#ResetToFactorySettings]] |
| |- | | |- |
− | | 1 || [[#OpenSystemUpdateControl]] | + | | 101 || [[#ResetToFactorySettingsWithoutUserSaveData]] |
| |- | | |- |
− | | 2 || [[#NotifyExFatDriverRequired]] | + | | 102 || [[#ResetToFactorySettingsForRefurbishment]] |
| |- | | |- |
− | | 3 || [[#ClearExFatDriverStatusForDebug]] | + | | 103 || [9.1.0+] [[#ResetToFactorySettingsWithPlatformRegion]] |
| |- | | |- |
− | | 4 || [[#RequestBackgroundNetworkUpdate]] | + | | 104 || [9.1.0+] [[#ResetToFactorySettingsWithPlatformRegionAuthentication]] |
| |- | | |- |
− | | 5 || [[#NotifyBackgroundNetworkUpdate]] | + | | 105 || [10.0.0+] [[#RequestResetToFactorySettingsSecurely]] |
| |- | | |- |
− | | 6 || [[#NotifyExFatDriverDownloadedForDebug]] | + | | 106 || [10.0.0+] [[#RequestResetToFactorySettingsWithPlatformRegionAuthenticationSecurely]] |
− | |-
| + | |} |
− | | 9 || [[#GetSystemUpdateNotificationEventForContentDelivery]]
| + | |
− | |-
| + | ==== ResetToFactorySettings ==== |
− | | 10 || [[#NotifySystemUpdateForContentDelivery]]
| + | No input/output. |
− | |-
| |
− | | 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 ==
| + | As of [9.1.0] this is the only [[#IFactoryResetInterface]] cmd used by [[qlaunch]]. |
− | No input, returns an output [[#BackgroundNetworkUpdateState]].
| |
| | | |
− | This is similar to [[#HasDownloaded]], see [[#BackgroundNetworkUpdateState]].
| + | ==== ResetToFactorySettingsWithoutUserSaveData ==== |
| + | No input/output. |
| | | |
− | == OpenSystemUpdateControl == | + | ==== ResetToFactorySettingsForRefurbishment ==== |
− | No input, returns an [[#ISystemUpdateControl]]. | + | No input/output. |
| | | |
− | == NotifyExFatDriverRequired == | + | ==== ResetToFactorySettingsWithPlatformRegion ==== |
| No input/output. | | No input/output. |
| | | |
− | Only usable when an [[#ISystemUpdateControl]] isn't open.
| + | ==== ResetToFactorySettingsWithPlatformRegionAuthentication ==== |
| + | No input/output. |
| | | |
− | This uses [[NIM_services|nim]] ListSystemUpdateTask, then when a task is returned uses it with DestroySystemUpdateTask.
| + | ==== RequestResetToFactorySettingsSecurely ==== |
| + | Takes a total of 8-bytes of input, a handle, returns an output [[#IAsyncValueAndProgress]] and a handle. |
| | | |
− | Then this runs ExFat handling, updates state, and sets the same state flag as [[#RequestBackgroundNetworkUpdate]].
| + | ==== RequestResetToFactorySettingsWithPlatformRegionAuthenticationSecurely ==== |
| + | Takes a total of 0x10-bytes of input, a handle, returns an output [[#IAsyncValueAndProgress]] and a handle. |
| | | |
− | == ClearExFatDriverStatusForDebug == | + | ===== IAsyncValueAndProgress ===== |
− | No input/output.
| + | This is "nn::ns::detail::IAsyncValueAndProgress". |
| | | |
− | == RequestBackgroundNetworkUpdate ==
| + | This was added with [10.0.0+]. |
− | No input/output.
| |
| | | |
− | Only usable when an [[#ISystemUpdateControl]] isn't open.
| + | {| class="wikitable" border="1" |
| + | |- |
| + | ! Cmd || Name |
| + | |- |
| + | | 0 || GetSize |
| + | |- |
| + | | 1 || Get |
| + | |- |
| + | | 2 || Cancel |
| + | |- |
| + | | 3 || GetErrorContext |
| + | |- |
| + | | 4 || GetProgress |
| + | |} |
| | | |
− | This sets a state flag to value 1. | + | === IApplicationResource === |
| + | This is "nn::ns::detail::IApplicationResource". |
| | | |
− | == NotifyBackgroundNetworkUpdate ==
| + | This was added with [9.0.0+]. |
− | Takes an input [[NCM_services#ContentMetaKey|ContentMetaKey]], no output.
| |
| | | |
− | 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]].
| + | {| class="wikitable" border="1" |
| + | |- |
| + | ! Cmd || Name |
| + | |- |
| + | | 0 || Attach |
| + | |- |
| + | | 1 || BoostSystemMemoryResourceLimit |
| + | |} |
| | | |
− | == NotifyExFatDriverDownloadedForDebug == | + | = ns:vm = |
− | No input/output.
| + | This is "nn::ns::detail::IVulnerabilityManagerInterface". |
| | | |
− | == GetSystemUpdateNotificationEventForContentDelivery == | + | {| class="wikitable" border="1" |
− | No input, returns an output Event handle with EventClearMode=0.
| + | |- |
| + | ! Cmd || Name |
| + | |- |
| + | | 1200 || [3.0.0+] [[#NeedsUpdateVulnerability]] |
| + | |- |
| + | | 1201 || [4.0.0+] [[#UpdateSafeSystemVersionForDebug]] |
| + | |- |
| + | | 1202 || [4.0.0+] [[#GetSafeSystemVersion]] |
| + | |} |
| | | |
− | == NotifySystemUpdateForContentDelivery == | + | == NeedsUpdateVulnerability == |
− | No input/output. | + | No input, returns an output u8 bool flag. |
| | | |
− | Signals the Event returned by [[#GetSystemUpdateNotificationEventForContentDelivery]].
| + | Web-applets use this command to check if the system needs an update. |
| | | |
− | == PrepareShutdown == | + | == UpdateSafeSystemVersionForDebug == |
− | No input/output.
| + | Takes an input [[NCM_services#ApplicationId|ApplicationId]] and an u32 '''version'''. |
| | | |
− | This is used by [[AM_services|AM]]. | + | 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. |
| | | |
− | Just returns 0 when an [[#ISystemUpdateControl]] is open.
| + | 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'''. |
| | | |
− | This does various cleanup / uses various service-cmds etc for shutdown preparation.
| + | 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". |
| | | |
− | == DestroySystemUpdateTask == | + | == GetSafeSystemVersion == |
− | No input/output. | + | 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>). |
| | | |
− | Only usable when an [[#ISystemUpdateControl]] isn't open.
| + | = ns:su = |
| + | This is "nn::ns::detail::ISystemUpdateInterface". |
| | | |
− | This uses [[NIM_services|nim]] ListSystemUpdateTask, then when a task is returned uses it with DestroySystemUpdateTask.
| + | {| class="wikitable" border="1" |
− | | + | |- |
− | == RequestSendSystemUpdate ==
| + | ! Cmd || Name |
− | Takes a type-0x15 input buffer containing a [[#SystemDeliveryInfo]], an u16 port, an u32 Ipv4Address, returns an output Event handle and an [[#IAsyncResult]].
| + | |- |
− | | + | | 0 || [[#GetBackgroundNetworkUpdateState]] |
− | [[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.
| + | |- |
− | | + | | 1 || [[#OpenSystemUpdateControl]] |
− | [[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.
| + | |- |
− | | + | | 2 || [[#NotifyExFatDriverRequired]] |
− | 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:
| + | | 3 || [[#ClearExFatDriverStatusForDebug]] |
− | ** 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 ==
| |
− | {| class="wikitable" border="1"
| |
| |- | | |- |
− | ! Cmd || Name
| + | | 4 || [[#RequestBackgroundNetworkUpdate]] |
| |- | | |- |
− | | 0 || [[#HasDownloaded]] | + | | 5 || [[#NotifyBackgroundNetworkUpdate]] |
| |- | | |- |
− | | 1 || [[#RequestCheckLatestUpdate]] | + | | 6 || [[#NotifyExFatDriverDownloadedForDebug]] |
| |- | | |- |
− | | 2 || [[#RequestDownloadLatestUpdate]] | + | | 9 || [[#GetSystemUpdateNotificationEventForContentDelivery]] |
| |- | | |- |
− | | 3 || [[#GetDownloadProgress]] | + | | 10 || [[#NotifySystemUpdateForContentDelivery]] |
| |- | | |- |
− | | 4 || [[#ApplyDownloadedUpdate]] | + | | 11 || [3.0.0+] [[#PrepareShutdown]] |
| |- | | |- |
− | | 5 || [[#RequestPrepareCardUpdate]] | + | | 12 || [3.0.0-3.0.2] |
| |- | | |- |
− | | 6 || [[#GetPrepareCardUpdateProgress]] | + | | 13 || [3.0.0-3.0.2] |
| |- | | |- |
− | | 7 || [[#HasPreparedCardUpdate]] | + | | 14 || [3.0.0-3.0.2] |
| |- | | |- |
− | | 8 || [[#ApplyCardUpdate]] | + | | 15 || [3.0.0-3.0.2] |
| |- | | |- |
− | | 9 || [[#GetDownloadedEulaDataSize]] | + | | 16 || [4.0.0+] [[#DestroySystemUpdateTask]] |
| |- | | |- |
− | | 10 || [[#GetDownloadedEulaData]] | + | | 17 || [4.0.0+] [[#RequestSendSystemUpdate]] |
| |- | | |- |
− | | 11 || [[#SetupCardUpdate]]
| + | | 18 || [4.0.0+] [[#GetSendSystemUpdateProgress]] |
− | |-
| |
− | | 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.
| + | == GetBackgroundNetworkUpdateState == |
| + | No input, returns an output [[#BackgroundNetworkUpdateState]]. |
| | | |
− | All Card cmds except SetupCardUpdate* require [[#SetupCardUpdate]]/[[#SetupCardUpdateViaSystemUpdater]] to be used previously. [[#GetPreparedCardUpdateEulaDataSize]]/[[#GetPreparedCardUpdateEulaData]] checks a different state flag.
| + | This is similar to [[#HasDownloaded]], see [[#BackgroundNetworkUpdateState]]. |
| | | |
− | === HasDownloaded === | + | == OpenSystemUpdateControl == |
− | No input, returns an output u8 bool flag. | + | No input, returns an [[#ISystemUpdateControl]]. |
| + | |
| + | == NotifyExFatDriverRequired == |
| + | No input/output. |
| + | |
| + | Only usable when an [[#ISystemUpdateControl]] isn't open. |
| | | |
− | Gets whether a network sysupdate was downloaded, with install pending.
| + | This uses [[NIM_services|nim]] ListSystemUpdateTask, then when a task is returned uses it with DestroySystemUpdateTask. |
| | | |
− | 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.
| + | Then this runs ExFat handling, updates state, and sets the same state flag as [[#RequestBackgroundNetworkUpdate]]. |
| | | |
− | This always returns 0, however this will assert if GetSystemUpdateTaskInfo fails with ret!=0x3C89.
| + | == ClearExFatDriverStatusForDebug == |
| + | No input/output. |
| | | |
− | === RequestCheckLatestUpdate === | + | == RequestBackgroundNetworkUpdate == |
− | No input, returns an output Event handle and an [[#IAsyncValue]]. | + | No input/output. |
| | | |
− | The data that can be read from the [[#IAsyncValue]] is [[#LatestSystemUpdate]].
| + | Only usable when an [[#ISystemUpdateControl]] isn't open. |
| | | |
− | === RequestDownloadLatestUpdate ===
| + | This sets a state flag to value 1. |
− | No input, returns an output Event handle and an [[#IAsyncResult]].
| |
| | | |
− | === GetDownloadProgress === | + | == NotifyBackgroundNetworkUpdate == |
− | No input, returns an output [[#SystemUpdateProgress]].
| + | Takes an input [[NCM_services#ContentMetaKey|ContentMetaKey]], no 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.
| + | 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]]. |
| | | |
− | === ApplyDownloadedUpdate === | + | == NotifyExFatDriverDownloadedForDebug == |
| 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:
| + | == GetSystemUpdateNotificationEventForContentDelivery == |
− | | + | No input, returns an output Event handle with EventClearMode=0. |
− | * 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 a state flag is set (by default it's not 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 === | + | == NotifySystemUpdateForContentDelivery == |
− | No input, returns an output Event handle and an [[#IAsyncResult]]. | + | No input/output. |
| | | |
− | === GetPrepareCardUpdateProgress ===
| + | Signals the Event returned by [[#GetSystemUpdateNotificationEventForContentDelivery]]. |
− | No input, returns an output [[#SystemUpdateProgress]].
| |
| | | |
− | === HasPreparedCardUpdate === | + | == PrepareShutdown == |
− | No input, returns an output u8 bool flag.
| |
− | | |
− | === ApplyCardUpdate ===
| |
| No input/output. | | No input/output. |
| | | |
− | === GetDownloadedEulaDataSize ===
| + | This is used by [[AM_services|AM]]. |
− | 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.
| + | Just returns 0 when an [[#ISystemUpdateControl]] is open. |
| | | |
− | Uses ListSystemUpdateTask again. Then [[NIM_services|nim]] GetDownloadedSystemDataPath, with the output ContentPath being used to mount the EULA title with FS.
| + | This does various cleanup / uses various service-cmds etc for shutdown preparation. |
| | | |
− | Then "<mountname>:/<[[#EulaDataPath]]>" is opened, gets the '''filesize''', then runs cleanup.
| + | == DestroySystemUpdateTask == |
| + | No input/output. |
| | | |
− | === GetDownloadedEulaData ===
| + | Only usable when an [[#ISystemUpdateControl]] isn't open. |
− | Takes a type-0x15 input buffer [[#EulaDataPath]] and a type-0x6 output buffer, returns an output u64 '''filesize'''.
| |
| | | |
− | Similar to [[#GetDownloadedEulaDataSize]] except this reads the file instead, using the specified output buffer with size=filesize. This will throw an error if the filesize is larger than the buffer size.
| + | This uses [[NIM_services|nim]] ListSystemUpdateTask, then when a task is returned uses it with DestroySystemUpdateTask. |
| | | |
− | === SetupCardUpdate === | + | == RequestSendSystemUpdate == |
− | Takes an input u64 size and a TransferMemory handle, no output. | + | Takes a type-0x15 input buffer containing a [[#SystemDeliveryInfo]], an u16 port, an u32 Ipv4Address, returns an output Event handle and an [[#IAsyncResult]]. |
| | | |
− | Official sw creates the TransferMemory with an user-specified buffer, with permissions=None.
| + | [[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. |
| | | |
− | [[qlaunch]] uses size 0x100000 for the TransferMemory buffer. | + | [[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. |
| | | |
− | === GetPreparedCardUpdateEulaDataSize ===
| + | 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: |
− | Takes a type-0x15 input buffer [[#EulaDataPath]], returns an output u64 '''filesize'''.
| + | * 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. |
| | | |
− | This is similar to [[#GetDownloadedEulaDataSize]].
| + | == GetSendSystemUpdateProgress == |
| + | No input, returns an output [[#SystemUpdateProgress]]. |
| | | |
− | === GetPreparedCardUpdateEulaData ===
| + | Same as [[#GetReceiveProgress]] except this uses nim cmd81 and cmd78. |
− | Takes a type-0x15 input buffer [[#EulaDataPath]] and a type-0x6 output buffer, returns an output u64 '''filesize'''.
| |
| | | |
− | This is similar to [[#GetDownloadedEulaData]].
| + | == ISystemUpdateControl == |
− | | + | {| class="wikitable" border="1" |
− | === SetupCardUpdateViaSystemUpdater === | + | |- |
− | Takes an input u64 size and a TransferMemory handle, no output.
| + | ! Cmd || Name |
− | | + | |- |
− | The permissions for the TransferMemory is None.
| + | | 0 || [[#HasDownloaded]] |
− | | + | |- |
− | 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.
| + | | 1 || [[#RequestCheckLatestUpdate]] |
− | | + | |- |
− | === HasReceived ===
| + | | 2 || [[#RequestDownloadLatestUpdate]] |
− | No input, returns an output u8 bool.
| + | |- |
− | | + | | 3 || [[#GetDownloadProgress]] |
− | Same as [[#HasDownloaded]] except this uses [[NIM_services|nim]] cmd71 and cmd73.
| + | |- |
− | | + | | 4 || [[#ApplyDownloadedUpdate]] |
− | === RequestReceiveSystemUpdate ===
| + | |- |
− | Takes a type-0x15 input buffer containing a [[#SystemDeliveryInfo]], an u16 port, an u32 Ipv4Address, returns an output Event handle and an [[#IAsyncResult]].
| + | | 5 || [[#RequestPrepareCardUpdate]] |
− | | + | |- |
− | [[qlaunch]] uses the same value for the port as [[#RequestSendSystemUpdate]] (see [[#RequestSendSystemUpdate]] for addr as well). | + | | 6 || [[#GetPrepareCardUpdateProgress]] |
− | | + | |- |
− | [[NIM_services|NIM]] will use the input addr/port with [[Sockets_services|connect()]]. | + | | 7 || [[#HasPreparedCardUpdate]] |
− | | + | |- |
− | 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:
| + | | 8 || [[#ApplyCardUpdate]] |
− | | + | |- |
− | * Calls a func which does:
| + | | 9 || [[#GetDownloadedEulaDataSize]] |
− | ** 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.
| + | | 10 || [[#GetDownloadedEulaData]] |
− | ** 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.
| + | | 11 || [[#SetupCardUpdate]] |
− | ** Handles cleanup and returns.
| + | |- |
− | * On success, this loads various data which is then used for saving a SystemPlayReport when a state flag is set.
| + | | 12 || [[#GetPreparedCardUpdateEulaDataSize]] |
− | ** The EventId is "receive_system_update" with ApplicationId <NS ProgramId>.
| + | |- |
− | ** This report has the following fields:
| + | | 13 || [[#GetPreparedCardUpdateEulaData]] |
− | *** "SourceSystemUpdateId"
| + | |- |
− | *** "DestinationSystemUpdateId"
| + | | 14 || [4.0.0+] [[#SetupCardUpdateViaSystemUpdater]] |
− | *** "SourceSystemUpdateVersion"
| + | |- |
− | *** "DestinationSystemUpdateVersion"
| + | | 15 || [4.0.0+] [[#HasReceived]] |
− | *** "SenderFirmwareVariationId"
| + | |- |
− | *** "ReceiverFirmwareVariationId"
| + | | 16 || [4.0.0+] [[#RequestReceiveSystemUpdate]] |
− | *** "SenderPlatformRegion"
| + | |- |
− | *** "ReceiverPlatformRegion"
| + | | 17 || [4.0.0+] [[#GetReceiveProgress]] |
− | *** "SenderHasExFat"
| + | |- |
− | *** "ReceiverHasExFat"
| + | | 18 || [4.0.0+] [[#ApplyReceivedUpdate]] |
− | *** "Size"
| + | |- |
− | *** "ThroughputKBps"
| + | | 19 || [4.0.0+] [[#GetReceivedEulaDataSize]] |
| + | |- |
| + | | 20 || [4.0.0+] [[#GetReceivedEulaData]] |
| + | |- |
| + | | 21 || [4.0.0+] [[#SetupToReceiveSystemUpdate]] |
| + | |- |
| + | | 22 || [6.0.0+] [[#RequestCheckLatestUpdateIncludesRebootlessUpdate]] |
| + | |} |
| | | |
− | === GetReceiveProgress ===
| + | Only 1 ISystemUpdateControl can be open at a time. |
− | No input, returns an output [[#SystemUpdateProgress]].
| |
| | | |
− | Same as [[#GetDownloadProgress]] except this uses [[NIM_services|nim]] cmd71 and cmd73.
| + | All Card cmds except SetupCardUpdate* require [[#SetupCardUpdate]]/[[#SetupCardUpdateViaSystemUpdater]] to be used previously. [[#GetPreparedCardUpdateEulaDataSize]]/[[#GetPreparedCardUpdateEulaData]] checks a different state flag. |
| | | |
− | === ApplyReceivedUpdate === | + | === HasDownloaded === |
− | No input/output. | + | No input, returns an output u8 bool flag. |
| + | |
| + | Gets whether a network sysupdate was downloaded, with install pending. |
| | | |
− | === GetReceivedEulaDataSize ===
| + | Uses [[NIM_services|nim]] ListSystemUpdateTask and [[NIM_services|nim]] GetSystemUpdateTaskInfo. When ListSystemUpdateTask successfully returns a task and GetSystemUpdateTaskInfo is successful, the output flag is set to: <code>*((u8*)(taskinfo+0) == 0x3</code>. Otherwise, flag=0. |
− | Takes a type-0x15 input buffer [[#EulaDataPath]], returns an output u64 '''filesize'''.
| |
| | | |
− | This is similar to [[#GetDownloadedEulaDataSize]]. | + | This always returns 0, however this will assert if GetSystemUpdateTaskInfo fails with ret!=0x3C89. |
| | | |
− | === GetReceivedEulaData === | + | === RequestCheckLatestUpdate === |
− | Takes a type-0x15 input buffer [[#EulaDataPath]] and a type-0x6 output buffer, returns an output u64 '''filesize'''.
| + | No input, returns an output Event handle and an [[#IAsyncValue]]. |
| | | |
− | This is similar to [[#GetDownloadedEulaData]].
| + | The data that can be read from the [[#IAsyncValue]] is [[#LatestSystemUpdate]]. |
| | | |
− | === SetupToReceiveSystemUpdate === | + | === RequestDownloadLatestUpdate === |
− | No input/output. | + | No input, 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.
| + | === GetDownloadProgress === |
| + | No input, returns an output [[#SystemUpdateProgress]]. |
| | | |
− | [[qlaunch]] uses this before [[#RequestReceiveSystemUpdate]]. | + | 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. |
| | | |
− | === RequestCheckLatestUpdateIncludesRebootlessUpdate === | + | === ApplyDownloadedUpdate === |
− | No input, returns an output Event handle and an [[#IAsyncValue]]. | + | No input/output. |
| | | |
− | = IAsyncValue =
| + | Runs code similar to [[#HasDownloaded]], throwing an error if a network sysupdate isn't ready for install. Then the sysupdate is installed: |
− | This is "nn::ns::detail::IAsyncValue".
| |
| | | |
− | {| class="wikitable" border="1"
| + | * 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. |
− | ! Cmd || Name
| + | ** 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". |
− | | 0 || GetSize
| + | * 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. |
− | | 1 || Get
| + | ** This report has the following fields: |
− | |-
| + | *** "Type" |
− | | 2 || Cancel
| + | *** "SourceSystemUpdateMetaId" |
− | |-
| + | *** "SourceSystemUpdateMetaVersion" |
− | | 3 || [4.0.0+] GetErrorContext | + | *** "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. |
| | | |
− | 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.
| + | === RequestPrepareCardUpdate === |
| + | No input, returns an output Event handle and an [[#IAsyncResult]]. |
| | | |
− | * GetSize: No input, returns an output u64.
| + | === GetPrepareCardUpdateProgress === |
− | * Get: Takes a type-0x6 output buffer, no output. Official sw waits on the Event prior to using this cmd.
| + | No input, returns an output [[#SystemUpdateProgress]]. |
− | * 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 = | + | === HasPreparedCardUpdate === |
− | This is "nn::ns::detail::IAsyncResult".
| + | No input, returns an output u8 bool flag. |
| + | |
| + | === ApplyCardUpdate === |
| + | No input/output. |
| | | |
− | {| class="wikitable" border="1"
| + | === GetDownloadedEulaDataSize === |
− | |-
| + | Takes a type-0x15 input buffer [[#EulaDataPath]], returns an output u64 '''filesize'''. |
− | ! 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.
| + | Runs code similar to [[#HasDownloaded]], throwing an error if a network sysupdate isn't ready for install. |
| | | |
− | * Get: No input/output. Official sw waits on the Event prior to using this cmd.
| + | Uses ListSystemUpdateTask again. Then [[NIM_services|nim]] GetDownloadedSystemDataPath, with the output ContentPath being used to mount the EULA title with FS. |
− | * 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 =
| + | Then "<mountname>:/<[[#EulaDataPath]]>" is opened, gets the '''filesize''', then runs cleanup. |
− | This is "nn::ns::detail::IDevelopInterface".
| |
| | | |
− | [10.0.0+] Some of these cmds were replaced by the [[PGL_services|pgl]] system module.
| + | === GetDownloadedEulaData === |
| + | Takes a type-0x15 input buffer [[#EulaDataPath]] and a type-0x6 output buffer, returns an output u64 '''filesize'''. |
| | | |
− | {| class="wikitable" border="1"
| + | 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. |
− | |-
| |
− | ! 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+] [[#LaunchApplicationFromHost]] ([1.0.0-9.2.0] [[#LaunchApplicationForDevelop]])
| |
− | |-
| |
− | | 9 || [[#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+] [[#GetApplicationProgramIdFromHost]]
| |
− | |}
| |
| | | |
− | == LaunchProgram == | + | === SetupCardUpdate === |
− | Wrapper for "pm:shell" [[Process_Manager_services#pm:shell|LaunchProcess]].
| + | Takes an input u64 size and a TransferMemory handle, no output. |
| | | |
− | == TerminateProcess == | + | Official sw creates the TransferMemory with an user-specified buffer, with permissions=None. |
− | Wrapper for "pm:shell" [[Process_Manager_services#pm:shell|TerminateProcess]].
| |
| | | |
− | == TerminateProgram ==
| + | [[qlaunch]] uses size 0x100000 for the TransferMemory buffer. |
− | Wrapper for "pm:shell" [[Process_Manager_services#pm:shell|TerminateProgram]].
| |
| | | |
− | == GetShellEvent == | + | === GetPreparedCardUpdateEulaDataSize === |
− | Wrapper for "pm:shell" [[Process_Manager_services#pm:shell|GetProcessEventHandle]].
| + | Takes a type-0x15 input buffer [[#EulaDataPath]], returns an output u64 '''filesize'''. |
| | | |
− | == GetShellEventInfo ==
| + | This is similar to [[#GetDownloadedEulaDataSize]]. |
− | Wrapper for "pm:shell" [[Process_Manager_services#pm:shell|GetProcessEventInfo]].
| |
| | | |
− | == TerminateApplication == | + | === GetPreparedCardUpdateEulaData === |
− | Calls "pm:shell" [[Process_Manager_services#pm:shell|GetApplicationProcessIdForShell]] and sends the ProcessId to [[Process_Manager_services#pm:shell|TerminateProcess]].
| + | Takes a type-0x15 input buffer [[#EulaDataPath]] and a type-0x6 output buffer, returns an output u64 '''filesize'''. |
| | | |
− | == PrepareLaunchProgramFromHost ==
| + | This is similar to [[#GetDownloadedEulaData]]. |
− | Takes a type-0x5 input buffer containing the [[Filesystem_services|ContentPath]], returns an output 0x10-byte struct.
| |
| | | |
− | Calls [[NCM_services#IPathResolverForStorage|IPathResolverForStorage]] Set...NcaPath functions.
| + | === SetupCardUpdateViaSystemUpdater === |
| + | Takes an input u64 size and a TransferMemory handle, no output. |
| | | |
− | == LaunchApplicationForDevelop ==
| + | The permissions for the TransferMemory is None. |
− | 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. | + | 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. |
| | | |
− | == LaunchApplicationFromHost == | + | === HasReceived === |
− | Takes an input u32 [[Process_Manager_services#LaunchFlags|LaunchFlags]] and a type-0x5 input buffer containing the [[Filesystem_services|ContentPath]]. Returns an output u64 ProcessId.
| + | No input, returns an output u8 bool. |
| | | |
− | == LaunchApplicationWithStorageIdForDevelop ==
| + | Same as [[#HasDownloaded]] except this uses [[NIM_services|nim]] cmd71 and cmd73. |
− | 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.
| + | === RequestReceiveSystemUpdate === |
| + | Takes a type-0x15 input buffer containing a [[#SystemDeliveryInfo]], an u16 port, an u32 Ipv4Address, returns an output Event handle and an [[#IAsyncResult]]. |
| | | |
− | == IsSystemMemoryResourceLimitBoosted ==
| + | [[qlaunch]] uses the same value for the port as [[#RequestSendSystemUpdate]] (see [[#RequestSendSystemUpdate]] for addr as well). |
− | No input. Returns a bool.
| |
| | | |
− | == GetRunningApplicationProcessIdForDevelop ==
| + | [[NIM_services|NIM]] will use the input addr/port with [[Sockets_services|connect()]]. |
− | Returns an output u64 ProcessId.
| |
| | | |
− | == SetCurrentApplicationRightsEnvironmentCanBeActiveForDevelop ==
| + | 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: |
− | Takes an input bool. No output.
| |
| | | |
− | == CreateApplicationResourceForDevelop ==
| + | * Calls a func which does: |
− | Takes an input u32 (1 = Preomia/MicroApplication). Returns an [[#IApplicationResource]].
| + | ** 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. |
− | == IsPreomiaForDevelop ==
| + | ** Uses [[NIM_services|nim]] cmd69, returning the Result on failure. |
− | Takes an input u64 [[NCM_services#ProgramId|ProgramId]]. Returns a bool.
| + | ** 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. |
− | == GetApplicationProgramIdFromHost ==
| + | * 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. |
− | Takes a type-0x5 input buffer containing the [[Filesystem_services|ContentPath]]. Returns an u64 [[NCM_services#ProgramId|ProgramId]].
| + | ** The EventId is "receive_system_update" with ApplicationId <NS ProgramId>. |
− | | + | ** This report has the following fields: |
− | = VersionListData =
| + | *** "SourceSystemUpdateId" |
− | This is "nn::ns::VersionListData".
| + | *** "DestinationSystemUpdateId" |
| + | *** "SourceSystemUpdateVersion" |
| + | *** "DestinationSystemUpdateVersion" |
| + | *** "SenderFirmwareVariationId" |
| + | *** "ReceiverFirmwareVariationId" |
| + | *** "SenderPlatformRegion" |
| + | *** "ReceiverPlatformRegion" |
| + | *** "SenderHasExFat" |
| + | *** "ReceiverHasExFat" |
| + | *** "Size" |
| + | *** "ThroughputKBps" |
| | | |
− | = ApplicationUpdateInfo = | + | === GetReceiveProgress === |
− | This is "nn::ns::ApplicationUpdateInfo".
| + | No input, returns an output [[#SystemUpdateProgress]]. |
| | | |
− | This is an u8. [[qlaunch]] just checks whether this is 0.
| + | Same as [[#GetDownloadProgress]] except this uses [[NIM_services|nim]] cmd71 and cmd73. |
| | | |
− | = ApplicationOccupiedSize = | + | === ApplyReceivedUpdate === |
− | This is "nn::ns::ApplicationOccupiedSize". This is a 0x80-byte struct.
| + | No input/output. |
| | | |
− | = ProgressForDeleteUserSaveDataAll = | + | === GetReceivedEulaDataSize === |
− | This is "nn::ns::detail::ProgressForDeleteUserSaveDataAll". This is a 0x28-byte struct.
| + | Takes a type-0x15 input buffer [[#EulaDataPath]], returns an output u64 '''filesize'''. |
| | | |
− | = ApplicationViewDeprecated =
| + | This is similar to [[#GetDownloadedEulaDataSize]]. |
− | This is "nn::ns::ApplicationViewDeprecated". This is a 0x40-byte struct. | |
| | | |
− | This is converted from [[#ApplicationView]] by [[#GetApplicationViewDeprecated]] on newer system-versions as follows:
| + | === GetReceivedEulaData === |
| + | Takes a type-0x15 input buffer [[#EulaDataPath]] and a type-0x6 output buffer, returns an output u64 '''filesize'''. |
| | | |
− | {| class="wikitable" border="1" | + | 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" |
| |- | | |- |
− | ! Offset | + | ! Cmd || Name |
− | ! Size
| |
− | ! Description
| |
| |- | | |- |
− | | 0x0 || 0x20 || Same as [[#ApplicationView]] +0x0. | + | | 0 || GetSize |
| |- | | |- |
− | | 0x20 || 0x4 || Same as [[#ApplicationView]] +0x20. | + | | 1 || Get |
| |- | | |- |
− | | 0x24 || 0x2 || Same as [[#ApplicationView]] +0x24. | + | | 2 || Cancel |
| |- | | |- |
− | | 0x26 || 0x2 || Cleared to 0. | + | | 3 || [4.0.0+] GetErrorContext |
− | |- | + | |} |
− | | 0x28 || 0x10 || Same as [[#ApplicationView]] +0x30.
| + | |
− | |-
| + | 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. |
− | | 0x38 || 0x4 || Same as [[#ApplicationView]] +0x40.
| + | |
− | |-
| + | * GetSize: No input, returns an output u64. |
− | | 0x3C || 0x1 || Same as [[#ApplicationView]] +0x44.
| + | * 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. |
− | | 0x3D || 0x2 || Cleared to 0.
| + | * GetErrorContext: No input/output, takes a type-0x16 output buffer containing an [[Error_Applet#ErrorContext|ErrorContext]]. |
− | |-
| |
− | | 0x3F || 0x1 || Cleared to 0. | |
− | |}
| |
| | | |
− | = ApplicationView = | + | = IAsyncResult = |
− | This is "nn::ns::ApplicationView". This is a 0x50-byte struct. | + | This is "nn::ns::detail::IAsyncResult". |
| | | |
| {| class="wikitable" border="1" | | {| class="wikitable" border="1" |
| |- | | |- |
− | ! Offset | + | ! Cmd || Name |
− | ! Size
| |
− | ! Description
| |
| |- | | |- |
− | | 0x0 || 0x8 || [[NCM_services#ApplicationId|ApplicationId]] | + | | 0 || Get |
| |- | | |- |
− | | 0x8 || 0x4 || ? | + | | 1 || Cancel |
| |- | | |- |
− | | 0xC || 0x4 || Flags | + | | 2 || [4.0.0+] GetErrorContext |
− | |-
| |
− | | 0x10 || 0x40 || ?
| |
| |} | | |} |
| | | |
− | = ApplicationViewWithPromotionInfo = | + | Official sw creates a container object for this using the output from the service commands, which contains the IAsyncResult object, and the Event with EventClearMode=0. |
− | This is a 0x70-byte struct.
| |
| | | |
− | {| class="wikitable" border="1"
| + | * 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. |
− | ! Offset
| + | * GetErrorContext: No input/output, takes a type-0x16 output buffer containing an [[Error_Applet#ErrorContext|ErrorContext]]. |
− | ! Size
| + | |
− | ! Description
| + | = ns:dev = |
− | |-
| + | This is "nn::ns::detail::IDevelopInterface". |
− | | 0x0 || 0x50 || [[#ApplicationView]]
| |
− | |-
| |
− | | 0x50 || 0x20 || [[#PromotionInfo]]
| |
− | |}
| |
| | | |
− | = PromotionInfo =
| + | [10.0.0+] Some of these cmds were replaced by the [[PGL_services|pgl]] system module. |
− | This is a 0x20-byte struct.
| |
| | | |
| {| class="wikitable" border="1" | | {| class="wikitable" border="1" |
| |- | | |- |
− | ! Offset | + | ! Cmd || Name |
− | ! Size
| + | |- |
− | ! Description
| + | | 0 || [1.0.0-9.2.0] [[#LaunchProgram]] |
| |- | | |- |
− | | 0x0 || 0x8 || PosixTime start_timestamp. | + | | 1 || [[#TerminateProcess]] |
| |- | | |- |
− | | 0x8 || 0x8 || PosixTime end_timestamp. | + | | 2 || [1.0.0-9.2.0] [[#TerminateProgram]] |
| |- | | |- |
− | | 0x10 || 0x8 || Remaining time until the promotion ends, in nanoseconds ({end_timestamp - current_time} converted to nanoseconds). | + | | 4 || [1.0.0-9.2.0] [[#GetShellEvent]] |
| |- | | |- |
− | | 0x18 || 0x4 || Not set, left at zero. | + | | 5 || [1.0.0-9.2.0] [[#GetShellEventInfo]] |
| |- | | |- |
− | | 0x1C || 0x1 || Flags. Bit0: whether the PromotionInfo is valid (including bit1). Bit1 clear: u64 +0x10 is set. | + | | 6 || [[#TerminateApplication]] |
| |- | | |- |
− | | 0x1D || 0x3 || Padding | + | | 7 || [1.0.0-9.2.0] [[#PrepareLaunchProgramFromHost]] |
− | |} | + | |- |
− | | + | | 8 || [10.0.0+] [[#LaunchApplicationFromHost]] ([1.0.0-9.2.0] [[#LaunchApplicationForDevelop]]) |
− | = NoDownloadRightsErrorResolution =
| + | |- |
− | This is "nn::ns::NoDownloadRightsErrorResolution".
| + | | 9 || [[#LaunchApplicationWithStorageIdForDevelop]] |
− | | + | |- |
− | = BackgroundNetworkUpdateState =
| + | | 10 || [6.0.0-8.1.0] [[#IsSystemMemoryResourceLimitBoosted]] |
− | {| class="wikitable" border="1"
| + | |- |
| + | | 11 || [6.0.0+] [[#GetRunningApplicationProcessIdForDevelop]] |
| + | |- |
| + | | 12 || [6.0.0+] [[#SetCurrentApplicationRightsEnvironmentCanBeActiveForDevelop]] |
| + | |- |
| + | | 13 || [9.0.0+] [[#CreateApplicationResourceForDevelop]] |
| + | |- |
| + | | 14 || [9.0.0+] [[#IsPreomiaForDevelop]] |
| + | |- |
| + | | 15 || [10.0.0+] [[#GetApplicationProgramIdFromHost]] |
| |- | | |- |
− | ! Value
| + | | 16 || [12.0.0+] RefreshCachedDebugValues |
− | ! Description
| |
| |- | | |- |
− | | 0 || No sysupdate task exists. | + | | 17 || [12.0.0+] PrepareLaunchApplicationFromHost |
| |- | | |- |
− | | 1 || Sysupdate download in progress. | + | | 18 || [12.0.0+] GetLaunchEvent |
| |- | | |- |
− | | 2 || Sysupdate ready, pending install. | + | | 19 || [12.0.0+] GetLaunchResult |
| |} | | |} |
| | | |
− | This is "nn::ns::BackgroundNetworkUpdateState". This is an u8.
| + | == LaunchProgram == |
| + | Wrapper for "pm:shell" [[Process_Manager_services#pm:shell|LaunchProcess]]. |
| | | |
− | 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.
| + | == TerminateProcess == |
| + | Wrapper for "pm:shell" [[Process_Manager_services#pm:shell|TerminateProcess]]. |
| | | |
− | [[#GetBackgroundNetworkUpdateState]] always returns Result 0, however this will assert if GetSystemUpdateTaskInfo fails with ret!=0x3C89. | + | == TerminateProgram == |
| + | Wrapper for "pm:shell" [[Process_Manager_services#pm:shell|TerminateProgram]]. |
| + | |
| + | == GetShellEvent == |
| + | Wrapper for "pm:shell" [[Process_Manager_services#pm:shell|GetProcessEventHandle]]. |
| | | |
− | = SystemUpdateProgress = | + | == GetShellEventInfo == |
− | {| class="wikitable" border="1"
| + | Wrapper for "pm:shell" [[Process_Manager_services#pm:shell|GetProcessEventInfo]]. |
− | |- | |
− | ! Offset
| |
− | ! Size
| |
− | ! 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.
| |
− | |-
| |
− | | 0x8 || 0x8 || s64 Total size, this field is only valid when >0.
| |
− | |}
| |
| | | |
− | This is "nn::ns::SystemUpdateProgress". This is a 0x10-byte struct.
| + | == TerminateApplication == |
| + | Calls "pm:shell" [[Process_Manager_services#pm:shell|GetApplicationProcessIdForShell]] and sends the ProcessId to [[Process_Manager_services#pm:shell|TerminateProcess]]. |
| | | |
− | Commands which have this as output will return 0 with the output cleared, when no task is available.
| + | == PrepareLaunchProgramFromHost == |
| + | Takes a type-0x5 input buffer containing the [[Filesystem_services|ContentPath]], returns an output 0x10-byte struct. |
| | | |
− | = EulaDataPath =
| + | Calls [[NCM_services#IPathResolverForStorage|IPathResolverForStorage]] Set...NcaPath functions. |
− | This is "nn::ns::detail::EulaDataPath". This is a 0x100-byte struct.
| |
| | | |
− | This contains a file path.
| + | == LaunchApplicationForDevelop == |
| + | Takes an input u32 [[Process_Manager_services#LaunchFlags|LaunchFlags]] and [[NCM_services#ApplicationId|ApplicationId]], returns an output u64 ProcessId. |
| | | |
− | = SystemDeliveryInfo =
| + | Same as [[#LaunchApplicationWithStorageIdForDevelop]] except the last two params passed to the internal vtable funcptr call are value 0x6, instead of from the command input. |
− | {| 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.
| |
− | |}
| |
| | | |
− | This is "nn::ns::SystemDeliveryInfo". This is a 0x100-byte struct.
| + | == LaunchApplicationFromHost == |
| + | Takes an input u32 [[Process_Manager_services#LaunchFlags|LaunchFlags]] and a type-0x5 input buffer containing the [[Filesystem_services|ContentPath]]. Returns an output u64 ProcessId. |
| | | |
− | = ApplicationDeliveryInfo = | + | == LaunchApplicationWithStorageIdForDevelop == |
− | {| class="wikitable" border="1"
| + | 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. |
− | |- | + | |
− | ! Offset
| + | Launches an application title which is registered with NS. |
− | ! Size
| + | |
− | ! Description
| + | == IsSystemMemoryResourceLimitBoosted == |
− | |-
| + | No input. Returns a bool. |
− | | 0x0 || 0x8 || ?
| + | |
− | |-
| + | == GetRunningApplicationProcessIdForDevelop == |
− | | 0x8 || 0x8 || ApplicationId.
| + | Returns an output u64 ProcessId. |
− | |-
| |
− | | 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]].
| |
− | |}
| |
| | | |
− | This is "nn::ns::ApplicationDeliveryInfo". This is a 0x100-byte struct.
| + | == SetCurrentApplicationRightsEnvironmentCanBeActiveForDevelop == |
| + | Takes an input bool. No output. |
| | | |
− | = LatestSystemUpdate = | + | == CreateApplicationResourceForDevelop == |
− | {| class="wikitable" border="1" | + | 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|ContentPath]]. Returns an u64 [[NCM_services#ProgramId|ProgramId]]. |
| + | |
| + | = VersionListData = |
| + | This is "nn::ns::VersionListData". |
| + | |
| + | = ApplicationUpdateInfo = |
| + | This is "nn::ns::ApplicationUpdateInfo". |
| + | |
| + | This is an u8. [[qlaunch]] just checks whether this is 0. |
| + | |
| + | = ApplicationOccupiedSize = |
| + | This is "nn::ns::ApplicationOccupiedSize". This is a 0x80-byte struct. |
| + | |
| + | = ProgressForDeleteUserSaveDataAll = |
| + | This is "nn::ns::detail::ProgressForDeleteUserSaveDataAll". This is a 0x28-byte struct. |
| + | |
| + | = 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 |
| + | ! Size |
| + | ! Description |
| |- | | |- |
− | ! Value | + | | 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. |
| + | |} |
| + | |
| + | = 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 |
| + | |} |
| + | |
| + | = NoDownloadRightsErrorResolution = |
| + | This is "nn::ns::NoDownloadRightsErrorResolution". |
| + | |
| + | = BackgroundNetworkUpdateState = |
| + | {| class="wikitable" border="1" |
| + | |- |
| + | ! Value |
| ! Description | | ! Description |
| |- | | |- |
− | | 1 || Unknown. | + | | 0 || No sysupdate task exists. |
− | |- | + | |- |
− | | 2 || Unknown. | + | | 1 || Sysupdate download in progress. |
− | |- | + | |- |
− | | Other values || Unknown. | + | | 2 || Sysupdate ready, pending install. |
− | |} | + | |} |
− | | + | |
− | This is "nn::ns::LatestSystemUpdate". This is an u8. | + | This is "nn::ns::BackgroundNetworkUpdateState". This is an u8. |
− | | + | |
− | = ReceiveApplicationProgress = | + | 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. |
− | This is "nn::ns::ReceiveApplicationProgress". This is a 0x10-byte struct. | + | |
− | | + | [[#GetBackgroundNetworkUpdateState]] always returns Result 0, however this will assert if GetSystemUpdateTaskInfo fails with ret!=0x3C89. |
− | = SendApplicationProgress = | + | |
− | This is "nn::ns::SendApplicationProgress". This is a 0x10-byte struct. | + | = SystemUpdateProgress = |
− | | + | {| class="wikitable" border="1" |
− | = ApplicationRightsOnClient = | + | |- |
− | This is a 0x20-byte struct. | + | ! Offset |
− | | + | ! Size |
− | [[qlaunch]] only uses +0x18/+0x19 in this struct. | + | ! Description |
− | | + | |- |
− | {| class="wikitable" border="1" | + | | 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. |
− | |- | + | |- |
− | ! Offset | + | | 0x8 || 0x8 || s64 Total size, this field is only valid when >0. |
− | ! Size | + | |} |
− | ! Description | + | |
| + | 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. |
| + | |- |
| + | | 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. |
| + | |} |
| + | |
| + | This is "nn::ns::SystemDeliveryInfo". This is a 0x100-byte struct. |
| + | |
| + | = ApplicationDeliveryInfo = |
| + | {| 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]]. |
| + | |} |
| + | |
| + | This is "nn::ns::ApplicationDeliveryInfo". This is a 0x100-byte struct. |
| + | |
| + | = LatestSystemUpdate = |
| + | {| class="wikitable" border="1" |
| + | |- |
| + | ! Value |
| + | ! Description |
| + | |- |
| + | | 1 || Unknown. |
| + | |- |
| + | | 2 || Unknown. |
| + | |- |
| + | | Other values || Unknown. |
| + | |} |
| + | |
| + | This is "nn::ns::LatestSystemUpdate". This is an u8. |
| + | |
| + | = 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. |
| + | |
| + | [[qlaunch]] only uses +0x18/+0x19 in this 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 |
| + | |} |
| + | |
| + | = DownloadTaskStatus = |
| + | This is "nn::ns::DownloadTaskStatus". This is a 0x20-byte struct. |
| + | |
| + | = ApplicationLaunchInfo = |
| + | This is a 0x40-byte struct. |
| + | |
| + | {| class="wikitable" border="1" |
| + | |- |
| + | ! Offset |
| + | ! Size |
| + | ! Description |
| + | |- |
| + | | 0x0 || 0x8 || [[NCM_services#ApplicationId|ApplicationId]] |
| + | |- |
| + | | 0x8 || 0x4 || Application version |
| |- | | |- |
− | | 0x0 || 0x8 || [[NCM_services#ApplicationId|ApplicationId]] | + | | 0xC || 0x4 || [[Process_Manager_services#LaunchFlags|LaunchFlags]], set to hard-coded value 0xB by [[#GetApplicationLaunchInfo]]. |
| |- | | |- |
− | | 0x8 || 0x10 || [[Account_services#Uid|Uid]] | + | | 0x10 || 0x1 || Application [[NCM_services#StorageId|StorageId]] |
− | |-
| |
− | | 0x18 || 0x1 || Flags, [[qlaunch]] only uses bit0-bit4 and bit7.
| |
| |- | | |- |
− | | 0x19 || 0x1 || Flags, [[qlaunch]] only uses bit0. | + | | 0x11 || 0x1 || Update [[NCM_services#StorageId|StorageId]] |
| |- | | |- |
− | | 0x1A || 0x6 || Unknown | + | | 0x12 || 0x2E || |
| |} | | |} |
− |
| |
− | = DownloadTaskStatus =
| |
− | This is "nn::ns::DownloadTaskStatus". This is a 0x20-byte struct.
| |
| | | |
| [[Category:Services]] | | [[Category:Services]] |