Added appletRequestToShutdown and appletRequestToReboot.

This commit is contained in:
yellows8 2019-07-13 20:04:26 -04:00
parent 3270bf3996
commit 333de18494
No known key found for this signature in database
GPG Key ID: 0AF90DA3F1E60E43
2 changed files with 30 additions and 0 deletions

View File

@ -259,6 +259,18 @@ Result appletSetGamePlayRecordingState(bool state);
/// Only usable when running under a title which supports video recording. Using this is only needed when the host title control.nacp has VideoCaptureMode set to Enabled, with Automatic appletInitializeGamePlayRecording is not needed.
Result appletInitializeGamePlayRecording(void);
/**
* @brief Requests a system shutdown.
* @note Only available with AppletType_*Application on 3.0.0+.
*/
Result appletRequestToShutdown(void);
/**
* @brief Requests a system reboot.
* @note Only available with AppletType_*Application on 3.0.0+.
*/
Result appletRequestToReboot(void);
/**
* @brief Gets ApplicationPlayStatistics.
* @note Only available with AppletType_*Application on 5.0.0+.

View File

@ -1561,6 +1561,24 @@ Result appletInitializeGamePlayRecording(void) {
return rc;
}
Result appletRequestToShutdown(void) {
if (!serviceIsActive(&g_appletSrv) || !_appletIsApplication())
return MAKERESULT(Module_Libnx, LibnxError_NotInitialized);
if (hosversionBefore(3,0,0))
return MAKERESULT(Module_Libnx, LibnxError_IncompatSysVer);
return _appletCmdNoIO(&g_appletIFunctions, 70);
}
Result appletRequestToReboot(void) {
if (!serviceIsActive(&g_appletSrv) || !_appletIsApplication())
return MAKERESULT(Module_Libnx, LibnxError_NotInitialized);
if (hosversionBefore(3,0,0))
return MAKERESULT(Module_Libnx, LibnxError_IncompatSysVer);
return _appletCmdNoIO(&g_appletIFunctions, 71);
}
//Official sw has these under 'pdm'.
Result appletQueryApplicationPlayStatistics(PdmApplicationPlayStatistics *stats, const u64 *titleIDs, s32 count, s32 *total_out) {
IpcCommand c;