mirror of
https://github.com/switchbrew/libnx.git
synced 2025-06-21 20:42:44 +02:00
ns: Added support for using the other services as fallback on [3.0.0+] when ns:am2 isn't available.
This commit is contained in:
parent
af2b4ab7c3
commit
f589c95214
@ -19,12 +19,15 @@ NX_GENERATE_SERVICE_GUARD(ns);
|
||||
|
||||
Result _nsInitialize(void) {
|
||||
Result rc=0;
|
||||
const char *servarray[5] = {"ns:ec", "ns:web", "ns:rid", "ns:rt", "ns:am2"}; // This is the order used used by official sw, however the below loop uses this in reverse since ns:am2 is last in the list.
|
||||
|
||||
if(hosversionBefore(3,0,0))
|
||||
return smGetService(&g_nsAppManSrv, "ns:am");
|
||||
|
||||
rc = smGetService(&g_nsGetterSrv, "ns:am2");//TODO: Support the other services?(Only useful when ns:am2 isn't accessible)
|
||||
if (R_FAILED(rc)) return rc;
|
||||
for (s32 i=4; i>=0; i--) {
|
||||
rc = smGetService(&g_nsGetterSrv, servarray[i]);
|
||||
if (R_SUCCEEDED(rc)) break;
|
||||
}
|
||||
|
||||
return rc;
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user