diff --git a/libctru/include/3ds/srv.h b/libctru/include/3ds/srv.h index 64455cf..7f1f2be 100644 --- a/libctru/include/3ds/srv.h +++ b/libctru/include/3ds/srv.h @@ -4,6 +4,7 @@ Result srvInit(void); Result srvExit(void); Handle *srvGetSessionHandle(void); Result srvRegisterClient(void); +Result srvGetServiceHandleDirect(Handle* out, const char* name); Result srvGetServiceHandle(Handle* out, const char* name); Result srvRegisterService(Handle* out, const char* name, int maxSessions); Result srvUnregisterService(const char* name); diff --git a/libctru/source/srv.c b/libctru/source/srv.c index 0b5a527..b67cbfe 100644 --- a/libctru/source/srv.c +++ b/libctru/source/srv.c @@ -116,19 +116,10 @@ Result srvRegisterClient(void) return cmdbuf[1]; } -Result srvGetServiceHandle(Handle* out, const char* name) +Result srvGetServiceHandleDirect(Handle* out, const char* name) { Result rc = 0; - /* Look in service-list given to us by loader. If we find find a match, - we return it. */ - Handle h = __get_handle_from_list(name); - - if(h != 0) { - return svcDuplicateHandle(out, h); - } - - /* Normal request to service manager. */ u32* cmdbuf = getThreadCommandBuffer(); cmdbuf[0] = 0x50100; strcpy((char*) &cmdbuf[1], name); @@ -141,6 +132,20 @@ Result srvGetServiceHandle(Handle* out, const char* name) return cmdbuf[1]; } +Result srvGetServiceHandle(Handle* out, const char* name) +{ + /* Look in service-list given to us by loader. If we find find a match, + we return it. */ + Handle h = __get_handle_from_list(name); + + if(h != 0) { + return svcDuplicateHandle(out, h); + } + + /* Normal request to service manager. */ + return srvGetServiceHandleDirect(out, name); +} + Result srvRegisterService(Handle* out, const char* name, int maxSessions) { u32* cmdbuf = getThreadCommandBuffer();