diff --git a/libraries/libstratosphere/include/stratosphere/pgl.hpp b/libraries/libstratosphere/include/stratosphere/pgl.hpp index 3d2ffeb81..c1ac74f9d 100644 --- a/libraries/libstratosphere/include/stratosphere/pgl.hpp +++ b/libraries/libstratosphere/include/stratosphere/pgl.hpp @@ -19,3 +19,4 @@ #include #include #include +#include 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 new file mode 100644 index 000000000..64d464cfd --- /dev/null +++ b/libraries/libstratosphere/include/stratosphere/pgl/sf/pgl_sf_i_shell_interface.hpp @@ -0,0 +1,74 @@ +/* + * Copyright (c) 2018-2020 Atmosphère-NX + * + * This program is free software; you can redistribute it and/or modify it + * under the terms and conditions of the GNU General Public License, + * version 2, as published by the Free Software Foundation. + * + * This program is distributed in the hope it will be useful, but WITHOUT + * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or + * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for + * more details. + * + * You should have received a copy of the GNU General Public License + * along with this program. If not, see . + */ + +#pragma once +#include +#include +#include +#include +#include + +namespace ams::pgl::sf { + + class IShellInterface : public ams::sf::IServiceObject { + protected: + enum class CommandId { + LaunchProgram = 0, + TerminateProcess = 1, + LaunchProgramFromHost = 2, + GetHostContentMetaInfo = 4, + GetApplicationProcessId = 5, + BoostSystemMemoryResourceLimit = 6, + IsProcessTracked = 7, + EnableApplicationCrashReport = 8, + IsApplicationCrashReportEnabled = 9, + EnableApplicationAllThreadDumpOnCrash = 10, + TriggerSnapShotDumper = 12, + GetShellEventObserver = 20, + }; + public: + /* Actual commands. */ + virtual Result LaunchProgram(ams::sf::Out out, const ncm::ProgramLocation &loc, u32 pm_flags, u8 pgl_flags) = 0; + virtual Result TerminateProcess(os::ProcessId process_id) = 0; + virtual Result LaunchProgramFromHost(ams::sf::Out out, const ams::sf::InBuffer &content_path, u32 pm_flags) = 0; + virtual Result GetHostContentMetaInfo(ams::sf::Out out, const ams::sf::InBuffer &content_path) = 0; + virtual Result GetApplicationProcessId(ams::sf::Out out) = 0; + virtual Result BoostSystemMemoryResourceLimit(u64 size) = 0; + virtual Result IsProcessTracked(ams::sf::Out out, os::ProcessId process_id) = 0; + virtual Result EnableApplicationCrashReport(bool enabled) = 0; + virtual Result IsApplicationCrashReportEnabled(ams::sf::Out out) = 0; + virtual Result EnableApplicationAllThreadDumpOnCrash(bool enabled) = 0; + virtual Result TriggerSnapShotDumper(const ams::sf::InBuffer &arg, SnapShotDumpType dump_type) = 0; + + virtual Result GetShellEventObserver(ams::sf::Out> out) = 0; + public: + DEFINE_SERVICE_DISPATCH_TABLE { + MAKE_SERVICE_COMMAND_META(LaunchProgram), + MAKE_SERVICE_COMMAND_META(TerminateProcess), + MAKE_SERVICE_COMMAND_META(LaunchProgramFromHost), + MAKE_SERVICE_COMMAND_META(GetHostContentMetaInfo), + MAKE_SERVICE_COMMAND_META(GetApplicationProcessId), + MAKE_SERVICE_COMMAND_META(BoostSystemMemoryResourceLimit), + MAKE_SERVICE_COMMAND_META(IsProcessTracked), + MAKE_SERVICE_COMMAND_META(EnableApplicationCrashReport), + MAKE_SERVICE_COMMAND_META(IsApplicationCrashReportEnabled), + MAKE_SERVICE_COMMAND_META(EnableApplicationAllThreadDumpOnCrash), + MAKE_SERVICE_COMMAND_META(TriggerSnapShotDumper), + MAKE_SERVICE_COMMAND_META(GetShellEventObserver), + }; + }; + +} \ No newline at end of file