]> Chaos Git - corbenik/ctrulib.git/commitdiff
Added NS_TerminateProcessTID.
authoryellows8 <yellows8@users.noreply.github.com>
Thu, 7 Jan 2016 04:31:10 +0000 (23:31 -0500)
committeryellows8 <yellows8@users.noreply.github.com>
Thu, 7 Jan 2016 04:31:10 +0000 (23:31 -0500)
libctru/include/3ds/services/ns.h
libctru/source/services/ns.c

index 5649c2c74ec67491bb75ba1f33c2742978f80e9a..6616168233e0605397c94320d0841708d276a34c 100644 (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);
index ffdcbfe89a0045af688807e8fff7859fd94da3b1..97f1547d8b322921f7bb536c3b3414edd4f3cb8c 100644 (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];
+}