mirror of
https://github.com/switchbrew/libnx.git
synced 2025-06-21 12:32:40 +02:00
Added appletGetApplicationIdByContentActionName.
This commit is contained in:
parent
31d34a6915
commit
aeca9041d5
@ -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).
|
||||
|
@ -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))
|
||||
|
Loading…
Reference in New Issue
Block a user