MCPcopy Create free account
hub / github.com/devkitPro/libctru / srvGetServiceHandleDirect

Function srvGetServiceHandleDirect

libctru/source/srv.c:140–155  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

138}
139
140Result srvGetServiceHandleDirect(Handle* out, const char* name)
141{
142 Result rc = 0;
143 u32* cmdbuf = getThreadCommandBuffer();
144
145 cmdbuf[0] = IPC_MakeHeader(0x5,4,0); // 0x50100
146 strncpy((char*) &cmdbuf[1], name,8);
147 cmdbuf[3] = strnlen(name, 8);
148 cmdbuf[4] = (u32)srvGetBlockingPolicy(); // per-thread setting, default is blocking
149
150 rc = svcSendSyncRequest(srvHandle);
151 rc = R_SUCCEEDED(rc) ? cmdbuf[1] : rc;
152 if(out) *out = R_SUCCEEDED(rc) ? cmdbuf[3] : 0;
153
154 return rc;
155}
156
157Result srvRegisterPort(const char* name, Handle clientHandle)
158{

Callers 3

srvGetServiceHandleFunction · 0.85
srvPmInitFunction · 0.85
aptGetServiceHandleFunction · 0.85

Calls 3

getThreadCommandBufferFunction · 0.85
IPC_MakeHeaderFunction · 0.85
srvGetBlockingPolicyFunction · 0.85

Tested by

no test coverage detected