From 49b12237e85cd11bc8f44c83e1ded63ceb165e24 Mon Sep 17 00:00:00 2001 From: hexkyz Date: Tue, 15 Sep 2026 22:16:29 +0100 Subject: [PATCH] pgl: clean up and add new 23.0.0 command --- .../stratosphere/pgl/pgl_event_observer.hpp | 28 ++++---- .../stratosphere/pgl/pgl_shell_api.hpp | 12 ++-- .../include/stratosphere/pgl/pgl_types.hpp | 7 +- .../pgl/sf/pgl_sf_i_event_observer.hpp | 4 +- .../pgl/sf/pgl_sf_i_shell_interface.hpp | 11 ++-- .../pgl/srv/pgl_srv_shell_interface.hpp | 32 ++++----- .../pgl/tipc/pgl_tipc_i_event_observer.hpp | 4 +- .../pgl/tipc/pgl_tipc_i_shell_interface.hpp | 26 ++++---- .../source/pgl/pgl_remote_event_observer.hpp | 16 ++--- .../source/pgl/pgl_shell_api.cpp | 41 +++++++----- .../source/pgl/srv/pgl_srv_shell.cpp | 34 +++++++--- .../source/pgl/srv/pgl_srv_shell.hpp | 7 +- .../pgl/srv/pgl_srv_shell_event_observer.cpp | 8 +-- .../pgl/srv/pgl_srv_shell_event_observer.hpp | 8 +-- .../pgl/srv/pgl_srv_shell_host_utils.cpp | 4 +- .../pgl/srv/pgl_srv_shell_host_utils.hpp | 2 +- .../pgl/srv/pgl_srv_shell_interface.cpp | 66 ++++++++++--------- 17 files changed, 170 insertions(+), 140 deletions(-) diff --git a/libraries/libstratosphere/include/stratosphere/pgl/pgl_event_observer.hpp b/libraries/libstratosphere/include/stratosphere/pgl/pgl_event_observer.hpp index 2a9eff313..3a98dfa14 100644 --- a/libraries/libstratosphere/include/stratosphere/pgl/pgl_event_observer.hpp +++ b/libraries/libstratosphere/include/stratosphere/pgl/pgl_event_observer.hpp @@ -33,8 +33,8 @@ namespace ams::pgl { virtual ~EventObserverInterface() { /* ... */ } - virtual Result GetSystemEvent(os::SystemEventType *out) = 0; - virtual Result GetProcessEventInfo(pm::ProcessEventInfo *out) = 0; + virtual Result GetShellEvent(os::SystemEventType *out) = 0; + virtual Result GetShellEventInfo(pm::ProcessEventInfo *out) = 0; }; class EventObserverByCmif final : public EventObserverInterface { @@ -45,9 +45,9 @@ namespace ams::pgl { public: explicit EventObserverByCmif(ams::sf::SharedPointer intf) : m_cmif_interface(intf) { /* ... */ } public: - virtual Result GetSystemEvent(os::SystemEventType *out) override { + virtual Result GetShellEvent(os::SystemEventType *out) override { ams::sf::NativeHandle handle; - R_TRY(m_cmif_interface->GetProcessEventHandle(std::addressof(handle))); + R_TRY(m_cmif_interface->GetShellEvent(std::addressof(handle))); os::AttachReadableHandleToSystemEvent(out, handle.GetOsHandle(), handle.IsManaged(), os::EventClearMode_AutoClear); handle.Detach(); @@ -55,8 +55,8 @@ namespace ams::pgl { R_SUCCEED(); } - virtual Result GetProcessEventInfo(pm::ProcessEventInfo *out) override { - R_RETURN(m_cmif_interface->GetProcessEventInfo(out)); + virtual Result GetShellEventInfo(pm::ProcessEventInfo *out) override { + R_RETURN(m_cmif_interface->GetShellEventInfo(out)); } }; @@ -70,15 +70,15 @@ namespace ams::pgl { template explicit EventObserverByTipc(Args &&... args) : m_tipc_interface(std::forward(args)...) { /* ... */ } public: - virtual Result GetSystemEvent(os::SystemEventType *out) override { + virtual Result GetShellEvent(os::SystemEventType *out) override { os::NativeHandle handle; - R_TRY(m_tipc_interface.GetProcessEventHandle(std::addressof(handle))); + R_TRY(m_tipc_interface.GetShellEvent(std::addressof(handle))); os::AttachReadableHandleToSystemEvent(out, handle, true, os::EventClearMode_AutoClear); R_SUCCEED(); } - virtual Result GetProcessEventInfo(pm::ProcessEventInfo *out) override { - R_RETURN(m_tipc_interface.GetProcessEventInfo(ams::tipc::Out(out))); + virtual Result GetShellEventInfo(pm::ProcessEventInfo *out) override { + R_RETURN(m_tipc_interface.GetShellEventInfo(ams::tipc::Out(out))); } }; @@ -112,12 +112,12 @@ namespace ams::pgl { std::swap(m_impl, rhs.m_impl); } public: - Result GetSystemEvent(os::SystemEventType *out) { - R_RETURN(m_impl->GetSystemEvent(out)); + Result GetShellEvent(os::SystemEventType *out) { + R_RETURN(m_impl->GetShellEvent(out)); } - Result GetProcessEventInfo(pm::ProcessEventInfo *out) { - R_RETURN(m_impl->GetProcessEventInfo(out)); + Result GetShellEventInfo(pm::ProcessEventInfo *out) { + R_RETURN(m_impl->GetShellEventInfo(out)); } }; diff --git a/libraries/libstratosphere/include/stratosphere/pgl/pgl_shell_api.hpp b/libraries/libstratosphere/include/stratosphere/pgl/pgl_shell_api.hpp index f61d008e6..e6dbeed31 100644 --- a/libraries/libstratosphere/include/stratosphere/pgl/pgl_shell_api.hpp +++ b/libraries/libstratosphere/include/stratosphere/pgl/pgl_shell_api.hpp @@ -27,15 +27,15 @@ namespace ams::pgl { Result LaunchProgram(os::ProcessId *out, const ncm::ProgramLocation &loc, u32 process_flags, u8 pgl_flags); Result TerminateProcess(os::ProcessId process_id); Result LaunchProgramFromHost(os::ProcessId *out, const char *content_path, u32 process_flags); - Result GetHostContentMetaInfo(pgl::ContentMetaInfo *out, const char *content_path); - Result GetApplicationProcessId(os::ProcessId *out); + Result GetProgramLaunchPropertyFromHost(pgl::ProgramLaunchProperty *out, const char *content_path); + Result GetRunningApplicationProcessId(os::ProcessId *out); Result BoostSystemMemoryResourceLimit(u64 size); - Result IsProcessTracked(bool *out, os::ProcessId process_id); + Result IsRunningProcess(bool *out, os::ProcessId process_id); Result EnableApplicationCrashReport(bool enabled); Result IsApplicationCrashReportEnabled(bool *out); Result EnableApplicationAllThreadDumpOnCrash(bool enabled); - Result TriggerApplicationSnapShotDumper(const char *arg, SnapShotDumpType dump_type); - - Result GetEventObserver(pgl::EventObserver *out); + Result TriggerSnapShotDumper(const char *arg, SnapShotDumpType dump_type); + Result CreateShellEvent(pgl::EventObserver *out); + Result EnableApplicationCrashReport2(os::ProcessId process_id, bool enabled); } diff --git a/libraries/libstratosphere/include/stratosphere/pgl/pgl_types.hpp b/libraries/libstratosphere/include/stratosphere/pgl/pgl_types.hpp index 25ed20d9c..268c3e6f6 100644 --- a/libraries/libstratosphere/include/stratosphere/pgl/pgl_types.hpp +++ b/libraries/libstratosphere/include/stratosphere/pgl/pgl_types.hpp @@ -35,8 +35,7 @@ namespace ams::pgl { Full = 2, }; - /* TODO: Is this really nn::ncm::ContentInfo? */ - struct ContentMetaInfo { + struct ProgramLaunchProperty { u64 id; u32 version; ncm::ContentType content_type; @@ -44,7 +43,7 @@ namespace ams::pgl { ncm::ContentMetaType content_meta_type; u8 reserved_0F; - static constexpr ContentMetaInfo Make(u64 id, u32 version, ncm::ContentType content_type, u8 id_offset) { + static constexpr ProgramLaunchProperty Make(u64 id, u32 version, ncm::ContentType content_type, u8 id_offset) { return { .id = id, .version = version, @@ -53,6 +52,6 @@ namespace ams::pgl { }; } }; - static_assert(sizeof(ContentMetaInfo) == 0x10 && util::is_pod::value); + static_assert(sizeof(ProgramLaunchProperty) == 0x10 && util::is_pod::value); } diff --git a/libraries/libstratosphere/include/stratosphere/pgl/sf/pgl_sf_i_event_observer.hpp b/libraries/libstratosphere/include/stratosphere/pgl/sf/pgl_sf_i_event_observer.hpp index 387fb8147..d08ce89bb 100644 --- a/libraries/libstratosphere/include/stratosphere/pgl/sf/pgl_sf_i_event_observer.hpp +++ b/libraries/libstratosphere/include/stratosphere/pgl/sf/pgl_sf_i_event_observer.hpp @@ -21,8 +21,8 @@ #include #define AMS_PGL_SF_I_EVENT_OBSERVER_INTERFACE_INFO(C, H) \ - AMS_SF_METHOD_INFO(C, H, 0, Result, GetProcessEventHandle, (ams::sf::OutCopyHandle out), (out)) \ - AMS_SF_METHOD_INFO(C, H, 1, Result, GetProcessEventInfo, (ams::sf::Out out), (out)) + AMS_SF_METHOD_INFO(C, H, 0, Result, GetShellEvent, (ams::sf::OutCopyHandle out), (out)) \ + AMS_SF_METHOD_INFO(C, H, 1, Result, GetShellEventInfo, (ams::sf::Out out), (out)) AMS_SF_DEFINE_INTERFACE(ams::pgl::sf, IEventObserver, AMS_PGL_SF_I_EVENT_OBSERVER_INTERFACE_INFO, 0x00000000); diff --git a/libraries/libstratosphere/include/stratosphere/pgl/sf/pgl_sf_i_shell_interface.hpp b/libraries/libstratosphere/include/stratosphere/pgl/sf/pgl_sf_i_shell_interface.hpp index bafda6364..405b54650 100644 --- a/libraries/libstratosphere/include/stratosphere/pgl/sf/pgl_sf_i_shell_interface.hpp +++ b/libraries/libstratosphere/include/stratosphere/pgl/sf/pgl_sf_i_shell_interface.hpp @@ -25,16 +25,15 @@ AMS_SF_METHOD_INFO(C, H, 0, Result, LaunchProgram, (ams::sf::Out out, const ncm::ProgramLocation &loc, u32 pm_flags, u8 pgl_flags), (out, loc, pm_flags, pgl_flags)) \ AMS_SF_METHOD_INFO(C, H, 1, Result, TerminateProcess, (os::ProcessId process_id), (process_id)) \ AMS_SF_METHOD_INFO(C, H, 2, Result, LaunchProgramFromHost, (ams::sf::Out out, const ams::sf::InBuffer &content_path, u32 pm_flags), (out, content_path, pm_flags)) \ - AMS_SF_METHOD_INFO(C, H, 4, Result, GetHostContentMetaInfo, (ams::sf::Out out, const ams::sf::InBuffer &content_path), (out, content_path)) \ - AMS_SF_METHOD_INFO(C, H, 5, Result, GetApplicationProcessId, (ams::sf::Out out), (out)) \ + AMS_SF_METHOD_INFO(C, H, 4, Result, GetProgramLaunchPropertyFromHost, (ams::sf::Out out, const ams::sf::InBuffer &content_path), (out, content_path)) \ + AMS_SF_METHOD_INFO(C, H, 5, Result, GetRunningApplicationProcessId, (ams::sf::Out out), (out)) \ AMS_SF_METHOD_INFO(C, H, 6, Result, BoostSystemMemoryResourceLimit, (u64 size), (size)) \ - AMS_SF_METHOD_INFO(C, H, 7, Result, IsProcessTracked, (ams::sf::Out out, os::ProcessId process_id), (out, process_id)) \ + AMS_SF_METHOD_INFO(C, H, 7, Result, IsRunningProcess, (ams::sf::Out out, os::ProcessId process_id), (out, process_id)) \ AMS_SF_METHOD_INFO(C, H, 8, Result, EnableApplicationCrashReport, (bool enabled), (enabled)) \ AMS_SF_METHOD_INFO(C, H, 9, Result, IsApplicationCrashReportEnabled, (ams::sf::Out out), (out)) \ AMS_SF_METHOD_INFO(C, H, 10, Result, EnableApplicationAllThreadDumpOnCrash, (bool enabled), (enabled)) \ - AMS_SF_METHOD_INFO(C, H, 11, Result, GetProcessId, (ams::sf::Out out, ncm::ProgramId program_id), (out, program_id)) \ - AMS_SF_METHOD_INFO(C, H, 12, Result, TriggerApplicationSnapShotDumper, (pgl::SnapShotDumpType dump_type, const ams::sf::InBuffer &arg), (dump_type, arg)) \ - AMS_SF_METHOD_INFO(C, H, 20, Result, GetShellEventObserver, (ams::sf::Out> out), (out)) \ + AMS_SF_METHOD_INFO(C, H, 12, Result, TriggerSnapShotDumper, (pgl::SnapShotDumpType dump_type, const ams::sf::InBuffer &arg), (dump_type, arg), hos::Version_10_0_0) \ + AMS_SF_METHOD_INFO(C, H, 20, Result, CreateShellEvent, (ams::sf::Out> out), (out)) \ AMS_SF_METHOD_INFO(C, H, 21, Result, Command21NotImplemented, (ams::sf::Out out, u32 in, const ams::sf::InBuffer &buf1, const ams::sf::InBuffer &buf2), (out, in, buf1, buf2), hos::Version_11_0_0) AMS_SF_DEFINE_INTERFACE(ams::pgl::sf, IShellInterface, AMS_PGL_I_SHELL_INTERFACE_INTERFACE_INFO, 0x00000000); diff --git a/libraries/libstratosphere/include/stratosphere/pgl/srv/pgl_srv_shell_interface.hpp b/libraries/libstratosphere/include/stratosphere/pgl/srv/pgl_srv_shell_interface.hpp index 9f488b318..a9d534d9e 100644 --- a/libraries/libstratosphere/include/stratosphere/pgl/srv/pgl_srv_shell_interface.hpp +++ b/libraries/libstratosphere/include/stratosphere/pgl/srv/pgl_srv_shell_interface.hpp @@ -30,15 +30,16 @@ namespace ams::pgl::srv { Result LaunchProgramImpl(os::ProcessId *out, const ncm::ProgramLocation &loc, u32 pm_flags, u8 pgl_flags); Result TerminateProcessImpl(os::ProcessId process_id); Result LaunchProgramFromHostImpl(os::ProcessId *out, const void *content_path, size_t content_path_size, u32 pm_flags); - Result GetHostContentMetaInfoImpl(pgl::ContentMetaInfo *out, const void *content_path, size_t content_path_size); - Result GetApplicationProcessIdImpl(os::ProcessId *out); + Result GetProgramLaunchPropertyFromHostImpl(pgl::ProgramLaunchProperty *out, const void *content_path, size_t content_path_size); + Result GetRunningApplicationProcessIdImpl(os::ProcessId *out); Result BoostSystemMemoryResourceLimitImpl(u64 size); - Result IsProcessTrackedImpl(bool *out, os::ProcessId process_id); + Result IsRunningProcessImpl(bool *out, os::ProcessId process_id); Result EnableApplicationCrashReportImpl(bool enabled); Result IsApplicationCrashReportEnabledImpl(bool *out); Result EnableApplicationAllThreadDumpOnCrashImpl(bool enabled); - Result GetProcessId(os::ProcessId *out, ncm::ProgramId program_id); - Result TriggerApplicationSnapShotDumperImpl(SnapShotDumpType dump_type, const void *arg, size_t arg_size); + Result GetProcessIdImpl(os::ProcessId *out, ncm::ProgramId program_id); + Result TriggerSnapShotDumperImpl(SnapShotDumpType dump_type, const void *arg, size_t arg_size); + Result EnableApplicationCrashReport2Impl(os::ProcessId process_id, bool enabled); }; class ShellInterfaceCmif : public ShellInterfaceCommon { @@ -56,17 +57,15 @@ namespace ams::pgl::srv { Result LaunchProgram(ams::sf::Out out, const ncm::ProgramLocation &loc, u32 pm_flags, u8 pgl_flags); Result TerminateProcess(os::ProcessId process_id); Result LaunchProgramFromHost(ams::sf::Out out, const ams::sf::InBuffer &content_path, u32 pm_flags); - Result GetHostContentMetaInfo(ams::sf::Out out, const ams::sf::InBuffer &content_path); - Result GetApplicationProcessId(ams::sf::Out out); + Result GetProgramLaunchPropertyFromHost(ams::sf::Out out, const ams::sf::InBuffer &content_path); + Result GetRunningApplicationProcessId(ams::sf::Out out); Result BoostSystemMemoryResourceLimit(u64 size); - Result IsProcessTracked(ams::sf::Out out, os::ProcessId process_id); + Result IsRunningProcess(ams::sf::Out out, os::ProcessId process_id); Result EnableApplicationCrashReport(bool enabled); Result IsApplicationCrashReportEnabled(ams::sf::Out out); Result EnableApplicationAllThreadDumpOnCrash(bool enabled); - Result GetProcessId(ams::sf::Out out, ncm::ProgramId program_id); - Result TriggerApplicationSnapShotDumper(SnapShotDumpType dump_type, const ams::sf::InBuffer &arg); - - Result GetShellEventObserver(ams::sf::Out> out); + Result TriggerSnapShotDumper(SnapShotDumpType dump_type, const ams::sf::InBuffer &arg); + Result CreateShellEvent(ams::sf::Out> out); Result Command21NotImplemented(ams::sf::Out out, u32 in, const ams::sf::InBuffer &buf1, const ams::sf::InBuffer &buf2); }; static_assert(pgl::sf::IsIShellInterface); @@ -81,15 +80,16 @@ namespace ams::pgl::srv { Result LaunchProgram(ams::tipc::Out out, const ncm::ProgramLocation loc, u32 pm_flags, u8 pgl_flags); Result TerminateProcess(os::ProcessId process_id); Result LaunchProgramFromHost(ams::tipc::Out out, const ams::tipc::InBuffer content_path, u32 pm_flags); - Result GetHostContentMetaInfo(ams::tipc::Out out, const ams::tipc::InBuffer content_path); - Result GetApplicationProcessId(ams::tipc::Out out); + Result GetProgramLaunchPropertyFromHost(ams::tipc::Out out, const ams::tipc::InBuffer content_path); + Result GetRunningApplicationProcessId(ams::tipc::Out out); Result BoostSystemMemoryResourceLimit(u64 size); - Result IsProcessTracked(ams::tipc::Out out, os::ProcessId process_id); + Result IsRunningProcess(ams::tipc::Out out, os::ProcessId process_id); Result EnableApplicationCrashReport(bool enabled); Result IsApplicationCrashReportEnabled(ams::tipc::Out out); Result EnableApplicationAllThreadDumpOnCrash(bool enabled); Result GetProcessId(ams::tipc::Out out, ncm::ProgramId program_id); - Result GetShellEventObserver(ams::tipc::OutMoveHandle out); + Result CreateShellEvent(ams::tipc::OutMoveHandle out); + Result EnableApplicationCrashReport2(os::ProcessId process_id, bool enabled); }; static_assert(pgl::tipc::IsIShellInterface); diff --git a/libraries/libstratosphere/include/stratosphere/pgl/tipc/pgl_tipc_i_event_observer.hpp b/libraries/libstratosphere/include/stratosphere/pgl/tipc/pgl_tipc_i_event_observer.hpp index 2287344c5..7036e9922 100644 --- a/libraries/libstratosphere/include/stratosphere/pgl/tipc/pgl_tipc_i_event_observer.hpp +++ b/libraries/libstratosphere/include/stratosphere/pgl/tipc/pgl_tipc_i_event_observer.hpp @@ -22,8 +22,8 @@ #include #define AMS_PGL_TIPC_I_EVENT_OBSERVER_INTERFACE_INFO(C, H) \ - AMS_TIPC_METHOD_INFO(C, H, 0, Result, GetProcessEventHandle, (ams::tipc::OutCopyHandle out), (out)) \ - AMS_TIPC_METHOD_INFO(C, H, 1, Result, GetProcessEventInfo, (ams::tipc::Out out), (out)) + AMS_TIPC_METHOD_INFO(C, H, 0, Result, GetShellEvent, (ams::tipc::OutCopyHandle out), (out)) \ + AMS_TIPC_METHOD_INFO(C, H, 1, Result, GetShellEventInfo, (ams::tipc::Out out), (out)) AMS_TIPC_DEFINE_INTERFACE(ams::pgl::tipc, IEventObserver, AMS_PGL_TIPC_I_EVENT_OBSERVER_INTERFACE_INFO); diff --git a/libraries/libstratosphere/include/stratosphere/pgl/tipc/pgl_tipc_i_shell_interface.hpp b/libraries/libstratosphere/include/stratosphere/pgl/tipc/pgl_tipc_i_shell_interface.hpp index ad61a71e4..d86e0f7d8 100644 --- a/libraries/libstratosphere/include/stratosphere/pgl/tipc/pgl_tipc_i_shell_interface.hpp +++ b/libraries/libstratosphere/include/stratosphere/pgl/tipc/pgl_tipc_i_shell_interface.hpp @@ -22,17 +22,19 @@ #include #include -#define AMS_PGL_TIPC_I_SHELL_INTERFACE_INTERFACE_INFO(C, H) \ - AMS_TIPC_METHOD_INFO(C, H, 0, Result, LaunchProgram, (ams::tipc::Out out, const ncm::ProgramLocation loc, u32 pm_flags, u8 pgl_flags), (out, loc, pm_flags, pgl_flags)) \ - AMS_TIPC_METHOD_INFO(C, H, 1, Result, TerminateProcess, (os::ProcessId process_id), (process_id)) \ - AMS_TIPC_METHOD_INFO(C, H, 2, Result, LaunchProgramFromHost, (ams::tipc::Out out, const ams::tipc::InBuffer content_path, u32 pm_flags), (out, content_path, pm_flags)) \ - AMS_TIPC_METHOD_INFO(C, H, 4, Result, GetHostContentMetaInfo, (ams::tipc::Out out, const ams::tipc::InBuffer content_path), (out, content_path)) \ - AMS_TIPC_METHOD_INFO(C, H, 5, Result, GetApplicationProcessId, (ams::tipc::Out out), (out)) \ - AMS_TIPC_METHOD_INFO(C, H, 6, Result, BoostSystemMemoryResourceLimit, (u64 size), (size)) \ - AMS_TIPC_METHOD_INFO(C, H, 7, Result, IsProcessTracked, (ams::tipc::Out out, os::ProcessId process_id), (out, process_id)) \ - AMS_TIPC_METHOD_INFO(C, H, 8, Result, EnableApplicationCrashReport, (bool enabled), (enabled)) \ - AMS_TIPC_METHOD_INFO(C, H, 9, Result, IsApplicationCrashReportEnabled, (ams::tipc::Out out), (out)) \ - AMS_TIPC_METHOD_INFO(C, H, 10, Result, EnableApplicationAllThreadDumpOnCrash, (bool enabled), (enabled)) \ - AMS_TIPC_METHOD_INFO(C, H, 20, Result, GetShellEventObserver, (ams::tipc::OutMoveHandle out), (out)) +#define AMS_PGL_TIPC_I_SHELL_INTERFACE_INTERFACE_INFO(C, H) \ + AMS_TIPC_METHOD_INFO(C, H, 0, Result, LaunchProgram, (ams::tipc::Out out, const ncm::ProgramLocation loc, u32 pm_flags, u8 pgl_flags), (out, loc, pm_flags, pgl_flags)) \ + AMS_TIPC_METHOD_INFO(C, H, 1, Result, TerminateProcess, (os::ProcessId process_id), (process_id)) \ + AMS_TIPC_METHOD_INFO(C, H, 2, Result, LaunchProgramFromHost, (ams::tipc::Out out, const ams::tipc::InBuffer content_path, u32 pm_flags), (out, content_path, pm_flags)) \ + AMS_TIPC_METHOD_INFO(C, H, 4, Result, GetProgramLaunchPropertyFromHost, (ams::tipc::Out out, const ams::tipc::InBuffer content_path), (out, content_path)) \ + AMS_TIPC_METHOD_INFO(C, H, 5, Result, GetRunningApplicationProcessId, (ams::tipc::Out out), (out)) \ + AMS_TIPC_METHOD_INFO(C, H, 6, Result, BoostSystemMemoryResourceLimit, (u64 size), (size)) \ + AMS_TIPC_METHOD_INFO(C, H, 7, Result, IsRunningProcess, (ams::tipc::Out out, os::ProcessId process_id), (out, process_id)) \ + AMS_TIPC_METHOD_INFO(C, H, 8, Result, EnableApplicationCrashReport, (bool enabled), (enabled)) \ + AMS_TIPC_METHOD_INFO(C, H, 9, Result, IsApplicationCrashReportEnabled, (ams::tipc::Out out), (out)) \ + AMS_TIPC_METHOD_INFO(C, H, 10, Result, EnableApplicationAllThreadDumpOnCrash, (bool enabled), (enabled)) \ + AMS_TIPC_METHOD_INFO(C, H, 11, Result, GetProcessId, (ams::sf::Out out, ncm::ProgramId program_id), (out, program_id), hos::Version_19_0_0) \ + AMS_TIPC_METHOD_INFO(C, H, 20, Result, CreateShellEvent, (ams::tipc::OutMoveHandle out), (out)) \ + AMS_TIPC_METHOD_INFO(C, H, 31, Result, EnableApplicationCrashReport2, (os::ProcessId process_id, bool enabled), (process_id, enabled), hos::Version_23_0_0) AMS_TIPC_DEFINE_INTERFACE(ams::pgl::tipc, IShellInterface, AMS_PGL_TIPC_I_SHELL_INTERFACE_INTERFACE_INFO); diff --git a/libraries/libstratosphere/source/pgl/pgl_remote_event_observer.hpp b/libraries/libstratosphere/source/pgl/pgl_remote_event_observer.hpp index 96f45f6eb..b31a3fc5e 100644 --- a/libraries/libstratosphere/source/pgl/pgl_remote_event_observer.hpp +++ b/libraries/libstratosphere/source/pgl/pgl_remote_event_observer.hpp @@ -30,28 +30,28 @@ namespace ams::pgl { ::pglEventObserverClose(std::addressof(m_observer)); } - Result GetProcessEventHandle(ams::sf::OutCopyHandle out) { + Result GetShellEvent(ams::sf::OutCopyHandle out) { ::Event ev; ON_RESULT_SUCCESS { out.SetValue(ev.revent, true); }; - R_RETURN(::pglEventObserverGetProcessEvent(std::addressof(m_observer), std::addressof(ev))); + R_RETURN(::pglEventObserverGetShellEvent(std::addressof(m_observer), std::addressof(ev))); } - Result GetProcessEventInfo(ams::sf::Out out) { + Result GetShellEventInfo(ams::sf::Out out) { static_assert(sizeof(*out.GetPointer()) == sizeof(::PmProcessEventInfo)); - R_RETURN(::pglEventObserverGetProcessEventInfo(std::addressof(m_observer), reinterpret_cast<::PmProcessEventInfo *>(out.GetPointer()))); + R_RETURN(::pglEventObserverGetShellEventInfo(std::addressof(m_observer), reinterpret_cast<::PmProcessEventInfo *>(out.GetPointer()))); } - Result GetProcessEventHandle(ams::tipc::OutCopyHandle out) { + Result GetShellEvent(ams::tipc::OutCopyHandle out) { ::Event ev; ON_RESULT_SUCCESS { out.SetValue(ev.revent); }; - R_RETURN(::pglEventObserverGetProcessEvent(std::addressof(m_observer), std::addressof(ev))); + R_RETURN(::pglEventObserverGetShellEvent(std::addressof(m_observer), std::addressof(ev))); } - Result GetProcessEventInfo(ams::tipc::Out out) { + Result GetShellEventInfo(ams::tipc::Out out) { static_assert(sizeof(*out.GetPointer()) == sizeof(::PmProcessEventInfo)); - R_RETURN(::pglEventObserverGetProcessEventInfo(std::addressof(m_observer), reinterpret_cast<::PmProcessEventInfo *>(out.GetPointer()))); + R_RETURN(::pglEventObserverGetShellEventInfo(std::addressof(m_observer), reinterpret_cast<::PmProcessEventInfo *>(out.GetPointer()))); } }; static_assert(pgl::sf::IsIEventObserver); diff --git a/libraries/libstratosphere/source/pgl/pgl_shell_api.cpp b/libraries/libstratosphere/source/pgl/pgl_shell_api.cpp index 8bbd0da0b..4b87961ff 100644 --- a/libraries/libstratosphere/source/pgl/pgl_shell_api.cpp +++ b/libraries/libstratosphere/source/pgl/pgl_shell_api.cpp @@ -80,22 +80,22 @@ namespace ams::pgl { R_RETURN(::pglLaunchProgramFromHost(reinterpret_cast(out), content_path, process_flags)); } - Result GetHostContentMetaInfo(pgl::ContentMetaInfo *out, const char *content_path) { - static_assert(sizeof(*out) == sizeof(::PglContentMetaInfo)); - R_RETURN(::pglGetHostContentMetaInfo(reinterpret_cast<::PglContentMetaInfo *>(out), content_path)); + Result GetHostProgramLaunchProperty(pgl::ProgramLaunchProperty *out, const char *content_path) { + static_assert(sizeof(*out) == sizeof(::PglProgramLaunchProperty)); + R_RETURN(::pglGetHostProgramLaunchProperty(reinterpret_cast<::PglProgramLaunchProperty *>(out), content_path)); } - Result GetApplicationProcessId(os::ProcessId *out) { + Result GetRunningApplicationProcessId(os::ProcessId *out) { static_assert(sizeof(*out) == sizeof(u64)); - R_RETURN(::pglGetApplicationProcessId(reinterpret_cast(out))); + R_RETURN(::pglGetRunningApplicationProcessId(reinterpret_cast(out))); } Result BoostSystemMemoryResourceLimit(u64 size) { R_RETURN(::pglBoostSystemMemoryResourceLimit(size)); } - Result IsProcessTracked(bool *out, os::ProcessId process_id) { - R_RETURN(::pglIsProcessTracked(out, static_cast(process_id))); + Result IsRunningProcess(bool *out, os::ProcessId process_id) { + R_RETURN(::pglIsRunningProcess(out, static_cast(process_id))); } Result EnableApplicationCrashReport(bool enabled) { @@ -110,13 +110,13 @@ namespace ams::pgl { R_RETURN(::pglEnableApplicationAllThreadDumpOnCrash(enabled)); } - Result TriggerApplicationSnapShotDumper(const char *arg, SnapShotDumpType dump_type) { - R_RETURN(::pglTriggerApplicationSnapShotDumper(static_cast<::PglSnapShotDumpType>(dump_type), arg)); + Result TriggerSnapShotDumper(const char *arg, SnapShotDumpType dump_type) { + R_RETURN(::pglTriggerSnapShotDumper(static_cast<::PglSnapShotDumpType>(dump_type), arg)); } - Result GetEventObserver(pgl::EventObserver *out) { + Result CreateShellEvent(pgl::EventObserver *out) { ::PglEventObserver obs; - R_TRY(::pglGetEventObserver(std::addressof(obs))); + R_TRY(::pglCreateShellEvent(std::addressof(obs))); if (hos::GetVersion() >= hos::Version_12_0_0) { auto observer_holder = MakeUniqueFromStaticExpHeap>(obs); @@ -135,6 +135,10 @@ namespace ams::pgl { R_SUCCEED(); } + + Result EnableApplicationCrashReport2(os::ProcessId process_id, bool enabled) { + R_RETURN(::pglEnableApplicationCrashReport2(process_id, enabled)); + } #else Result Initialize() { AMS_ABORT("TODO"); @@ -159,12 +163,12 @@ namespace ams::pgl { AMS_ABORT("TODO"); } - Result GetHostContentMetaInfo(pgl::ContentMetaInfo *out, const char *content_path) { + Result GetHostProgramLaunchProperty(pgl::ProgramLaunchProperty *out, const char *content_path) { AMS_UNUSED(out, content_path); AMS_ABORT("TODO"); } - Result GetApplicationProcessId(os::ProcessId *out) { + Result GetRunningApplicationProcessId(os::ProcessId *out) { AMS_UNUSED(out); AMS_ABORT("TODO"); } @@ -174,7 +178,7 @@ namespace ams::pgl { AMS_ABORT("TODO"); } - Result IsProcessTracked(bool *out, os::ProcessId process_id) { + Result IsRunningProcess(bool *out, os::ProcessId process_id) { AMS_UNUSED(out, process_id); AMS_ABORT("TODO"); } @@ -194,15 +198,20 @@ namespace ams::pgl { AMS_ABORT("TODO"); } - Result TriggerApplicationSnapShotDumper(const char *arg, SnapShotDumpType dump_type) { + Result TriggerSnapShotDumper(const char *arg, SnapShotDumpType dump_type) { AMS_UNUSED(arg, dump_type); AMS_ABORT("TODO"); } - Result GetEventObserver(pgl::EventObserver *out) { + Result CreateShellEvent(pgl::EventObserver *out) { AMS_UNUSED(out); AMS_ABORT("TODO"); } + + Result EnableApplicationCrashReport2(os::ProcessId process_id, bool enabled) { + AMS_UNUSED(process_id, enabled); + AMS_ABORT("TODO"); + } #endif } \ No newline at end of file diff --git a/libraries/libstratosphere/source/pgl/srv/pgl_srv_shell.cpp b/libraries/libstratosphere/source/pgl/srv/pgl_srv_shell.cpp index 577f59560..7178e3a29 100644 --- a/libraries/libstratosphere/source/pgl/srv/pgl_srv_shell.cpp +++ b/libraries/libstratosphere/source/pgl/srv/pgl_srv_shell.cpp @@ -85,7 +85,7 @@ namespace ams::pgl::srv { } } - util::optional GetRunningApplicationProcessId() { + util::optional GetRunningApplicationProcessIdInternal() { os::ProcessId process_id; if (R_SUCCEEDED(pm::shell::GetApplicationProcessIdForShell(std::addressof(process_id)))) { return process_id; @@ -403,9 +403,9 @@ namespace ams::pgl::srv { R_RETURN(pm::shell::TerminateProcess(process_id)); } - Result GetApplicationProcessId(os::ProcessId *out) { - /* Get the application process id. */ - auto application_process_id = GetRunningApplicationProcessId(); + Result GetRunningApplicationProcessId(os::ProcessId *out) { + /* Get the running application process id. */ + auto application_process_id = GetRunningApplicationProcessIdInternal(); R_UNLESS(application_process_id, pgl::ResultApplicationNotRunning()); /* Return the id. */ @@ -418,7 +418,7 @@ namespace ams::pgl::srv { R_RETURN(pm::shell::BoostSystemMemoryResourceLimit(size)); } - bool IsProcessTracked(os::ProcessId process_id) { + bool IsRunningProcess(os::ProcessId process_id) { /* Check whether a ProcessData exists for the process. */ std::scoped_lock lk(g_process_data_mutex); return FindProcessData(process_id) != nullptr; @@ -426,7 +426,7 @@ namespace ams::pgl::srv { void EnableApplicationCrashReport(bool enabled) { /* Get the application process id. */ - auto application_process_id = GetRunningApplicationProcessId(); + auto application_process_id = GetRunningApplicationProcessIdInternal(); if (application_process_id) { /* Find the data for the application process. */ std::scoped_lock lk(g_process_data_mutex); @@ -446,7 +446,7 @@ namespace ams::pgl::srv { bool IsApplicationCrashReportEnabled() { /* Get the application process id. */ - auto application_process_id = GetRunningApplicationProcessId(); + auto application_process_id = GetRunningApplicationProcessIdInternal(); if (!application_process_id) { return false; } @@ -462,7 +462,7 @@ namespace ams::pgl::srv { void EnableApplicationAllThreadDumpOnCrash(bool enabled) { /* Get the application process id. */ - auto application_process_id = GetRunningApplicationProcessId(); + auto application_process_id = GetRunningApplicationProcessIdInternal(); if (application_process_id) { /* Find the data for the application process. */ std::scoped_lock lk(g_process_data_mutex); @@ -486,7 +486,7 @@ namespace ams::pgl::srv { } } - Result TriggerApplicationSnapShotDumper(SnapShotDumpType dump_type, const char *arg) { + Result TriggerSnapShotDumper(SnapShotDumpType dump_type, const char *arg) { /* Try to get the application process id. */ os::ProcessId process_id; R_TRY(pm::shell::GetApplicationProcessIdForShell(std::addressof(process_id))); @@ -495,5 +495,21 @@ namespace ams::pgl::srv { ON_SCOPE_EXIT { g_ssd_process_id = os::InvalidProcessId; }; R_RETURN(TriggerSnapShotDumper(process_id, dump_type, arg)); } + + void EnableApplicationCrashReport2(os::ProcessId process_id, bool enabled) { + /* Find the data for the process. */ + std::scoped_lock lk(g_process_data_mutex); + ProcessData *data = FindProcessData(*process_id); + /* It's okay if we aren't tracking the process. */ + if (data != nullptr) { + /* Set or clear the flag. */ + if (enabled) { + data->flags |= ProcessDataFlag_DetailedCrashReportEnabled; + } else { + data->flags &= ~ProcessDataFlag_DetailedCrashReportEnabled; + } + } + } + } diff --git a/libraries/libstratosphere/source/pgl/srv/pgl_srv_shell.hpp b/libraries/libstratosphere/source/pgl/srv/pgl_srv_shell.hpp index 11228d78a..b4001e4ab 100644 --- a/libraries/libstratosphere/source/pgl/srv/pgl_srv_shell.hpp +++ b/libraries/libstratosphere/source/pgl/srv/pgl_srv_shell.hpp @@ -27,12 +27,13 @@ namespace ams::pgl::srv { Result LaunchProgram(os::ProcessId *out, const ncm::ProgramLocation &loc, u32 pm_flags, u8 pgl_flags); Result TerminateProcess(os::ProcessId process_id); - Result GetApplicationProcessId(os::ProcessId *out); + Result GetRunningApplicationProcessId(os::ProcessId *out); Result BoostSystemMemoryResourceLimit(u64 size); - bool IsProcessTracked(os::ProcessId process_id); + bool IsRunningProcess(os::ProcessId process_id); void EnableApplicationCrashReport(bool enabled); bool IsApplicationCrashReportEnabled(); void EnableApplicationAllThreadDumpOnCrash(bool enabled); - Result TriggerApplicationSnapShotDumper(SnapShotDumpType dump_type, const char *arg); + Result TriggerSnapShotDumper(SnapShotDumpType dump_type, const char *arg); + void EnableApplicationCrashReport2(os::ProcessId process_id, bool enabled); } diff --git a/libraries/libstratosphere/source/pgl/srv/pgl_srv_shell_event_observer.cpp b/libraries/libstratosphere/source/pgl/srv/pgl_srv_shell_event_observer.cpp index 047123d36..e60712816 100644 --- a/libraries/libstratosphere/source/pgl/srv/pgl_srv_shell_event_observer.cpp +++ b/libraries/libstratosphere/source/pgl/srv/pgl_srv_shell_event_observer.cpp @@ -65,21 +65,21 @@ namespace ams::pgl::srv { m_event.Signal(); } - Result ShellEventObserverCmif::GetProcessEventHandle(ams::sf::OutCopyHandle out) { + Result ShellEventObserverCmif::GetShellEvent(ams::sf::OutCopyHandle out) { out.SetValue(this->GetEvent().GetReadableHandle(), false); R_SUCCEED(); } - Result ShellEventObserverCmif::GetProcessEventInfo(ams::sf::Out out) { + Result ShellEventObserverCmif::GetShellEventInfo(ams::sf::Out out) { R_RETURN(this->PopEventInfo(out.GetPointer())); } - Result ShellEventObserverTipc::GetProcessEventHandle(ams::tipc::OutCopyHandle out) { + Result ShellEventObserverTipc::GetShellEvent(ams::tipc::OutCopyHandle out) { out.SetValue(this->GetEvent().GetReadableHandle()); R_SUCCEED(); } - Result ShellEventObserverTipc::GetProcessEventInfo(ams::tipc::Out out) { + Result ShellEventObserverTipc::GetShellEventInfo(ams::tipc::Out out) { R_RETURN(this->PopEventInfo(out.GetPointer())); } diff --git a/libraries/libstratosphere/source/pgl/srv/pgl_srv_shell_event_observer.hpp b/libraries/libstratosphere/source/pgl/srv/pgl_srv_shell_event_observer.hpp index 8fc52d0ed..d55163af1 100644 --- a/libraries/libstratosphere/source/pgl/srv/pgl_srv_shell_event_observer.hpp +++ b/libraries/libstratosphere/source/pgl/srv/pgl_srv_shell_event_observer.hpp @@ -60,15 +60,15 @@ namespace ams::pgl::srv { class ShellEventObserverCmif : public ShellEventObserverImpl { public: - Result GetProcessEventHandle(ams::sf::OutCopyHandle out); - Result GetProcessEventInfo(ams::sf::Out out); + Result GetShellEvent(ams::sf::OutCopyHandle out); + Result GetShellEventInfo(ams::sf::Out out); }; static_assert(pgl::sf::IsIEventObserver); class ShellEventObserverTipc : public ShellEventObserverImpl { public: - Result GetProcessEventHandle(ams::tipc::OutCopyHandle out); - Result GetProcessEventInfo(ams::tipc::Out out); + Result GetShellEvent(ams::tipc::OutCopyHandle out); + Result GetShellEventInfo(ams::tipc::Out out); }; static_assert(pgl::tipc::IsIEventObserver); diff --git a/libraries/libstratosphere/source/pgl/srv/pgl_srv_shell_host_utils.cpp b/libraries/libstratosphere/source/pgl/srv/pgl_srv_shell_host_utils.cpp index 720ff476a..0cb14b620 100644 --- a/libraries/libstratosphere/source/pgl/srv/pgl_srv_shell_host_utils.cpp +++ b/libraries/libstratosphere/source/pgl/srv/pgl_srv_shell_host_utils.cpp @@ -335,7 +335,7 @@ namespace ams::pgl::srv { R_RETURN(pgl::srv::LaunchProgram(out, ncm::ProgramLocation::Make(reader.GetProgramId(), ncm::StorageId::Host), pm_flags, pgl::LaunchFlags_None)); } - Result GetHostContentMetaInfo(pgl::ContentMetaInfo *out, const char *package_path) { + Result GetProgramLaunchPropertyFromHost(pgl::ProgramLaunchProperty *out, const char *package_path) { /* Read the package. */ HostPackageReader reader; R_TRY(reader.Initialize(package_path, HostPackageMountName)); @@ -343,7 +343,7 @@ namespace ams::pgl::srv { /* Read the program info. */ R_TRY(reader.ReadProgramInfo()); - /* Get the content meta info. */ + /* Get the program launch property. */ *out = { .id = reader.GetProgramId().value, .version = reader.GetProgramVersion(), diff --git a/libraries/libstratosphere/source/pgl/srv/pgl_srv_shell_host_utils.hpp b/libraries/libstratosphere/source/pgl/srv/pgl_srv_shell_host_utils.hpp index 263f813b7..d09755fb9 100644 --- a/libraries/libstratosphere/source/pgl/srv/pgl_srv_shell_host_utils.hpp +++ b/libraries/libstratosphere/source/pgl/srv/pgl_srv_shell_host_utils.hpp @@ -19,6 +19,6 @@ namespace ams::pgl::srv { Result LaunchProgramFromHost(os::ProcessId *out, const char *content_path, u32 pm_flags); - Result GetHostContentMetaInfo(pgl::ContentMetaInfo *out, const char *content_path); + Result GetProgramLaunchPropertyFromHost(pgl::ProgramLaunchProperty *out, const char *content_path); } diff --git a/libraries/libstratosphere/source/pgl/srv/pgl_srv_shell_interface.cpp b/libraries/libstratosphere/source/pgl/srv/pgl_srv_shell_interface.cpp index f6c018bf0..63a53f892 100644 --- a/libraries/libstratosphere/source/pgl/srv/pgl_srv_shell_interface.cpp +++ b/libraries/libstratosphere/source/pgl/srv/pgl_srv_shell_interface.cpp @@ -34,21 +34,21 @@ namespace ams::pgl::srv { R_RETURN(pgl::srv::LaunchProgramFromHost(out, static_cast(content_path), pm_flags)); } - Result ShellInterfaceCommon::GetHostContentMetaInfoImpl(pgl::ContentMetaInfo *out, const void *content_path, size_t content_path_size) { + Result ShellInterfaceCommon::GetProgramLaunchPropertyFromHostImpl(pgl::ProgramLaunchProperty *out, const void *content_path, size_t content_path_size) { AMS_UNUSED(content_path_size); - R_RETURN(pgl::srv::GetHostContentMetaInfo(out, static_cast(content_path))); + R_RETURN(pgl::srv::GetProgramLaunchPropertyFromHost(out, static_cast(content_path))); } - Result ShellInterfaceCommon::GetApplicationProcessIdImpl(os::ProcessId *out) { - R_RETURN(pgl::srv::GetApplicationProcessId(out)); + Result ShellInterfaceCommon::GetRunningApplicationProcessIdImpl(os::ProcessId *out) { + R_RETURN(pgl::srv::GetRunningApplicationProcessId(out)); } Result ShellInterfaceCommon::BoostSystemMemoryResourceLimitImpl(u64 size) { R_RETURN(pgl::srv::BoostSystemMemoryResourceLimit(size)); } - Result ShellInterfaceCommon::IsProcessTrackedImpl(bool *out, os::ProcessId process_id) { - *out = pgl::srv::IsProcessTracked(process_id); + Result ShellInterfaceCommon::IsRunningProcessImpl(bool *out, os::ProcessId process_id) { + *out = pgl::srv::IsRunningProcess(process_id); R_SUCCEED(); } @@ -67,13 +67,18 @@ namespace ams::pgl::srv { R_SUCCEED(); } - Result ShellInterfaceCommon::GetProcessId(os::ProcessId *out, ncm::ProgramId program_id) { + Result ShellInterfaceCommon::GetProcessIdImpl(os::ProcessId *out, ncm::ProgramId program_id) { R_RETURN(pm::shell::GetProcessId(out, program_id)); } - Result ShellInterfaceCommon::TriggerApplicationSnapShotDumperImpl(SnapShotDumpType dump_type, const void *arg, size_t arg_size) { + Result ShellInterfaceCommon::TriggerSnapShotDumperImpl(SnapShotDumpType dump_type, const void *arg, size_t arg_size) { AMS_UNUSED(arg_size); - R_RETURN(pgl::srv::TriggerApplicationSnapShotDumper(dump_type, static_cast(arg))); + R_RETURN(pgl::srv::TriggerSnapShotDumper(dump_type, static_cast(arg))); + } + + Result ShellInterfaceCommon::EnableApplicationCrashReport2Impl(os::ProcessId process_id, bool enabled) { + pgl::srv::EnableApplicationCrashReport2(process_id, enabled); + R_SUCCEED(); } Result ShellInterfaceCmif::LaunchProgram(ams::sf::Out out, const ncm::ProgramLocation &loc, u32 pm_flags, u8 pgl_flags) { @@ -88,20 +93,20 @@ namespace ams::pgl::srv { R_RETURN(this->LaunchProgramFromHostImpl(out.GetPointer(), content_path.GetPointer(), content_path.GetSize(), pm_flags)); } - Result ShellInterfaceCmif::GetHostContentMetaInfo(ams::sf::Out out, const ams::sf::InBuffer &content_path) { - R_RETURN(this->GetHostContentMetaInfoImpl(out.GetPointer(), content_path.GetPointer(), content_path.GetSize())); + Result ShellInterfaceCmif::GetProgramLaunchPropertyFromHost(ams::sf::Out out, const ams::sf::InBuffer &content_path) { + R_RETURN(this->GetProgramLaunchPropertyFromHostImpl(out.GetPointer(), content_path.GetPointer(), content_path.GetSize())); } - Result ShellInterfaceCmif::GetApplicationProcessId(ams::sf::Out out) { - R_RETURN(this->GetApplicationProcessIdImpl(out.GetPointer())); + Result ShellInterfaceCmif::GetRunningApplicationProcessId(ams::sf::Out out) { + R_RETURN(this->GetRunningApplicationProcessIdImpl(out.GetPointer())); } Result ShellInterfaceCmif::BoostSystemMemoryResourceLimit(u64 size) { R_RETURN(this->BoostSystemMemoryResourceLimitImpl(size)); } - Result ShellInterfaceCmif::IsProcessTracked(ams::sf::Out out, os::ProcessId process_id) { - R_RETURN(this->IsProcessTrackedImpl(out.GetPointer(), process_id)); + Result ShellInterfaceCmif::IsRunningProcess(ams::sf::Out out, os::ProcessId process_id) { + R_RETURN(this->IsRunningProcessImpl(out.GetPointer(), process_id)); } Result ShellInterfaceCmif::EnableApplicationCrashReport(bool enabled) { @@ -116,15 +121,11 @@ namespace ams::pgl::srv { R_RETURN(this->EnableApplicationAllThreadDumpOnCrashImpl(enabled)); } - Result ShellInterfaceCmif::TriggerApplicationSnapShotDumper(SnapShotDumpType dump_type, const ams::sf::InBuffer &arg) { - R_RETURN(this->TriggerApplicationSnapShotDumperImpl(dump_type, arg.GetPointer(), arg.GetSize())); + Result ShellInterfaceCmif::TriggerSnapShotDumper(SnapShotDumpType dump_type, const ams::sf::InBuffer &arg) { + R_RETURN(this->TriggerSnapShotDumperImpl(dump_type, arg.GetPointer(), arg.GetSize())); } - Result ShellInterfaceCmif::GetProcessId(ams::sf::Out out, ncm::ProgramId program_id) { - R_RETURN(ShellInterfaceCommon::GetProcessId(out.GetPointer(), program_id)); - } - - Result ShellInterfaceCmif::GetShellEventObserver(ams::sf::Out> out) { + Result ShellInterfaceCmif::CreateShellEvent(ams::sf::Out> out) { /* Allocate a new interface. */ auto session = ObjectFactory::CreateSharedEmplaced(m_allocator); R_UNLESS(session != nullptr, pgl::ResultOutOfMemory()); @@ -150,20 +151,20 @@ namespace ams::pgl::srv { R_RETURN(this->LaunchProgramFromHostImpl(out.GetPointer(), content_path.GetPointer(), content_path.GetSize(), pm_flags)); } - Result ShellInterfaceTipc::GetHostContentMetaInfo(ams::tipc::Out out, const ams::tipc::InBuffer content_path) { - R_RETURN(this->GetHostContentMetaInfoImpl(out.GetPointer(), content_path.GetPointer(), content_path.GetSize())); + Result ShellInterfaceTipc::GetProgramLaunchPropertyFromHost(ams::tipc::Out out, const ams::tipc::InBuffer content_path) { + R_RETURN(this->GetProgramLaunchPropertyFromHostImpl(out.GetPointer(), content_path.GetPointer(), content_path.GetSize())); } - Result ShellInterfaceTipc::GetApplicationProcessId(ams::tipc::Out out) { - R_RETURN(this->GetApplicationProcessIdImpl(out.GetPointer())); + Result ShellInterfaceTipc::GetRunningApplicationProcessId(ams::tipc::Out out) { + R_RETURN(this->GetRunningApplicationProcessIdImpl(out.GetPointer())); } Result ShellInterfaceTipc::BoostSystemMemoryResourceLimit(u64 size) { R_RETURN(this->BoostSystemMemoryResourceLimitImpl(size)); } - Result ShellInterfaceTipc::IsProcessTracked(ams::tipc::Out out, os::ProcessId process_id) { - R_RETURN(this->IsProcessTrackedImpl(out.GetPointer(), process_id)); + Result ShellInterfaceTipc::IsRunningProcess(ams::tipc::Out out, os::ProcessId process_id) { + R_RETURN(this->IsRunningProcessImpl(out.GetPointer(), process_id)); } Result ShellInterfaceTipc::EnableApplicationCrashReport(bool enabled) { @@ -179,11 +180,14 @@ namespace ams::pgl::srv { } Result ShellInterfaceTipc::GetProcessId(ams::tipc::Out out, ncm::ProgramId program_id) { - R_RETURN(ShellInterfaceCommon::GetProcessId(out.GetPointer(), program_id)); + R_RETURN(this->GetProcessIdImpl(out.GetPointer(), program_id)); } - Result ShellInterfaceTipc::GetShellEventObserver(ams::tipc::OutMoveHandle out) { + Result ShellInterfaceTipc::CreateShellEvent(ams::tipc::OutMoveHandle out) { R_RETURN(pgl::srv::AllocateShellEventObserverForTipc(out.GetPointer())); } - + + Result ShellInterfaceTipc::EnableApplicationCrashReport2(os::ProcessId process_id, bool enabled) { + R_RETURN(this->EnableApplicationCrashReport2Impl(process_id, enabled)); + } }