Added envGetLastLoadResult().

This commit is contained in:
yellows8 2018-03-11 17:40:28 -04:00
parent e112ab6968
commit 49bea43cce
2 changed files with 12 additions and 0 deletions

View File

@ -85,3 +85,6 @@ Result envSetNextLoad(const char* path, const char* argv);
/// Returns true if the environment supports envSetNextLoad.
bool envHasNextLoad(void);
/// Returns the Result from the last NRO.
Result envGetLastLoadResult(void);

View File

@ -16,6 +16,7 @@ static u64 g_syscallHints[2];
static Handle g_processHandle = INVALID_HANDLE;
static char* g_nextLoadPath = NULL;
static char* g_nextLoadArgv = NULL;
static Result g_lastLoadResult = 0;
extern __attribute__((weak)) u32 __nx_applet_type;
@ -84,6 +85,10 @@ void envSetup(void* ctx, Handle main_thread, LoaderReturnFn saved_lr)
g_processHandle = ent->Value[0];
break;
case EntryType_LastLoadResult:
g_lastLoadResult = ent->Value[0];
break;
default:
if (ent->Flags & EntryFlag_IsMandatory)
{
@ -164,3 +169,7 @@ Result envSetNextLoad(const char* path, const char* argv)
bool envHasNextLoad(void) {
return g_nextLoadPath != NULL;
}
Result envGetLastLoadResult(void) {
return g_lastLoadResult;
}