mirror of
https://github.com/switchbrew/libnx.git
synced 2025-06-25 22:32:39 +02:00
applet: Add appletSelfExit()
This commit is contained in:
parent
00b12b93fb
commit
1c948e2d32
@ -71,6 +71,12 @@ Result appletSetScreenShotPermission(s32 val);
|
||||
|
||||
Result appletSetScreenShotImageOrientation(s32 val);
|
||||
|
||||
/**
|
||||
* @brief Exits the application.
|
||||
* @note Can only be used with AppletType_Application.
|
||||
*/
|
||||
Result appletSelfExit(void);
|
||||
|
||||
/**
|
||||
* @brief Processes the current applet status. Generally used within a main loop.
|
||||
* @return Whether the application should continue running.
|
||||
|
@ -1071,6 +1071,37 @@ Result appletSetScreenShotImageOrientation(s32 val) {
|
||||
return rc;
|
||||
}
|
||||
|
||||
Result appletSelfExit(void) {
|
||||
IpcCommand c;
|
||||
ipcInitialize(&c);
|
||||
|
||||
struct {
|
||||
u64 magic;
|
||||
u64 cmd_id;
|
||||
} *raw;
|
||||
|
||||
raw = ipcPrepareHeader(&c, sizeof(*raw));
|
||||
|
||||
raw->magic = SFCI_MAGIC;
|
||||
raw->cmd_id = 0;
|
||||
|
||||
Result rc = serviceIpcDispatch(&g_appletISelfController);
|
||||
|
||||
if (R_SUCCEEDED(rc)) {
|
||||
IpcParsedCommand r;
|
||||
ipcParse(&r);
|
||||
|
||||
struct {
|
||||
u64 magic;
|
||||
u64 result;
|
||||
} *resp = r.Raw;
|
||||
|
||||
rc = resp->result;
|
||||
}
|
||||
|
||||
return rc;
|
||||
}
|
||||
|
||||
Result appletCreateManagedDisplayLayer(u64 *out) {
|
||||
IpcCommand c;
|
||||
ipcInitialize(&c);
|
||||
|
Loading…
Reference in New Issue
Block a user