mirror of
https://github.com/Atmosphere-NX/Atmosphere.git
synced 2024-11-26 05:42:17 +00:00
ro: simplify program id logic
This commit is contained in:
parent
65fd967550
commit
a774833790
3 changed files with 3 additions and 15 deletions
|
@ -15,7 +15,7 @@
|
|||
"filesystem_access": {
|
||||
"permissions": "0xFFFFFFFFFFFFFFFF"
|
||||
},
|
||||
"service_access": ["fatal:u", "spl:", "set:sys", "fsp-srv", "pm:info"],
|
||||
"service_access": ["fatal:u", "spl:", "set:sys", "fsp-srv"],
|
||||
"service_host": ["ldr:ro", "ro:dmnt", "ro:1"],
|
||||
"kernel_capabilities": [{
|
||||
"type": "kernel_flags",
|
||||
|
|
|
@ -84,18 +84,12 @@ namespace ams::ro::impl {
|
|||
ncm::ProgramId GetProgramId(Handle other_process_h) const {
|
||||
/* Automatically select a handle, allowing for override. */
|
||||
Handle process_h = this->process_handle;
|
||||
if (other_process_h != INVALID_HANDLE) {
|
||||
if (other_process_h != svc::InvalidHandle) {
|
||||
process_h = other_process_h;
|
||||
}
|
||||
|
||||
ncm::ProgramId program_id = ncm::InvalidProgramId;
|
||||
if (hos::GetVersion() >= hos::Version_3_0_0) {
|
||||
/* 3.0.0+: Use svcGetInfo. */
|
||||
R_ABORT_UNLESS(svcGetInfo(&program_id.value, InfoType_ProgramId, process_h, 0));
|
||||
} else {
|
||||
/* 1.0.0-2.3.0: We're not inside loader, so ask pm. */
|
||||
R_ABORT_UNLESS(pm::info::GetProgramId(&program_id, os::GetProcessId(process_h)));
|
||||
}
|
||||
R_ABORT_UNLESS(svc::GetInfo(std::addressof(program_id.value), svc::InfoType_ProgramId, process_h, 0));
|
||||
return program_id;
|
||||
}
|
||||
|
||||
|
|
|
@ -144,9 +144,6 @@ void __appInit(void) {
|
|||
R_ABORT_UNLESS(setsysInitialize());
|
||||
R_ABORT_UNLESS(fsInitialize());
|
||||
spl::Initialize();
|
||||
if (hos::GetVersion() < hos::Version_3_0_0) {
|
||||
R_ABORT_UNLESS(pminfoInitialize());
|
||||
}
|
||||
|
||||
R_ABORT_UNLESS(fs::MountSdCard("sdmc"));
|
||||
|
||||
|
@ -155,9 +152,6 @@ void __appInit(void) {
|
|||
|
||||
void __appExit(void) {
|
||||
fsExit();
|
||||
if (hos::GetVersion() < hos::Version_3_0_0) {
|
||||
pminfoExit();
|
||||
}
|
||||
|
||||
setsysExit();
|
||||
}
|
||||
|
|
Loading…
Reference in a new issue