From e2c855d4ef9794f357c877990b9f884864546239 Mon Sep 17 00:00:00 2001 From: Michael Scire Date: Mon, 30 Nov 2020 22:06:52 -0800 Subject: [PATCH] loader: update for 11.0.0 (anti-dg + set program args abi) --- .../include/stratosphere/hos/hos_types.hpp | 2 ++ .../ldr/impl/ldr_debug_monitor_interface.hpp | 11 ++++---- .../ldr/impl/ldr_shell_interface.hpp | 9 +++--- .../pgl/sf/pgl_sf_i_shell_interface.hpp | 28 +++++++++---------- 4 files changed, 27 insertions(+), 23 deletions(-) diff --git a/libstratosphere/include/stratosphere/hos/hos_types.hpp b/libstratosphere/include/stratosphere/hos/hos_types.hpp index 961fc280..e7017d82 100644 --- a/libstratosphere/include/stratosphere/hos/hos_types.hpp +++ b/libstratosphere/include/stratosphere/hos/hos_types.hpp @@ -57,6 +57,8 @@ namespace ams::hos { Version_10_0_3 = ::ams::TargetFirmware_10_0_3, Version_10_0_4 = ::ams::TargetFirmware_10_0_4, Version_10_1_0 = ::ams::TargetFirmware_10_1_0, + Version_10_2_0 = ::ams::TargetFirmware_10_2_0, + Version_11_0_0 = ::ams::TargetFirmware_11_0_0, Version_Current = ::ams::TargetFirmware_Current, diff --git a/libstratosphere/include/stratosphere/ldr/impl/ldr_debug_monitor_interface.hpp b/libstratosphere/include/stratosphere/ldr/impl/ldr_debug_monitor_interface.hpp index 328ae400..3ecfdb7e 100644 --- a/libstratosphere/include/stratosphere/ldr/impl/ldr_debug_monitor_interface.hpp +++ b/libstratosphere/include/stratosphere/ldr/impl/ldr_debug_monitor_interface.hpp @@ -21,11 +21,12 @@ namespace ams::ldr::impl { - #define AMS_LDR_I_DEBUG_MONITOR_INTERFACE_INTERFACE_INFO(C, H) \ - AMS_SF_METHOD_INFO(C, H, 0, Result, SetProgramArguments, (ncm::ProgramId program_id, const sf::InPointerBuffer &args, u32 args_size)) \ - AMS_SF_METHOD_INFO(C, H, 1, Result, FlushArguments, ()) \ - AMS_SF_METHOD_INFO(C, H, 2, Result, GetProcessModuleInfo, (sf::Out count, const sf::OutPointerArray &out, os::ProcessId process_id)) \ - AMS_SF_METHOD_INFO(C, H, 65000, void, AtmosphereHasLaunchedProgram, (sf::Out out, ncm::ProgramId program_id)) + #define AMS_LDR_I_DEBUG_MONITOR_INTERFACE_INTERFACE_INFO(C, H) \ + AMS_SF_METHOD_INFO(C, H, 0, Result, SetProgramArgumentsDeprecated, (ncm::ProgramId program_id, const sf::InPointerBuffer &args, u32 args_size), hos::Version_Min, hos::Version_10_2_0) \ + AMS_SF_METHOD_INFO(C, H, 0, Result, SetProgramArguments, (ncm::ProgramId program_id, const sf::InPointerBuffer &args), hos::Version_11_0_0 ) \ + AMS_SF_METHOD_INFO(C, H, 1, Result, FlushArguments, ()) \ + AMS_SF_METHOD_INFO(C, H, 2, Result, GetProcessModuleInfo, (sf::Out count, const sf::OutPointerArray &out, os::ProcessId process_id)) \ + AMS_SF_METHOD_INFO(C, H, 65000, void, AtmosphereHasLaunchedProgram, (sf::Out out, ncm::ProgramId program_id)) AMS_SF_DEFINE_INTERFACE(IDebugMonitorInterface, AMS_LDR_I_DEBUG_MONITOR_INTERFACE_INTERFACE_INFO) diff --git a/libstratosphere/include/stratosphere/ldr/impl/ldr_shell_interface.hpp b/libstratosphere/include/stratosphere/ldr/impl/ldr_shell_interface.hpp index 5e3e3118..6f8984ee 100644 --- a/libstratosphere/include/stratosphere/ldr/impl/ldr_shell_interface.hpp +++ b/libstratosphere/include/stratosphere/ldr/impl/ldr_shell_interface.hpp @@ -21,10 +21,11 @@ namespace ams::ldr::impl { - #define AMS_LDR_I_SHELL_INTERFACE_INTERFACE_INFO(C, H) \ - AMS_SF_METHOD_INFO(C, H, 0, Result, SetProgramArguments, (ncm::ProgramId program_id, const sf::InPointerBuffer &args, u32 args_size)) \ - AMS_SF_METHOD_INFO(C, H, 1, Result, FlushArguments, ()) \ - AMS_SF_METHOD_INFO(C, H, 65000, Result, AtmosphereRegisterExternalCode, (sf::OutMoveHandle out, ncm::ProgramId program_id)) \ + #define AMS_LDR_I_SHELL_INTERFACE_INTERFACE_INFO(C, H) \ + AMS_SF_METHOD_INFO(C, H, 0, Result, SetProgramArgumentsDeprecated, (ncm::ProgramId program_id, const sf::InPointerBuffer &args, u32 args_size), hos::Version_Min, hos::Version_10_2_0) \ + AMS_SF_METHOD_INFO(C, H, 0, Result, SetProgramArguments, (ncm::ProgramId program_id, const sf::InPointerBuffer &args), hos::Version_11_0_0 ) \ + AMS_SF_METHOD_INFO(C, H, 1, Result, FlushArguments, ()) \ + AMS_SF_METHOD_INFO(C, H, 65000, Result, AtmosphereRegisterExternalCode, (sf::OutMoveHandle out, ncm::ProgramId program_id)) \ AMS_SF_METHOD_INFO(C, H, 65001, void, AtmosphereUnregisterExternalCode, (ncm::ProgramId program_id)) AMS_SF_DEFINE_INTERFACE(IShellInterface, AMS_LDR_I_SHELL_INTERFACE_INTERFACE_INFO) diff --git a/libstratosphere/include/stratosphere/pgl/sf/pgl_sf_i_shell_interface.hpp b/libstratosphere/include/stratosphere/pgl/sf/pgl_sf_i_shell_interface.hpp index e4339411..d202f4f7 100644 --- a/libstratosphere/include/stratosphere/pgl/sf/pgl_sf_i_shell_interface.hpp +++ b/libstratosphere/include/stratosphere/pgl/sf/pgl_sf_i_shell_interface.hpp @@ -23,20 +23,20 @@ namespace ams::pgl::sf { - #define AMS_PGL_I_SHELL_INTERFACE_INTERFACE_INFO(C, H) \ - AMS_SF_METHOD_INFO(C, H, 0, Result, LaunchProgram, (ams::sf::Out out, const ncm::ProgramLocation &loc, u32 pm_flags, u8 pgl_flags)) \ - AMS_SF_METHOD_INFO(C, H, 1, Result, TerminateProcess, (os::ProcessId process_id)) \ - AMS_SF_METHOD_INFO(C, H, 2, Result, LaunchProgramFromHost, (ams::sf::Out out, const ams::sf::InBuffer &content_path, u32 pm_flags)) \ - AMS_SF_METHOD_INFO(C, H, 4, Result, GetHostContentMetaInfo, (ams::sf::Out out, const ams::sf::InBuffer &content_path)) \ - AMS_SF_METHOD_INFO(C, H, 5, Result, GetApplicationProcessId, (ams::sf::Out out)) \ - AMS_SF_METHOD_INFO(C, H, 6, Result, BoostSystemMemoryResourceLimit, (u64 size)) \ - AMS_SF_METHOD_INFO(C, H, 7, Result, IsProcessTracked, (ams::sf::Out out, os::ProcessId process_id)) \ - AMS_SF_METHOD_INFO(C, H, 8, Result, EnableApplicationCrashReport, (bool enabled)) \ - AMS_SF_METHOD_INFO(C, H, 9, Result, IsApplicationCrashReportEnabled, (ams::sf::Out out)) \ - AMS_SF_METHOD_INFO(C, H, 10, Result, EnableApplicationAllThreadDumpOnCrash, (bool enabled)) \ - AMS_SF_METHOD_INFO(C, H, 12, Result, TriggerApplicationSnapShotDumper, (SnapShotDumpType dump_type, const ams::sf::InBuffer &arg)) \ - AMS_SF_METHOD_INFO(C, H, 20, Result, GetShellEventObserver, (ams::sf::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)) + #define AMS_PGL_I_SHELL_INTERFACE_INTERFACE_INFO(C, H) \ + AMS_SF_METHOD_INFO(C, H, 0, Result, LaunchProgram, (ams::sf::Out out, const ncm::ProgramLocation &loc, u32 pm_flags, u8 pgl_flags)) \ + AMS_SF_METHOD_INFO(C, H, 1, Result, TerminateProcess, (os::ProcessId process_id)) \ + AMS_SF_METHOD_INFO(C, H, 2, Result, LaunchProgramFromHost, (ams::sf::Out out, const ams::sf::InBuffer &content_path, u32 pm_flags)) \ + AMS_SF_METHOD_INFO(C, H, 4, Result, GetHostContentMetaInfo, (ams::sf::Out out, const ams::sf::InBuffer &content_path)) \ + AMS_SF_METHOD_INFO(C, H, 5, Result, GetApplicationProcessId, (ams::sf::Out out)) \ + AMS_SF_METHOD_INFO(C, H, 6, Result, BoostSystemMemoryResourceLimit, (u64 size)) \ + AMS_SF_METHOD_INFO(C, H, 7, Result, IsProcessTracked, (ams::sf::Out out, os::ProcessId process_id)) \ + AMS_SF_METHOD_INFO(C, H, 8, Result, EnableApplicationCrashReport, (bool enabled)) \ + AMS_SF_METHOD_INFO(C, H, 9, Result, IsApplicationCrashReportEnabled, (ams::sf::Out out)) \ + AMS_SF_METHOD_INFO(C, H, 10, Result, EnableApplicationAllThreadDumpOnCrash, (bool enabled)) \ + AMS_SF_METHOD_INFO(C, H, 12, Result, TriggerApplicationSnapShotDumper, (SnapShotDumpType dump_type, const ams::sf::InBuffer &arg)) \ + AMS_SF_METHOD_INFO(C, H, 20, Result, GetShellEventObserver, (ams::sf::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), hos::Version_11_0_0) AMS_SF_DEFINE_INTERFACE(IShellInterface, AMS_PGL_I_SHELL_INTERFACE_INTERFACE_INFO);