2019-12-09 12:57:37 +01:00
|
|
|
/*
|
2021-10-04 21:59:10 +02:00
|
|
|
* Copyright (c) Atmosphère-NX
|
2019-12-09 12:57:37 +01:00
|
|
|
*
|
|
|
|
* 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 <http://www.gnu.org/licenses/>.
|
|
|
|
*/
|
2020-05-12 00:02:10 +02:00
|
|
|
#include <stratosphere.hpp>
|
2019-12-09 12:57:37 +01:00
|
|
|
#include "sm_utils.hpp"
|
2022-03-06 21:08:20 +01:00
|
|
|
|
|
|
|
#if defined(ATMOSPHERE_OS_HORIZON)
|
|
|
|
#include "smm_ams.os.horizon.h"
|
|
|
|
#endif
|
2019-12-09 12:57:37 +01:00
|
|
|
|
|
|
|
namespace ams::sm::manager {
|
|
|
|
|
2022-03-06 21:08:20 +01:00
|
|
|
#if defined(ATMOSPHERE_OS_HORIZON)
|
2019-12-09 12:57:37 +01:00
|
|
|
/* Manager API. */
|
|
|
|
Result RegisterProcess(os::ProcessId process_id, ncm::ProgramId program_id, cfg::OverrideStatus status, const void *acid, size_t acid_size, const void *aci, size_t aci_size) {
|
|
|
|
static_assert(sizeof(status) == sizeof(CfgOverrideStatus), "CfgOverrideStatus definition");
|
2022-03-26 22:48:33 +01:00
|
|
|
R_RETURN(smManagerAtmosphereRegisterProcess(static_cast<u64>(process_id), static_cast<u64>(program_id), reinterpret_cast<const CfgOverrideStatus *>(std::addressof(status)), acid, acid_size, aci, aci_size));
|
2019-12-09 12:57:37 +01:00
|
|
|
}
|
|
|
|
|
|
|
|
Result UnregisterProcess(os::ProcessId process_id) {
|
2022-03-26 22:48:33 +01:00
|
|
|
R_RETURN(smManagerUnregisterProcess(static_cast<u64>(process_id)));
|
2019-12-09 12:57:37 +01:00
|
|
|
}
|
|
|
|
|
|
|
|
/* Atmosphere extensions. */
|
|
|
|
Result EndInitialDefers() {
|
2022-03-26 22:48:33 +01:00
|
|
|
R_RETURN(smManagerAtmosphereEndInitialDefers());
|
2019-12-09 12:57:37 +01:00
|
|
|
}
|
|
|
|
|
|
|
|
Result HasMitm(bool *out, ServiceName name) {
|
2022-03-26 22:48:33 +01:00
|
|
|
R_RETURN(smManagerAtmosphereHasMitm(out, impl::ConvertName(name)));
|
2019-12-09 12:57:37 +01:00
|
|
|
}
|
2022-03-06 21:08:20 +01:00
|
|
|
#endif
|
2019-12-09 12:57:37 +01:00
|
|
|
|
|
|
|
}
|