Add timeout in NS_TerminateProcessTID() (#389)

This commit is contained in:
Kartik 2018-01-15 17:15:05 +05:30 committed by fincs
parent c598c445cd
commit 2158f71eb2
2 changed files with 5 additions and 4 deletions

View File

@ -41,5 +41,6 @@ Result NS_RebootToTitle(u8 mediatype, u64 titleid);
/**
* @brief Terminates the process with the specified titleid.
* @param titleid ID of the title to terminate.
* @param timeout Timeout in nanoseconds. Pass 0 if not required.
*/
Result NS_TerminateProcessTID(u64 titleid);
Result NS_TerminateProcessTID(u64 titleid, u64 timeout);

View File

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