CFGI_SecureInfoGetSerialNumber is now included in ctrulib

This commit is contained in:
Joel16 2017-12-12 01:01:03 -06:00
parent 713fb65fa3
commit 63d9fce285
4 changed files with 1 additions and 43 deletions

View File

@ -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

View File

@ -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();
}

View File

@ -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];
}

View File

@ -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;