Enter infinite-sleep-loop in appletRequestToShutdown/appletRequestToReboot. Minor change in appletHolderJump.

This commit is contained in:
yellows8 2019-08-16 20:19:50 -04:00
parent 112da06f37
commit 10e2e71ea2
No known key found for this signature in database
GPG Key ID: 0AF90DA3F1E60E43
2 changed files with 13 additions and 7 deletions

View File

@ -1199,13 +1199,13 @@ Result appletSetGamePlayRecordingState(bool state);
Result appletInitializeGamePlayRecording(void); Result appletInitializeGamePlayRecording(void);
/** /**
* @brief Requests a system shutdown. * @brief Requests a system shutdown. This will enter an infinite-sleep-loop on success.
* @note Only available with AppletType_*Application on 3.0.0+. * @note Only available with AppletType_*Application on 3.0.0+.
*/ */
Result appletRequestToShutdown(void); Result appletRequestToShutdown(void);
/** /**
* @brief Requests a system reboot. * @brief Requests a system reboot. This will enter an infinite-sleep-loop on success.
* @note Only available with AppletType_*Application on 3.0.0+. * @note Only available with AppletType_*Application on 3.0.0+.
*/ */
Result appletRequestToReboot(void); Result appletRequestToReboot(void);

View File

@ -2896,9 +2896,7 @@ Result appletHolderJump(AppletHolder *h) {
if (R_SUCCEEDED(rc)) rc = _appletWindAndDoReserved(); if (R_SUCCEEDED(rc)) rc = _appletWindAndDoReserved();
if (R_FAILED(rc)) return rc; if (R_SUCCEEDED(rc)) while(1)svcSleepThread(86400000000000ULL);
while(1)svcSleepThread(86400000000000ULL);
return rc; return rc;
} }
@ -3856,21 +3854,29 @@ Result appletInitializeGamePlayRecording(void) {
} }
Result appletRequestToShutdown(void) { Result appletRequestToShutdown(void) {
Result rc=0;
if (!serviceIsActive(&g_appletSrv) || !_appletIsApplication()) if (!serviceIsActive(&g_appletSrv) || !_appletIsApplication())
return MAKERESULT(Module_Libnx, LibnxError_NotInitialized); return MAKERESULT(Module_Libnx, LibnxError_NotInitialized);
if (hosversionBefore(3,0,0)) if (hosversionBefore(3,0,0))
return MAKERESULT(Module_Libnx, LibnxError_IncompatSysVer); return MAKERESULT(Module_Libnx, LibnxError_IncompatSysVer);
return _appletCmdNoIO(&g_appletIFunctions, 70); rc = _appletCmdNoIO(&g_appletIFunctions, 70);
if (R_SUCCEEDED(rc)) while(1)svcSleepThread(86400000000000ULL);
return rc;
} }
Result appletRequestToReboot(void) { Result appletRequestToReboot(void) {
Result rc=0;
if (!serviceIsActive(&g_appletSrv) || !_appletIsApplication()) if (!serviceIsActive(&g_appletSrv) || !_appletIsApplication())
return MAKERESULT(Module_Libnx, LibnxError_NotInitialized); return MAKERESULT(Module_Libnx, LibnxError_NotInitialized);
if (hosversionBefore(3,0,0)) if (hosversionBefore(3,0,0))
return MAKERESULT(Module_Libnx, LibnxError_IncompatSysVer); return MAKERESULT(Module_Libnx, LibnxError_IncompatSysVer);
return _appletCmdNoIO(&g_appletIFunctions, 71); rc = _appletCmdNoIO(&g_appletIFunctions, 71);
if (R_SUCCEEDED(rc)) while(1)svcSleepThread(86400000000000ULL);
return rc;
} }
static Result _appletInitializeApplicationCopyrightFrameBuffer(TransferMemory *tmem, s32 width, s32 height) { static Result _appletInitializeApplicationCopyrightFrameBuffer(TransferMemory *tmem, s32 width, s32 height) {