Line 305: |
Line 305: |
| | 0x0 | | | 0x0 |
| | 0x8 | | | 0x8 |
− | | [[NCM_services#ProgramId|ProgramId]] | + | | [[NCM_services#ApplicationId|ApplicationId]] |
| |- | | |- |
| | 0x8 | | | 0x8 |
Line 329: |
Line 329: |
| | | |
| == LaunchApplication == | | == LaunchApplication == |
− | Takes an input u64 [[NCM_services#ProgramId|ProgramId]], returns an output u64 PID. | + | Takes an input [[NCM_services#ApplicationId|ApplicationId]], returns an output u64 PID. |
| | | |
| Launches an application title which is registered with NS. | | Launches an application title which is registered with NS. |
| | | |
| == GetApplicationContentPath == | | == GetApplicationContentPath == |
− | Takes a 0x16-type output buffer, an u8 [[NCM_services#ContentMetaType|ContentMetaType]], and an u64 [[NCM_services#ProgramId|ProgramId]]. | + | Takes a 0x16-type output buffer, an u8 [[NCM_services#ContentMetaType|ContentMetaType]], and an [[NCM_services#ApplicationId|ApplicationId]]. |
| | | |
− | The input [[NCM_services#ProgramId|ProgramId]] is used with the application-title table like various other cmds, anything not in that table can't be used with this. | + | The input [[NCM_services#ApplicationId|ApplicationId]] is used with the application-title table like various other cmds, anything not in that table can't be used with this. |
| | | |
− | Returns a string path for the specified type of patch content with this [[NCM_services#ProgramId|ProgramId]], otherwise returns regular-application paths when update-title not installed. Returns an error when the specified type of content doesn't exist for this title. Starts with "@{SdCardContent,UserContent}://" and ends in ".nca". | + | Returns a string path for the specified type of patch content with this [[NCM_services#ApplicationId|ApplicationId]], otherwise returns regular-application paths when update-title not installed. Returns an error when the specified type of content doesn't exist for this title. Starts with "@{SdCardContent,UserContent}://" and ends in ".nca". |
| | | |
| For gamecard content, the output path is: "@GcSXXXXXXXX:/<NcaId>.nca". NCA-type0 with gamecard returns 0 with an empty output string. | | For gamecard content, the output path is: "@GcSXXXXXXXX:/<NcaId>.nca". NCA-type0 with gamecard returns 0 with an empty output string. |
Line 365: |
Line 365: |
| | | |
| == GetApplicationControlData == | | == GetApplicationControlData == |
− | Takes an input u8 [[#ApplicationControlSource]], an u64 [[NCM_services#ProgramId|ProgramId]], and a type-0x6 output buffer. Returns an output u32 for actual_size. Official user-processes use buffer size 0x24000. [[qlaunch]] only uses flag value 0x1 (Storage if not in cache). | + | Takes an input u8 [[#ApplicationControlSource]], an [[NCM_services#ApplicationId|ApplicationId]], and a type-0x6 output buffer. Returns an output u32 for actual_size. Official user-processes use buffer size 0x24000. [[qlaunch]] only uses flag value 0x1 (Storage if not in cache). |
| | | |
| Loads cached [[control.nacp]] to buf+0 and the cached icon to buf+0x4000. Returns an error if the buffer is too small. | | Loads cached [[control.nacp]] to buf+0 and the cached icon to buf+0x4000. Returns an error if the buffer is too small. |
Line 383: |
Line 383: |
| | 0x2 | | | 0x2 |
| | StorageOnly (Returns data from storage without using cache) | | | StorageOnly (Returns data from storage without using cache) |
− | |-
| |
| |} | | |} |
| | | |
| == ListApplicationContentMetaStatus == | | == ListApplicationContentMetaStatus == |
− | Takes a type-0x6 output buffer containing an array of the below entries, an input s32 index and u64 [[NCM_services#ProgramId|ProgramId]], returns an output s32 out_entrycount. | + | Takes a type-0x6 output buffer containing an array of the below entries, an input s32 index and [[NCM_services#ApplicationId|ApplicationId]], returns an output s32 out_entrycount. |
| | | |
− | Returns 0x10-byte entries using the specified [[NCM_services#ProgramId|ProgramId]] starting at the specified index. Can only return game titles. The second entry if any is the update-title usually. When the input entryindex is >= totalentries, this will return 0 with out_entrycount=0. | + | Returns 0x10-byte entries using the specified [[NCM_services#ApplicationId|ApplicationId]] starting at the specified index. Can only return game titles. The second entry if any is the update-title usually. When the input entryindex is >= totalentries, this will return 0 with out_entrycount=0. |
| | | |
| Entry structure: | | Entry structure: |
Line 420: |
Line 419: |
| | 0x8 | | | 0x8 |
| | 0x8 | | | 0x8 |
− | | [[NCM_services#ProgramId|ProgramId]] | + | | [[NCM_services#ApplicationId|ApplicationId]] |
| |} | | |} |
| | | |
Line 944: |
Line 943: |
| | | |
| ==== RequestApplicationUpdateInfo ==== | | ==== RequestApplicationUpdateInfo ==== |
− | Takes an input u64 [[NCM_services#ProgramId|ApplicationId]], returns an output Event handle and an [[#IAsyncValue]]. | + | Takes an input [[NCM_services#ApplicationId|ApplicationId]], returns an output Event handle and an [[#IAsyncValue]]. |
| | | |
| The data that can be read from the [[#IAsyncValue]] is [[#ApplicationUpdateInfo]]. | | The data that can be read from the [[#IAsyncValue]] is [[#ApplicationUpdateInfo]]. |
Line 955: |
Line 954: |
| This loads ProgramIds from [[System_Settings|system-settings]] <code>ns.applet!devmenu_id</code> and <code>ns.applet!devoverlaydisp_id</code>, which only exists on devunits. An error is thrown if loading these fail. | | This loads ProgramIds from [[System_Settings|system-settings]] <code>ns.applet!devmenu_id</code> and <code>ns.applet!devoverlaydisp_id</code>, which only exists on devunits. An error is thrown if loading these fail. |
| | | |
− | [[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, with a 0.5s sleep-thread afterwards on success. |
Line 982: |
Line 981: |
| | | |
| ==== RequestNoDownloadRightsErrorResolution ==== | | ==== RequestNoDownloadRightsErrorResolution ==== |
− | Takes an input u64 [[NCM_services#ProgramId|ApplicationId]], returns an output Event handle and an [[#IAsyncValue]]. | + | Takes an input [[NCM_services#ApplicationId|ApplicationId]], returns an output Event handle and an [[#IAsyncValue]]. |
| | | |
| The data that can be read from the [[#IAsyncValue]] is [[#NoDownloadRightsErrorResolution]]. | | The data that can be read from the [[#IAsyncValue]] is [[#NoDownloadRightsErrorResolution]]. |
| | | |
| ==== RequestResolveNoDownloadRightsError ==== | | ==== RequestResolveNoDownloadRightsError ==== |
− | Takes an input u64 [[NCM_services#ProgramId|ApplicationId]], returns an output Event handle and an [[#IAsyncValue]]. | + | Takes an input [[NCM_services#ApplicationId|ApplicationId]], returns an output Event handle and an [[#IAsyncValue]]. |
| | | |
| The data that can be read from the [[#IAsyncValue]] is [[#NoDownloadRightsErrorResolution]]. | | The data that can be read from the [[#IAsyncValue]] is [[#NoDownloadRightsErrorResolution]]. |
Line 1,013: |
Line 1,012: |
| | | |
| ==== GetApplicationDeliveryInfo ==== | | ==== GetApplicationDeliveryInfo ==== |
− | Takes a type-0x6 output buffer containing an array of [[#ApplicationDeliveryInfo]], an input u32 bitmask <code>nn::ns::ApplicationDeliveryAttributeTag</code>, an u64 <code>nn::ncm::ApplicationId</code>, and returns an output s32 total_out. | + | Takes a type-0x6 output buffer containing an array of [[#ApplicationDeliveryInfo]], an input u32 bitmask <code>nn::ns::ApplicationDeliveryAttributeTag</code>, an [[NCM_services#ApplicationId|ApplicationId]], and returns an output s32 total_out. |
| | | |
| An error is thrown if any bit is set in ApplicationDeliveryAttributeTag besides bit1. The output array-count must be at least 1: only 1 entry will be written to this array (hence on success total_out will also only be 1 on success). | | An error is thrown if any bit is set in ApplicationDeliveryAttributeTag besides bit1. The output array-count must be at least 1: only 1 entry will be written to this array (hence on success total_out will also only be 1 on success). |
Line 1,054: |
Line 1,053: |
| | | |
| ==== RequestReceiveApplication ==== | | ==== RequestReceiveApplication ==== |
− | Takes a type-0x5 input buffer containing an array of [[NCM_services#ContentMetaKey|ContentMetaKey]], a [[NCM_services#StorageId|StorageId]], an u16 port, an u32 Ipv4Address, an u64 <code>nn::ncm::ApplicationId</code>, returns an output Event handle and an [[#IAsyncResult]]. | + | Takes a type-0x5 input buffer containing an array of [[NCM_services#ContentMetaKey|ContentMetaKey]], a [[NCM_services#StorageId|StorageId]], an u16 port, an u32 Ipv4Address, an [[NCM_services#ApplicationId|ApplicationId]], returns an output Event handle and an [[#IAsyncResult]]. |
| | | |
| [[qlaunch]] uses value Any for the StorageId, and value 55556 for the port. | | [[qlaunch]] uses value Any for the StorageId, and value 55556 for the port. |
Line 1,073: |
Line 1,072: |
| | | |
| ==== CommitReceiveApplication ==== | | ==== CommitReceiveApplication ==== |
− | Takes an input u64 <code>nn::ncm::ApplicationId</code>, no output. | + | Takes an input [[NCM_services#ApplicationId|ApplicationId]], no output. |
| | | |
| ==== GetReceiveApplicationProgress ==== | | ==== GetReceiveApplicationProgress ==== |
− | Takes an input u64 <code>nn::ncm::ApplicationId</code>, returns an output [[#ReceiveApplicationProgress]]. | + | Takes an input [[NCM_services#ApplicationId|ApplicationId]], returns an output [[#ReceiveApplicationProgress]]. |
| | | |
| An error is thrown if a state ref-count is zero. An error is thrown if [[NIM_services|nim]] ListApplicationApplyDeltaTask returns a task. | | An error is thrown if a state ref-count is zero. An error is thrown if [[NIM_services|nim]] ListApplicationApplyDeltaTask returns a task. |
Line 1,083: |
Line 1,082: |
| | | |
| ==== RequestSendApplication ==== | | ==== RequestSendApplication ==== |
− | Takes a type-0x5 input buffer containing an array of [[NCM_services#ContentMetaKey|ContentMetaKey]], an u16 port, an u32 Ipv4Address, an u64 <code>nn::ncm::ApplicationId</code>, returns an output Event handle and an [[#IAsyncResult]]. | + | Takes a type-0x5 input buffer containing an array of [[NCM_services#ContentMetaKey|ContentMetaKey]], an u16 port, an u32 Ipv4Address, an [[NCM_services#ApplicationId|ApplicationId]], returns an output Event handle and an [[#IAsyncResult]]. |
| | | |
| [[qlaunch]] uses value 55556 for the port. | | [[qlaunch]] uses value 55556 for the port. |
Line 1,102: |
Line 1,101: |
| | | |
| ==== GetSendApplicationProgress ==== | | ==== GetSendApplicationProgress ==== |
− | Takes an input u64 <code>nn::ncm::ApplicationId</code>, returns an output [[#SendApplicationProgress]]. | + | Takes an input [[NCM_services#ApplicationId|ApplicationId]], returns an output [[#SendApplicationProgress]]. |
| | | |
| Same as [[#GetReceiveApplicationProgress]] except this is the Send version, and uses [[NIM_services|nim]] cmd68/cmd63 instead. | | Same as [[#GetReceiveApplicationProgress]] except this is the Send version, and uses [[NIM_services|nim]] cmd68/cmd63 instead. |
Line 1,112: |
Line 1,111: |
| | | |
| ==== ListNotCommittedContentMeta ==== | | ==== ListNotCommittedContentMeta ==== |
− | Takes a type-0x6 output buffer containing an array of [[NCM_services#ContentMetaKey|ContentMetaKey]], a s32, an u64 <code>nn::ncm::ApplicationId</code>, returns an output s32 total_out. | + | Takes a type-0x6 output buffer containing an array of [[NCM_services#ContentMetaKey|ContentMetaKey]], a s32, an [[NCM_services#ApplicationId|ApplicationId]], returns an output s32 total_out. |
| | | |
| ==== RecoverDownloadTask ==== | | ==== RecoverDownloadTask ==== |
Line 1,363: |
Line 1,362: |
| | | |
| == UpdateSafeSystemVersionForDebug == | | == UpdateSafeSystemVersionForDebug == |
− | Takes an input u64 [[NCM_services#ProgramId|ProgramId]] and an u32 '''version'''. | + | Takes an input [[NCM_services#ApplicationId|ApplicationId]] and an u32 '''version'''. |
| | | |
− | This command is not available for retail units. On a debug unit, if the [[System_Settings|system setting]] <code>vulnerability!enable_debug</code> is set, this mounts the system savegame [[Flash_Filesystem#System_Savegames|0x8000000000000049]] as "ns_ssversion:/", opens the file "ns_ssversion:/entry" and writes the supplied [[NCM_services#ProgramId|ProgramId]] and '''version''' in it. | + | 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. |
| | | |
− | Finally, it calls [[NCM_services#ncm|OpenContentMetaDatabase]] with [[NCM_services#StorageId|StorageId]] 3, then calls [[NCM_services#IContentMetaDatabase|GetLatestContentMetaKey]] with the supplied [[NCM_services#ProgramId|ProgramId]] and compares the version field from the returned [[CNMT#Content_Meta_Records|Content Meta Record]] with the supplied '''version'''. | + | 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'''. |
| | | |
| 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". | | 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". |
| | | |
| == GetSafeSystemVersion == | | == GetSafeSystemVersion == |
− | No input, returns an output [[NCM_services#ContentMetaKey|ContentMetaKey]] with the cached contents of "ns_ssversion:/entry" (u64 [[NCM_services#ProgramId|ProgramId]], u32 '''version''' and u32 '''policy''' from <code>vulnerability!needs_update_vulnerability_policy</code>). | + | No input, returns an output [[NCM_services#ContentMetaKey|ContentMetaKey]] with the cached contents of "ns_ssversion:/entry" ([[NCM_services#ApplicationId|ApplicationId]], u32 '''version''' and u32 '''policy''' from <code>vulnerability!needs_update_vulnerability_policy</code>). |
| | | |
| = ns:su = | | = ns:su = |
Line 1,799: |
Line 1,798: |
| | | |
| == LaunchApplicationForDevelop == | | == LaunchApplicationForDevelop == |
− | Takes an input u32 [[Process_Manager_services#LaunchFlags|LaunchFlags]] and u64 [[NCM_services#ProgramId|ProgramId]], returns an output u64 PID. | + | Takes an input u32 [[Process_Manager_services#LaunchFlags|LaunchFlags]] and [[NCM_services#ApplicationId|ApplicationId]], returns an output u64 PID. |
| | | |
| Same as LaunchApplicationWithStorageId except the last two params passed to the internal vtable funcptr call are value 0x6, instead of from the command input. | | Same as LaunchApplicationWithStorageId except the last two params passed to the internal vtable funcptr call are value 0x6, instead of from the command input. |
| | | |
| == LaunchApplicationWithStorageIdForDevelop == | | == LaunchApplicationWithStorageIdForDevelop == |
− | Takes 2 input u8s, an u32 [[Process_Manager_services#LaunchFlags|LaunchFlags]], and an u64 [[NCM_services#ProgramId|ProgramId]]. Returns an output u64 PID. | + | Takes 2 input u8s, an u32 [[Process_Manager_services#LaunchFlags|LaunchFlags]], and an [[NCM_services#ApplicationId|ApplicationId]]. Returns an output u64 PID. |
| | | |
| Launches an application title which is registered with NS. | | Launches an application title which is registered with NS. |