mirror of
https://github.com/switchbrew/libnx.git
synced 2025-06-21 20:42:44 +02:00
Added envGetLastLoadResult().
This commit is contained in:
parent
e112ab6968
commit
49bea43cce
@ -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);
|
||||
|
@ -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;
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user