Added NS_TerminateProcessTID.

This commit is contained in:
yellows8 2016-01-06 23:31:10 -05:00
parent 57ec5db247
commit afae9ad607
2 changed files with 22 additions and 0 deletions

View File

@ -24,3 +24,9 @@ Result NS_LaunchTitle(u64 titleid, u32 launch_flags, u32 *procid);
* @param titleid ID of the title to launch.
*/
Result NS_RebootToTitle(u8 mediatype, u64 titleid);
/**
* @brief Terminates the process with the specified titleid.
* @param titleid ID of the title to terminate.
*/
Result NS_TerminateProcessTID(u64 titleid);

View File

@ -59,3 +59,19 @@ Result NS_RebootToTitle(u8 mediatype, u64 titleid)
return (Result)cmdbuf[1];
}
Result NS_TerminateProcessTID(u64 titleid)
{
Result ret = 0;
u32 *cmdbuf = getThreadCommandBuffer();
cmdbuf[0] = IPC_MakeHeader(0x11,4,0); // 0x110100
cmdbuf[1] = titleid & 0xffffffff;
cmdbuf[2] = (titleid >> 32) & 0xffffffff;
cmdbuf[3] = 0x0;
cmdbuf[4] = 0x0;
if(R_FAILED(ret = svcSendSyncRequest(nsHandle)))return ret;
return (Result)cmdbuf[1];
}