Added appletGetLaunchStorageInfoForDebug.

This commit is contained in:
yellows8 2019-08-20 18:16:45 -04:00
parent 8135d6cbc5
commit c3b32581c9
No known key found for this signature in database
GPG Key ID: 0AF90DA3F1E60E43
2 changed files with 50 additions and 0 deletions

View File

@ -1211,6 +1211,14 @@ Result appletSetTerminateResult(Result res);
*/
Result appletGetDisplayVersion(char *displayVersion);
/**
* @brief Gets the LaunchStorageInfo.
* @note Only available with AppletType_*Application on [2.0.0+].
* @param[out] app_storageId Same as AppletApplicationLaunchProperty::app_storageId.
* @param[out] update_storageId Same as AppletApplicationLaunchProperty::update_storageId.
*/
Result appletGetLaunchStorageInfoForDebug(FsStorageId *app_storageId, FsStorageId *update_storageId);
/**
* @brief Blocks the usage of the home button, for short (Home Menu) and long (Overlay) presses.
* @note Only available with AppletType_*Application.

View File

@ -3772,6 +3772,48 @@ Result appletGetDisplayVersion(char *displayVersion) {
return rc;
}
Result appletGetLaunchStorageInfoForDebug(FsStorageId *app_storageId, FsStorageId *update_storageId) {
if (!serviceIsActive(&g_appletSrv) || !_appletIsApplication())
return MAKERESULT(Module_Libnx, LibnxError_NotInitialized);
if (hosversionBefore(2,0,0))
return MAKERESULT(Module_Libnx, LibnxError_IncompatSysVer);
IpcCommand c;
ipcInitialize(&c);
struct {
u64 magic;
u64 cmd_id;
} *raw;
raw = serviceIpcPrepareHeader(&g_appletIFunctions, &c, sizeof(*raw));
raw->magic = SFCI_MAGIC;
raw->cmd_id = 24;
Result rc = serviceIpcDispatch(&g_appletIFunctions);
if (R_SUCCEEDED(rc)) {
IpcParsedCommand r;
struct {
u64 magic;
u64 result;
u8 app_storageId;
u8 update_storageId;
} *resp;
serviceIpcParse(&g_appletIFunctions, &r, sizeof(*resp));
resp = r.Raw;
rc = resp->result;
if (R_SUCCEEDED(rc) && app_storageId) *app_storageId = resp->app_storageId;
if (R_SUCCEEDED(rc) && update_storageId) *update_storageId = resp->update_storageId;
}
return rc;
}
Result appletBeginBlockingHomeButtonShortAndLongPressed(s64 val) {
if (!serviceIsActive(&g_appletSrv) || !_appletIsApplication())
return MAKERESULT(Module_Libnx, LibnxError_NotInitialized);