SOC:u added close/shutdown sockets

This commit is contained in:
Lectem 2016-01-16 21:13:22 -05:00
parent ac7af47956
commit 464d6c6363
3 changed files with 32 additions and 0 deletions

View File

@ -27,3 +27,6 @@ Result socExit(void);
*/
long gethostid(void);
int SOCU_ShutdownSockets();
int SOCU_CloseSockets();

View File

@ -0,0 +1,15 @@
#include "soc_common.h"
#include <3ds/ipc.h>
#include <3ds/result.h>
int SOCU_CloseSockets()
{
u32 *cmdbuf = getThreadCommandBuffer();
cmdbuf[0] = IPC_MakeHeader(0x21,0,2); // 0x210002;
cmdbuf[1] = IPC_Desc_CurProcessHandle();
int ret = svcSendSyncRequest(SOCU_handle);
if(R_FAILED(ret))return ret;
return cmdbuf[1];
}

View File

@ -0,0 +1,14 @@
#include "soc_common.h"
#include <3ds/ipc.h>
#include <3ds/result.h>
int SOCU_ShutdownSockets()
{
u32 *cmdbuf = getThreadCommandBuffer();
cmdbuf[0] = IPC_MakeHeader(0x19,0,0); // 0x190000
int ret = svcSendSyncRequest(SOCU_handle);
if(R_FAILED(ret))return ret;
return cmdbuf[1];
}