mirror of
https://github.com/Atmosphere-NX/Atmosphere.git
synced 2025-05-21 18:35:13 -04:00
ldr/pm: update for 20.0.0 abi changes
This commit is contained in:
parent
6bab59ea3d
commit
37a971a706
17 changed files with 186 additions and 141 deletions
|
@ -117,14 +117,14 @@ namespace ams::pm::impl {
|
|||
R_SUCCEED();
|
||||
}
|
||||
|
||||
Result LaunchProgramImpl(ProcessInfo **out_process_info, os::ProcessId *out_process_id, const ncm::ProgramLocation &loc, u32 flags) {
|
||||
Result LaunchProgramImpl(ProcessInfo **out_process_info, os::ProcessId *out_process_id, const ncm::ProgramLocation &loc, u32 flags, const ProcessAttributes &attrs) {
|
||||
/* Set the output to nullptr, if we fail. */
|
||||
*out_process_info = nullptr;
|
||||
|
||||
/* Get Program Info. */
|
||||
ldr::ProgramInfo program_info;
|
||||
cfg::OverrideStatus override_status;
|
||||
R_TRY(ldr::pm::AtmosphereGetProgramInfo(std::addressof(program_info), std::addressof(override_status), loc));
|
||||
R_TRY(ldr::pm::AtmosphereGetProgramInfo(std::addressof(program_info), std::addressof(override_status), loc, attrs.program_attrs));
|
||||
const bool is_application = (program_info.flags & ldr::ProgramInfoFlag_ApplicationTypeMask) == ldr::ProgramInfoFlag_Application;
|
||||
const bool allow_debug = (program_info.flags & ldr::ProgramInfoFlag_AllowDebug) || hos::GetVersion() < hos::Version_2_0_0;
|
||||
|
||||
|
@ -166,14 +166,14 @@ namespace ams::pm::impl {
|
|||
WaitResourceAvailable(std::addressof(program_info));
|
||||
|
||||
/* Actually create the process. */
|
||||
R_TRY(ldr::pm::CreateProcess(std::addressof(process_handle), pin_id, GetLoaderCreateProcessFlags(flags), GetResourceLimitHandle(std::addressof(program_info))));
|
||||
R_TRY(ldr::pm::CreateProcess(std::addressof(process_handle), pin_id, GetLoaderCreateProcessFlags(flags), GetResourceLimitHandle(std::addressof(program_info)), attrs.program_attrs));
|
||||
}
|
||||
|
||||
/* Get the process id. */
|
||||
os::ProcessId process_id = os::GetProcessId(process_handle);
|
||||
|
||||
/* Make new process info. */
|
||||
ProcessInfo *process_info = AllocateProcessInfo(process_handle, process_id, pin_id, fixed_location, override_status);
|
||||
ProcessInfo *process_info = AllocateProcessInfo(process_handle, process_id, pin_id, fixed_location, override_status, attrs);
|
||||
AMS_ABORT_UNLESS(process_info != nullptr);
|
||||
|
||||
/* Add the new process info to the process list. */
|
||||
|
@ -253,7 +253,7 @@ namespace ams::pm::impl {
|
|||
Result LaunchProgram(os::ProcessId *out_process_id, const ncm::ProgramLocation &loc, u32 flags) {
|
||||
/* Launch the program. */
|
||||
ProcessInfo *process_info = nullptr;
|
||||
R_TRY(LaunchProgramImpl(std::addressof(process_info), out_process_id, loc, flags));
|
||||
R_TRY(LaunchProgramImpl(std::addressof(process_info), out_process_id, loc, flags, ProcessAttributes_Nx));
|
||||
|
||||
/* Register the process info with the tracker. */
|
||||
g_process_tracker.QueueEntry(process_info);
|
||||
|
@ -268,7 +268,7 @@ namespace ams::pm::impl {
|
|||
R_UNLESS(!process_info->HasStarted(), pm::ResultAlreadyStarted());
|
||||
|
||||
ldr::ProgramInfo program_info;
|
||||
R_TRY(ldr::pm::GetProgramInfo(std::addressof(program_info), process_info->GetProgramLocation()));
|
||||
R_TRY(ldr::pm::GetProgramInfo(std::addressof(program_info), process_info->GetProgramLocation(), process_info->GetProcessAttributes().program_attrs));
|
||||
R_RETURN(StartProcess(process_info, std::addressof(program_info)));
|
||||
}
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue