mirror of
https://github.com/Atmosphere-NX/Atmosphere.git
synced 2025-05-30 06:25:20 -04:00
loader: completely rewrite.
This commit is contained in:
parent
9217e4c5f9
commit
61fcf5e0f4
49 changed files with 2523 additions and 5817 deletions
|
@ -15,6 +15,9 @@
|
|||
*/
|
||||
|
||||
#include <switch.h>
|
||||
#include <stratosphere/ldr.hpp>
|
||||
#include <stratosphere/ldr/ldr_pm_api.hpp>
|
||||
|
||||
#include "pm_registration.hpp"
|
||||
#include "pm_info.hpp"
|
||||
|
||||
|
@ -22,9 +25,26 @@ Result InformationService::GetTitleId(Out<u64> tid, u64 pid) {
|
|||
std::scoped_lock<ProcessList &> lk(Registration::GetProcessList());
|
||||
|
||||
std::shared_ptr<Registration::Process> proc = Registration::GetProcess(pid);
|
||||
if (proc != NULL) {
|
||||
tid.SetValue(proc->tid_sid.title_id);
|
||||
return ResultSuccess;
|
||||
if (proc == NULL) {
|
||||
return ResultPmProcessNotFound;
|
||||
}
|
||||
return ResultPmProcessNotFound;
|
||||
|
||||
tid.SetValue(proc->tid_sid.title_id);
|
||||
return ResultSuccess;
|
||||
}
|
||||
|
||||
Result InformationService::AtmosphereGetProcessId(Out<u64> pid, u64 tid) {
|
||||
std::scoped_lock<ProcessList &> lk(Registration::GetProcessList());
|
||||
|
||||
std::shared_ptr<Registration::Process> proc = Registration::GetProcessByTitleId(tid);
|
||||
if (proc == nullptr) {
|
||||
return ResultPmProcessNotFound;
|
||||
}
|
||||
|
||||
pid.SetValue(proc->pid);
|
||||
return ResultSuccess;
|
||||
}
|
||||
|
||||
Result InformationService::AtmosphereHasLaunchedTitle(Out<bool> out, u64 tid) {
|
||||
return sts::ldr::pm::HasLaunchedTitle(out.GetPointer(), sts::ncm::TitleId{tid});
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue