diff --git a/stratosphere/libstratosphere b/stratosphere/libstratosphere index 035968147..cd7f81f7b 160000 --- a/stratosphere/libstratosphere +++ b/stratosphere/libstratosphere @@ -1 +1 @@ -Subproject commit 0359681475183bd9c519d8fa680641e185f4de8e +Subproject commit cd7f81f7b07a832258a7a8c4a39f1680f98bbecc diff --git a/stratosphere/pm/source/pm_debug_monitor.cpp b/stratosphere/pm/source/pm_debug_monitor.cpp index 776f79576..fe964da58 100644 --- a/stratosphere/pm/source/pm_debug_monitor.cpp +++ b/stratosphere/pm/source/pm_debug_monitor.cpp @@ -24,7 +24,7 @@ Result DebugMonitorService::GetUnknownStub(Out count, OutBuffer out_buf, u64 in_unk) { /* This command seems stubbed. */ if (out_buf.num_elements >> 31) { - return 0xC0F; + return ResultPmInvalidSize; } count.SetValue(0); return 0x0; @@ -32,7 +32,7 @@ Result DebugMonitorService::GetUnknownStub(Out count, OutBuffer out_buf Result DebugMonitorService::GetDebugProcessIds(Out count, OutBuffer out_pids) { if (out_pids.num_elements >> 31) { - return 0xC0F; + return ResultPmInvalidSize; } return Registration::GetDebugProcessIds(out_pids.buffer, out_pids.num_elements, count.GetPointer()); } @@ -49,7 +49,7 @@ Result DebugMonitorService::GetTitleProcessId(Out pid, u64 tid) { pid.SetValue(proc->pid); return 0; } - return 0x20F; + return ResultPmProcessNotFound; } Result DebugMonitorService::EnableDebugForTitleId(Out event, u64 tid) { @@ -64,7 +64,7 @@ Result DebugMonitorService::GetApplicationProcessId(Out pid) { pid.SetValue(app_proc->pid); return 0x0; } - return 0x20F; + return ResultPmProcessNotFound; } Result DebugMonitorService::EnableDebugForApplication(Out event) { @@ -83,7 +83,7 @@ Result DebugMonitorService::AtmosphereGetProcessInfo(Out proc_hand tid_sid.SetValue(proc->tid_sid); return 0; } - return 0x20F; + return ResultPmProcessNotFound; } Result DebugMonitorService::AtmosphereGetCurrentLimitInfo(Out cur_val, Out lim_val, u32 category, u32 resource) { diff --git a/stratosphere/pm/source/pm_info.cpp b/stratosphere/pm/source/pm_info.cpp index 847bb7df4..6c1c2c42b 100644 --- a/stratosphere/pm/source/pm_info.cpp +++ b/stratosphere/pm/source/pm_info.cpp @@ -26,5 +26,5 @@ Result InformationService::GetTitleId(Out tid, u64 pid) { tid.SetValue(proc->tid_sid.title_id); return 0; } - return 0x20F; + return ResultPmProcessNotFound; } diff --git a/stratosphere/pm/source/pm_registration.cpp b/stratosphere/pm/source/pm_registration.cpp index 508790dd7..957f5ad08 100644 --- a/stratosphere/pm/source/pm_registration.cpp +++ b/stratosphere/pm/source/pm_registration.cpp @@ -80,7 +80,7 @@ void Registration::HandleProcessLaunch() { /* Get the resource limit handle, ensure that we can launch the program. */ if ((program_info.application_type & 3) == 1 && HasApplicationProcess(NULL)) { - rc = 0xA0F; + rc = ResultPmApplicationRunning; goto HANDLE_PROCESS_LAUNCH_END; } @@ -190,11 +190,11 @@ Result Registration::LaunchDebugProcess(u64 pid) { std::shared_ptr proc = GetProcess(pid); if (proc == NULL) { - return 0x20F; + return ResultPmProcessNotFound; } if (proc->state >= ProcessState_Running) { - return 0x40F; + return ResultPmAlreadyStarted; } /* Check that this is a real program. */ @@ -480,7 +480,7 @@ Result Registration::EnableDebugForTitleId(u64 tid, Handle *out) { u64 old = g_debug_on_launch_tid.exchange(tid); if (old) { g_debug_on_launch_tid = old; - return 0x80F; + return ResultPmDebugHookInUse; } *out = g_debug_title_event->GetHandle(); return 0x0; diff --git a/stratosphere/pm/source/pm_resource_limits.cpp b/stratosphere/pm/source/pm_resource_limits.cpp index d6d5b70f3..b3e37cef7 100644 --- a/stratosphere/pm/source/pm_resource_limits.cpp +++ b/stratosphere/pm/source/pm_resource_limits.cpp @@ -239,7 +239,7 @@ Handle ResourceLimitUtils::GetResourceLimitHandleByCategory(ResourceLimitCategor Result ResourceLimitUtils::BoostSystemMemoryResourceLimit(u64 boost_size) { Result rc = 0; if (boost_size > g_memory_resource_limits[g_memory_limit_type][ResourceLimitCategory_Application]) { - return 0xC0F; + return ResultPmInvalidSize; } u64 app_size = g_memory_resource_limits[g_memory_limit_type][ResourceLimitCategory_Application] - boost_size; if (kernelAbove500()) { diff --git a/stratosphere/pm/source/pm_shell.cpp b/stratosphere/pm/source/pm_shell.cpp index 258431912..c9ce75dc7 100644 --- a/stratosphere/pm/source/pm_shell.cpp +++ b/stratosphere/pm/source/pm_shell.cpp @@ -34,7 +34,7 @@ Result ShellService::TerminateProcessId(u64 pid) { if (proc != nullptr) { return svcTerminateProcess(proc->handle); } else { - return 0x20F; + return ResultPmProcessNotFound; } } @@ -45,7 +45,7 @@ Result ShellService::TerminateTitleId(u64 tid) { if (proc != NULL) { return svcTerminateProcess(proc->handle); } else { - return 0x20F; + return ResultPmProcessNotFound; } } @@ -62,9 +62,9 @@ Result ShellService::FinalizeExitedProcess(u64 pid) { auto proc = Registration::GetProcess(pid); if (proc == NULL) { - return 0x20F; + return ResultPmProcessNotFound; } else if (proc->state != ProcessState_Exited) { - return 0x60F; + return ResultPmNotExited; } else { Registration::FinalizeExitedProcess(proc); return 0x0; @@ -79,7 +79,7 @@ Result ShellService::ClearProcessNotificationFlag(u64 pid) { proc->flags &= ~PROCESSFLAGS_CRASHED; return 0x0; } else { - return 0x20F; + return ResultPmProcessNotFound; } } @@ -98,7 +98,7 @@ Result ShellService::GetApplicationProcessId(Out pid) { pid.SetValue(app_proc->pid); return 0; } - return 0x20F; + return ResultPmProcessNotFound; } Result ShellService::BoostSystemMemoryResourceLimit(u64 sysmem_size) {