mirror of
https://github.com/switchbrew/libnx.git
synced 2025-08-07 00:29:23 +02:00
applet: Updated for 15.0.0. Various fixes and added __nx_applet_init_timeout.
This commit is contained in:
parent
cea3018de6
commit
75290f912e
@ -344,10 +344,10 @@ Service* appletGetServiceSession_Proxy(void);
|
|||||||
/// Gets the Service object for IAppletCommonFunctions. Only initialized with AppletType_SystemApplet, AppletType_LibraryApplet, or AppletType_OverlayApplet, on [7.0.0+].
|
/// Gets the Service object for IAppletCommonFunctions. Only initialized with AppletType_SystemApplet, AppletType_LibraryApplet, or AppletType_OverlayApplet, on [7.0.0+].
|
||||||
Service* appletGetServiceSession_AppletCommonFunctions(void);
|
Service* appletGetServiceSession_AppletCommonFunctions(void);
|
||||||
|
|
||||||
/// Gets the Service object for I*Functions, specific to each AppletType (IApplicationFunctions for AppletType_*Application). Not initialized with AppletType_LibraryApplet.
|
/// Gets the Service object for I*Functions, specific to each AppletType (IApplicationFunctions for AppletType_*Application). Not initialized with AppletType_LibraryApplet pre-15.0.0. On [15.0.0+] with AppletType_LibraryApplet this returns the object for IHomeMenuFunctions.
|
||||||
Service* appletGetServiceSession_Functions(void);
|
Service* appletGetServiceSession_Functions(void);
|
||||||
|
|
||||||
/// Gets the Service object for IGlobalStateController. Only initialized with AppletType_SystemApplet.
|
/// Gets the Service object for IGlobalStateController. Only initialized with AppletType_SystemApplet, or on [15.0.0+] with AppletType_LibraryApplet/AppletType_OverlayApplet.
|
||||||
Service* appletGetServiceSession_GlobalStateController(void);
|
Service* appletGetServiceSession_GlobalStateController(void);
|
||||||
|
|
||||||
/// Gets the Service object for IApplicationCreator. Only initialized with AppletType_SystemApplet.
|
/// Gets the Service object for IApplicationCreator. Only initialized with AppletType_SystemApplet.
|
||||||
@ -1732,37 +1732,37 @@ Result appletPrepareForJit(void);
|
|||||||
|
|
||||||
///@}
|
///@}
|
||||||
|
|
||||||
///@name IHomeMenuFunctions: IFunctions for AppletType_SystemApplet.
|
///@name IHomeMenuFunctions: IFunctions for AppletType_SystemApplet and on [15.0.0+] for AppletType_LibraryApplet.
|
||||||
///@{
|
///@{
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @brief RequestToGetForeground
|
* @brief RequestToGetForeground
|
||||||
* @note Only available with AppletType_SystemApplet.
|
* @note Only available with AppletType_SystemApplet, or on [15.0.0+] with AppletType_LibraryApplet.
|
||||||
*/
|
*/
|
||||||
Result appletRequestToGetForeground(void);
|
Result appletRequestToGetForeground(void);
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @brief LockForeground
|
* @brief LockForeground
|
||||||
* @note Only available with AppletType_SystemApplet.
|
* @note Only available with AppletType_SystemApplet, or on [15.0.0+] with AppletType_LibraryApplet.
|
||||||
*/
|
*/
|
||||||
Result appletLockForeground(void);
|
Result appletLockForeground(void);
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @brief UnlockForeground
|
* @brief UnlockForeground
|
||||||
* @note Only available with AppletType_SystemApplet.
|
* @note Only available with AppletType_SystemApplet, or on [15.0.0+] with AppletType_LibraryApplet.
|
||||||
*/
|
*/
|
||||||
Result appletUnlockForeground(void);
|
Result appletUnlockForeground(void);
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @brief Pops a storage from the general channel.
|
* @brief Pops a storage from the general channel.
|
||||||
* @note Only available with AppletType_SystemApplet.
|
* @note Only available with AppletType_SystemApplet, or on [15.0.0+] with AppletType_LibraryApplet.
|
||||||
* @param[out] s Storage object.
|
* @param[out] s Storage object.
|
||||||
*/
|
*/
|
||||||
Result appletPopFromGeneralChannel(AppletStorage *s);
|
Result appletPopFromGeneralChannel(AppletStorage *s);
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @brief Gets an Event which is signaled when a new storage is available with \ref appletPopFromGeneralChannel where previously no storage was available, this event is automatically cleared by the system once the last storage is popped.
|
* @brief Gets an Event which is signaled when a new storage is available with \ref appletPopFromGeneralChannel where previously no storage was available, this event is automatically cleared by the system once the last storage is popped.
|
||||||
* @note Only available with AppletType_SystemApplet.
|
* @note Only available with AppletType_SystemApplet, or on [15.0.0+] with AppletType_LibraryApplet.
|
||||||
* @note The Event must be closed by the user once finished with it.
|
* @note The Event must be closed by the user once finished with it.
|
||||||
* @param[out] out_event Output Event with autoclear=false.
|
* @param[out] out_event Output Event with autoclear=false.
|
||||||
*/
|
*/
|
||||||
@ -1770,7 +1770,7 @@ Result appletGetPopFromGeneralChannelEvent(Event *out_event);
|
|||||||
|
|
||||||
/**
|
/**
|
||||||
* @brief Gets a \ref AppletLockAccessor for HomeButtonWriter.
|
* @brief Gets a \ref AppletLockAccessor for HomeButtonWriter.
|
||||||
* @note Only available with AppletType_SystemApplet.
|
* @note Only available with AppletType_SystemApplet, or on [15.0.0+] with AppletType_LibraryApplet.
|
||||||
* @note Similar to using \ref appletGetWriterLockAccessorEx with inval=0.
|
* @note Similar to using \ref appletGetWriterLockAccessorEx with inval=0.
|
||||||
* @param a LockAccessor object.
|
* @param a LockAccessor object.
|
||||||
*/
|
*/
|
||||||
@ -1778,14 +1778,14 @@ Result appletGetHomeButtonWriterLockAccessor(AppletLockAccessor *a);
|
|||||||
|
|
||||||
/**
|
/**
|
||||||
* @brief IsSleepEnabled
|
* @brief IsSleepEnabled
|
||||||
* @note Only available with AppletType_SystemApplet on [11.0.0+].
|
* @note Only available with AppletType_SystemApplet on [11.0.0+], or on [15.0.0+] with AppletType_LibraryApplet.
|
||||||
* @param[out] out Output flag.
|
* @param[out] out Output flag.
|
||||||
*/
|
*/
|
||||||
Result appletIsSleepEnabled(bool *out);
|
Result appletIsSleepEnabled(bool *out);
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @brief PopRequestLaunchApplicationForDebug
|
* @brief PopRequestLaunchApplicationForDebug
|
||||||
* @note Only available with AppletType_SystemApplet on [6.0.0+].
|
* @note Only available with AppletType_SystemApplet on [6.0.0+], or on [15.0.0+] with AppletType_LibraryApplet.
|
||||||
* @param[out] uids Output array of \ref AccountUid.
|
* @param[out] uids Output array of \ref AccountUid.
|
||||||
* @param[in] count Size of the uids array in entries, must be at least the size stored in state.
|
* @param[in] count Size of the uids array in entries, must be at least the size stored in state.
|
||||||
* @param[out] application_id Output ApplicationId.
|
* @param[out] application_id Output ApplicationId.
|
||||||
@ -1795,21 +1795,21 @@ Result appletPopRequestLaunchApplicationForDebug(AccountUid *uids, s32 count, u6
|
|||||||
|
|
||||||
/**
|
/**
|
||||||
* @brief IsForceTerminateApplicationDisabledForDebug
|
* @brief IsForceTerminateApplicationDisabledForDebug
|
||||||
* @note Only available with AppletType_SystemApplet on [9.0.0+].
|
* @note Only available with AppletType_SystemApplet on [9.0.0+], or on [15.0.0+] with AppletType_LibraryApplet.
|
||||||
* @param[out] out Output flag. 0 when DebugMode is not enabled, otherwise this is loaded from a system-setting.
|
* @param[out] out Output flag. 0 when DebugMode is not enabled, otherwise this is loaded from a system-setting.
|
||||||
*/
|
*/
|
||||||
Result appletIsForceTerminateApplicationDisabledForDebug(bool *out);
|
Result appletIsForceTerminateApplicationDisabledForDebug(bool *out);
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @brief Launches DevMenu and the dev Overlay-applet. This will enter an infinite-sleep-loop on success.
|
* @brief Launches DevMenu and the dev Overlay-applet. This will enter an infinite-sleep-loop on success.
|
||||||
* @note Only available with AppletType_SystemApplet on [8.0.0+].
|
* @note Only available with AppletType_SystemApplet on [8.0.0+], or on [15.0.0+] with AppletType_LibraryApplet.
|
||||||
* @note This verifies that DebugMode is enabled, then uses a ns cmd. That cmd then loads the system-settings for these two ProgramIds (which normally only exist on devunits), and verifies that these programs are installed + launches them.
|
* @note This verifies that DebugMode is enabled, then uses a ns cmd. That cmd then loads the system-settings for these two ProgramIds (which normally only exist on devunits), and verifies that these programs are installed + launches them.
|
||||||
*/
|
*/
|
||||||
Result appletLaunchDevMenu(void);
|
Result appletLaunchDevMenu(void);
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @brief SetLastApplicationExitReason
|
* @brief SetLastApplicationExitReason
|
||||||
* @note Only available with AppletType_SystemApplet on [11.0.0+].
|
* @note Only available with AppletType_SystemApplet on [11.0.0+], or on [15.0.0+] with AppletType_LibraryApplet.
|
||||||
* @param[in] reason Reason
|
* @param[in] reason Reason
|
||||||
*/
|
*/
|
||||||
Result appletSetLastApplicationExitReason(s32 reason);
|
Result appletSetLastApplicationExitReason(s32 reason);
|
||||||
@ -1821,65 +1821,65 @@ Result appletSetLastApplicationExitReason(s32 reason);
|
|||||||
|
|
||||||
/**
|
/**
|
||||||
* @brief Start the sequence for entering sleep-mode.
|
* @brief Start the sequence for entering sleep-mode.
|
||||||
* @note Only available with AppletType_SystemApplet.
|
* @note Only available with AppletType_SystemApplet, or on [15.0.0+] with AppletType_LibraryApplet/AppletType_OverlayApplet.
|
||||||
* @param[in] flag Flag, official sw uses hard-coded value = true.
|
* @param[in] flag Flag, official sw uses hard-coded value = true.
|
||||||
*/
|
*/
|
||||||
Result appletStartSleepSequence(bool flag);
|
Result appletStartSleepSequence(bool flag);
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @brief Start the system-shutdown sequence.
|
* @brief Start the system-shutdown sequence.
|
||||||
* @note Only available with AppletType_SystemApplet.
|
* @note Only available with AppletType_SystemApplet, or on [15.0.0+] with AppletType_LibraryApplet/AppletType_OverlayApplet.
|
||||||
*/
|
*/
|
||||||
Result appletStartShutdownSequence(void);
|
Result appletStartShutdownSequence(void);
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @brief Start the system-reboot sequence.
|
* @brief Start the system-reboot sequence.
|
||||||
* @note Only available with AppletType_SystemApplet.
|
* @note Only available with AppletType_SystemApplet, or on [15.0.0+] with AppletType_LibraryApplet/AppletType_OverlayApplet.
|
||||||
*/
|
*/
|
||||||
Result appletStartRebootSequence(void);
|
Result appletStartRebootSequence(void);
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @brief IsAutoPowerDownRequested. Uses an idle:sys cmd internally.
|
* @brief IsAutoPowerDownRequested. Uses an idle:sys cmd internally.
|
||||||
* @note Only available with AppletType_SystemApplet on [7.0.0+].
|
* @note Only available with AppletType_SystemApplet on [7.0.0+], or on [15.0.0+] with AppletType_LibraryApplet/AppletType_OverlayApplet.
|
||||||
* @param[out] out Output flag.
|
* @param[out] out Output flag.
|
||||||
*/
|
*/
|
||||||
Result appletIsAutoPowerDownRequested(bool *out);
|
Result appletIsAutoPowerDownRequested(bool *out);
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @brief LoadAndApplyIdlePolicySettings. Uses an idle:sys cmd internally.
|
* @brief LoadAndApplyIdlePolicySettings. Uses an idle:sys cmd internally.
|
||||||
* @note Only available with AppletType_SystemApplet.
|
* @note Only available with AppletType_SystemApplet, or on [15.0.0+] with AppletType_LibraryApplet/AppletType_OverlayApplet.
|
||||||
*/
|
*/
|
||||||
Result appletLoadAndApplyIdlePolicySettings(void);
|
Result appletLoadAndApplyIdlePolicySettings(void);
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @brief NotifyCecSettingsChanged. Uses an omm cmd internally.
|
* @brief NotifyCecSettingsChanged. Uses an omm cmd internally.
|
||||||
* @note Only available with AppletType_SystemApplet on [2.0.0+].
|
* @note Only available with AppletType_SystemApplet on [2.0.0+], or on [15.0.0+] with AppletType_LibraryApplet/AppletType_OverlayApplet.
|
||||||
*/
|
*/
|
||||||
Result appletNotifyCecSettingsChanged(void);
|
Result appletNotifyCecSettingsChanged(void);
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @brief Sets the DefaultHomeButtonLongPressTime.
|
* @brief Sets the DefaultHomeButtonLongPressTime.
|
||||||
* @note Only available with AppletType_SystemApplet on [3.0.0+].
|
* @note Only available with AppletType_SystemApplet on [3.0.0+], or on [15.0.0+] with AppletType_LibraryApplet/AppletType_OverlayApplet.
|
||||||
* @param[in] val Input value.
|
* @param[in] val Input value.
|
||||||
*/
|
*/
|
||||||
Result appletSetDefaultHomeButtonLongPressTime(s64 val);
|
Result appletSetDefaultHomeButtonLongPressTime(s64 val);
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @brief UpdateDefaultDisplayResolution. Uses an omm cmd internally.
|
* @brief UpdateDefaultDisplayResolution. Uses an omm cmd internally.
|
||||||
* @note Only available with AppletType_SystemApplet on [3.0.0+].
|
* @note Only available with AppletType_SystemApplet on [3.0.0+], or on [15.0.0+] with AppletType_LibraryApplet/AppletType_OverlayApplet.
|
||||||
*/
|
*/
|
||||||
Result appletUpdateDefaultDisplayResolution(void);
|
Result appletUpdateDefaultDisplayResolution(void);
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @brief ShouldSleepOnBoot. Uses an omm cmd internally.
|
* @brief ShouldSleepOnBoot. Uses an omm cmd internally.
|
||||||
* @note Only available with AppletType_SystemApplet on [3.0.0+].
|
* @note Only available with AppletType_SystemApplet on [3.0.0+], or on [15.0.0+] with AppletType_LibraryApplet/AppletType_OverlayApplet.
|
||||||
* @param[out] out Output flag.
|
* @param[out] out Output flag.
|
||||||
*/
|
*/
|
||||||
Result appletShouldSleepOnBoot(bool *out);
|
Result appletShouldSleepOnBoot(bool *out);
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @brief Gets an Event which is signaled for HdcpAuthenticationFailed.
|
* @brief Gets an Event which is signaled for HdcpAuthenticationFailed.
|
||||||
* @note Only available with AppletType_SystemApplet on [4.0.0+].
|
* @note Only available with AppletType_SystemApplet on [4.0.0+], or on [15.0.0+] with AppletType_LibraryApplet/AppletType_OverlayApplet.
|
||||||
* @note The Event must be closed by the user once finished with it.
|
* @note The Event must be closed by the user once finished with it.
|
||||||
* @param[out] out_event Output Event with autoclear=false.
|
* @param[out] out_event Output Event with autoclear=false.
|
||||||
*/
|
*/
|
||||||
|
@ -13,6 +13,8 @@ __attribute__((weak)) AppletAttribute __nx_applet_AppletAttribute;
|
|||||||
__attribute__((weak)) u32 __nx_applet_PerformanceConfiguration[2] = {/*0x92220008*//*0x20004*//*0x92220007*/0, 0};
|
__attribute__((weak)) u32 __nx_applet_PerformanceConfiguration[2] = {/*0x92220008*//*0x20004*//*0x92220007*/0, 0};
|
||||||
//// Controls whether to use applet exit cmds during \ref appletExit. 0 (default): Only run exit cmds when running under a NSO. 1: Use exit cmds regardless. >1: Skip exit cmds.
|
//// Controls whether to use applet exit cmds during \ref appletExit. 0 (default): Only run exit cmds when running under a NSO. 1: Use exit cmds regardless. >1: Skip exit cmds.
|
||||||
__attribute__((weak)) u32 __nx_applet_exit_mode = 0;
|
__attribute__((weak)) u32 __nx_applet_exit_mode = 0;
|
||||||
|
/// Controls the timeout in nanoseconds to use during LibraryApplet initialization in appletInitialize, with diagAbortWithResult being used if the timeout is reached.
|
||||||
|
__attribute__((weak)) u64 __nx_applet_init_timeout = 864000000000000000ULL;
|
||||||
|
|
||||||
static Service g_appletSrv;
|
static Service g_appletSrv;
|
||||||
static Service g_appletProxySession;
|
static Service g_appletProxySession;
|
||||||
@ -152,6 +154,11 @@ Result _appletInitialize(void) {
|
|||||||
if (R_SUCCEEDED(rc)) {
|
if (R_SUCCEEDED(rc)) {
|
||||||
#define AM_BUSY_ERROR 0x19280
|
#define AM_BUSY_ERROR 0x19280
|
||||||
|
|
||||||
|
u64 start_tick = 0;
|
||||||
|
u64 timeout = __nx_applet_init_timeout;
|
||||||
|
if (__nx_applet_type == AppletType_LibraryApplet)
|
||||||
|
start_tick = armGetSystemTick();
|
||||||
|
|
||||||
do {
|
do {
|
||||||
u32 cmd_id;
|
u32 cmd_id;
|
||||||
|
|
||||||
@ -176,7 +183,12 @@ Result _appletInitialize(void) {
|
|||||||
rc = _appletOpenLibraryAppletProxy(&g_appletProxySession, CUR_PROCESS_HANDLE, attr);
|
rc = _appletOpenLibraryAppletProxy(&g_appletProxySession, CUR_PROCESS_HANDLE, attr);
|
||||||
|
|
||||||
if (R_VALUE(rc) == AM_BUSY_ERROR) {
|
if (R_VALUE(rc) == AM_BUSY_ERROR) {
|
||||||
svcSleepThread(10000000);
|
svcSleepThread(100000000);
|
||||||
|
|
||||||
|
if (__nx_applet_type == AppletType_LibraryApplet && armTicksToNs(armGetSystemTick() - start_tick) >= timeout)
|
||||||
|
diagAbortWithResult(MAKERESULT(Module_Libnx, LibnxError_Timeout));
|
||||||
|
|
||||||
|
// Official sw also has code for calling a funcptr on the first AM_BUSY_ERROR (instead of sleep) where the elapsed time since start_tick is >=1 second, but we don't impl that.
|
||||||
}
|
}
|
||||||
|
|
||||||
} while (R_VALUE(rc) == AM_BUSY_ERROR);
|
} while (R_VALUE(rc) == AM_BUSY_ERROR);
|
||||||
@ -211,6 +223,16 @@ Result _appletInitialize(void) {
|
|||||||
rc = _appletCmdGetSession(&g_appletProxySession, &g_appletIProcessWindingController, 10);
|
rc = _appletCmdGetSession(&g_appletProxySession, &g_appletIProcessWindingController, 10);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
if (R_SUCCEEDED(rc) && hosversionAtLeast(15,0,0)) { // [15.0.0+]
|
||||||
|
// GetHomeMenuFunctions
|
||||||
|
if (__nx_applet_type == AppletType_LibraryApplet)
|
||||||
|
rc = _appletCmdGetSession(&g_appletProxySession, &g_appletIFunctions, 22);
|
||||||
|
|
||||||
|
// GetGlobalStateController
|
||||||
|
if (R_SUCCEEDED(rc) && (__nx_applet_type == AppletType_LibraryApplet || __nx_applet_type == AppletType_OverlayApplet))
|
||||||
|
rc = _appletCmdGetSession(&g_appletProxySession, &g_appletIGlobalStateController, 23);
|
||||||
|
}
|
||||||
|
|
||||||
// GetLibraryAppletCreator
|
// GetLibraryAppletCreator
|
||||||
if (R_SUCCEEDED(rc))
|
if (R_SUCCEEDED(rc))
|
||||||
rc = _appletCmdGetSession(&g_appletProxySession, &g_appletILibraryAppletCreator, 11);
|
rc = _appletCmdGetSession(&g_appletProxySession, &g_appletILibraryAppletCreator, 11);
|
||||||
@ -267,7 +289,7 @@ Result _appletInitialize(void) {
|
|||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
|
|
||||||
if (msg != 0xF)
|
if (msg != AppletMessage_FocusStateChanged)
|
||||||
continue;
|
continue;
|
||||||
|
|
||||||
rc = _appletGetCurrentFocusState(&g_appletFocusState);
|
rc = _appletGetCurrentFocusState(&g_appletFocusState);
|
||||||
@ -301,7 +323,7 @@ Result _appletInitialize(void) {
|
|||||||
rc = _appletSetPerformanceModeChangedNotification(1);
|
rc = _appletSetPerformanceModeChangedNotification(1);
|
||||||
|
|
||||||
// Official apps aren't known to use apmSetPerformanceConfiguration with mode=1.
|
// Official apps aren't known to use apmSetPerformanceConfiguration with mode=1.
|
||||||
if (R_SUCCEEDED(rc)) {
|
if (R_SUCCEEDED(rc) && __nx_applet_type == AppletType_Application) {
|
||||||
u32 i;
|
u32 i;
|
||||||
for (i=0; i<2; i++)
|
for (i=0; i<2; i++)
|
||||||
{
|
{
|
||||||
@ -405,19 +427,19 @@ void _appletCleanup(void) {
|
|||||||
serviceClose(&g_appletICommonStateGetter);
|
serviceClose(&g_appletICommonStateGetter);
|
||||||
serviceClose(&g_appletILibraryAppletCreator);
|
serviceClose(&g_appletILibraryAppletCreator);
|
||||||
|
|
||||||
if (__nx_applet_type == AppletType_SystemApplet) {
|
if (__nx_applet_type == AppletType_SystemApplet)
|
||||||
serviceClose(&g_appletIApplicationCreator);
|
serviceClose(&g_appletIApplicationCreator);
|
||||||
serviceClose(&g_appletIGlobalStateController);
|
|
||||||
}
|
|
||||||
|
|
||||||
if (__nx_applet_type != AppletType_LibraryApplet)
|
|
||||||
serviceClose(&g_appletIFunctions);
|
|
||||||
|
|
||||||
if (__nx_applet_type == AppletType_LibraryApplet) {
|
if (__nx_applet_type == AppletType_LibraryApplet) {
|
||||||
serviceClose(&g_appletIProcessWindingController);
|
serviceClose(&g_appletIProcessWindingController);
|
||||||
serviceClose(&g_appletILibraryAppletSelfAccessor);
|
serviceClose(&g_appletILibraryAppletSelfAccessor);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
if (__nx_applet_type == AppletType_SystemApplet || __nx_applet_type == AppletType_LibraryApplet || __nx_applet_type == AppletType_OverlayApplet)
|
||||||
|
serviceClose(&g_appletIGlobalStateController);
|
||||||
|
|
||||||
|
serviceClose(&g_appletIFunctions);
|
||||||
|
|
||||||
serviceClose(&g_appletIAppletCommonFunctions);
|
serviceClose(&g_appletIAppletCommonFunctions);
|
||||||
|
|
||||||
serviceClose(&g_appletProxySession);
|
serviceClose(&g_appletProxySession);
|
||||||
@ -599,14 +621,14 @@ proto { \
|
|||||||
|
|
||||||
#define IPC_MAKE_CMD_IMPL_INITEXPR(proto,_s,_rid,func,initexpr,...) \
|
#define IPC_MAKE_CMD_IMPL_INITEXPR(proto,_s,_rid,func,initexpr,...) \
|
||||||
proto { \
|
proto { \
|
||||||
if (!serviceIsActive((_s)) || initexpr) \
|
if (!serviceIsActive((_s)) || (initexpr)) \
|
||||||
return MAKERESULT(Module_Libnx, LibnxError_NotInitialized); \
|
return MAKERESULT(Module_Libnx, LibnxError_NotInitialized); \
|
||||||
return func((_s), ##__VA_ARGS__, (_rid)); \
|
return func((_s), ##__VA_ARGS__, (_rid)); \
|
||||||
}
|
}
|
||||||
|
|
||||||
#define IPC_MAKE_CMD_IMPL_INITEXPR_HOSVER(proto,_s,_rid,func,initexpr,_hosver,...) \
|
#define IPC_MAKE_CMD_IMPL_INITEXPR_HOSVER(proto,_s,_rid,func,initexpr,_hosver,...) \
|
||||||
proto { \
|
proto { \
|
||||||
if (!serviceIsActive((_s)) || initexpr) \
|
if (!serviceIsActive((_s)) || (initexpr)) \
|
||||||
return MAKERESULT(Module_Libnx, LibnxError_NotInitialized); \
|
return MAKERESULT(Module_Libnx, LibnxError_NotInitialized); \
|
||||||
if (hosversionBefore _hosver) \
|
if (hosversionBefore _hosver) \
|
||||||
return MAKERESULT(Module_Libnx, LibnxError_IncompatSysVer); \
|
return MAKERESULT(Module_Libnx, LibnxError_IncompatSysVer); \
|
||||||
@ -2359,16 +2381,16 @@ IPC_MAKE_CMD_IMPL_INITEXPR_HOSVER(Result appletPrepareForJit(void),
|
|||||||
|
|
||||||
// IHomeMenuFunctions
|
// IHomeMenuFunctions
|
||||||
|
|
||||||
IPC_MAKE_CMD_IMPL_INITEXPR(Result appletRequestToGetForeground(void), &g_appletIFunctions, 10, _appletCmdNoIO, __nx_applet_type != AppletType_SystemApplet)
|
IPC_MAKE_CMD_IMPL_INITEXPR(Result appletRequestToGetForeground(void), &g_appletIFunctions, 10, _appletCmdNoIO, __nx_applet_type != AppletType_SystemApplet && __nx_applet_type != AppletType_LibraryApplet)
|
||||||
IPC_MAKE_CMD_IMPL_INITEXPR(Result appletLockForeground(void), &g_appletIFunctions, 11, _appletCmdNoIO, __nx_applet_type != AppletType_SystemApplet)
|
IPC_MAKE_CMD_IMPL_INITEXPR(Result appletLockForeground(void), &g_appletIFunctions, 11, _appletCmdNoIO, __nx_applet_type != AppletType_SystemApplet && __nx_applet_type != AppletType_LibraryApplet)
|
||||||
IPC_MAKE_CMD_IMPL_INITEXPR(Result appletUnlockForeground(void), &g_appletIFunctions, 12, _appletCmdNoIO, __nx_applet_type != AppletType_SystemApplet)
|
IPC_MAKE_CMD_IMPL_INITEXPR(Result appletUnlockForeground(void), &g_appletIFunctions, 12, _appletCmdNoIO, __nx_applet_type != AppletType_SystemApplet && __nx_applet_type != AppletType_LibraryApplet)
|
||||||
IPC_MAKE_CMD_IMPL_INITEXPR(Result appletPopFromGeneralChannel(AppletStorage *s), &g_appletIFunctions, 20, _appletCmdNoInOutStorage, __nx_applet_type != AppletType_SystemApplet, s)
|
IPC_MAKE_CMD_IMPL_INITEXPR(Result appletPopFromGeneralChannel(AppletStorage *s), &g_appletIFunctions, 20, _appletCmdNoInOutStorage, __nx_applet_type != AppletType_SystemApplet && __nx_applet_type != AppletType_LibraryApplet, s)
|
||||||
IPC_MAKE_CMD_IMPL_INITEXPR(Result appletGetPopFromGeneralChannelEvent(Event *out_event), &g_appletIFunctions, 21, _appletCmdGetEvent, __nx_applet_type != AppletType_SystemApplet, out_event, false)
|
IPC_MAKE_CMD_IMPL_INITEXPR(Result appletGetPopFromGeneralChannelEvent(Event *out_event), &g_appletIFunctions, 21, _appletCmdGetEvent, __nx_applet_type != AppletType_SystemApplet && __nx_applet_type != AppletType_LibraryApplet, out_event, false)
|
||||||
IPC_MAKE_CMD_IMPL_INITEXPR(Result appletGetHomeButtonWriterLockAccessor(AppletLockAccessor *a), &g_appletIFunctions, 30, _appletGetHomeButtonRwLockAccessor, __nx_applet_type != AppletType_SystemApplet, a)
|
IPC_MAKE_CMD_IMPL_INITEXPR(Result appletGetHomeButtonWriterLockAccessor(AppletLockAccessor *a), &g_appletIFunctions, 30, _appletGetHomeButtonRwLockAccessor, __nx_applet_type != AppletType_SystemApplet && __nx_applet_type != AppletType_LibraryApplet, a)
|
||||||
IPC_MAKE_CMD_IMPL_INITEXPR_HOSVER(Result appletIsSleepEnabled(bool *out), &g_appletIFunctions, 40, _appletCmdNoInOutBool, __nx_applet_type != AppletType_SystemApplet, (11,0,0), out)
|
IPC_MAKE_CMD_IMPL_INITEXPR_HOSVER(Result appletIsSleepEnabled(bool *out), &g_appletIFunctions, 40, _appletCmdNoInOutBool, __nx_applet_type != AppletType_SystemApplet && __nx_applet_type != AppletType_LibraryApplet, (11,0,0), out)
|
||||||
|
|
||||||
Result appletPopRequestLaunchApplicationForDebug(AccountUid *uids, s32 count, u64 *application_id, s32 *total_out) {
|
Result appletPopRequestLaunchApplicationForDebug(AccountUid *uids, s32 count, u64 *application_id, s32 *total_out) {
|
||||||
if (__nx_applet_type != AppletType_SystemApplet)
|
if (__nx_applet_type != AppletType_SystemApplet && __nx_applet_type != AppletType_LibraryApplet)
|
||||||
return MAKERESULT(Module_Libnx, LibnxError_NotInitialized);
|
return MAKERESULT(Module_Libnx, LibnxError_NotInitialized);
|
||||||
if (hosversionBefore(6,0,0))
|
if (hosversionBefore(6,0,0))
|
||||||
return MAKERESULT(Module_Libnx, LibnxError_IncompatSysVer);
|
return MAKERESULT(Module_Libnx, LibnxError_IncompatSysVer);
|
||||||
@ -2388,13 +2410,13 @@ Result appletPopRequestLaunchApplicationForDebug(AccountUid *uids, s32 count, u6
|
|||||||
return rc;
|
return rc;
|
||||||
}
|
}
|
||||||
|
|
||||||
IPC_MAKE_CMD_IMPL_INITEXPR_HOSVER(Result appletIsForceTerminateApplicationDisabledForDebug(bool *out), &g_appletIFunctions, 110, _appletCmdNoInOutBool, __nx_applet_type != AppletType_SystemApplet, (9,0,0), out)
|
IPC_MAKE_CMD_IMPL_INITEXPR_HOSVER(Result appletIsForceTerminateApplicationDisabledForDebug(bool *out), &g_appletIFunctions, 110, _appletCmdNoInOutBool, __nx_applet_type != AppletType_SystemApplet && __nx_applet_type != AppletType_LibraryApplet, (9,0,0), out)
|
||||||
IPC_MAKE_CMD_IMPL_INITEXPR_HOSVER(Result appletSetLastApplicationExitReason(s32 reason), &g_appletIFunctions, 1000, _appletCmdInU32NoOut, __nx_applet_type != AppletType_SystemApplet, (11,0,0), reason)
|
IPC_MAKE_CMD_IMPL_INITEXPR_HOSVER(Result appletSetLastApplicationExitReason(s32 reason), &g_appletIFunctions, 1000, _appletCmdInU32NoOut, __nx_applet_type != AppletType_SystemApplet && __nx_applet_type != AppletType_LibraryApplet, (11,0,0), reason)
|
||||||
|
|
||||||
Result appletLaunchDevMenu(void) {
|
Result appletLaunchDevMenu(void) {
|
||||||
Result rc=0;
|
Result rc=0;
|
||||||
|
|
||||||
if (__nx_applet_type != AppletType_SystemApplet)
|
if (__nx_applet_type != AppletType_SystemApplet && __nx_applet_type != AppletType_LibraryApplet)
|
||||||
return MAKERESULT(Module_Libnx, LibnxError_NotInitialized);
|
return MAKERESULT(Module_Libnx, LibnxError_NotInitialized);
|
||||||
if (hosversionBefore(8,0,0))
|
if (hosversionBefore(8,0,0))
|
||||||
return MAKERESULT(Module_Libnx, LibnxError_IncompatSysVer);
|
return MAKERESULT(Module_Libnx, LibnxError_IncompatSysVer);
|
||||||
@ -2406,16 +2428,16 @@ Result appletLaunchDevMenu(void) {
|
|||||||
|
|
||||||
// IGlobalStateController
|
// IGlobalStateController
|
||||||
|
|
||||||
IPC_MAKE_CMD_IMPL_INITEXPR( Result appletStartSleepSequence(bool flag), &g_appletIGlobalStateController, 2, _appletCmdInBoolNoOut, __nx_applet_type != AppletType_SystemApplet, flag)
|
IPC_MAKE_CMD_IMPL( Result appletStartSleepSequence(bool flag), &g_appletIGlobalStateController, 2, _appletCmdInBoolNoOut, flag)
|
||||||
IPC_MAKE_CMD_IMPL_INITEXPR( Result appletStartShutdownSequence(void), &g_appletIGlobalStateController, 3, _appletCmdNoIO, __nx_applet_type != AppletType_SystemApplet)
|
IPC_MAKE_CMD_IMPL( Result appletStartShutdownSequence(void), &g_appletIGlobalStateController, 3, _appletCmdNoIO )
|
||||||
IPC_MAKE_CMD_IMPL_INITEXPR( Result appletStartRebootSequence(void), &g_appletIGlobalStateController, 4, _appletCmdNoIO, __nx_applet_type != AppletType_SystemApplet)
|
IPC_MAKE_CMD_IMPL( Result appletStartRebootSequence(void), &g_appletIGlobalStateController, 4, _appletCmdNoIO )
|
||||||
IPC_MAKE_CMD_IMPL_INITEXPR_HOSVER(Result appletIsAutoPowerDownRequested(bool *out), &g_appletIGlobalStateController, 9, _appletCmdNoInOutBool, __nx_applet_type != AppletType_SystemApplet, (7,0,0), out)
|
IPC_MAKE_CMD_IMPL_HOSVER(Result appletIsAutoPowerDownRequested(bool *out), &g_appletIGlobalStateController, 9, _appletCmdNoInOutBool, (7,0,0), out)
|
||||||
IPC_MAKE_CMD_IMPL_INITEXPR( Result appletLoadAndApplyIdlePolicySettings(void), &g_appletIGlobalStateController, 10, _appletCmdNoIO, __nx_applet_type != AppletType_SystemApplet)
|
IPC_MAKE_CMD_IMPL( Result appletLoadAndApplyIdlePolicySettings(void), &g_appletIGlobalStateController, 10, _appletCmdNoIO )
|
||||||
IPC_MAKE_CMD_IMPL_INITEXPR_HOSVER(Result appletNotifyCecSettingsChanged(void), &g_appletIGlobalStateController, 11, _appletCmdNoIO, __nx_applet_type != AppletType_SystemApplet, (2,0,0))
|
IPC_MAKE_CMD_IMPL_HOSVER(Result appletNotifyCecSettingsChanged(void), &g_appletIGlobalStateController, 11, _appletCmdNoIO, (2,0,0))
|
||||||
IPC_MAKE_CMD_IMPL_INITEXPR_HOSVER(Result appletSetDefaultHomeButtonLongPressTime(s64 val), &g_appletIGlobalStateController, 12, _appletCmdInU64NoOut, __nx_applet_type != AppletType_SystemApplet, (3,0,0), val)
|
IPC_MAKE_CMD_IMPL_HOSVER(Result appletSetDefaultHomeButtonLongPressTime(s64 val), &g_appletIGlobalStateController, 12, _appletCmdInU64NoOut, (3,0,0), val)
|
||||||
IPC_MAKE_CMD_IMPL_INITEXPR_HOSVER(Result appletUpdateDefaultDisplayResolution(void), &g_appletIGlobalStateController, 13, _appletCmdNoIO, __nx_applet_type != AppletType_SystemApplet, (3,0,0))
|
IPC_MAKE_CMD_IMPL_HOSVER(Result appletUpdateDefaultDisplayResolution(void), &g_appletIGlobalStateController, 13, _appletCmdNoIO, (3,0,0))
|
||||||
IPC_MAKE_CMD_IMPL_INITEXPR_HOSVER(Result appletShouldSleepOnBoot(bool *out), &g_appletIGlobalStateController, 14, _appletCmdNoInOutBool, __nx_applet_type != AppletType_SystemApplet, (3,0,0), out)
|
IPC_MAKE_CMD_IMPL_HOSVER(Result appletShouldSleepOnBoot(bool *out), &g_appletIGlobalStateController, 14, _appletCmdNoInOutBool, (3,0,0), out)
|
||||||
IPC_MAKE_CMD_IMPL_INITEXPR_HOSVER(Result appletGetHdcpAuthenticationFailedEvent(Event *out_event), &g_appletIGlobalStateController, 15, _appletCmdGetEvent, __nx_applet_type != AppletType_SystemApplet, (4,0,0), out_event, false)
|
IPC_MAKE_CMD_IMPL_HOSVER(Result appletGetHdcpAuthenticationFailedEvent(Event *out_event), &g_appletIGlobalStateController, 15, _appletCmdGetEvent, (4,0,0), out_event, false)
|
||||||
|
|
||||||
// IApplicationCreator
|
// IApplicationCreator
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user