From 63d9fce2858fec56d4779eaab5e7b54ac6636d16 Mon Sep 17 00:00:00 2001 From: Joel16 Date: Tue, 12 Dec 2017 01:01:03 -0600 Subject: [PATCH] CFGI_SecureInfoGetSerialNumber is now included in ctrulib --- include/services/cfgs.h | 10 ---------- source/main.c | 3 --- source/services/cfgs.c | 29 ----------------------------- source/system.c | 2 +- 4 files changed, 1 insertion(+), 43 deletions(-) delete mode 100644 include/services/cfgs.h delete mode 100644 source/services/cfgs.c diff --git a/include/services/cfgs.h b/include/services/cfgs.h deleted file mode 100644 index 4319009..0000000 --- a/include/services/cfgs.h +++ /dev/null @@ -1,10 +0,0 @@ -#ifndef CFGS_H -#define CFGS_H - -#include <3ds.h> - -Result cfgsInit(void); -Result cfgsExit(void); -Result CFGS_SecureInfoGetSerialNo(u8 * serial); - -#endif \ No newline at end of file diff --git a/source/main.c b/source/main.c index bc79c99..11ec711 100644 --- a/source/main.c +++ b/source/main.c @@ -4,7 +4,6 @@ #include "ac.h" #include "actu.h" -#include "cfgs.h" #include "fs.h" #include "hardware.h" #include "kernel.h" @@ -22,7 +21,6 @@ void initServices() { gfxInitDefault(); cfguInit(); - cfgsInit(); ptmuInit(); mcuInit(); amInit(); @@ -59,7 +57,6 @@ void termServices() amExit(); mcuExit(); ptmuExit(); - cfgsExit(); cfguExit(); gfxExit(); } diff --git a/source/services/cfgs.c b/source/services/cfgs.c deleted file mode 100644 index 7e31c86..0000000 --- a/source/services/cfgs.c +++ /dev/null @@ -1,29 +0,0 @@ -#include "cfgs.h" - -static Handle cfgsHandle; - -Result cfgsInit(void) // Already initialized with CFGUinit(), but we need to use this handle. -{ - return srvGetServiceHandle(&cfgsHandle, "cfg:s"); -} - -Result cfgsExit(void) -{ - return svcCloseHandle(cfgsHandle); -} - -Result CFGS_SecureInfoGetSerialNo(u8 * serial) -{ - Result ret = 0; - u32 * cmdbuf = getThreadCommandBuffer(); - - cmdbuf[0] = IPC_MakeHeader(0x408, 1, 2); // 0x04080042 - cmdbuf[1] = 0xF; - cmdbuf[2] = 12 | (0xF << 4); - cmdbuf[3] = (u32)serial; - - if (R_FAILED(ret = svcSendSyncRequest(cfgsHandle))) - return ret; - - return cmdbuf[1]; -} \ No newline at end of file diff --git a/source/system.c b/source/system.c index c3cb646..8866d46 100644 --- a/source/system.c +++ b/source/system.c @@ -219,7 +219,7 @@ u8 * getSerialNumber(void) { static u8 serial[0xF]; - if (R_SUCCEEDED(CFGS_SecureInfoGetSerialNo(serial))) + if (R_SUCCEEDED(CFGI_SecureInfoGetSerialNumber(serial))) return serial; return NULL;