mirror of
https://github.com/switchbrew/libnx.git
synced 2025-06-26 06:42:47 +02:00
Added appletPopLaunchParameter.
This commit is contained in:
parent
3af857575c
commit
10826dda13
@ -49,6 +49,12 @@ typedef enum {
|
||||
AppletFocusHandlingMode_Max, //< Number of focus handling modes
|
||||
} AppletFocusHandlingMode;
|
||||
|
||||
typedef enum {
|
||||
AppletLaunchParameterKind_Application = 1, ///< Application-specific LaunchParameter
|
||||
AppletLaunchParameterKind_PreselectedUser = 2, ///< account PreselectedUser
|
||||
AppletLaunchParameterKind_Unknown = 3, ///< Unknown if used by anything?
|
||||
} AppletLaunchParameterKind;
|
||||
|
||||
/// applet hook function.
|
||||
typedef void (*AppletHookFn)(AppletHookType hook, void* param);
|
||||
|
||||
@ -77,6 +83,14 @@ AppletType appletGetAppletType(void);
|
||||
void appletNotifyRunning(u8 *out);
|
||||
Result appletCreateManagedDisplayLayer(u64 *out);
|
||||
|
||||
/**
|
||||
* @brief Pops a LaunchParameter AppletStorage, the storage will be removed from sysmodule state during this.
|
||||
* @param s Output storage.
|
||||
* @param kind See \ref AppletLaunchParameterKind.
|
||||
* @note Can only be used in Applications.
|
||||
*/
|
||||
Result appletPopLaunchParameter(AppletStorage *s, AppletLaunchParameterKind kind);
|
||||
|
||||
Result appletGetDesiredLanguage(u64 *LanguageCode);
|
||||
|
||||
/// Gets whether video recording is supported.
|
||||
|
@ -719,6 +719,48 @@ Result appletGetAppletResourceUserId(u64 *out) {
|
||||
|
||||
// IFunctions
|
||||
|
||||
Result appletPopLaunchParameter(AppletStorage *s, AppletLaunchParameterKind kind) {
|
||||
IpcCommand c;
|
||||
ipcInitialize(&c);
|
||||
|
||||
if (!serviceIsActive(&g_appletSrv) || !_appletIsApplication())
|
||||
return MAKERESULT(Module_Libnx, LibnxError_NotInitialized);
|
||||
|
||||
struct {
|
||||
u64 magic;
|
||||
u64 cmd_id;
|
||||
u32 kind;
|
||||
} *raw;
|
||||
|
||||
raw = serviceIpcPrepareHeader(&g_appletIFunctions, &c, sizeof(*raw));
|
||||
|
||||
raw->magic = SFCI_MAGIC;
|
||||
raw->cmd_id = 1;
|
||||
raw->kind = kind;
|
||||
|
||||
Result rc = serviceIpcDispatch(&g_appletIFunctions);
|
||||
|
||||
if (R_SUCCEEDED(rc)) {
|
||||
IpcParsedCommand r;
|
||||
struct {
|
||||
u64 magic;
|
||||
u64 result;
|
||||
} *resp;
|
||||
|
||||
serviceIpcParse(&g_appletIFunctions, &r, sizeof(*resp));
|
||||
resp = r.Raw;
|
||||
|
||||
rc = resp->result;
|
||||
|
||||
if (R_SUCCEEDED(rc)) {
|
||||
memset(s, 0, sizeof(AppletStorage));
|
||||
serviceCreateSubservice(&s->s, &g_appletIFunctions, &r, 0);
|
||||
}
|
||||
}
|
||||
|
||||
return rc;
|
||||
}
|
||||
|
||||
Result appletGetDesiredLanguage(u64 *LanguageCode) {
|
||||
if (!serviceIsActive(&g_appletSrv) || !_appletIsApplication())
|
||||
return MAKERESULT(Module_Libnx, LibnxError_NotInitialized);
|
||||
|
Loading…
Reference in New Issue
Block a user