libnx  v4.2.0
ns.h
Go to the documentation of this file.
1 /**
2  * @file ns.h
3  * @brief NS services IPC wrapper.
4  * @author yellows8
5  * @copyright libnx Authors
6  */
7 #pragma once
8 #include "../types.h"
9 #include "../nacp.h"
10 #include "../sf/service.h"
11 #include "../services/ncm_types.h"
12 #include "../services/async.h"
13 #include "../services/acc.h"
14 #include "../services/fs.h"
15 #include "../applets/error.h"
16 #include "../kernel/event.h"
17 #include "../kernel/tmem.h"
18 
19 /// ShellEvent
20 typedef enum {
21  NsShellEvent_None = 0, ///< None
22  NsShellEvent_Exit = 1, ///< Exit
23  NsShellEvent_Start = 2, ///< Start
24  NsShellEvent_Crash = 3, ///< Crash
25  NsShellEvent_Debug = 4, ///< Debug
26 } NsShellEvent;
27 
28 /// ApplicationControlSource
29 typedef enum {
30  NsApplicationControlSource_CacheOnly = 0, ///< Returns data from cache.
31  NsApplicationControlSource_Storage = 1, ///< Returns data from storage if not present in cache.
32  NsApplicationControlSource_StorageOnly = 2, ///< Returns data from storage without using cache.
34 
35 /// BackgroundNetworkUpdateState
36 typedef enum {
37  NsBackgroundNetworkUpdateState_None = 0, ///< No sysupdate task exists.
38  NsBackgroundNetworkUpdateState_Downloading = 1, ///< Sysupdate download in progress.
39  NsBackgroundNetworkUpdateState_Ready = 2, ///< Sysupdate ready, pending install.
41 
42 /// LatestSystemUpdate
43 typedef enum {
44  NsLatestSystemUpdate_Unknown0 = 0, ///< Unknown.
45  NsLatestSystemUpdate_Unknown1 = 1, ///< Unknown.
46  NsLatestSystemUpdate_Unknown2 = 2, ///< Unknown.
48 
49 /// RequestServerStopper
50 typedef struct {
51  Service s; ///< IRequestServerStopper
53 
54 /// ProgressMonitorForDeleteUserSaveDataAll
55 typedef struct {
56  Service s; ///< IProgressMonitorForDeleteUserSaveDataAll
58 
59 /// ProgressAsyncResult
60 typedef struct {
61  Service s; ///< IProgressAsyncResult
62  Event event; ///< Event with autoclear=false.
64 
65 /// SystemUpdateControl
66 typedef struct {
67  Service s; ///< ISystemUpdateControl
68  TransferMemory tmem; ///< TransferMemory for SetupCardUpdate/SetupCardUpdateViaSystemUpdater.
70 
71 /// ApplicationControlData
72 typedef struct {
73  NacpStruct nacp; ///< \ref NacpStruct
74  u8 icon[0x20000]; ///< JPEG
76 
77 /// ApplicationOccupiedSize
78 typedef struct {
79  u8 unk_x0[0x80]; ///< Unknown.
81 
82 /// NsApplicationContentMetaStatus
83 typedef struct {
84  u8 meta_type; ///< \ref NcmContentMetaType
85  u8 storageID; ///< \ref NcmStorageId
86  u8 unk_x02; ///< Unknown.
87  u8 padding; ///< Padding.
88  u32 version; ///< Application version.
89  u64 application_id; ///< ApplicationId.
91 
92 /// ApplicationRecord
93 typedef struct {
94  u64 application_id; ///< ApplicationId.
95  u8 type; ///< Type.
96  u8 unk_x09; ///< Unknown.
97  u8 unk_x0a[6]; ///< Unknown.
98  u8 unk_x10; ///< Unknown.
99  u8 unk_x11[7]; ///< Unknown.
101 
102 /// ProgressForDeleteUserSaveDataAll
103 typedef struct {
104  u8 unk_x0[0x28]; ///< Unknown.
106 
107 /// ApplicationViewDeprecated. The below comments are for the \ref NsApplicationView to NsApplicationViewDeprecated conversion done by \ref nsGetApplicationViewDeprecated on newer system-versions.
108 typedef struct {
109  u64 application_id; ///< Same as NsApplicationView::application_id.
110  u8 unk_x8[0x4]; ///< Same as NsApplicationView::unk_x8.
111  u32 flags; ///< Same as NsApplicationView::flags.
112  u8 unk_x10[0x10]; ///< Same as NsApplicationView::unk_x10.
113  u32 unk_x20; ///< Same as NsApplicationView::unk_x20.
114  u16 unk_x24; ///< Same as NsApplicationView::unk_x24.
115  u8 unk_x26[0x2]; ///< Cleared to zero.
116  u8 unk_x28[0x10]; ///< Same as NsApplicationView::unk_x30.
117  u32 unk_x38; ///< Same as NsApplicationView::unk_x40.
118  u8 unk_x3c; ///< Same as NsApplicationView::unk_x44.
119  u8 unk_x3d[3]; ///< Cleared to zero.
121 
122 /// ApplicationView
123 typedef struct {
124  u64 application_id; ///< ApplicationId.
125  u8 unk_x8[0x4]; ///< Unknown.
126  u32 flags; ///< Flags.
127  u8 unk_x10[0x10]; ///< Unknown.
128  u32 unk_x20; ///< Unknown.
129  u16 unk_x24; ///< Unknown.
130  u8 unk_x26[0x2]; ///< Unknown.
131  u8 unk_x28[0x8]; ///< Unknown.
132  u8 unk_x30[0x10]; ///< Unknown.
133  u32 unk_x40; ///< Unknown.
134  u8 unk_x44; ///< Unknown.
135  u8 unk_x45[0xb]; ///< Unknown.
137 
138 /// NsPromotionInfo
139 typedef struct {
140  u64 start_timestamp; ///< POSIX timestamp for the promotion start.
141  u64 end_timestamp; ///< POSIX timestamp for the promotion end.
142  s64 remaining_time; ///< Remaining time until the promotion ends, in nanoseconds ({end_timestamp - current_time} converted to nanoseconds).
143  u8 unk_x18[0x4]; ///< Not set, left at zero.
144  u8 flags; ///< Flags. Bit0: whether the PromotionInfo is valid (including bit1). Bit1 clear: remaining_time is set.
145  u8 pad[3]; ///< Padding.
147 
148 /// NsApplicationViewWithPromotionInfo
149 typedef struct {
150  NsApplicationView view; ///< \ref NsApplicationView
151  NsPromotionInfo promotion; ///< \ref NsPromotionInfo
153 
154 /// LaunchProperties
155 typedef struct {
156  u64 program_id; ///< program_id.
157  u32 version; ///< Program version.
158  u8 storageID; ///< \ref NcmStorageId
159  u8 index; ///< Index.
160  u8 is_application; ///< Whether this is an Application.
162 
163 /// ShellEventInfo
164 typedef struct {
165  NsShellEvent event; ///< \ref NsShellEvent
166  u64 process_id; ///< processID.
168 
169 /// SystemUpdateProgress. Commands which have this as output will return 0 with the output cleared, when no task is available.
170 typedef struct {
171  s64 current_size; ///< 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.
172  s64 total_size; ///< Total size, this field is only valid when >0.
174 
175 /// ReceiveApplicationProgress. Same as \ref NsSystemUpdateProgress, except cmds which return this will return actual errors on failure, instead of returning 0 with a cleared struct.
177 
178 /// SendApplicationProgress. Same as \ref NsSystemUpdateProgress, except cmds which return this will return actual errors on failure, instead of returning 0 with a cleared struct.
180 
181 /// EulaDataPath
182 typedef struct {
183  char path[0x100]; ///< Path.
185 
186 /// SystemDeliveryInfo
187 typedef struct {
188  struct {
189  u32 system_delivery_protocol_version; ///< Must match a system-setting.
190  u32 application_delivery_protocol_version; ///< Loaded from a system-setting. Unused by \ref nssuRequestSendSystemUpdate / \ref nssuControlRequestReceiveSystemUpdate, besides HMAC validation.
191  u32 includes_exfat; ///< Whether ExFat is included. Unused by \ref nssuRequestSendSystemUpdate / \ref nssuControlRequestReceiveSystemUpdate, besides HMAC validation.
192  u32 system_update_meta_version; ///< SystemUpdate meta version.
193  u64 system_update_meta_id; ///< SystemUpdate meta Id.
194  u8 unk_x18; ///< Copied into state by \ref nssuRequestSendSystemUpdate.
195  u8 unk_x19; ///< Unused by \ref nssuRequestSendSystemUpdate / \ref nssuControlRequestReceiveSystemUpdate, besides HMAC validation.
196  u8 unk_x1a; ///< Unknown.
197  u8 unk_x1b[0xc5]; ///< Unused by \ref nssuRequestSendSystemUpdate / \ref nssuControlRequestReceiveSystemUpdate, besides HMAC validation.
198  } data; ///< Data used with the below hmac.
199  u8 hmac[0x20]; ///< HMAC-SHA256 over the above data.
201 
202 /// ApplicationDeliveryInfo
203 typedef struct {
204  struct {
205  u8 unk_x0[0x10]; ///< Unknown.
206  u32 application_version; ///< Application version.
207  u32 unk_x14; ///< Unknown.
208  u32 required_system_version; ///< Required system version, see NsSystemDeliveryInfo::system_update_meta_version.
209  u32 unk_x1c; ///< Unknown.
210  u8 unk_x20[0xc0]; ///< Unknown.
211  } data; ///< Data used with the below hmac.
212  u8 hmac[0x20]; ///< HMAC-SHA256 over the above data.
214 
215 /// NsApplicationRightsOnClient
216 typedef struct {
217  u64 application_id; ///< ApplicationId.
218  AccountUid uid; ///< \ref AccountUid
219  u8 flags_x18; ///< qlaunch uses bit0-bit4 and bit7 from here.
220  u8 flags_x19; ///< qlaunch uses bit0 from here.
221  u8 unk_x1a[0x6]; ///< Unknown.
223 
224 /// DownloadTaskStatus
225 typedef struct {
226  u8 unk_x0[0x20]; ///< Unknown.
228 
229 /// Default size for \ref nssuControlSetupCardUpdate / \ref nssuControlSetupCardUpdateViaSystemUpdater. This is the size used by qlaunch for SetupCardUpdate.
230 #define NSSU_CARDUPDATE_TMEM_SIZE_DEFAULT 0x100000
231 
232 ///@name ns
233 ///@{
234 
235 /// Initialize ns services. Uses ns:am on pre-3.0.0, ns:am2 on [3.0.0+].
236 Result nsInitialize(void);
237 
238 /// Exit ns services.
239 void nsExit(void);
240 
241 /// Gets the Service object for the actual ns:* service session. Only initialized on [3.0.0+], on pre-3.0.0 see \ref nsGetServiceSession_ApplicationManagerInterface.
243 
244 /// Gets the Service object for IApplicationManagerInterface. Only initialized on pre-3.0.0, on [3.0.0+] use \ref nsGetApplicationManagerInterface.
246 
247 /// Gets the Service object for IDynamicRightsInterface via the cmd for that.
248 /// Only available on [6.0.0+].
250 
251 /// Gets the Service object for IReadOnlyApplicationControlDataInterface via the cmd for that.
252 /// Only available on [5.1.0+].
254 
255 /// Gets the Service object for IReadOnlyApplicationRecordInterface via the cmd for that.
256 /// Only available on [5.0.0+].
258 
259 /// Gets the Service object for IECommerceInterface via the cmd for that.
260 /// Only available on [4.0.0+].
262 
263 /// Gets the Service object for IApplicationVersionInterface via the cmd for that.
264 /// Only available on [4.0.0+].
266 
267 /// Gets the Service object for IFactoryResetInterface via the cmd for that.
268 /// Only available on [3.0.0+].
270 
271 /// Gets the Service object for IAccountProxyInterface via the cmd for that.
272 /// Only available on [3.0.0+].
274 
275 /// Gets the Service object for IApplicationManagerInterface via the cmd for that.
276 /// Only available on [3.0.0+], on prior sysvers use \ref nsGetServiceSession_ApplicationManagerInterface.
278 
279 /// Gets the Service object for IDownloadTaskInterface via the cmd for that.
280 /// Only available on [3.0.0+].
282 
283 /// Gets the Service object for IContentManagementInterface via the cmd for that.
284 /// Only available on [3.0.0+].
286 
287 /// Gets the Service object for IDocumentInterface via the cmd for that.
288 /// Only available on [3.0.0+].
290 
291 ///@}
292 
293 ///@name IReadOnlyApplicationControlDataInterface
294 ///@{
295 
296 /**
297  * @brief Gets the \ref NsApplicationControlData for the specified application.
298  * @note Uses \ref nsGetReadOnlyApplicationControlDataInterface on [5.1.0+], otherwise IApplicationManagerInterface is used.
299  * @param[in] source Source, official sw uses ::NsApplicationControlSource_Storage.
300  * @param[in] application_id ApplicationId.
301  * @param[out] buffer \ref NsApplicationControlData
302  * @param[in] size Size of the buffer.
303  * @param[out] actual_size Actual output size.
304  */
305 Result nsGetApplicationControlData(NsApplicationControlSource source, u64 application_id, NsApplicationControlData* buffer, size_t size, u64* actual_size);
306 
307 /**
308  * @brief GetApplicationDesiredLanguage. Selects a \ref NacpLanguageEntry to use from the specified \ref NacpStruct.
309  * @note Uses \ref nsGetReadOnlyApplicationControlDataInterface on [5.1.0+], otherwise IApplicationManagerInterface is used.
310  * @param[in] nacp \ref NacpStruct
311  * @param[out] langentry \ref NacpLanguageEntry
312  */
314 
315 ///@}
316 
317 ///@name IECommerceInterface
318 ///@{
319 
320 /**
321  * @brief RequestLinkDevice
322  * @note \ref nifmInitialize must be used prior to this. Before using the cmd, this calls \ref nifmIsAnyInternetRequestAccepted with the output from \ref nifmGetClientId, an error is returned when that returns false.
323  * @note Only available on [4.0.0+].
324  * @param[out] a \ref AsyncResult
325  * @param[in] uid \ref AccountUid
326  */
328 
329 /**
330  * @brief RequestSyncRights
331  * @note Only available on [6.0.0+].
332  * @param[out] a \ref AsyncResult
333  */
335 
336 /**
337  * @brief RequestUnlinkDevice
338  * @note \ref nifmInitialize must be used prior to this. Before using the cmd, this calls \ref nifmIsAnyInternetRequestAccepted with the output from \ref nifmGetClientId, an error is returned when that returns false.
339  * @note Only available on [6.0.0+].
340  * @param[out] a \ref AsyncResult
341  * @param[in] uid \ref AccountUid
342  */
344 
345 ///@}
346 
347 ///@name IFactoryResetInterface
348 ///@{
349 
350 /**
351  * @brief ResetToFactorySettings
352  * @note Uses \ref nsGetFactoryResetInterface on [3.0.0+], otherwise IApplicationManagerInterface is used.
353  */
355 
356 /**
357  * @brief ResetToFactorySettingsWithoutUserSaveData
358  * @note Uses \ref nsGetFactoryResetInterface on [3.0.0+], otherwise IApplicationManagerInterface is used.
359  */
361 
362 /**
363  * @brief ResetToFactorySettingsForRefurbishment
364  * @note Uses \ref nsGetFactoryResetInterface on [3.0.0+], otherwise IApplicationManagerInterface is used.
365  * @note Only available on [2.0.0+].
366  */
368 
369 /**
370  * @brief ResetToFactorySettingsWithPlatformRegion
371  * @note Only available on [9.1.0+].
372  */
374 
375 /**
376  * @brief ResetToFactorySettingsWithPlatformRegionAuthentication
377  * @note Only available on [9.1.0+].
378  */
380 
381 ///@}
382 
383 ///@name IApplicationManagerInterface
384 ///@{
385 
386 /**
387  * @brief Gets an listing of \ref NsApplicationRecord.
388  * @param[out] records Output array of \ref NsApplicationRecord.
389  * @param[in] count Size of the records array in entries.
390  * @param[in] entry_offset Starting entry offset.
391  * @param[out] out_entrycount Total output entries.
392  */
393 Result nsListApplicationRecord(NsApplicationRecord* records, s32 count, s32 entry_offset, s32* out_entrycount);
394 
395 /**
396  * @brief GetApplicationRecordUpdateSystemEvent
397  * @note The Event must be closed by the user once finished with it.
398  * @param[out] out_event Output Event with autoclear=true.
399  */
401 
402 /**
403  * @brief GetApplicationViewDeprecated
404  * @note On [3.0.0+] you should generally use \ref nsGetApplicationView instead.
405  * @param[out] out Output array of \ref NsApplicationViewDeprecated.
406  * @param[in] application_ids Input array of ApplicationIds.
407  * @param[in] count Size of the input/output arrays in entries.
408  */
409 Result nsGetApplicationViewDeprecated(NsApplicationViewDeprecated *views, const u64 *application_ids, s32 count);
410 
411 /**
412  * @brief DeleteApplicationEntity
413  * @param[in] application_id ApplicationId.
414  */
415 Result nsDeleteApplicationEntity(u64 application_id);
416 
417 /**
418  * @brief DeleteApplicationCompletely
419  * @param[in] application_id ApplicationId.
420  */
422 
423 /**
424  * @brief DeleteRedundantApplicationEntity
425  */
427 
428 /**
429  * @brief IsApplicationEntityMovable
430  * @param[in] application_id ApplicationId.
431  * @param[in] storage_id \ref NcmStorageId
432  * @param[out] out Output flag.
433  */
434 Result nsIsApplicationEntityMovable(u64 application_id, NcmStorageId storage_id, bool *out);
435 
436 /**
437  * @brief MoveApplicationEntity
438  * @note Only available on [1.0.0-9.2.0].
439  * @param[in] application_id ApplicationId.
440  * @param[in] storage_id \ref NcmStorageId
441  */
442 Result nsMoveApplicationEntity(u64 application_id, NcmStorageId storage_id);
443 
444 /**
445  * @brief RequestApplicationUpdateInfo
446  * @note \ref nifmInitialize must be used prior to this. Before using the cmd, this calls \ref nifmIsAnyInternetRequestAccepted with the output from \ref nifmGetClientId, an error is returned when that returns false.
447  * @param[out] a \ref AsyncValue. The data that can be read from this is u8 ApplicationUpdateInfo. qlaunch just checks whether this is 0.
448  * @param application_id ApplicationId.
449  */
451 
452 /**
453  * @brief CancelApplicationDownload
454  * @param[in] application_id ApplicationId.
455  */
456 Result nsCancelApplicationDownload(u64 application_id);
457 
458 /**
459  * @brief ResumeApplicationDownload
460  * @param[in] application_id ApplicationId.
461  */
462 Result nsResumeApplicationDownload(u64 application_id);
463 
464 /**
465  * @brief CheckApplicationLaunchVersion
466  * @param[in] application_id ApplicationId.
467  */
469 
470 /**
471  * @brief CalculateApplicationApplyDeltaRequiredSize
472  * @param[in] application_id ApplicationId.
473  * @param[out] storage_id Output \ref NcmStorageId.
474  * @param[out] size Output size.
475  */
476 Result nsCalculateApplicationDownloadRequiredSize(u64 application_id, NcmStorageId *storage_id, s64 *size);
477 
478 /**
479  * @brief CleanupSdCard
480  */
481 Result nsCleanupSdCard(void);
482 
483 /**
484  * @brief GetSdCardMountStatusChangedEvent
485  * @note The Event must be closed by the user once finished with it.
486  * @param[out] out_event Output Event with autoclear=false.
487  */
489 
490 /**
491  * @brief GetGameCardUpdateDetectionEvent
492  * @note The Event must be closed by the user once finished with it.
493  * @param[out] out_event Output Event with autoclear=false.
494  */
496 
497 /**
498  * @brief DisableApplicationAutoDelete
499  * @param[in] application_id ApplicationId.
500  */
502 
503 /**
504  * @brief EnableApplicationAutoDelete
505  * @param[in] application_id ApplicationId.
506  */
508 
509 /**
510  * @brief SetApplicationTerminateResult
511  * @param[in] application_id ApplicationId.
512  * @param[in] res Result.
513  */
514 Result nsSetApplicationTerminateResult(u64 application_id, Result res);
515 
516 /**
517  * @brief ClearApplicationTerminateResult
518  * @param[in] application_id ApplicationId.
519  */
521 
522 /**
523  * @brief GetLastSdCardMountUnexpectedResult
524  */
526 
527 /**
528  * @brief Opens a \ref NsRequestServerStopper.
529  * @note Only available on [2.0.0+].
530  * @param[out] r \ref NsRequestServerStopper
531  */
533 
534 /**
535  * @brief CancelApplicationApplyDelta
536  * @note Only available on [3.0.0+].
537  * @param[in] application_id ApplicationId.
538  */
540 
541 /**
542  * @brief ResumeApplicationApplyDelta
543  * @note Only available on [3.0.0+].
544  * @param[in] application_id ApplicationId.
545  */
547 
548 /**
549  * @brief CalculateApplicationApplyDeltaRequiredSize
550  * @note Only available on [3.0.0+].
551  * @param[in] application_id ApplicationId.
552  * @param[out] storage_id Output \ref NcmStorageId.
553  * @param[out] size Output size.
554  */
555 Result nsCalculateApplicationApplyDeltaRequiredSize(u64 application_id, NcmStorageId *storage_id, s64 *size);
556 
557 /**
558  * @brief ResumeAll
559  * @note Only available on [3.0.0+].
560  */
561 Result nsResumeAll(void);
562 
563 /**
564  * @brief Temporarily mounts the specified fs ContentStorage, then uses fs GetTotalSpaceSize/GetFreeSpaceSize with that mounted ContentStorage.
565  * @note Only available on [3.0.0+].
566  * @param[in] storage_id \ref NcmStorageId, must be ::NcmStorageId_BuiltInUser or ::NcmStorageId_SdCard.
567  * @param[out] total_space_size Output from GetTotalSpaceSize.
568  * @param[out] free_space_size Output from GetFreeSpaceSize.
569  */
570 Result nsGetStorageSize(NcmStorageId storage_id, s64 *total_space_size, s64 *free_space_size);
571 
572 /**
573  * @brief RequestUpdateApplication2
574  * @note \ref nifmInitialize must be used prior to this. Before using the cmd, this calls \ref nifmIsAnyInternetRequestAccepted with the output from \ref nifmGetClientId, an error is returned when that returns false.
575  * @note Only available on [4.0.0+].
576  * @param[out] a \ref AsyncResult
577  * @param[in] application_id ApplicationId.
578  */
580 
581 /**
582  * @brief DeleteUserSaveDataAll
583  * @param[in] p \ref NsProgressMonitorForDeleteUserSaveDataAll
584  * @param[in] uid \ref AccountUid
585  */
587 
588 /**
589  * @brief DeleteUserSystemSaveData
590  * @param[in] uid \ref AccountUid
591  * @param[in] system_save_data_id SystemSaveDataId
592  */
593 Result nsDeleteUserSystemSaveData(AccountUid uid, u64 system_save_data_id);
594 
595 /**
596  * @brief DeleteSaveData
597  * @note Only available on [6.0.0+].
598  * @param[in] save_data_space_id \ref FsSaveDataSpaceId
599  * @param[in] save_data_id SaveDataId
600  */
601 Result nsDeleteSaveData(FsSaveDataSpaceId save_data_space_id, u64 save_data_id);
602 
603 /**
604  * @brief UnregisterNetworkServiceAccount
605  * @param[in] uid \ref AccountUid
606  */
608 
609 /**
610  * @brief UnregisterNetworkServiceAccountWithUserSaveDataDeletion
611  * @note Only available on [6.0.0+].
612  * @param[in] uid \ref AccountUid
613  */
615 
616 /**
617  * @brief RequestDownloadApplicationControlData
618  * @note \ref nifmInitialize must be used prior to this. Before using the cmd, this calls \ref nifmIsAnyInternetRequestAccepted with the output from \ref nifmGetClientId, an error is returned when that returns false.
619  * @param[out] a \ref AsyncResult
620  * @param[in] application_id ApplicationId.
621  */
623 
624 /**
625  * @brief ListApplicationTitle
626  * @note The data available with \ref asyncValueGet is a s32 for the offset within the buffer where the output data is located, \ref asyncValueGetSize returns the total byte-size of the data located here. The data located here is the \ref NacpLanguageEntry for each specified ApplicationId.
627  * @note Only available on [8.0.0+].
628  * @param[out] a \ref AsyncValue
629  * @param[in] source Source, qlaunch uses ::NsApplicationControlSource_Storage.
630  * @param[in] application_ids Input array of ApplicationIds.
631  * @param[in] count Size of the application_ids array in entries.
632  * @param buffer 0x1000-byte aligned buffer for TransferMemory. This buffer must not be accessed until the async operation finishes.
633  * @param[in] size 0x1000-byte aligned buffer size for TransferMemory. This must be at least: count*sizeof(\ref NacpLanguageEntry) + count*sizeof(u64) + count*sizeof(\ref NsApplicationControlData).
634  */
635 Result nsListApplicationTitle(AsyncValue *a, NsApplicationControlSource source, const u64 *application_ids, s32 count, void* buffer, size_t size);
636 
637 /**
638  * @brief ListApplicationIcon
639  * @note The data available with \ref asyncValueGet is a s32 for the offset within the buffer where the output data is located, \ref asyncValueGetSize returns the total byte-size of the data located here. This data is: an u64 for total entries, an array of u64s for each icon size, then the icon JPEGs for the specified ApplicationIds.
640  * @note Only available on [8.0.0+].
641  * @param[out] a \ref AsyncValue
642  * @param[in] source Source.
643  * @param[in] application_ids Input array of ApplicationIds.
644  * @param[in] count Size of the application_ids array in entries.
645  * @param buffer 0x1000-byte aligned buffer for TransferMemory. This buffer must not be accessed until the async operation finishes.
646  * @param[in] size 0x1000-byte aligned buffer size for TransferMemory. This must be at least: 0x4 + count*sizeof(u64) + count*sizeof(\ref NsApplicationControlData::icon) + count*sizeof(u64) + sizeof(\ref NsApplicationControlData).
647  */
648 Result nsListApplicationIcon(AsyncValue *a, NsApplicationControlSource source, const u64 *application_ids, s32 count, void* buffer, size_t size);
649 
650 /**
651  * @brief RequestCheckGameCardRegistration
652  * @note \ref nifmInitialize must be used prior to this. Before using the cmd, this calls \ref nifmIsAnyInternetRequestAccepted with the output from \ref nifmGetClientId, an error is returned when that returns false.
653  * @note Only available on [2.0.0+].
654  * @param[out] a \ref AsyncResult
655  * @param[in] application_id ApplicationId.
656  */
658 
659 /**
660  * @brief RequestGameCardRegistrationGoldPoint
661  * @note \ref nifmInitialize must be used prior to this. Before using the cmd, this calls \ref nifmIsAnyInternetRequestAccepted with the output from \ref nifmGetClientId, an error is returned when that returns false.
662  * @note Only available on [2.0.0+].
663  * @param[out] a \ref AsyncValue. The data that can be read from this is 4-bytes.
664  * @param[in] uid \ref AccountUid
665  * @param[in] application_id ApplicationId.
666  */
668 
669 /**
670  * @brief RequestRegisterGameCard
671  * @note \ref nifmInitialize must be used prior to this. Before using the cmd, this calls \ref nifmIsAnyInternetRequestAccepted with the output from \ref nifmGetClientId, an error is returned when that returns false.
672  * @note Only available on [2.0.0+].
673  * @param[out] a \ref AsyncResult
674  * @param[in] uid \ref AccountUid
675  * @param[in] application_id ApplicationId.
676  * @param[in] inval Input value.
677  */
678 Result nsRequestRegisterGameCard(AsyncResult *a, AccountUid uid, u64 application_id, s32 inval);
679 
680 /**
681  * @brief GetGameCardMountFailureEvent
682  * @note The Event must be closed by the user once finished with it.
683  * @note Only available on [3.0.0+].
684  * @param[out] out_event Output Event with autoclear=false.
685  */
687 
688 /**
689  * @brief IsGameCardInserted
690  * @note Only available on [3.0.0+].
691  * @param[out] out Output flag.
692  */
693 Result nsIsGameCardInserted(bool *out);
694 
695 /**
696  * @brief EnsureGameCardAccess
697  * @note Only available on [3.0.0+].
698  */
700 
701 /**
702  * @brief GetLastGameCardMountFailureResult
703  * @note Only available on [3.0.0+].
704  */
706 
707 /**
708  * @brief ListApplicationIdOnGameCard
709  * @note Only available on [5.0.0+].
710  * @param[out] application_ids Output array of ApplicationIds.
711  * @param[in] count Size of the application_ids array in entries.
712  * @param[out] total_out Total output entries.
713  */
714 Result nsListApplicationIdOnGameCard(u64 *application_ids, s32 count, s32 *total_out);
715 
716 /**
717  * @brief TouchApplication
718  * @note Only available on [2.0.0+].
719  * @param[in] application_id ApplicationId.
720  */
721 Result nsTouchApplication(u64 application_id);
722 
723 /**
724  * @brief IsApplicationUpdateRequested
725  * @note Only available on [2.0.0+].
726  * @param[in] application_id ApplicationId.
727  * @param[out] flag Output flag, indicating whether out is valid.
728  * @param[out] out Output value.
729  */
730 Result nsIsApplicationUpdateRequested(u64 application_id, bool *flag, u32 *out);
731 
732 /**
733  * @brief WithdrawApplicationUpdateRequest
734  * @note Only available on [2.0.0+].
735  * @param[in] application_id ApplicationId.
736  */
738 
739 /**
740  * @brief RequestVerifyAddOnContentsRights
741  * @note Only available on [3.0.0-9.2.0].
742  * @param[out] a \ref NsProgressAsyncResult
743  * @param[in] application_id ApplicationId.
744  */
746 
747 /**
748  * @brief RequestVerifyApplication
749  * @note On pre-5.0.0 this uses cmd RequestVerifyApplicationDeprecated, otherwise cmd RequestVerifyApplication is used.
750  * @param[out] a \ref NsProgressAsyncResult. The data available with \ref nsProgressAsyncResultGetProgress is basically the same as \ref NsSystemUpdateProgress.
751  * @param[in] application_id ApplicationId.
752  * @param[in] unk Unknown. A default value of 0x7 can be used (which is what qlaunch uses). Only used on [5.0.0+].
753  * @param buffer 0x1000-byte aligned buffer for TransferMemory. This buffer must not be accessed until the async operation finishes.
754  * @param[in] size 0x1000-byte aligned buffer size for TransferMemory. qlaunch uses size 0x100000.
755  */
756 Result nsRequestVerifyApplication(NsProgressAsyncResult *a, u64 application_id, u32 unk, void* buffer, size_t size);
757 
758 /**
759  * @brief IsAnyApplicationEntityInstalled
760  * @note Only available on [2.0.0+].
761  * @param[in] application_id ApplicationId.
762  * @param[out] out Output flag.
763  */
764 Result nsIsAnyApplicationEntityInstalled(u64 application_id, bool *out);
765 
766 /**
767  * @brief CleanupUnavailableAddOnContents
768  * @note Only available on [6.0.0+].
769  * @param[in] application_id ApplicationId.
770  * @param[in] uid \ref AccountUid
771  */
773 
774 /**
775  * @brief FormatSdCard
776  * @note Only available on [2.0.0+].
777  */
778 Result nsFormatSdCard(void);
779 
780 /**
781  * @brief NeedsSystemUpdateToFormatSdCard
782  * @note Only available on [2.0.0+].
783  * @param[out] out Output flag.
784  */
786 
787 /**
788  * @brief GetLastSdCardFormatUnexpectedResult
789  * @note Only available on [2.0.0+].
790  */
792 
793 /**
794  * @brief GetApplicationView
795  * @note Only available on [3.0.0+], on prior system-versions use \ref nsGetApplicationViewDeprecated instead.
796  * @param[out] out Output array of \ref NsApplicationView.
797  * @param[in] application_ids Input array of ApplicationIds.
798  * @param[in] count Size of the input/output arrays in entries.
799  */
800 Result nsGetApplicationView(NsApplicationView *views, const u64 *application_ids, s32 count);
801 
802 /**
803  * @brief GetApplicationViewDownloadErrorContext
804  * @note Only available on [4.0.0+].
805  * @param[in] application_id ApplicationId
806  * @param[out] context \ref ErrorContext
807  */
809 
810 /**
811  * @brief GetApplicationViewWithPromotionInfo
812  * @note Only available on [8.0.0+].
813  * @param[out] out Output array of \ref NsApplicationViewWithPromotionInfo.
814  * @param[in] application_ids Input array of ApplicationIds.
815  * @param[in] count Size of the input/output arrays in entries.
816  */
818 
819 /**
820  * @brief RequestDownloadApplicationPrepurchasedRights
821  * @note \ref nifmInitialize must be used prior to this. Before using the cmd, this calls \ref nifmIsAnyInternetRequestAccepted with the output from \ref nifmGetClientId, an error is returned when that returns false.
822  * @note Only available on [4.0.0+].
823  * @param[out] a \ref AsyncResult
824  * @param[in] application_id ApplicationId.
825  */
827 
828 /**
829  * @brief Generates a \ref NsSystemDeliveryInfo using the currently installed SystemUpdate meta.
830  * @note Only available on [4.0.0+].
831  * @param[out] info \ref NsSystemDeliveryInfo
832  */
834 
835 /**
836  * @brief SelectLatestSystemDeliveryInfo
837  * @note This selects the \ref NsSystemDeliveryInfo with the latest version from sys_list, using minimum versions determined from app_list/state and base_info. This also does various validation, etc.
838  * @note Only available on [4.0.0+].
839  * @param[in] sys_list Input array of \ref NsSystemDeliveryInfo.
840  * @param[in] sys_count Size of the sys_list array in entries.
841  * @param[in] base_info \ref NsSystemDeliveryInfo
842  * @param[in] app_list Input array of \ref NsApplicationDeliveryInfo. This can be NULL.
843  * @param[in] app_count Size of the app_list array in entries. This can be 0.
844  * @param[out] index Output index for the selected entry in sys_list, -1 if none found.
845  */
846 Result nsSelectLatestSystemDeliveryInfo(const NsSystemDeliveryInfo *sys_list, s32 sys_count, const NsSystemDeliveryInfo *base_info, const NsApplicationDeliveryInfo *app_list, s32 app_count, s32 *index);
847 
848 /**
849  * @brief VerifyDeliveryProtocolVersion
850  * @note Only available on [4.0.0+].
851  * @param[in] info \ref NsSystemDeliveryInfo
852  */
854 
855 /**
856  * @brief Generates \ref NsApplicationDeliveryInfo for the specified ApplicationId.
857  * @note Only available on [4.0.0+].
858  * @param[out] info Output array of \ref NsApplicationDeliveryInfo.
859  * @param[in] count Size of the array in entries.
860  * @param[in] application_id ApplicationId
861  * @param[in] attr ApplicationDeliveryAttributeTag bitmask.
862  * @param[out] total_out Total output entries.
863  */
864 Result nsGetApplicationDeliveryInfo(NsApplicationDeliveryInfo *info, s32 count, u64 application_id, u32 attr, s32 *total_out);
865 
866 /**
867  * @brief HasAllContentsToDeliver
868  * @note Only available on [4.0.0+].
869  * @param[in] info Input array of \ref NsApplicationDeliveryInfo.
870  * @param[in] count Size of the array in entries. Must be value 1.
871  * @param[out] out Output flag.
872  */
873 Result nsHasAllContentsToDeliver(const NsApplicationDeliveryInfo* info, s32 count, bool *out);
874 
875 /**
876  * @brief Both \ref NsApplicationDeliveryInfo are validated, then the application_version in the first/second \ref NsApplicationDeliveryInfo are compared.
877  * @note Only available on [4.0.0+].
878  * @param[in] info0 First input array of \ref NsApplicationDeliveryInfo.
879  * @param[in] count0 Size of the info0 array in entries. Must be value 1.
880  * @param[in] info1 Second input array of \ref NsApplicationDeliveryInfo.
881  * @param[in] count1 Size of the info1 array in entries. Must be value 1.
882  * @param[out] out Comparison result: -1 for less than, 0 for equal, and 1 for higher than.
883  */
885 
886 /**
887  * @brief CanDeliverApplication
888  * @note Only available on [4.0.0+].
889  * @param[in] info0 First input array of \ref NsApplicationDeliveryInfo.
890  * @param[in] count0 Size of the info0 array in entries. Must be value <=1, when 0 this will return 0 with out set to 0.
891  * @param[in] info1 Second input array of \ref NsApplicationDeliveryInfo.
892  * @param[in] count1 Size of the info1 array in entries. Must be value 1.
893  * @param[out] out Output flag.
894  */
895 Result nsCanDeliverApplication(const NsApplicationDeliveryInfo *info0, s32 count0, const NsApplicationDeliveryInfo *info1, s32 count1, bool *out);
896 
897 /**
898  * @brief ListContentMetaKeyToDeliverApplication
899  * @note Only available on [4.0.0+].
900  * @param[out] meta Output array of \ref NcmContentMetaKey.
901  * @param[in] meta_count Size of the meta array in entries. Must be at least 1, only 1 entry will be returned.
902  * @param[in] meta_index Meta entry index. An output \ref NcmContentMetaKey will not be returned when this value is larger than 0.
903  * @param[in] info Input array of \ref NsApplicationDeliveryInfo.
904  * @param[in] info_count Size of the info array in entries. Must be value 1.
905  * @param[out] total_out Total output entries.
906  */
907 Result nsListContentMetaKeyToDeliverApplication(NcmContentMetaKey *meta, s32 meta_count, s32 meta_index, const NsApplicationDeliveryInfo *info, s32 info_count, s32 *total_out);
908 
909 /**
910  * @brief After validation etc, this sets the output bool by comparing system-version fields in the \ref NsSystemDeliveryInfo / info-array and with a state field.
911  * @note Only available on [4.0.0+].
912  * @param[in] info Input array of \ref NsApplicationDeliveryInfo.
913  * @param[in] count Size of the info array in entries. Must be value 1.
914  * @param[in] sys_info \ref NsSystemDeliveryInfo
915  * @param[out] out Output flag.
916  */
918 
919 /**
920  * @brief EstimateRequiredSize
921  * @note Only available on [4.0.0+].
922  * @param[in] meta Input array of \ref NcmContentMetaKey.
923  * @param[in] count Size of the meta array in entries. When less than 1, this will return 0 with out set to 0.
924  * @param[out] out Output size.
925  */
926 Result nsEstimateRequiredSize(const NcmContentMetaKey *meta, s32 count, s64 *out);
927 
928 /**
929  * @brief RequestReceiveApplication
930  * @note This is the Application version of \ref nssuControlRequestReceiveSystemUpdate, see the notes for that.
931  * @note Only available on [4.0.0+].
932  * @param[out] a \ref AsyncResult
933  * @param[in] addr Server IPv4 address.
934  * @param[in] port Socket port. qlaunch uses value 55556.
935  * @param[in] application_id ApplicationId
936  * @param[in] meta Input array of \ref NcmContentMetaKey. The ::NcmContentMetaType must match ::NcmContentMetaType_Patch.
937  * @param[in] count Size of the meta array in entries.
938  * @param[in] storage_id \ref NcmStorageId. qlaunch uses ::NcmStorageId_Any.
939  */
940 Result nsRequestReceiveApplication(AsyncResult *a, u32 addr, u16 port, u64 application_id, const NcmContentMetaKey *meta, s32 count, NcmStorageId storage_id);
941 
942 /**
943  * @brief CommitReceiveApplication
944  * @note Only available on [4.0.0+].
945  * @param[in] application_id ApplicationId
946  */
947 Result nsCommitReceiveApplication(u64 application_id);
948 
949 /**
950  * @brief GetReceiveApplicationProgress
951  * @note Only available on [4.0.0+].
952  * @param[in] application_id ApplicationId
953  * @param[out] out \ref NsReceiveApplicationProgress
954  */
956 
957 /**
958  * @brief RequestSendApplication
959  * @note This is the Application version of \ref nssuRequestSendSystemUpdate, see the notes for that.
960  * @note Only available on [4.0.0+].
961  * @param[out] a \ref AsyncResult
962  * @param[in] addr Client IPv4 address.
963  * @param[in] port Socket port. qlaunch uses value 55556.
964  * @param[in] application_id ApplicationId
965  * @param[in] meta Input array of \ref NcmContentMetaKey. The ::NcmContentMetaType must match ::NcmContentMetaType_Patch.
966  * @param[in] count Size of the meta array in entries.
967  */
968 Result nsRequestSendApplication(AsyncResult *a, u32 addr, u16 port, u64 application_id, const NcmContentMetaKey *meta, s32 count);
969 
970 /**
971  * @brief GetSendApplicationProgress
972  * @note Only available on [4.0.0+].
973  * @param[in] application_id ApplicationId
974  * @param[out] out \ref NsSendApplicationProgress
975  */
977 
978 /**
979  * @brief Both \ref NsSystemDeliveryInfo are validated, then the system_update_meta_version in the first/second \ref NsSystemDeliveryInfo are compared.
980  * @note Only available on [4.0.0+].
981  * @param[in] info0 First \ref NsSystemDeliveryInfo.
982  * @param[in] info1 Second \ref NsSystemDeliveryInfo.
983  * @param[out] out Comparison result: -1 for less than, 0 for equal, and 1 for higher than.
984  */
986 
987 /**
988  * @brief ListNotCommittedContentMeta
989  * @note Only available on [4.0.0+].
990  * @param[out] meta Output array of \ref NcmContentMetaKey.
991  * @param[in] count Size of the meta array in entries.
992  * @param[in] application_id ApplicationId
993  * @param[in] unk Unknown.
994  * @param[out] total_out Total output entries.
995  */
996 Result nsListNotCommittedContentMeta(NcmContentMetaKey *meta, s32 count, u64 application_id, s32 unk, s32 *total_out);
997 
998 /**
999  * @brief This extracts data from the input array for hashing with SHA256, with validation being done when handling each entry.
1000  * @note Only available on [5.0.0+].
1001  * @param[in] info Input array of \ref NsApplicationDeliveryInfo.
1002  * @param[in] count Size of the array in entries.
1003  * @param[out] out_hash Output 0x20-byte SHA256 hash.
1004  */
1006 
1007 /**
1008  * @brief GetApplicationTerminateResult
1009  * @note Only available on [6.0.0+].
1010  * @param[in] application_id ApplicationId.
1011  * @param[out] res Output Result.
1012  */
1013 Result nsGetApplicationTerminateResult(u64 application_id, Result *res);
1014 
1015 /**
1016  * @brief GetApplicationRightsOnClient
1017  * @note Only available on [6.0.0+].
1018  * @param[out] rights Output array of \ref NsApplicationRightsOnClient.
1019  * @param[in] count Size of the rights array in entries. qlaunch uses value 3 for this.
1020  * @param[in] application_id ApplicationId
1021  * @param[in] uid \ref AccountUid, can optionally be all-zero.
1022  * @param[in] flags Flags. Official sw hard-codes this to value 0x3.
1023  * @param[out] total_out Total output entries.
1024  */
1025 Result nsGetApplicationRightsOnClient(NsApplicationRightsOnClient *rights, s32 count, u64 application_id, AccountUid uid, u32 flags, s32 *total_out);
1026 
1027 /**
1028  * @brief RequestNoDownloadRightsErrorResolution
1029  * @note \ref nifmInitialize must be used prior to this. Before using the cmd, this calls \ref nifmIsAnyInternetRequestAccepted with the output from \ref nifmGetClientId, an error is returned when that returns false.
1030  * @note Only available on [9.0.0+].
1031  * @param[out] a \ref AsyncValue. The data that can be read from this is u8 NoDownloadRightsErrorResolution.
1032  * @param application_id ApplicationId.
1033  */
1035 
1036 /**
1037  * @brief RequestResolveNoDownloadRightsError
1038  * @note \ref nifmInitialize must be used prior to this. Before using the cmd, this calls \ref nifmIsAnyInternetRequestAccepted with the output from \ref nifmGetClientId, an error is returned when that returns false.
1039  * @note Only available on [9.0.0+].
1040  * @param[out] a \ref AsyncValue. The data that can be read from this is u8 NoDownloadRightsErrorResolution.
1041  * @param application_id ApplicationId.
1042  */
1044 
1045 /**
1046  * @brief GetPromotionInfo
1047  * @note Only available on [8.0.0+].
1048  * @param[out] promotion \ref NsPromotionInfo
1049  * @param application_id ApplicationId.
1050  * @param[in] uid \ref AccountUid
1051  */
1052 Result nsGetPromotionInfo(NsPromotionInfo *promotion, u64 application_id, AccountUid uid);
1053 
1054 ///@}
1055 
1056 ///@name IDownloadTaskInterface
1057 ///@{
1058 
1059 /**
1060  * @brief ClearTaskStatusList
1061  * @note Uses \ref nsGetDownloadTaskInterface on [3.0.0+], otherwise IApplicationManagerInterface is used.
1062  * @note Only available on [2.0.0+].
1063  */
1065 
1066 /**
1067  * @brief RequestDownloadTaskList
1068  * @note Uses \ref nsGetDownloadTaskInterface on [3.0.0+], otherwise IApplicationManagerInterface is used.
1069  * @note Only available on [2.0.0+].
1070  */
1072 
1073 /**
1074  * @brief RequestEnsureDownloadTask
1075  * @note Uses \ref nsGetDownloadTaskInterface on [3.0.0+], otherwise IApplicationManagerInterface is used.
1076  * @note Only available on [2.0.0+].
1077  * @param[out] a \ref AsyncResult
1078  */
1080 
1081 /**
1082  * @brief ListDownloadTaskStatus
1083  * @note Uses \ref nsGetDownloadTaskInterface on [3.0.0+], otherwise IApplicationManagerInterface is used.
1084  * @note Only available on [2.0.0+].
1085  * @param[out] tasks Output array of \ref NsDownloadTaskStatus.
1086  * @param[in] count Size of the tasks array in entries. A maximum of 0x100 tasks can be stored in state.
1087  * @param[out] total_out Total output entries.
1088  */
1089 Result nsListDownloadTaskStatus(NsDownloadTaskStatus* tasks, s32 count, s32 *total_out);
1090 
1091 /**
1092  * @brief RequestDownloadTaskListData
1093  * @note Uses \ref nsGetDownloadTaskInterface on [3.0.0+], otherwise IApplicationManagerInterface is used.
1094  * @note Only available on [2.0.0+].
1095  * @param[out] a \ref AsyncValue
1096  */
1098 
1099 /**
1100  * @brief TryCommitCurrentApplicationDownloadTask
1101  * @note Only available on [4.0.0+].
1102  */
1104 
1105 /**
1106  * @brief EnableAutoCommit
1107  * @note Only available on [4.0.0+].
1108  */
1110 
1111 /**
1112  * @brief DisableAutoCommit
1113  * @note Only available on [4.0.0+].
1114  */
1116 
1117 /**
1118  * @brief TriggerDynamicCommitEvent
1119  * @note Only available on [4.0.0+].
1120  */
1122 
1123 ///@}
1124 
1125 ///@name IContentManagementInterface
1126 ///@{
1127 
1128 /**
1129  * @brief CalculateApplicationOccupiedSize
1130  * @note Uses \ref nsGetContentManagementInterface on [3.0.0+], otherwise IApplicationManagerInterface is used.
1131  * @param[in] application_id ApplicationId.
1132  * @param[out] out \ref NsApplicationOccupiedSize
1133  */
1135 
1136 /**
1137  * @brief CheckSdCardMountStatus
1138  * @note Uses \ref nsGetContentManagementInterface on [3.0.0+], otherwise IApplicationManagerInterface is used.
1139  */
1141 
1142 /**
1143  * @brief Returns the total storage capacity (used + free) from content manager services.
1144  * @note Uses \ref nsGetContentManagementInterface on [3.0.0+], otherwise IApplicationManagerInterface is used.
1145  * @param[in] storage_id \ref NcmStorageId. Must be ::NcmStorageId_SdCard.
1146  * @param[out] size Pointer to output the total storage size to.
1147  */
1148 Result nsGetTotalSpaceSize(NcmStorageId storage_id, s64 *size);
1149 
1150 /**
1151  * @brief Returns the available storage capacity from content manager services.
1152  * @note Uses \ref nsGetContentManagementInterface on [3.0.0+], otherwise IApplicationManagerInterface is used.
1153  * @param[in] storage_id \ref NcmStorageId. Must be ::NcmStorageId_SdCard.
1154  * @param[out] size Pointer to output the free storage size to.
1155  */
1156 Result nsGetFreeSpaceSize(NcmStorageId storage_id, s64 *size);
1157 
1158 /**
1159  * @brief CountApplicationContentMeta
1160  * @note Uses \ref nsGetContentManagementInterface on [3.0.0+], otherwise IApplicationManagerInterface is used.
1161  * @note Only available on [2.0.0+].
1162  * @param[in] application_id ApplicationId.
1163  * @param[out] out Output count.
1164  */
1165 Result nsCountApplicationContentMeta(u64 application_id, s32 *out);
1166 
1167 /**
1168  * @brief Gets an listing of \ref NsApplicationContentMetaStatus.
1169  * @note Uses \ref nsGetContentManagementInterface on [3.0.0+], otherwise IApplicationManagerInterface is used.
1170  * @note Only available on [2.0.0+].
1171  * @param[in] application_id ApplicationId.
1172  * @param[in] index Starting entry index.
1173  * @param[out] list Output array of \ref NsApplicationContentMetaStatus.
1174  * @param[in] count Size of the list array in entries.
1175  * @param[out] out_entrycount Total output entries.
1176  */
1177 Result nsListApplicationContentMetaStatus(u64 application_id, s32 index, NsApplicationContentMetaStatus* list, s32 count, s32* out_entrycount);
1178 
1179 /**
1180  * @brief IsAnyApplicationRunning
1181  * @note Only available on [3.0.0+].
1182  * @param[out] out Output flag.
1183  */
1185 
1186 ///@}
1187 
1188 ///@name IRequestServerStopper
1189 ///@{
1190 
1191 /**
1192  * @brief Close a \ref NsRequestServerStopper.
1193  * @param r \ref NsRequestServerStopper
1194  */
1196 
1197 ///@}
1198 
1199 ///@name IProgressMonitorForDeleteUserSaveDataAll
1200 ///@{
1201 
1202 /**
1203  * @brief Close a \ref NsProgressMonitorForDeleteUserSaveDataAll. When initialized this will use \ref nsProgressMonitorForDeleteUserSaveDataAllIsFinished, throwing errors on failure / when the operation isn't finished (without closing the object).
1204  * @note Cancelling the operation before it's finished is not supported by \ref NsProgressMonitorForDeleteUserSaveDataAll.
1205  * @param p \ref NsProgressMonitorForDeleteUserSaveDataAll
1206  */
1208 
1209 /**
1210  * @brief GetSystemEvent
1211  * @note The Event must be closed by the user once finished with it.
1212  * @param[out] out_event Output Event with autoclear=false.
1213  */
1215 
1216 /**
1217  * @brief IsFinished
1218  * @param p \ref NsProgressMonitorForDeleteUserSaveDataAll
1219  * @param[out] out Whether the operation finished.
1220  */
1222 
1223 /**
1224  * @brief GetResult
1225  * @param p \ref NsProgressMonitorForDeleteUserSaveDataAll
1226  */
1228 
1229 /**
1230  * @brief GetProgress
1231  * @param p \ref NsProgressMonitorForDeleteUserSaveDataAll
1232  * @param[out] progress Output \ref NsProgressForDeleteUserSaveDataAll.
1233  */
1235 
1236 ///@}
1237 
1238 ///@name IProgressAsyncResult
1239 ///@{
1240 
1241 /**
1242  * @brief Close a \ref NsProgressAsyncResult.
1243  * @note When the object is initialized, this uses \ref nsProgressAsyncResultCancel then \ref nsProgressAsyncResultWait with timeout=UINT64_MAX.
1244  * @param a \ref NsProgressAsyncResult
1245  */
1247 
1248 /**
1249  * @brief Waits for the async operation to finish using the specified timeout.
1250  * @param a \ref NsProgressAsyncResult
1251  * @param[in] timeout Timeout in nanoseconds. UINT64_MAX for no timeout.
1252  */
1254 
1255 /**
1256  * @brief Gets the Result.
1257  * @note Prior to using the cmd, this uses \ref nsProgressAsyncResultWait with timeout=UINT64_MAX.
1258  * @param a \ref NsProgressAsyncResult
1259  */
1261 
1262 /**
1263  * @brief Cancels the async operation.
1264  * @note Used automatically by \ref nsProgressAsyncResultClose.
1265  * @param a \ref NsProgressAsyncResult
1266  */
1268 
1269 /**
1270  * @brief Gets the progress.
1271  * @param a \ref NsProgressAsyncResult
1272  * @param[out] buffer Output buffer.
1273  * @param[in] size Output buffer size.
1274  */
1275 Result nsProgressAsyncResultGetProgress(NsProgressAsyncResult *a, void* buffer, size_t size);
1276 
1277 /**
1278  * @brief GetDetailResult
1279  * @param a \ref NsProgressAsyncResult
1280  */
1282 
1283 /**
1284  * @brief Gets the \ref ErrorContext.
1285  * @note Only available on [4.0.0+].
1286  * @param a \ref NsProgressAsyncResult
1287  * @param[out] context \ref ErrorContext
1288  */
1290 
1291 ///@}
1292 
1293 ///@name ns:vm
1294 ///@{
1295 
1296 /// Initialize ns:vm. On pre-3.0.0 this must be used with \ref nsInitialize.
1297 Result nsvmInitialize(void);
1298 
1299 /// Exit ns:vm.
1300 void nsvmExit(void);
1301 
1302 /// Gets the Service object for ns:vm. This is only initialized on [3.0.0+].
1304 
1305 Result nsvmNeedsUpdateVulnerability(bool *out);
1307 
1308 ///@}
1309 
1310 ///@name ns:dev
1311 ///@{
1312 
1313 /// Initialize ns:dev.
1314 Result nsdevInitialize(void);
1315 
1316 /// Initialize ns:dev.
1317 void nsdevExit(void);
1318 
1319 /// Gets the Service object for ns:dev.
1321 
1322 Result nsdevLaunchProgram(u64* out_pid, const NsLaunchProperties* properties, u32 flags); ///< [1.0.0-9.2.0]
1323 Result nsdevTerminateProcess(u64 pid);
1324 Result nsdevTerminateProgram(u64 tid); ///< [1.0.0-9.2.0]
1325 Result nsdevGetShellEvent(Event* out_event); ///< Autoclear for nsdevShellEvent is always true. [1.0.0-9.2.0]
1326 Result nsdevGetShellEventInfo(NsShellEventInfo* out); ///< [1.0.0-9.2.0]
1327 Result nsdevTerminateApplication(void);
1328 Result nsdevPrepareLaunchProgramFromHost(NsLaunchProperties* out, const char* path, size_t path_len); ///< [1.0.0-9.2.0]
1329 Result nsdevLaunchApplicationForDevelop(u64* out_pid, u64 application_id, u32 flags); ///< [1.0.0-9.2.0]
1330 Result nsdevLaunchApplicationFromHost(u64* out_pid, const char* path, size_t path_len, u32 flags); ///< [10.0.0+]
1331 Result nsdevLaunchApplicationWithStorageIdForDevelop(u64* out_pid, u64 application_id, u32 flags, u8 app_storage_id, u8 patch_storage_id);
1332 Result nsdevIsSystemMemoryResourceLimitBoosted(bool* out); ///< [6.0.0-8.1.0]
1335 
1336 ///@}
1337 
1338 ///@name ns:su
1339 ///@{
1340 
1341 /// Initialize ns:su.
1342 Result nssuInitialize(void);
1343 
1344 /// Exit ns:su.
1345 void nssuExit(void);
1346 
1347 /// Gets the Service object for ns:su.
1349 
1350 /**
1351  * @brief Gets the \ref NsBackgroundNetworkUpdateState.
1352  * @note Internally this uses nim commands ListSystemUpdateTask and GetSystemUpdateTaskInfo to determine the output state.
1353  * @param[out] out \ref NsBackgroundNetworkUpdateState
1354  */
1356 
1357 /**
1358  * @brief Opens a \ref NsSystemUpdateControl.
1359  * @note Only 1 \ref NsSystemUpdateControl can be open at a time.
1360  * @param[out] c \ref NsSystemUpdateControl
1361  */
1363 
1364 /**
1365  * @brief Uses nim ListSystemUpdateTask, then uses the task with DestroySystemUpdateTask if it exists. Then this runs ExFat handling, updates state, and sets the same state flag as \ref nssuRequestBackgroundNetworkUpdate.
1366  * @note Only usable when a \ref NsSystemUpdateControl isn't open.
1367  */
1369 
1370 /**
1371  * @brief ClearExFatDriverStatusForDebug
1372  */
1374 
1375 /**
1376  * @brief RequestBackgroundNetworkUpdate
1377  * @note Only usable when a \ref NsSystemUpdateControl isn't open.
1378  */
1380 
1381 /**
1382  * @brief This checks whether a sysupdate is needed with the input \ref NcmContentMetaKey using NCM commands, if not this will just return 0. Otherwise, this will then run code which is identical to \ref nssuRequestBackgroundNetworkUpdate.
1383  * @note Only usable when a \ref NsSystemUpdateControl isn't open.
1384  * @param[in] key \ref NcmContentMetaKey
1385  */
1387 
1388 /**
1389  * @brief NotifyExFatDriverDownloadedForDebug
1390  */
1392 
1393 /**
1394  * @brief Gets an Event which can be signaled by \ref nssuNotifySystemUpdateForContentDelivery.
1395  * @note The Event must be closed by the user once finished with it.
1396  * @param[out] out_event Output Event with autoclear=false.
1397  */
1399 
1400 /**
1401  * @brief Signals the event returned by \ref nssuGetSystemUpdateNotificationEventForContentDelivery.
1402  */
1404 
1405 /**
1406  * @brief This does shutdown preparation.
1407  * @note This is used by am-sysmodule, so generally there's no need to use this.
1408  * @note Only available on [3.0.0+].
1409  */
1411 
1412 /**
1413  * @brief This uses nim ListSystemUpdateTask, then when a task is returned uses it with DestroySystemUpdateTask.
1414  * @note Only available on [4.0.0+].
1415  */
1417 
1418 /**
1419  * @brief RequestSendSystemUpdate
1420  * @note The system will use the input addr/port with bind(), the input addr will eventually be validated with the addr from accept(). addr/port are little-endian.
1421  * @note After the system accepts a connection etc, an error will be thrown if the system is Internet-connected.
1422  * @note Only available on [4.0.0+].
1423  * @param[out] a \ref AsyncResult
1424  * @param[in] addr Client IPv4 address. qlaunch uses a local-WLAN addr.
1425  * @param[in] port Socket port. qlaunch uses value 55556.
1426  * @param[in] info \ref NsSystemDeliveryInfo
1427  */
1429 
1430 /**
1431  * @brief GetSendSystemUpdateProgress
1432  * @note Only available on [4.0.0+].
1433  * @param[out] out \ref NsSystemUpdateProgress
1434  */
1436 
1437 ///@}
1438 
1439 ///@name ISystemUpdateControl
1440 ///@{
1441 
1442 /**
1443  * @brief Close a \ref NsSystemUpdateControl.
1444  * @param c \ref NsSystemUpdateControl
1445  */
1447 
1448 /**
1449  * @brief Gets whether a network sysupdate was downloaded, with install pending.
1450  * @param c \ref NsSystemUpdateControl
1451  * @param[out] out Output flag.
1452  */
1454 
1455 /**
1456  * @brief RequestCheckLatestUpdate
1457  * @param c \ref NsSystemUpdateControl
1458  * @param[out] a \ref AsyncValue. The data that can be read from this is u8 \ref NsLatestSystemUpdate.
1459  */
1461 
1462 /**
1463  * @brief RequestDownloadLatestUpdate
1464  * @param c \ref NsSystemUpdateControl
1465  * @param[out] a \ref AsyncResult
1466  */
1468 
1469 /**
1470  * @brief GetDownloadProgress
1471  * @param c \ref NsSystemUpdateControl
1472  * @param[out] out \ref NsSystemUpdateProgress
1473  */
1475 
1476 /**
1477  * @brief ApplyDownloadedUpdate
1478  * @param c \ref NsSystemUpdateControl
1479  */
1481 
1482 /**
1483  * @brief RequestPrepareCardUpdate
1484  * @param c \ref NsSystemUpdateControl
1485  * @param[out] a \ref AsyncResult
1486  */
1488 
1489 /**
1490  * @brief GetPrepareCardUpdateProgress
1491  * @note \ref nssuControlSetupCardUpdate / \ref nssuControlSetupCardUpdateViaSystemUpdater must have been used at some point prior to using this.
1492  * @param c \ref NsSystemUpdateControl
1493  * @param[out] out \ref NsSystemUpdateProgress
1494  */
1496 
1497 /**
1498  * @brief HasPreparedCardUpdate
1499  * @note \ref nssuControlSetupCardUpdate / \ref nssuControlSetupCardUpdateViaSystemUpdater must have been used at some point prior to using this.
1500  * @param c \ref NsSystemUpdateControl
1501  * @param[out] out Output flag.
1502  */
1504 
1505 /**
1506  * @brief ApplyCardUpdate
1507  * @note \ref nssuControlSetupCardUpdate / \ref nssuControlSetupCardUpdateViaSystemUpdater must have been used at some point prior to using this.
1508  * @param c \ref NsSystemUpdateControl
1509  */
1511 
1512 /**
1513  * @brief Gets the filesize for the specified DownloadedEulaData.
1514  * @note This mounts the Eula SystemData, then uses the file "<mountname>:/<input path>".
1515  * @param c \ref NsSystemUpdateControl
1516  * @param[in] path EulaData path.
1517  * @param[out] filesize Output filesize.
1518  */
1519 Result nssuControlGetDownloadedEulaDataSize(NsSystemUpdateControl *c, const char* path, u64 *filesize);
1520 
1521 /**
1522  * @brief Gets the specified DownloadedEulaData.
1523  * @note See the note for \ref nssuControlGetDownloadedEulaDataSize.
1524  * @param c \ref NsSystemUpdateControl
1525  * @param[in] path EulaData path.
1526  * @param[out] buffer Output buffer.
1527  * @param[in] size Size of the output buffer, must be at least the output size from \ref nssuControlGetDownloadedEulaDataSize.
1528  * @param[out] filesize Output filesize.
1529  */
1530 Result nssuControlGetDownloadedEulaData(NsSystemUpdateControl *c, const char* path, void* buffer, size_t size, u64 *filesize);
1531 
1532 /**
1533  * @brief SetupCardUpdate
1534  * @param c \ref NsSystemUpdateControl
1535  * @param[in] buffer TransferMemory buffer, when NULL this is automatically allocated.
1536  * @param[in] size TransferMemory buffer size, see \ref NSSU_CARDUPDATE_TMEM_SIZE_DEFAULT.
1537  */
1538 Result nssuControlSetupCardUpdate(NsSystemUpdateControl *c, void* buffer, size_t size);
1539 
1540 /**
1541  * @brief Gets the filesize for the specified PreparedCardUpdateEulaData.
1542  * @note See the note for \ref nssuControlGetDownloadedEulaDataSize.
1543  * @param c \ref NsSystemUpdateControl
1544  * @param[in] path EulaData path.
1545  * @param[out] filesize Output filesize.
1546  */
1548 
1549 /**
1550  * @brief Gets the specified PreparedCardUpdateEulaData.
1551  * @note See the note for \ref nssuControlGetDownloadedEulaDataSize.
1552  * @param c \ref NsSystemUpdateControl
1553  * @param[in] path EulaData path.
1554  * @param[out] buffer Output buffer.
1555  * @param[in] size Size of the output buffer, must be at least the output size from \ref nssuControlGetPreparedCardUpdateEulaDataSize.
1556  * @param[out] filesize Output filesize.
1557  */
1558 Result nssuControlGetPreparedCardUpdateEulaData(NsSystemUpdateControl *c, const char* path, void* buffer, size_t size, u64 *filesize);
1559 
1560 /**
1561  * @brief SetupCardUpdateViaSystemUpdater
1562  * @note Same as \ref nssuControlSetupCardUpdate, except this doesn't run the code for fs cmds GetGameCardHandle/GetGameCardUpdatePartitionInfo, and uses fs OpenRegisteredUpdatePartition instead of OpenGameCardFileSystem.
1563  * @note Only available on [4.0.0+].
1564  * @param c \ref NsSystemUpdateControl
1565  * @param[in] buffer TransferMemory buffer, when NULL this is automatically allocated.
1566  * @param[in] size TransferMemory buffer size, see \ref NSSU_CARDUPDATE_TMEM_SIZE_DEFAULT.
1567  */
1569 
1570 /**
1571  * @brief HasReceived
1572  * @note Only available on [4.0.0+].
1573  * @param c \ref NsSystemUpdateControl
1574  * @param[out] out Output flag.
1575  */
1577 
1578 /**
1579  * @brief RequestReceiveSystemUpdate
1580  * @note The system will use the input addr/port with connect(). addr/port are little-endian.
1581  * @note Only available on [4.0.0+].
1582  * @param c \ref NsSystemUpdateControl
1583  * @param[out] a \ref AsyncResult
1584  * @param[in] addr Server IPv4 address. qlaunch uses a local-WLAN addr, however this can be any addr.
1585  * @param[in] port Socket port. qlaunch uses value 55556.
1586  * @param[in] info \ref NsSystemDeliveryInfo
1587  */
1589 
1590 /**
1591  * @brief GetReceiveProgress
1592  * @note Only available on [4.0.0+].
1593  * @param c \ref NsSystemUpdateControl
1594  * @param[out] out \ref NsSystemUpdateProgress
1595  */
1597 
1598 /**
1599  * @brief ApplyReceivedUpdate
1600  * @note Only available on [4.0.0+].
1601  * @param c \ref NsSystemUpdateControl
1602  */
1604 
1605 /**
1606  * @brief Gets the filesize for the specified ReceivedEulaData.
1607  * @note See the note for \ref nssuControlGetDownloadedEulaDataSize.
1608  * @note Only available on [4.0.0+].
1609  * @param c \ref NsSystemUpdateControl
1610  * @param[in] path EulaData path.
1611  * @param[out] filesize Output filesize.
1612  */
1613 Result nssuControlGetReceivedEulaDataSize(NsSystemUpdateControl *c, const char* path, u64 *filesize);
1614 
1615 /**
1616  * @brief Gets the specified ReceivedEulaData.
1617  * @note See the note for \ref nssuControlGetDownloadedEulaDataSize.
1618  * @note Only available on [4.0.0+].
1619  * @param c \ref NsSystemUpdateControl
1620  * @param[in] path EulaData path.
1621  * @param[out] buffer Output buffer.
1622  * @param[in] size Size of the output buffer, must be at least the output size from \ref nssuControlGetReceivedEulaDataSize.
1623  * @param[out] filesize Output filesize.
1624  */
1625 Result nssuControlGetReceivedEulaData(NsSystemUpdateControl *c, const char* path, void* buffer, size_t size, u64 *filesize);
1626 
1627 /**
1628  * @brief Does setup for ReceiveSystemUpdate by using the same nim cmds as \ref nssuDestroySystemUpdateTask.
1629  * @note qlaunch uses this before \ref nssuControlRequestReceiveSystemUpdate.
1630  * @note Only available on [4.0.0+].
1631  * @param c \ref NsSystemUpdateControl
1632  */
1634 
1635 /**
1636  * @brief RequestCheckLatestUpdateIncludesRebootlessUpdate
1637  * @note Only available on [6.0.0+].
1638  * @param c \ref NsSystemUpdateControl
1639  * @param[out] a \ref AsyncValue
1640  */
1642 
1643 ///@}
1644 
nsDeleteRedundantApplicationEntity
Result nsDeleteRedundantApplicationEntity(void)
DeleteRedundantApplicationEntity.
nsGetApplicationDesiredLanguage
Result nsGetApplicationDesiredLanguage(NacpStruct *nacp, NacpLanguageEntry **langentry)
GetApplicationDesiredLanguage.
s64
int64_t s64
64-bit signed integer.
Definition: types.h:28
nsListContentMetaKeyToDeliverApplication
Result nsListContentMetaKeyToDeliverApplication(NcmContentMetaKey *meta, s32 meta_count, s32 meta_index, const NsApplicationDeliveryInfo *info, s32 info_count, s32 *total_out)
ListContentMetaKeyToDeliverApplication.
nsRequestRegisterGameCard
Result nsRequestRegisterGameCard(AsyncResult *a, AccountUid uid, u64 application_id, s32 inval)
RequestRegisterGameCard.
nsResetToFactorySettingsWithPlatformRegionAuthentication
Result nsResetToFactorySettingsWithPlatformRegionAuthentication(void)
ResetToFactorySettingsWithPlatformRegionAuthentication.
nssuControlGetDownloadedEulaDataSize
Result nssuControlGetDownloadedEulaDataSize(NsSystemUpdateControl *c, const char *path, u64 *filesize)
Gets the filesize for the specified DownloadedEulaData.
NsApplicationContentMetaStatus::meta_type
u8 meta_type
NcmContentMetaType
Definition: ns.h:84
NsApplicationControlSource
NsApplicationControlSource
ApplicationControlSource.
Definition: ns.h:29
NsApplicationView::application_id
u64 application_id
ApplicationId.
Definition: ns.h:124
NsApplicationContentMetaStatus
NsApplicationContentMetaStatus.
Definition: ns.h:83
nsvmInitialize
Result nsvmInitialize(void)
Initialize ns:vm. On pre-3.0.0 this must be used with nsInitialize.
nsGetServiceSession_ApplicationManagerInterface
Service * nsGetServiceSession_ApplicationManagerInterface(void)
Gets the Service object for IApplicationManagerInterface. Only initialized on pre-3....
nssuControlGetReceivedEulaData
Result nssuControlGetReceivedEulaData(NsSystemUpdateControl *c, const char *path, void *buffer, size_t size, u64 *filesize)
Gets the specified ReceivedEulaData.
nssuControlSetupToReceiveSystemUpdate
Result nssuControlSetupToReceiveSystemUpdate(NsSystemUpdateControl *c)
Does setup for ReceiveSystemUpdate by using the same nim cmds as nssuDestroySystemUpdateTask.
nsRequestNoDownloadRightsErrorResolution
Result nsRequestNoDownloadRightsErrorResolution(AsyncValue *a, u64 application_id)
RequestNoDownloadRightsErrorResolution.
nsRequestGameCardRegistrationGoldPoint
Result nsRequestGameCardRegistrationGoldPoint(AsyncValue *a, AccountUid uid, u64 application_id)
RequestGameCardRegistrationGoldPoint.
nssuControlGetReceiveProgress
Result nssuControlGetReceiveProgress(NsSystemUpdateControl *c, NsSystemUpdateProgress *out)
GetReceiveProgress.
NsDownloadTaskStatus
DownloadTaskStatus.
Definition: ns.h:225
NcmContentMetaKey
ContentMetaKey.
Definition: ncm_types.h:72
NsBackgroundNetworkUpdateState_Downloading
@ NsBackgroundNetworkUpdateState_Downloading
Sysupdate download in progress.
Definition: ns.h:38
NcmStorageId
NcmStorageId
StorageId.
Definition: ncm_types.h:12
NsApplicationViewWithPromotionInfo
NsApplicationViewWithPromotionInfo.
Definition: ns.h:149
nsCompareSystemDeliveryInfo
Result nsCompareSystemDeliveryInfo(const NsSystemDeliveryInfo *info0, const NsSystemDeliveryInfo *info1, s32 *out)
Both NsSystemDeliveryInfo are validated, then the system_update_meta_version in the first/second NsSy...
nsRequestDownloadTaskListData
Result nsRequestDownloadTaskListData(AsyncValue *a)
RequestDownloadTaskListData.
nsSelectLatestSystemDeliveryInfo
Result nsSelectLatestSystemDeliveryInfo(const NsSystemDeliveryInfo *sys_list, s32 sys_count, const NsSystemDeliveryInfo *base_info, const NsApplicationDeliveryInfo *app_list, s32 app_count, s32 *index)
SelectLatestSystemDeliveryInfo.
nsGetReadOnlyApplicationControlDataInterface
Result nsGetReadOnlyApplicationControlDataInterface(Service *srv_out)
Gets the Service object for IReadOnlyApplicationControlDataInterface via the cmd for that.
NsApplicationView::unk_x40
u32 unk_x40
Unknown.
Definition: ns.h:133
nsdevPrepareLaunchProgramFromHost
Result nsdevPrepareLaunchProgramFromHost(NsLaunchProperties *out, const char *path, size_t path_len)
[1.0.0-9.2.0]
nsDeleteApplicationEntity
Result nsDeleteApplicationEntity(u64 application_id)
DeleteApplicationEntity.
nsNeedsSystemUpdateToFormatSdCard
Result nsNeedsSystemUpdateToFormatSdCard(bool *out)
NeedsSystemUpdateToFormatSdCard.
NsApplicationViewDeprecated::unk_x3c
u8 unk_x3c
Same as NsApplicationView::unk_x44.
Definition: ns.h:118
NsApplicationViewDeprecated::application_id
u64 application_id
Same as NsApplicationView::application_id.
Definition: ns.h:109
nsProgressAsyncResultClose
void nsProgressAsyncResultClose(NsProgressAsyncResult *a)
Close a NsProgressAsyncResult.
nsGetApplicationRecordUpdateSystemEvent
Result nsGetApplicationRecordUpdateSystemEvent(Event *out_event)
GetApplicationRecordUpdateSystemEvent.
NsReceiveApplicationProgress
NsSystemUpdateProgress NsReceiveApplicationProgress
ReceiveApplicationProgress. Same as NsSystemUpdateProgress, except cmds which return this will return...
Definition: ns.h:176
nssuControlGetPrepareCardUpdateProgress
Result nssuControlGetPrepareCardUpdateProgress(NsSystemUpdateControl *c, NsSystemUpdateProgress *out)
GetPrepareCardUpdateProgress.
nsCalculateApplicationDownloadRequiredSize
Result nsCalculateApplicationDownloadRequiredSize(u64 application_id, NcmStorageId *storage_id, s64 *size)
CalculateApplicationApplyDeltaRequiredSize.
nssuClearExFatDriverStatusForDebug
Result nssuClearExFatDriverStatusForDebug(void)
ClearExFatDriverStatusForDebug.
nsGetContentManagementInterface
Result nsGetContentManagementInterface(Service *srv_out)
Gets the Service object for IContentManagementInterface via the cmd for that.
nsRequestDownloadTaskList
Result nsRequestDownloadTaskList(void)
RequestDownloadTaskList.
nssuControlHasPreparedCardUpdate
Result nssuControlHasPreparedCardUpdate(NsSystemUpdateControl *c, bool *out)
HasPreparedCardUpdate.
NsApplicationDeliveryInfo
ApplicationDeliveryInfo.
Definition: ns.h:203
nssuGetSendSystemUpdateProgress
Result nssuGetSendSystemUpdateProgress(NsSystemUpdateProgress *out)
GetSendSystemUpdateProgress.
nsGetApplicationVersionInterface
Result nsGetApplicationVersionInterface(Service *srv_out)
Gets the Service object for IApplicationVersionInterface via the cmd for that.
NsLatestSystemUpdate_Unknown0
@ NsLatestSystemUpdate_Unknown0
Unknown.
Definition: ns.h:44
nsDeleteApplicationCompletely
Result nsDeleteApplicationCompletely(u64 application_id)
DeleteApplicationCompletely.
u8
uint8_t u8
8-bit unsigned integer.
Definition: types.h:19
nssuControlSetupCardUpdate
Result nssuControlSetupCardUpdate(NsSystemUpdateControl *c, void *buffer, size_t size)
SetupCardUpdate.
NsApplicationDeliveryInfo::application_version
u32 application_version
Application version.
Definition: ns.h:206
nsProgressAsyncResultGetDetailResult
Result nsProgressAsyncResultGetDetailResult(NsProgressAsyncResult *a)
GetDetailResult.
nssuControlSetupCardUpdateViaSystemUpdater
Result nssuControlSetupCardUpdateViaSystemUpdater(NsSystemUpdateControl *c, void *buffer, size_t size)
SetupCardUpdateViaSystemUpdater.
NsApplicationRightsOnClient::flags_x18
u8 flags_x18
qlaunch uses bit0-bit4 and bit7 from here.
Definition: ns.h:219
Event
Kernel-mode event structure.
Definition: event.h:13
nsListApplicationRecord
Result nsListApplicationRecord(NsApplicationRecord *records, s32 count, s32 entry_offset, s32 *out_entrycount)
Gets an listing of NsApplicationRecord.
nsProgressMonitorForDeleteUserSaveDataAllGetSystemEvent
Result nsProgressMonitorForDeleteUserSaveDataAllGetSystemEvent(NsProgressMonitorForDeleteUserSaveDataAll *p, Event *out_event)
GetSystemEvent.
nsDisableAutoCommit
Result nsDisableAutoCommit(void)
DisableAutoCommit.
AsyncResult
AsyncResult.
Definition: async.h:20
nsCleanupUnavailableAddOnContents
Result nsCleanupUnavailableAddOnContents(u64 application_id, AccountUid uid)
CleanupUnavailableAddOnContents.
nsGetApplicationViewWithPromotionInfo
Result nsGetApplicationViewWithPromotionInfo(NsApplicationViewWithPromotionInfo *out, const u64 *application_ids, s32 count)
GetApplicationViewWithPromotionInfo.
nsResetToFactorySettingsWithoutUserSaveData
Result nsResetToFactorySettingsWithoutUserSaveData(void)
ResetToFactorySettingsWithoutUserSaveData.
nsdevGetShellEventInfo
Result nsdevGetShellEventInfo(NsShellEventInfo *out)
[1.0.0-9.2.0]
NsSystemDeliveryInfo::includes_exfat
u32 includes_exfat
Whether ExFat is included. Unused by nssuRequestSendSystemUpdate / nssuControlRequestReceiveSystemUpd...
Definition: ns.h:191
nsVerifyDeliveryProtocolVersion
Result nsVerifyDeliveryProtocolVersion(const NsSystemDeliveryInfo *info)
VerifyDeliveryProtocolVersion.
nsProgressAsyncResultGetErrorContext
Result nsProgressAsyncResultGetErrorContext(NsProgressAsyncResult *a, ErrorContext *context)
Gets the ErrorContext.
nsGetDownloadTaskInterface
Result nsGetDownloadTaskInterface(Service *srv_out)
Gets the Service object for IDownloadTaskInterface via the cmd for that.
NsSystemUpdateProgress::current_size
s64 current_size
Current size. This value can be larger than total_size when the async operation is finishing....
Definition: ns.h:171
nsdevLaunchApplicationForDevelop
Result nsdevLaunchApplicationForDevelop(u64 *out_pid, u64 application_id, u32 flags)
[1.0.0-9.2.0]
nsdevLaunchApplicationFromHost
Result nsdevLaunchApplicationFromHost(u64 *out_pid, const char *path, size_t path_len, u32 flags)
[10.0.0+]
NsApplicationViewDeprecated::unk_x38
u32 unk_x38
Same as NsApplicationView::unk_x40.
Definition: ns.h:117
nsvmGetSafeSystemVersion
Result nsvmGetSafeSystemVersion(NcmContentMetaKey *out)
[4.0.0+]
NsShellEvent_Start
@ NsShellEvent_Start
Start.
Definition: ns.h:23
nsGetStorageSize
Result nsGetStorageSize(NcmStorageId storage_id, s64 *total_space_size, s64 *free_space_size)
Temporarily mounts the specified fs ContentStorage, then uses fs GetTotalSpaceSize/GetFreeSpaceSize w...
NsSystemUpdateControl::tmem
TransferMemory tmem
TransferMemory for SetupCardUpdate/SetupCardUpdateViaSystemUpdater.
Definition: ns.h:68
nsGetLastSdCardFormatUnexpectedResult
Result nsGetLastSdCardFormatUnexpectedResult(void)
GetLastSdCardFormatUnexpectedResult.
NsBackgroundNetworkUpdateState_Ready
@ NsBackgroundNetworkUpdateState_Ready
Sysupdate ready, pending install.
Definition: ns.h:39
NsApplicationContentMetaStatus::padding
u8 padding
Padding.
Definition: ns.h:87
AccountUid
Account UserId.
Definition: acc.h:25
NsApplicationDeliveryInfo::unk_x14
u32 unk_x14
Unknown.
Definition: ns.h:207
nsResumeApplicationApplyDelta
Result nsResumeApplicationApplyDelta(u64 application_id)
ResumeApplicationApplyDelta.
nssuNotifyBackgroundNetworkUpdate
Result nssuNotifyBackgroundNetworkUpdate(const NcmContentMetaKey *key)
This checks whether a sysupdate is needed with the input NcmContentMetaKey using NCM commands,...
nsResumeApplicationDownload
Result nsResumeApplicationDownload(u64 application_id)
ResumeApplicationDownload.
NsLatestSystemUpdate_Unknown1
@ NsLatestSystemUpdate_Unknown1
Unknown.
Definition: ns.h:45
NsApplicationControlSource_Storage
@ NsApplicationControlSource_Storage
Returns data from storage if not present in cache.
Definition: ns.h:31
NsSystemDeliveryInfo::unk_x19
u8 unk_x19
Unused by nssuRequestSendSystemUpdate / nssuControlRequestReceiveSystemUpdate, besides HMAC validatio...
Definition: ns.h:195
nsdevTerminateProgram
Result nsdevTerminateProgram(u64 tid)
[1.0.0-9.2.0]
NsRequestServerStopper
RequestServerStopper.
Definition: ns.h:50
TransferMemory
Transfer memory information structure.
Definition: tmem.h:13
s32
int32_t s32
32-bit signed integer.
Definition: types.h:27
NsSystemDeliveryInfo::system_delivery_protocol_version
u32 system_delivery_protocol_version
Must match a system-setting.
Definition: ns.h:189
NacpStruct
ns ApplicationControlProperty
Definition: nacp.h:34
NsApplicationDeliveryInfo::required_system_version
u32 required_system_version
Required system version, see NsSystemDeliveryInfo::system_update_meta_version.
Definition: ns.h:208
nssuControlGetDownloadProgress
Result nssuControlGetDownloadProgress(NsSystemUpdateControl *c, NsSystemUpdateProgress *out)
GetDownloadProgress.
NsSystemUpdateProgress
SystemUpdateProgress. Commands which have this as output will return 0 with the output cleared,...
Definition: ns.h:170
nsUnregisterNetworkServiceAccountWithUserSaveDataDeletion
Result nsUnregisterNetworkServiceAccountWithUserSaveDataDeletion(AccountUid uid)
UnregisterNetworkServiceAccountWithUserSaveDataDeletion.
nsDisableApplicationAutoDelete
Result nsDisableApplicationAutoDelete(u64 application_id)
DisableApplicationAutoDelete.
nsGetApplicationManagerInterface
Result nsGetApplicationManagerInterface(Service *srv_out)
Gets the Service object for IApplicationManagerInterface via the cmd for that.
NsApplicationView::unk_x44
u8 unk_x44
Unknown.
Definition: ns.h:134
nsGetRequestServerStopper
Result nsGetRequestServerStopper(NsRequestServerStopper *r)
Opens a NsRequestServerStopper.
nsGetFreeSpaceSize
Result nsGetFreeSpaceSize(NcmStorageId storage_id, s64 *size)
Returns the available storage capacity from content manager services.
nsProgressMonitorForDeleteUserSaveDataAllClose
Result nsProgressMonitorForDeleteUserSaveDataAllClose(NsProgressMonitorForDeleteUserSaveDataAll *p)
Close a NsProgressMonitorForDeleteUserSaveDataAll.
NsSystemDeliveryInfo
SystemDeliveryInfo.
Definition: ns.h:187
nsRequestReceiveApplication
Result nsRequestReceiveApplication(AsyncResult *a, u32 addr, u16 port, u64 application_id, const NcmContentMetaKey *meta, s32 count, NcmStorageId storage_id)
RequestReceiveApplication.
nsRequestCheckGameCardRegistration
Result nsRequestCheckGameCardRegistration(AsyncResult *a, u64 application_id)
RequestCheckGameCardRegistration.
nsListApplicationIdOnGameCard
Result nsListApplicationIdOnGameCard(u64 *application_ids, s32 count, s32 *total_out)
ListApplicationIdOnGameCard.
NsApplicationRecord::application_id
u64 application_id
ApplicationId.
Definition: ns.h:94
nsClearTaskStatusList
Result nsClearTaskStatusList(void)
ClearTaskStatusList.
NsSystemDeliveryInfo::unk_x1a
u8 unk_x1a
Unknown.
Definition: ns.h:196
nsProgressMonitorForDeleteUserSaveDataAllGetResult
Result nsProgressMonitorForDeleteUserSaveDataAllGetResult(NsProgressMonitorForDeleteUserSaveDataAll *p)
GetResult.
nsRequestEnsureDownloadTask
Result nsRequestEnsureDownloadTask(AsyncResult *a)
RequestEnsureDownloadTask.
nsdevGetShellEvent
Result nsdevGetShellEvent(Event *out_event)
Autoclear for nsdevShellEvent is always true. [1.0.0-9.2.0].
NsShellEventInfo::event
NsShellEvent event
NsShellEvent
Definition: ns.h:165
nssuOpenSystemUpdateControl
Result nssuOpenSystemUpdateControl(NsSystemUpdateControl *c)
Opens a NsSystemUpdateControl.
nsGetServiceSession_GetterInterface
Service * nsGetServiceSession_GetterInterface(void)
Gets the Service object for the actual ns:* service session. Only initialized on [3....
nsvmExit
void nsvmExit(void)
Exit ns:vm.
FsSaveDataSpaceId
FsSaveDataSpaceId
SaveDataSpaceId.
Definition: fs.h:192
nsDeleteSaveData
Result nsDeleteSaveData(FsSaveDataSpaceId save_data_space_id, u64 save_data_id)
DeleteSaveData.
NacpLanguageEntry
Language entry. These strings are UTF-8.
Definition: nacp.h:10
nsFormatSdCard
Result nsFormatSdCard(void)
FormatSdCard.
nsGetDocumentInterface
Result nsGetDocumentInterface(Service *srv_out)
Gets the Service object for IDocumentInterface via the cmd for that.
AsyncValue
AsyncValue.
Definition: async.h:14
nsGetApplicationViewDeprecated
Result nsGetApplicationViewDeprecated(NsApplicationViewDeprecated *views, const u64 *application_ids, s32 count)
GetApplicationViewDeprecated.
nsGetLastGameCardMountFailureResult
Result nsGetLastGameCardMountFailureResult(void)
GetLastGameCardMountFailureResult.
nsCheckSdCardMountStatus
Result nsCheckSdCardMountStatus(void)
CheckSdCardMountStatus.
NsApplicationViewWithPromotionInfo::promotion
NsPromotionInfo promotion
NsPromotionInfo
Definition: ns.h:151
nsCanDeliverApplication
Result nsCanDeliverApplication(const NsApplicationDeliveryInfo *info0, s32 count0, const NsApplicationDeliveryInfo *info1, s32 count1, bool *out)
CanDeliverApplication.
nsvmGetServiceSession
Service * nsvmGetServiceSession(void)
Gets the Service object for ns:vm. This is only initialized on [3.0.0+].
nsGetApplicationRightsOnClient
Result nsGetApplicationRightsOnClient(NsApplicationRightsOnClient *rights, s32 count, u64 application_id, AccountUid uid, u32 flags, s32 *total_out)
GetApplicationRightsOnClient.
nssuControlHasDownloaded
Result nssuControlHasDownloaded(NsSystemUpdateControl *c, bool *out)
Gets whether a network sysupdate was downloaded, with install pending.
NsApplicationRecord
ApplicationRecord.
Definition: ns.h:93
nsCheckApplicationLaunchVersion
Result nsCheckApplicationLaunchVersion(u64 application_id)
CheckApplicationLaunchVersion.
nsRequestServerStopperClose
void nsRequestServerStopperClose(NsRequestServerStopper *r)
Close a NsRequestServerStopper.
nsDeleteUserSaveDataAll
Result nsDeleteUserSaveDataAll(NsProgressMonitorForDeleteUserSaveDataAll *p, AccountUid uid)
DeleteUserSaveDataAll.
nssuPrepareShutdown
Result nssuPrepareShutdown(void)
This does shutdown preparation.
NsProgressMonitorForDeleteUserSaveDataAll
ProgressMonitorForDeleteUserSaveDataAll.
Definition: ns.h:55
NsApplicationView
ApplicationView.
Definition: ns.h:123
u32
uint32_t u32
32-bit unsigned integer.
Definition: types.h:21
NsLatestSystemUpdate
NsLatestSystemUpdate
LatestSystemUpdate.
Definition: ns.h:43
nsListApplicationTitle
Result nsListApplicationTitle(AsyncValue *a, NsApplicationControlSource source, const u64 *application_ids, s32 count, void *buffer, size_t size)
ListApplicationTitle.
NsLaunchProperties::is_application
u8 is_application
Whether this is an Application.
Definition: ns.h:160
nsRequestSendApplication
Result nsRequestSendApplication(AsyncResult *a, u32 addr, u16 port, u64 application_id, const NcmContentMetaKey *meta, s32 count)
RequestSendApplication.
nsRequestSyncRights
Result nsRequestSyncRights(AsyncResult *a)
RequestSyncRights.
nsdevGetServiceSession
Service * nsdevGetServiceSession(void)
Gets the Service object for ns:dev.
nsCompareApplicationDeliveryInfo
Result nsCompareApplicationDeliveryInfo(const NsApplicationDeliveryInfo *info0, s32 count0, const NsApplicationDeliveryInfo *info1, s32 count1, s32 *out)
Both NsApplicationDeliveryInfo are validated, then the application_version in the first/second NsAppl...
NsApplicationViewDeprecated::flags
u32 flags
Same as NsApplicationView::flags.
Definition: ns.h:111
nssuControlApplyReceivedUpdate
Result nssuControlApplyReceivedUpdate(NsSystemUpdateControl *c)
ApplyReceivedUpdate.
NsProgressMonitorForDeleteUserSaveDataAll::s
Service s
IProgressMonitorForDeleteUserSaveDataAll.
Definition: ns.h:56
nssuControlHasReceived
Result nssuControlHasReceived(NsSystemUpdateControl *c, bool *out)
HasReceived.
nsNeedsSystemUpdateToDeliverApplication
Result nsNeedsSystemUpdateToDeliverApplication(const NsApplicationDeliveryInfo *info, s32 count, const NsSystemDeliveryInfo *sys_info, bool *out)
After validation etc, this sets the output bool by comparing system-version fields in the NsSystemDel...
nsGetReadOnlyApplicationRecordInterface
Result nsGetReadOnlyApplicationRecordInterface(Service *srv_out)
Gets the Service object for IReadOnlyApplicationRecordInterface via the cmd for that.
NsShellEvent_Debug
@ NsShellEvent_Debug
Debug.
Definition: ns.h:25
NsApplicationContentMetaStatus::storageID
u8 storageID
NcmStorageId
Definition: ns.h:85
nsListDownloadTaskStatus
Result nsListDownloadTaskStatus(NsDownloadTaskStatus *tasks, s32 count, s32 *total_out)
ListDownloadTaskStatus.
NsApplicationViewWithPromotionInfo::view
NsApplicationView view
NsApplicationView
Definition: ns.h:150
NsApplicationViewDeprecated::unk_x24
u16 unk_x24
Same as NsApplicationView::unk_x24.
Definition: ns.h:114
nsResumeAll
Result nsResumeAll(void)
ResumeAll.
NsPromotionInfo::start_timestamp
u64 start_timestamp
POSIX timestamp for the promotion start.
Definition: ns.h:140
nsGetTotalSpaceSize
Result nsGetTotalSpaceSize(NcmStorageId storage_id, s64 *size)
Returns the total storage capacity (used + free) from content manager services.
nssuControlRequestDownloadLatestUpdate
Result nssuControlRequestDownloadLatestUpdate(NsSystemUpdateControl *c, AsyncResult *a)
RequestDownloadLatestUpdate.
nssuControlApplyCardUpdate
Result nssuControlApplyCardUpdate(NsSystemUpdateControl *c)
ApplyCardUpdate.
NsShellEvent_None
@ NsShellEvent_None
None.
Definition: ns.h:21
NsApplicationDeliveryInfo::unk_x1c
u32 unk_x1c
Unknown.
Definition: ns.h:209
u64
uint64_t u64
64-bit unsigned integer.
Definition: types.h:22
NsApplicationOccupiedSize
ApplicationOccupiedSize.
Definition: ns.h:78
nsResetToFactorySettingsWithPlatformRegion
Result nsResetToFactorySettingsWithPlatformRegion(void)
ResetToFactorySettingsWithPlatformRegion.
NsApplicationView::unk_x20
u32 unk_x20
Unknown.
Definition: ns.h:128
nsEstimateRequiredSize
Result nsEstimateRequiredSize(const NcmContentMetaKey *meta, s32 count, s64 *out)
EstimateRequiredSize.
NsLaunchProperties
LaunchProperties.
Definition: ns.h:155
NsSystemUpdateControl::s
Service s
ISystemUpdateControl.
Definition: ns.h:67
nsCommitReceiveApplication
Result nsCommitReceiveApplication(u64 application_id)
CommitReceiveApplication.
nsTouchApplication
Result nsTouchApplication(u64 application_id)
TouchApplication.
NsSystemDeliveryInfo::system_update_meta_version
u32 system_update_meta_version
SystemUpdate meta version.
Definition: ns.h:192
nssuDestroySystemUpdateTask
Result nssuDestroySystemUpdateTask(void)
This uses nim ListSystemUpdateTask, then when a task is returned uses it with DestroySystemUpdateTask...
nsGetECommerceInterface
Result nsGetECommerceInterface(Service *srv_out)
Gets the Service object for IECommerceInterface via the cmd for that.
nsIsApplicationEntityMovable
Result nsIsApplicationEntityMovable(u64 application_id, NcmStorageId storage_id, bool *out)
IsApplicationEntityMovable.
NsLaunchProperties::program_id
u64 program_id
program_id.
Definition: ns.h:156
NsShellEventInfo::process_id
u64 process_id
processID.
Definition: ns.h:166
NsProgressAsyncResult::s
Service s
IProgressAsyncResult.
Definition: ns.h:61
nsdevInitialize
Result nsdevInitialize(void)
Initialize ns:dev.
nsCancelApplicationApplyDelta
Result nsCancelApplicationApplyDelta(u64 application_id)
CancelApplicationApplyDelta.
nsProgressAsyncResultGetProgress
Result nsProgressAsyncResultGetProgress(NsProgressAsyncResult *a, void *buffer, size_t size)
Gets the progress.
nsGetApplicationDeliveryInfo
Result nsGetApplicationDeliveryInfo(NsApplicationDeliveryInfo *info, s32 count, u64 application_id, u32 attr, s32 *total_out)
Generates NsApplicationDeliveryInfo for the specified ApplicationId.
NsApplicationControlData
ApplicationControlData.
Definition: ns.h:72
nssuGetBackgroundNetworkUpdateState
Result nssuGetBackgroundNetworkUpdateState(NsBackgroundNetworkUpdateState *out)
Gets the NsBackgroundNetworkUpdateState.
nsGetGameCardMountFailureEvent
Result nsGetGameCardMountFailureEvent(Event *out_event)
GetGameCardMountFailureEvent.
Result
u32 Result
Function error code result type.
Definition: types.h:44
nsTriggerDynamicCommitEvent
Result nsTriggerDynamicCommitEvent(void)
TriggerDynamicCommitEvent.
nsProgressMonitorForDeleteUserSaveDataAllGetProgress
Result nsProgressMonitorForDeleteUserSaveDataAllGetProgress(NsProgressMonitorForDeleteUserSaveDataAll *p, NsProgressForDeleteUserSaveDataAll *progress)
GetProgress.
nssuNotifySystemUpdateForContentDelivery
Result nssuNotifySystemUpdateForContentDelivery(void)
Signals the event returned by nssuGetSystemUpdateNotificationEventForContentDelivery.
nsCountApplicationContentMeta
Result nsCountApplicationContentMeta(u64 application_id, s32 *out)
CountApplicationContentMeta.
nsClearApplicationTerminateResult
Result nsClearApplicationTerminateResult(u64 application_id)
ClearApplicationTerminateResult.
nsGetFactoryResetInterface
Result nsGetFactoryResetInterface(Service *srv_out)
Gets the Service object for IFactoryResetInterface via the cmd for that.
nsRequestLinkDevice
Result nsRequestLinkDevice(AsyncResult *a, AccountUid uid)
RequestLinkDevice.
nsCalculateApplicationOccupiedSize
Result nsCalculateApplicationOccupiedSize(u64 application_id, NsApplicationOccupiedSize *out)
CalculateApplicationOccupiedSize.
NsProgressForDeleteUserSaveDataAll
ProgressForDeleteUserSaveDataAll.
Definition: ns.h:103
NsApplicationContentMetaStatus::version
u32 version
Application version.
Definition: ns.h:88
nsdevIsSystemMemoryResourceLimitBoosted
Result nsdevIsSystemMemoryResourceLimitBoosted(bool *out)
[6.0.0-8.1.0]
nsdevExit
void nsdevExit(void)
Initialize ns:dev.
NsLaunchProperties::index
u8 index
Index.
Definition: ns.h:159
nsProgressAsyncResultGet
Result nsProgressAsyncResultGet(NsProgressAsyncResult *a)
Gets the Result.
nsGetSdCardMountStatusChangedEvent
Result nsGetSdCardMountStatusChangedEvent(Event *out_event)
GetSdCardMountStatusChangedEvent.
nssuControlRequestCheckLatestUpdate
Result nssuControlRequestCheckLatestUpdate(NsSystemUpdateControl *c, AsyncValue *a)
RequestCheckLatestUpdate.
nssuGetServiceSession
Service * nssuGetServiceSession(void)
Gets the Service object for ns:su.
NsSystemUpdateProgress::total_size
s64 total_size
Total size, this field is only valid when >0.
Definition: ns.h:172
NsApplicationRightsOnClient::application_id
u64 application_id
ApplicationId.
Definition: ns.h:217
nssuControlClose
void nssuControlClose(NsSystemUpdateControl *c)
Close a NsSystemUpdateControl.
nsResetToFactorySettingsForRefurbishment
Result nsResetToFactorySettingsForRefurbishment(void)
ResetToFactorySettingsForRefurbishment.
nsGetGameCardUpdateDetectionEvent
Result nsGetGameCardUpdateDetectionEvent(Event *out_event)
GetGameCardUpdateDetectionEvent.
NsBackgroundNetworkUpdateState
NsBackgroundNetworkUpdateState
BackgroundNetworkUpdateState.
Definition: ns.h:36
NsLaunchProperties::storageID
u8 storageID
NcmStorageId
Definition: ns.h:158
nsGetApplicationView
Result nsGetApplicationView(NsApplicationView *views, const u64 *application_ids, s32 count)
GetApplicationView.
nssuExit
void nssuExit(void)
Exit ns:su.
nsInitialize
Result nsInitialize(void)
Initialize ns services. Uses ns:am on pre-3.0.0, ns:am2 on [3.0.0+].
nssuControlApplyDownloadedUpdate
Result nssuControlApplyDownloadedUpdate(NsSystemUpdateControl *c)
ApplyDownloadedUpdate.
nsProgressAsyncResultWait
Result nsProgressAsyncResultWait(NsProgressAsyncResult *a, u64 timeout)
Waits for the async operation to finish using the specified timeout.
nsGetLastSdCardMountUnexpectedResult
Result nsGetLastSdCardMountUnexpectedResult(void)
GetLastSdCardMountUnexpectedResult.
NsApplicationRightsOnClient::uid
AccountUid uid
AccountUid
Definition: ns.h:218
NsApplicationRightsOnClient::flags_x19
u8 flags_x19
qlaunch uses bit0 from here.
Definition: ns.h:220
nsGetApplicationControlData
Result nsGetApplicationControlData(NsApplicationControlSource source, u64 application_id, NsApplicationControlData *buffer, size_t size, u64 *actual_size)
Gets the NsApplicationControlData for the specified application.
nssuNotifyExFatDriverRequired
Result nssuNotifyExFatDriverRequired(void)
Uses nim ListSystemUpdateTask, then uses the task with DestroySystemUpdateTask if it exists.
NsSendApplicationProgress
NsSystemUpdateProgress NsSendApplicationProgress
SendApplicationProgress. Same as NsSystemUpdateProgress, except cmds which return this will return ac...
Definition: ns.h:179
nsSetApplicationTerminateResult
Result nsSetApplicationTerminateResult(u64 application_id, Result res)
SetApplicationTerminateResult.
nsIsGameCardInserted
Result nsIsGameCardInserted(bool *out)
IsGameCardInserted.
nsGetSystemDeliveryInfo
Result nsGetSystemDeliveryInfo(NsSystemDeliveryInfo *info)
Generates a NsSystemDeliveryInfo using the currently installed SystemUpdate meta.
NsShellEvent_Exit
@ NsShellEvent_Exit
Exit.
Definition: ns.h:22
nssuRequestSendSystemUpdate
Result nssuRequestSendSystemUpdate(AsyncResult *a, u32 addr, u16 port, NsSystemDeliveryInfo *info)
RequestSendSystemUpdate.
NsPromotionInfo
NsPromotionInfo.
Definition: ns.h:139
NsApplicationControlData::nacp
NacpStruct nacp
NacpStruct
Definition: ns.h:73
nssuInitialize
Result nssuInitialize(void)
Initialize ns:su.
NsApplicationContentMetaStatus::unk_x02
u8 unk_x02
Unknown.
Definition: ns.h:86
NsSystemDeliveryInfo::unk_x18
u8 unk_x18
Copied into state by nssuRequestSendSystemUpdate.
Definition: ns.h:194
nssuControlRequestPrepareCardUpdate
Result nssuControlRequestPrepareCardUpdate(NsSystemUpdateControl *c, AsyncResult *a)
RequestPrepareCardUpdate.
nsEnsureGameCardAccess
Result nsEnsureGameCardAccess(void)
EnsureGameCardAccess.
nsProgressMonitorForDeleteUserSaveDataAllIsFinished
Result nsProgressMonitorForDeleteUserSaveDataAllIsFinished(NsProgressMonitorForDeleteUserSaveDataAll *p, bool *out)
IsFinished.
nssuControlGetPreparedCardUpdateEulaData
Result nssuControlGetPreparedCardUpdateEulaData(NsSystemUpdateControl *c, const char *path, void *buffer, size_t size, u64 *filesize)
Gets the specified PreparedCardUpdateEulaData.
NsProgressAsyncResult
ProgressAsyncResult.
Definition: ns.h:60
nsdevGetRunningApplicationProcessIdForDevelop
Result nsdevGetRunningApplicationProcessIdForDevelop(u64 *out_pid)
[6.0.0+]
nsRequestVerifyApplication
Result nsRequestVerifyApplication(NsProgressAsyncResult *a, u64 application_id, u32 unk, void *buffer, size_t size)
RequestVerifyApplication.
NsApplicationContentMetaStatus::application_id
u64 application_id
ApplicationId.
Definition: ns.h:89
nsGetAccountProxyInterface
Result nsGetAccountProxyInterface(Service *srv_out)
Gets the Service object for IAccountProxyInterface via the cmd for that.
NsProgressAsyncResult::event
Event event
Event with autoclear=false.
Definition: ns.h:62
NsLatestSystemUpdate_Unknown2
@ NsLatestSystemUpdate_Unknown2
Unknown.
Definition: ns.h:46
ErrorContext
Error context.
Definition: error.h:38
nssuControlGetReceivedEulaDataSize
Result nssuControlGetReceivedEulaDataSize(NsSystemUpdateControl *c, const char *path, u64 *filesize)
Gets the filesize for the specified ReceivedEulaData.
nsEnableAutoCommit
Result nsEnableAutoCommit(void)
EnableAutoCommit.
nsGetApplicationTerminateResult
Result nsGetApplicationTerminateResult(u64 application_id, Result *res)
GetApplicationTerminateResult.
nsRequestDownloadApplicationPrepurchasedRights
Result nsRequestDownloadApplicationPrepurchasedRights(AsyncResult *a, u64 application_id)
RequestDownloadApplicationPrepurchasedRights.
nsGetApplicationViewDownloadErrorContext
Result nsGetApplicationViewDownloadErrorContext(u64 application_id, ErrorContext *context)
GetApplicationViewDownloadErrorContext.
nsHasAllContentsToDeliver
Result nsHasAllContentsToDeliver(const NsApplicationDeliveryInfo *info, s32 count, bool *out)
HasAllContentsToDeliver.
nsWithdrawApplicationUpdateRequest
Result nsWithdrawApplicationUpdateRequest(u64 application_id)
WithdrawApplicationUpdateRequest.
nsGetSendApplicationProgress
Result nsGetSendApplicationProgress(u64 application_id, NsSendApplicationProgress *out)
GetSendApplicationProgress.
NsPromotionInfo::flags
u8 flags
Flags. Bit0: whether the PromotionInfo is valid (including bit1). Bit1 clear: remaining_time is set.
Definition: ns.h:144
NsPromotionInfo::remaining_time
s64 remaining_time
Remaining time until the promotion ends, in nanoseconds ({end_timestamp - current_time} converted to ...
Definition: ns.h:142
NsApplicationRecord::unk_x10
u8 unk_x10
Unknown.
Definition: ns.h:98
NsRequestServerStopper::s
Service s
IRequestServerStopper.
Definition: ns.h:51
NsApplicationControlSource_StorageOnly
@ NsApplicationControlSource_StorageOnly
Returns data from storage without using cache.
Definition: ns.h:32
NsSystemDeliveryInfo::application_delivery_protocol_version
u32 application_delivery_protocol_version
Loaded from a system-setting. Unused by nssuRequestSendSystemUpdate / nssuControlRequestReceiveSystem...
Definition: ns.h:190
nsRequestUpdateApplication2
Result nsRequestUpdateApplication2(AsyncResult *a, u64 application_id)
RequestUpdateApplication2.
Service
Service object structure.
Definition: service.h:13
nsIsApplicationUpdateRequested
Result nsIsApplicationUpdateRequested(u64 application_id, bool *flag, u32 *out)
IsApplicationUpdateRequested.
nsMoveApplicationEntity
Result nsMoveApplicationEntity(u64 application_id, NcmStorageId storage_id)
MoveApplicationEntity.
nsCancelApplicationDownload
Result nsCancelApplicationDownload(u64 application_id)
CancelApplicationDownload.
nsdevSetCurrentApplicationRightsEnvironmentCanBeActiveForDevelop
Result nsdevSetCurrentApplicationRightsEnvironmentCanBeActiveForDevelop(bool can_be_active)
[6.0.0+]
NsApplicationControlSource_CacheOnly
@ NsApplicationControlSource_CacheOnly
Returns data from cache.
Definition: ns.h:30
nsGetReceiveApplicationProgress
Result nsGetReceiveApplicationProgress(u64 application_id, NsReceiveApplicationProgress *out)
GetReceiveApplicationProgress.
nsRequestApplicationUpdateInfo
Result nsRequestApplicationUpdateInfo(AsyncValue *a, u64 application_id)
RequestApplicationUpdateInfo.
NsPromotionInfo::end_timestamp
u64 end_timestamp
POSIX timestamp for the promotion end.
Definition: ns.h:141
nsIsAnyApplicationRunning
Result nsIsAnyApplicationRunning(bool *out)
IsAnyApplicationRunning.
NsShellEvent_Crash
@ NsShellEvent_Crash
Crash.
Definition: ns.h:24
NsApplicationRecord::unk_x09
u8 unk_x09
Unknown.
Definition: ns.h:96
nsTryCommitCurrentApplicationDownloadTask
Result nsTryCommitCurrentApplicationDownloadTask(void)
TryCommitCurrentApplicationDownloadTask.
nsProgressAsyncResultCancel
Result nsProgressAsyncResultCancel(NsProgressAsyncResult *a)
Cancels the async operation.
nsGetDynamicRightsInterface
Result nsGetDynamicRightsInterface(Service *srv_out)
Gets the Service object for IDynamicRightsInterface via the cmd for that.
NsApplicationView::flags
u32 flags
Flags.
Definition: ns.h:126
nssuControlRequestCheckLatestUpdateIncludesRebootlessUpdate
Result nssuControlRequestCheckLatestUpdateIncludesRebootlessUpdate(NsSystemUpdateControl *c, AsyncValue *a)
RequestCheckLatestUpdateIncludesRebootlessUpdate.
nssuControlRequestReceiveSystemUpdate
Result nssuControlRequestReceiveSystemUpdate(NsSystemUpdateControl *c, AsyncResult *a, u32 addr, u16 port, NsSystemDeliveryInfo *info)
RequestReceiveSystemUpdate.
nssuRequestBackgroundNetworkUpdate
Result nssuRequestBackgroundNetworkUpdate(void)
RequestBackgroundNetworkUpdate.
nsEnableApplicationAutoDelete
Result nsEnableApplicationAutoDelete(u64 application_id)
EnableApplicationAutoDelete.
nsListNotCommittedContentMeta
Result nsListNotCommittedContentMeta(NcmContentMetaKey *meta, s32 count, u64 application_id, s32 unk, s32 *total_out)
ListNotCommittedContentMeta.
nsRequestResolveNoDownloadRightsError
Result nsRequestResolveNoDownloadRightsError(AsyncValue *a, u64 application_id)
RequestResolveNoDownloadRightsError.
nsGetApplicationDeliveryInfoHash
Result nsGetApplicationDeliveryInfoHash(const NsApplicationDeliveryInfo *info, s32 count, u8 *out_hash)
This extracts data from the input array for hashing with SHA256, with validation being done when hand...
NsShellEventInfo
ShellEventInfo.
Definition: ns.h:164
NsApplicationViewDeprecated::unk_x20
u32 unk_x20
Same as NsApplicationView::unk_x20.
Definition: ns.h:113
NsApplicationViewDeprecated
ApplicationViewDeprecated. The below comments are for the NsApplicationView to NsApplicationViewDepre...
Definition: ns.h:108
nssuNotifyExFatDriverDownloadedForDebug
Result nssuNotifyExFatDriverDownloadedForDebug(void)
NotifyExFatDriverDownloadedForDebug.
NsSystemDeliveryInfo::system_update_meta_id
u64 system_update_meta_id
SystemUpdate meta Id.
Definition: ns.h:193
nssuGetSystemUpdateNotificationEventForContentDelivery
Result nssuGetSystemUpdateNotificationEventForContentDelivery(Event *out_event)
Gets an Event which can be signaled by nssuNotifySystemUpdateForContentDelivery.
nsRequestDownloadApplicationControlData
Result nsRequestDownloadApplicationControlData(AsyncResult *a, u64 application_id)
RequestDownloadApplicationControlData.
nsListApplicationContentMetaStatus
Result nsListApplicationContentMetaStatus(u64 application_id, s32 index, NsApplicationContentMetaStatus *list, s32 count, s32 *out_entrycount)
Gets an listing of NsApplicationContentMetaStatus.
nsCalculateApplicationApplyDeltaRequiredSize
Result nsCalculateApplicationApplyDeltaRequiredSize(u64 application_id, NcmStorageId *storage_id, s64 *size)
CalculateApplicationApplyDeltaRequiredSize.
NsEulaDataPath
EulaDataPath.
Definition: ns.h:182
NsApplicationView::unk_x24
u16 unk_x24
Unknown.
Definition: ns.h:129
NsSystemUpdateControl
SystemUpdateControl.
Definition: ns.h:66
nsRequestVerifyAddOnContentsRights
Result nsRequestVerifyAddOnContentsRights(NsProgressAsyncResult *a, u64 application_id)
RequestVerifyAddOnContentsRights.
nsResetToFactorySettings
Result nsResetToFactorySettings(void)
ResetToFactorySettings.
nsRequestUnlinkDevice
Result nsRequestUnlinkDevice(AsyncResult *a, AccountUid uid)
RequestUnlinkDevice.
NsShellEvent
NsShellEvent
ShellEvent.
Definition: ns.h:20
nsdevLaunchProgram
Result nsdevLaunchProgram(u64 *out_pid, const NsLaunchProperties *properties, u32 flags)
[1.0.0-9.2.0]
u16
uint16_t u16
16-bit unsigned integer.
Definition: types.h:20
NsApplicationRecord::type
u8 type
Type.
Definition: ns.h:95
nssuControlGetDownloadedEulaData
Result nssuControlGetDownloadedEulaData(NsSystemUpdateControl *c, const char *path, void *buffer, size_t size, u64 *filesize)
Gets the specified DownloadedEulaData.
nsListApplicationIcon
Result nsListApplicationIcon(AsyncValue *a, NsApplicationControlSource source, const u64 *application_ids, s32 count, void *buffer, size_t size)
ListApplicationIcon.
nsGetPromotionInfo
Result nsGetPromotionInfo(NsPromotionInfo *promotion, u64 application_id, AccountUid uid)
GetPromotionInfo.
nsIsAnyApplicationEntityInstalled
Result nsIsAnyApplicationEntityInstalled(u64 application_id, bool *out)
IsAnyApplicationEntityInstalled.
nsExit
void nsExit(void)
Exit ns services.
nsUnregisterNetworkServiceAccount
Result nsUnregisterNetworkServiceAccount(AccountUid uid)
UnregisterNetworkServiceAccount.
NsBackgroundNetworkUpdateState_None
@ NsBackgroundNetworkUpdateState_None
No sysupdate task exists.
Definition: ns.h:37
nsCleanupSdCard
Result nsCleanupSdCard(void)
CleanupSdCard.
NsLaunchProperties::version
u32 version
Program version.
Definition: ns.h:157
NsApplicationRightsOnClient
NsApplicationRightsOnClient.
Definition: ns.h:216
nssuControlGetPreparedCardUpdateEulaDataSize
Result nssuControlGetPreparedCardUpdateEulaDataSize(NsSystemUpdateControl *c, const char *path, u64 *filesize)
Gets the filesize for the specified PreparedCardUpdateEulaData.
nsDeleteUserSystemSaveData
Result nsDeleteUserSystemSaveData(AccountUid uid, u64 system_save_data_id)
DeleteUserSystemSaveData.