From 0fb107fb86fd1ae93203fcaff0d2917a20593c14 Mon Sep 17 00:00:00 2001 From: Michael Scire Date: Fri, 20 Apr 2018 21:38:51 -0600 Subject: [PATCH] Stratosphere: Add arguments to GetProgramInfo --- .../loader/source/ldr_process_manager.cpp | 8 +++++--- .../loader/source/ldr_process_manager.hpp | 17 ++++++++++++++++- 2 files changed, 21 insertions(+), 4 deletions(-) diff --git a/stratosphere/loader/source/ldr_process_manager.cpp b/stratosphere/loader/source/ldr_process_manager.cpp index be1e3caed..843f3116f 100644 --- a/stratosphere/loader/source/ldr_process_manager.cpp +++ b/stratosphere/loader/source/ldr_process_manager.cpp @@ -31,9 +31,11 @@ std::tuple ProcessManagerService::create_process() { return std::make_tuple(0xF601); } -std::tuple ProcessManagerService::get_program_info() { - /* TODO */ - return std::make_tuple(0xF601); +std::tuple ProcessManagerService::get_program_info(Registration::TidSid tid_sid, OutPointerWithServerSize out_program_info) { + /* Zero output. */ + std::fill(out_program_info.pointer, out_program_info.pointer + out_program_info.num_elements, (const ProcessManagerService::ProgramInfo){0}); + + return std::make_tuple(0xA09); } std::tuple ProcessManagerService::register_title(Registration::TidSid tid_sid) { diff --git a/stratosphere/loader/source/ldr_process_manager.hpp b/stratosphere/loader/source/ldr_process_manager.hpp index 5627e1d0d..5a1e583ed 100644 --- a/stratosphere/loader/source/ldr_process_manager.hpp +++ b/stratosphere/loader/source/ldr_process_manager.hpp @@ -12,13 +12,28 @@ enum ProcessManagerServiceCmd { }; class ProcessManagerService : IServiceObject { + struct ProgramInfo { + u8 main_thread_priority; + u8 default_cpu_id; + u16 application_type; + u32 main_thread_stack_size; + u64 title_id_min; + u32 acid_sac_size; + u32 aci0_sac_size; + u32 acid_fac_size; + u32 aci0_fac_size; + u8 ac_buffer[0x3E0]; + }; + + static_assert(sizeof(ProcessManagerService::ProgramInfo) == 0x400, "Incorrect ProgramInfo definition."); + public: Result dispatch(IpcParsedCommand &r, IpcCommand &out_c, u64 cmd_id, u8 *pointer_buffer, size_t pointer_buffer_size); private: /* Actual commands. */ std::tuple create_process(); - std::tuple get_program_info(); + std::tuple get_program_info(Registration::TidSid tid_sid, OutPointerWithServerSize out_program_info); std::tuple register_title(Registration::TidSid tid_sid); std::tuple unregister_title(u64 index); }; \ No newline at end of file