mirror of
https://github.com/Atmosphere-NX/Atmosphere.git
synced 2025-11-17 17:41:18 +01:00
pgl/pm: add GetProcessId command
This commit is contained in:
parent
0fb9481e59
commit
4b32a2b964
@ -32,6 +32,7 @@
|
||||
AMS_SF_METHOD_INFO(C, H, 8, Result, EnableApplicationCrashReport, (bool enabled), (enabled)) \
|
||||
AMS_SF_METHOD_INFO(C, H, 9, Result, IsApplicationCrashReportEnabled, (ams::sf::Out<bool> 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<os::ProcessId> 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<ams::sf::SharedPointer<pgl::sf::IEventObserver>> out), (out)) \
|
||||
AMS_SF_METHOD_INFO(C, H, 21, Result, Command21NotImplemented, (ams::sf::Out<u64> out, u32 in, const ams::sf::InBuffer &buf1, const ams::sf::InBuffer &buf2), (out, in, buf1, buf2), hos::Version_11_0_0)
|
||||
|
||||
@ -37,6 +37,7 @@ namespace ams::pgl::srv {
|
||||
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);
|
||||
};
|
||||
|
||||
@ -62,6 +63,7 @@ namespace ams::pgl::srv {
|
||||
Result EnableApplicationCrashReport(bool enabled);
|
||||
Result IsApplicationCrashReportEnabled(ams::sf::Out<bool> out);
|
||||
Result EnableApplicationAllThreadDumpOnCrash(bool enabled);
|
||||
Result GetProcessId(ams::sf::Out<os::ProcessId> out, ncm::ProgramId program_id);
|
||||
Result TriggerApplicationSnapShotDumper(SnapShotDumpType dump_type, const ams::sf::InBuffer &arg);
|
||||
|
||||
Result GetShellEventObserver(ams::sf::Out<ams::sf::SharedPointer<pgl::sf::IEventObserver>> out);
|
||||
@ -86,6 +88,7 @@ namespace ams::pgl::srv {
|
||||
Result EnableApplicationCrashReport(bool enabled);
|
||||
Result IsApplicationCrashReportEnabled(ams::tipc::Out<bool> out);
|
||||
Result EnableApplicationAllThreadDumpOnCrash(bool enabled);
|
||||
Result GetProcessId(ams::tipc::Out<os::ProcessId> out, ncm::ProgramId program_id);
|
||||
Result GetShellEventObserver(ams::tipc::OutMoveHandle out);
|
||||
};
|
||||
static_assert(pgl::tipc::IsIShellInterface<ShellInterfaceTipc>);
|
||||
|
||||
@ -30,7 +30,8 @@
|
||||
AMS_SF_METHOD_INFO(C, H, 7, Result, BoostSystemMemoryResourceLimit, (u64 boost_size), (boost_size)) \
|
||||
AMS_SF_METHOD_INFO(C, H, 8, Result, BoostApplicationThreadResourceLimit, (), ()) \
|
||||
AMS_SF_METHOD_INFO(C, H, 9, void, GetBootFinishedEventHandle, (sf::OutCopyHandle out), (out), hos::Version_8_0_0) \
|
||||
AMS_SF_METHOD_INFO(C, H, 10, Result, BoostSystemThreadResourceLimit, (), ())
|
||||
AMS_SF_METHOD_INFO(C, H, 10, Result, BoostSystemThreadResourceLimit, (), ()) \
|
||||
AMS_SF_METHOD_INFO(C, H, 12, Result, GetProcessId, (sf::Out<os::ProcessId> out, ncm::ProgramId program_id), (out, program_id))
|
||||
|
||||
AMS_SF_DEFINE_INTERFACE(ams::pm::impl, IShellInterface, AMS_PM_I_SHELL_INTERFACE_INTERFACE_INFO, 0x387D60C0)
|
||||
|
||||
@ -45,6 +46,7 @@ AMS_SF_DEFINE_INTERFACE(ams::pm::impl, IShellInterface, AMS_PM_I_SHELL_INTERFACE
|
||||
AMS_SF_METHOD_INFO(C, H, 7, void, NotifyBootFinished, (), ()) \
|
||||
AMS_SF_METHOD_INFO(C, H, 8, Result, GetApplicationProcessIdForShell, (sf::Out<os::ProcessId> out), (out)) \
|
||||
AMS_SF_METHOD_INFO(C, H, 9, Result, BoostSystemMemoryResourceLimit, (u64 boost_size), (boost_size), hos::Version_4_0_0) \
|
||||
AMS_SF_METHOD_INFO(C, H, 10, Result, BoostSystemThreadResourceLimit, (), ())
|
||||
AMS_SF_METHOD_INFO(C, H, 10, Result, BoostSystemThreadResourceLimit, (), ()) \
|
||||
AMS_SF_METHOD_INFO(C, H, 12, Result, GetProcessId, (sf::Out<os::ProcessId> out, ncm::ProgramId program_id), (out, program_id))
|
||||
|
||||
AMS_SF_DEFINE_INTERFACE(ams::pm::impl, IDeprecatedShellInterface, AMS_PM_I_DEPRECATED_SHELL_INTERFACE_INTERFACE_INFO, 0x387D60C0)
|
||||
|
||||
@ -31,5 +31,6 @@ namespace ams::pm::shell {
|
||||
Result BoostSystemMemoryResourceLimit(u64 size);
|
||||
Result BoostApplicationThreadResourceLimit();
|
||||
Result BoostSystemThreadResourceLimit();
|
||||
Result GetProcessId(os::ProcessId *out_process_id, const ncm::ProgramId program_id);
|
||||
|
||||
}
|
||||
|
||||
@ -67,6 +67,10 @@ namespace ams::pgl::srv {
|
||||
R_SUCCEED();
|
||||
}
|
||||
|
||||
Result ShellInterfaceCommon::GetProcessId(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) {
|
||||
AMS_UNUSED(arg_size);
|
||||
R_RETURN(pgl::srv::TriggerApplicationSnapShotDumper(dump_type, static_cast<const char *>(arg)));
|
||||
@ -116,6 +120,10 @@ namespace ams::pgl::srv {
|
||||
R_RETURN(this->TriggerApplicationSnapShotDumperImpl(dump_type, arg.GetPointer(), arg.GetSize()));
|
||||
}
|
||||
|
||||
Result ShellInterfaceCmif::GetProcessId(ams::sf::Out<os::ProcessId> out, ncm::ProgramId program_id) {
|
||||
R_RETURN(ShellInterfaceCommon::GetProcessId(out.GetPointer(), program_id));
|
||||
}
|
||||
|
||||
Result ShellInterfaceCmif::GetShellEventObserver(ams::sf::Out<ams::sf::SharedPointer<pgl::sf::IEventObserver>> out) {
|
||||
/* Allocate a new interface. */
|
||||
auto session = ObjectFactory::CreateSharedEmplaced<pgl::sf::IEventObserver, ShellEventObserverCmif>(m_allocator);
|
||||
@ -170,6 +178,10 @@ namespace ams::pgl::srv {
|
||||
R_RETURN(this->EnableApplicationAllThreadDumpOnCrashImpl(enabled));
|
||||
}
|
||||
|
||||
Result ShellInterfaceTipc::GetProcessId(ams::tipc::Out<os::ProcessId> out, ncm::ProgramId program_id) {
|
||||
R_RETURN(ShellInterfaceCommon::GetProcessId(out.GetPointer(), program_id));
|
||||
}
|
||||
|
||||
Result ShellInterfaceTipc::GetShellEventObserver(ams::tipc::OutMoveHandle out) {
|
||||
R_RETURN(pgl::srv::AllocateShellEventObserverForTipc(out.GetPointer()));
|
||||
}
|
||||
|
||||
@ -58,6 +58,11 @@ namespace ams::pm::shell {
|
||||
Result BoostSystemThreadResourceLimit() {
|
||||
R_RETURN(::pmshellBoostSystemThreadResourceLimit());
|
||||
}
|
||||
|
||||
Result GetProcessId(os::ProcessId *out_process_id, const ncm::ProgramId program_id) {
|
||||
static_assert(sizeof(*out_process_id) == sizeof(u64));
|
||||
R_RETURN(::pmshellGetProcessId(reinterpret_cast<u64 *>(out_process_id), static_cast<u64>(program_id)));
|
||||
}
|
||||
#endif
|
||||
|
||||
}
|
||||
|
||||
@ -88,4 +88,8 @@ namespace ams::pm {
|
||||
R_RETURN(impl::BoostSystemThreadResourceLimit());
|
||||
}
|
||||
|
||||
Result ShellService::GetProcessId(sf::Out<os::ProcessId> out, ncm::ProgramId program_id) {
|
||||
R_RETURN(impl::GetProcessId(out.GetPointer(), program_id));
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
@ -34,6 +34,7 @@ namespace ams::pm {
|
||||
Result BoostApplicationThreadResourceLimit();
|
||||
void GetBootFinishedEventHandle(sf::OutCopyHandle out);
|
||||
Result BoostSystemThreadResourceLimit();
|
||||
Result GetProcessId(sf::Out<os::ProcessId> out, ncm::ProgramId program_id);
|
||||
};
|
||||
static_assert(pm::impl::IsIShellInterface<ShellService>);
|
||||
|
||||
|
||||
Loading…
Reference in New Issue
Block a user