mirror of
https://github.com/switchbrew/libnx.git
synced 2025-06-22 13:02:38 +02:00
Added pmshellGetApplicationPid().
This commit is contained in:
parent
b4859873ec
commit
6d2699b38d
@ -28,3 +28,4 @@ Result pminfoGetTitleId(u64* title_id_out, u64 pid);
|
|||||||
|
|
||||||
Result pmshellLaunchProcess(u32 launch_flags, u64 titleID, u64 storageID, u64 *pid);
|
Result pmshellLaunchProcess(u32 launch_flags, u64 titleID, u64 storageID, u64 *pid);
|
||||||
Result pmshellTerminateProcessByTitleId(u64 titleID);
|
Result pmshellTerminateProcessByTitleId(u64 titleID);
|
||||||
|
Result pmshellGetApplicationPid(u64* pid_out);
|
||||||
|
@ -348,3 +348,39 @@ Result pmshellTerminateProcessByTitleId(u64 titleID) {
|
|||||||
|
|
||||||
return rc;
|
return rc;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Result pmshellGetApplicationPid(u64* pid_out) {
|
||||||
|
IpcCommand c;
|
||||||
|
ipcInitialize(&c);
|
||||||
|
|
||||||
|
struct {
|
||||||
|
u64 magic;
|
||||||
|
u64 cmd_id;
|
||||||
|
} *raw;
|
||||||
|
|
||||||
|
raw = ipcPrepareHeader(&c, sizeof(*raw));
|
||||||
|
|
||||||
|
raw->magic = SFCI_MAGIC;
|
||||||
|
raw->cmd_id = kernelAbove500() ? 6 : 8;
|
||||||
|
|
||||||
|
Result rc = serviceIpcDispatch(&g_pmshellSrv);
|
||||||
|
|
||||||
|
if (R_SUCCEEDED(rc)) {
|
||||||
|
IpcParsedCommand r;
|
||||||
|
ipcParse(&r);
|
||||||
|
|
||||||
|
struct {
|
||||||
|
u64 magic;
|
||||||
|
u64 result;
|
||||||
|
u64 pid;
|
||||||
|
} *resp = r.Raw;
|
||||||
|
|
||||||
|
rc = resp->result;
|
||||||
|
|
||||||
|
if (R_SUCCEEDED(rc)) {
|
||||||
|
*pid_out = resp->pid;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
return rc;
|
||||||
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user