strat: replace kernel/dbg magic numbers with result defs
This commit is contained in:
@@ -62,15 +62,15 @@ static void LaunchTitle(Boot2KnownTitleId title_id, FsStorageId storage_id, u32
|
||||
|
||||
Result rc = Registration::LaunchProcessByTidSid(Registration::TidSid{(u64)title_id, storage_id}, launch_flags, &local_pid);
|
||||
switch (rc) {
|
||||
case 0xCE01:
|
||||
case ResultKernelResourceExhausted:
|
||||
/* Out of resource! */
|
||||
std::abort();
|
||||
break;
|
||||
case 0xDE01:
|
||||
case ResultKernelOutOfMemory:
|
||||
/* Out of memory! */
|
||||
std::abort();
|
||||
break;
|
||||
case 0xD001:
|
||||
case ResultKernelLimitReached:
|
||||
/* Limit Reached! */
|
||||
std::abort();
|
||||
break;
|
||||
|
||||
@@ -89,7 +89,7 @@ Result DebugMonitorService::AtmosphereGetProcessInfo(Out<CopiedHandle> proc_hand
|
||||
Result DebugMonitorService::AtmosphereGetCurrentLimitInfo(Out<u64> cur_val, Out<u64> lim_val, u32 category, u32 resource) {
|
||||
Result rc;
|
||||
if(category > ResourceLimitUtils::ResourceLimitCategory::ResourceLimitCategory_Applet) {
|
||||
return 0xF001;
|
||||
return ResultKernelInvalidEnumValue;
|
||||
}
|
||||
|
||||
Handle limit_h = ResourceLimitUtils::GetResourceLimitHandleByCategory((ResourceLimitUtils::ResourceLimitCategory) category);
|
||||
|
||||
@@ -275,7 +275,7 @@ Result Registration::HandleSignaledProcess(std::shared_ptr<Registration::Process
|
||||
} else {
|
||||
FinalizeExitedProcess(process);
|
||||
}
|
||||
return 0xF601;
|
||||
return ResultKernelConnectionClosed;
|
||||
case ProcessState_DebugSuspended:
|
||||
if (process->flags & PROCESSFLAGS_NOTIFYDEBUGEVENTS) {
|
||||
process->flags |= (PROCESSFLAGS_DEBUGEVENTPENDING | PROCESSFLAGS_DEBUGSUSPENDED);
|
||||
|
||||
@@ -276,7 +276,7 @@ Result ResourceLimitUtils::BoostSystemMemoryResourceLimit(u64 boost_size) {
|
||||
}
|
||||
}
|
||||
} else {
|
||||
rc = 0xF601;
|
||||
rc = ResultKernelConnectionClosed;
|
||||
}
|
||||
if (R_SUCCEEDED(rc)) {
|
||||
g_system_boost_size = boost_size;
|
||||
|
||||
Reference in New Issue
Block a user