NS services: Difference between revisions
(3 intermediate revisions by the same user not shown) | |||
Line 825: | Line 825: | ||
|- | |- | ||
| 931 || [20.0.0+] | | 931 || [20.0.0+] | ||
|- | |||
| 933 || [20.1.0+] | |||
|- | |- | ||
| 1000 || [[#RequestVerifyApplicationDeprecated]] | | 1000 || [[#RequestVerifyApplicationDeprecated]] | ||
Line 999: | Line 1,001: | ||
|- | |- | ||
| 2182 || [6.0.0+] SetActiveRightsContextUsingStateToRightsEnvironment | | 2182 || [6.0.0+] SetActiveRightsContextUsingStateToRightsEnvironment | ||
|- | |||
| 2183 || [20.1.0+] | |||
|- | |- | ||
| 2190 || [6.0.0+] [[#GetRightsEnvironmentHandleForApplication]] | | 2190 || [6.0.0+] [[#GetRightsEnvironmentHandleForApplication]] | ||
Line 1,478: | Line 1,482: | ||
No input, returns an output u64. | No input, returns an output u64. | ||
A state flag must be non-zero, otherwise an error is thrown. When a state field is value 1, a hard-coded ProgramId for MaintenanceMenu is used. Otherwise, the ProgramId is loaded from [[System_Settings|system-setting]] <code>ns.applet!system_applet_id</code>. | A state flag must be non-zero, otherwise an error is thrown. When a state field is value 1, a hard-coded ProgramId for MaintenanceMenu is used. Otherwise, the ProgramId is loaded from [[System_Settings|system-setting]] <code>ns.applet!system_applet_id</code> ([20.0.0+] <code>ns.applet!system_applet_id_gen2</code>). | ||
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 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. | ||
Line 2,006: | Line 2,010: | ||
|- | |- | ||
| 48 || [[#GetFreeSpaceSize]] | | 48 || [[#GetFreeSpaceSize]] | ||
|- | |||
| 58 || [20.1.0+] | |||
|- | |||
| 71 || [20.1.0+] | |||
|- | |- | ||
| 600 || [[#CountApplicationContentMeta]] | | 600 || [[#CountApplicationContentMeta]] | ||
Line 2,161: | Line 2,169: | ||
|- | |- | ||
| 16 || [20.0.0+] || | | 16 || [20.0.0+] || | ||
|- | |||
| 17 || [20.1.0+] || | |||
|} | |} | ||
Line 4,410: | Line 4,420: | ||
= SystemDeliveryInfo = | = SystemDeliveryInfo = | ||
This is "nn::ns::SystemDeliveryInfo". This is a 0x100-byte struct. | This is "nn::ns::SystemDeliveryInfo". This is a 0x100-byte struct. | ||
[20.0.0+] The used (New)SystemUpdateMetaId as selected by NewSystemUpdateMetaIdFlag must now match one of the Ids in [[System_Settings|system-setting]] <code>contents_delivery!acceptable_system_update_ids_string</code>. | |||
{| class="wikitable" border="1" | {| class="wikitable" border="1" | ||
Line 4,427: | Line 4,439: | ||
| 0xC || 0x4 || SystemUpdateMetaVersion. | | 0xC || 0x4 || SystemUpdateMetaVersion. | ||
|- | |- | ||
| 0x10 || 0x8 || SystemUpdateMetaId. | | 0x10 || 0x8 || SystemUpdateMetaId. Always the NX Id. | ||
|- | |- | ||
| 0x18 || 0x1 || FirmwareVariationId. Used by [[#RequestSendSystemUpdate]]. | | 0x18 || 0x1 || FirmwareVariationId. Used by [[#RequestSendSystemUpdate]]. This is set to 0xC on S2. | ||
|- | |- | ||
| 0x19 || 0x1 || UpdatableFirmwareGroupId. Unused by [[#RequestSendSystemUpdate]]/[[#RequestReceiveSystemUpdate]], besides HMAC validation. | | 0x19 || 0x1 || UpdatableFirmwareGroupId. Unused by [[#RequestSendSystemUpdate]]/[[#RequestReceiveSystemUpdate]], besides HMAC validation. This is set to 0x8 on S2. | ||
|- | |- | ||
| 0x1A || 0x1 || PlatformRegion (0x00 = Unknown, 0x01 = Global, 0x02 = China). | | 0x1A || 0x1 || PlatformRegion (0x00 = Unknown, 0x01 = Global, 0x02 = China). | ||
Line 4,437: | Line 4,449: | ||
| 0x1B || 0x1 || [20.0.0+] SystemDeliveryInfoPlatform. Loaded from [[System_Settings|system-setting]] <code>ns.systemupdate!system_delivery_info_platform</code>. Elsewhere this is compared against the sys-setting, etc. | | 0x1B || 0x1 || [20.0.0+] SystemDeliveryInfoPlatform. Loaded from [[System_Settings|system-setting]] <code>ns.systemupdate!system_delivery_info_platform</code>. Elsewhere this is compared against the sys-setting, etc. | ||
|- | |- | ||
| 0x1C || | | 0x1C || 0x1 || [20.0.0+] NewSystemUpdateMetaIdFlag. When non-zero, NewSystemUpdateMetaId is used instead of SystemUpdateMetaId. Always set to 0x1 by [[#GetSystemDeliveryInfo]] with [20.0.0+]. | ||
|- | |||
| 0x1D || 0x3 || Padding | |||
|- | |||
| 0x20 || 0x8 || [20.0.0+] NewSystemUpdateMetaId. See above. With [20.0.0+] [[#GetSystemDeliveryInfo]] now writes the Id here instead of SystemUpdateMetaId. On S2 this is set to the Ounce Id. | |||
|- | |||
| 0x28 || 0xB8 || Unused by [[#RequestSendSystemUpdate]]/[[#RequestReceiveSystemUpdate]], besides HMAC validation. | |||
|- | |- | ||
| 0xE0 || 0x20 || HMAC-SHA256 over the previous 0xE0-bytes. | | 0xE0 || 0x20 || HMAC-SHA256 over the previous 0xE0-bytes. |