Moved amapp init into a seperate function.
This commit is contained in:
parent
94b3748870
commit
12f0f638ff
@ -56,9 +56,12 @@ typedef struct {
|
|||||||
u64 titlesFreeSpace; ///< Free space for titles.
|
u64 titlesFreeSpace; ///< Free space for titles.
|
||||||
} AM_TWLPartitionInfo;
|
} AM_TWLPartitionInfo;
|
||||||
|
|
||||||
/// Initializes AM.
|
/// Initializes AM. This doesn't initialize with "am:app", see amAppInit().
|
||||||
Result amInit(void);
|
Result amInit(void);
|
||||||
|
|
||||||
|
/// Initializes AM with a service which has access to the amapp-commands. This should only be used when using the amapp commands, not non-amapp AM commands.
|
||||||
|
Result amAppInit(void);
|
||||||
|
|
||||||
/// Exits AM.
|
/// Exits AM.
|
||||||
void amExit(void);
|
void amExit(void);
|
||||||
|
|
||||||
|
@ -20,6 +20,18 @@ Result amInit(void)
|
|||||||
ret = srvGetServiceHandle(&amHandle, "am:net");
|
ret = srvGetServiceHandle(&amHandle, "am:net");
|
||||||
if (R_FAILED(ret)) ret = srvGetServiceHandle(&amHandle, "am:u");
|
if (R_FAILED(ret)) ret = srvGetServiceHandle(&amHandle, "am:u");
|
||||||
if (R_FAILED(ret)) ret = srvGetServiceHandle(&amHandle, "am:sys");
|
if (R_FAILED(ret)) ret = srvGetServiceHandle(&amHandle, "am:sys");
|
||||||
|
if (R_FAILED(ret)) AtomicDecrement(&amRefCount);
|
||||||
|
|
||||||
|
return ret;
|
||||||
|
}
|
||||||
|
|
||||||
|
Result amAppInit(void)
|
||||||
|
{
|
||||||
|
Result ret;
|
||||||
|
|
||||||
|
if (AtomicPostIncrement(&amRefCount)) return 0;
|
||||||
|
|
||||||
|
ret = srvGetServiceHandle(&amHandle, "am:sys");
|
||||||
if (R_FAILED(ret)) ret = srvGetServiceHandle(&amHandle, "am:app");
|
if (R_FAILED(ret)) ret = srvGetServiceHandle(&amHandle, "am:app");
|
||||||
if (R_FAILED(ret)) AtomicDecrement(&amRefCount);
|
if (R_FAILED(ret)) AtomicDecrement(&amRefCount);
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user