Added appletGetApplicationIdByContentActionName.

This commit is contained in:
yellows8 2019-07-25 23:47:03 -04:00
parent 31d34a6915
commit aeca9041d5
No known key found for this signature in database
GPG Key ID: 0AF90DA3F1E60E43
2 changed files with 48 additions and 0 deletions

View File

@ -311,6 +311,14 @@ Result appletGetHdcpAuthenticationStateChangeEvent(Event *out_event);
*/
Result appletSetTvPowerStateMatchingMode(AppletTvPowerStateMatchingMode mode);
/**
* @brief Gets the application titleID for the specified ContentActionName string.
* @note Only available when the current applet is ::AppletId_starter on [5.1.0+].
* @param[out] titleID Application titleID.
* @param[in] name ContentActionName string.
*/
Result appletGetApplicationIdByContentActionName(u64 *titleID, const char *name);
/**
* @brief Sets the \ref ApmCpuBoostMode.
* @note Only available with [7.0.0+] (not fully usable system-side with 6.x).

View File

@ -1275,6 +1275,46 @@ Result appletSetTvPowerStateMatchingMode(AppletTvPowerStateMatchingMode mode) {
return _appletCmdInU32(&g_appletICommonStateGetter, mode, 64);
}
Result appletGetApplicationIdByContentActionName(u64 *titleID, const char *name) {
if (hosversionBefore(5,1,0))
return MAKERESULT(Module_Libnx, LibnxError_IncompatSysVer);
IpcCommand c;
ipcInitialize(&c);
ipcAddSendBuffer(&c, name, strlen(name)+1, BufferType_Normal);
struct {
u64 magic;
u64 cmd_id;
} *raw;
raw = serviceIpcPrepareHeader(&g_appletICommonStateGetter, &c, sizeof(*raw));
raw->magic = SFCI_MAGIC;
raw->cmd_id = 65;
Result rc = serviceIpcDispatch(&g_appletICommonStateGetter);
if (R_SUCCEEDED(rc)) {
IpcParsedCommand r;
struct {
u64 magic;
u64 result;
u64 titleID;
} *resp;
serviceIpcParse(&g_appletICommonStateGetter, &r, sizeof(*resp));
resp = r.Raw;
rc = resp->result;
if (R_SUCCEEDED(rc) && titleID) *titleID = resp->titleID;
}
return rc;
}
Result appletSetCpuBoostMode(ApmCpuBoostMode mode) {
Result rc=0;
if (hosversionBefore(7,0,0))