2021-12-07 07:11:26 +00:00
|
|
|
/*
|
|
|
|
* Copyright (c) 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 <http://www.gnu.org/licenses/>.
|
|
|
|
*/
|
|
|
|
#pragma once
|
|
|
|
#include <vapours.hpp>
|
|
|
|
#include <stratosphere/fssrv/sf/fssrv_sf_i_program_registry.hpp>
|
|
|
|
|
|
|
|
namespace ams::fssrv {
|
|
|
|
|
2021-12-07 10:04:39 +00:00
|
|
|
class ProgramRegistryServiceImpl;
|
|
|
|
|
2021-12-07 07:11:26 +00:00
|
|
|
namespace impl {
|
|
|
|
|
|
|
|
class ProgramInfo;
|
|
|
|
|
|
|
|
}
|
|
|
|
|
2022-03-24 15:43:40 +00:00
|
|
|
/* ACCURATE_TO_VERSION: Unknown */
|
2021-12-07 07:11:26 +00:00
|
|
|
class ProgramRegistryImpl {
|
|
|
|
NON_COPYABLE(ProgramRegistryImpl);
|
|
|
|
NON_MOVEABLE(ProgramRegistryImpl);
|
|
|
|
private:
|
|
|
|
u64 m_process_id;
|
|
|
|
public:
|
|
|
|
ProgramRegistryImpl();
|
|
|
|
~ProgramRegistryImpl();
|
2021-12-07 10:04:39 +00:00
|
|
|
public:
|
|
|
|
static void Initialize(ProgramRegistryServiceImpl *service);
|
2021-12-07 07:11:26 +00:00
|
|
|
public:
|
|
|
|
Result RegisterProgram(u64 process_id, u64 program_id, u8 storage_id, const ams::sf::InBuffer &data, s64 data_size, const ams::sf::InBuffer &desc, s64 desc_size);
|
|
|
|
Result UnregisterProgram(u64 process_id);
|
|
|
|
Result SetCurrentProcess(const ams::sf::ClientProcessId &client_pid);
|
|
|
|
Result SetEnabledProgramVerification(bool en);
|
|
|
|
};
|
|
|
|
static_assert(sf::IsIProgramRegistry<ProgramRegistryImpl>);
|
|
|
|
|
2022-03-24 15:43:40 +00:00
|
|
|
/* ACCURATE_TO_VERSION: Unknown */
|
2021-12-07 07:11:26 +00:00
|
|
|
class InvalidProgramRegistryImpl {
|
|
|
|
public:
|
|
|
|
Result RegisterProgram(u64 process_id, u64 program_id, u8 storage_id, const ams::sf::InBuffer &data, s64 data_size, const ams::sf::InBuffer &desc, s64 desc_size) {
|
|
|
|
AMS_UNUSED(process_id, program_id, storage_id, data, data_size, desc, desc_size);
|
2022-03-24 15:43:40 +00:00
|
|
|
R_THROW(fs::ResultPortAcceptableCountLimited());
|
2021-12-07 07:11:26 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
Result UnregisterProgram(u64 process_id) {
|
|
|
|
AMS_UNUSED(process_id);
|
2022-03-24 15:43:40 +00:00
|
|
|
R_THROW(fs::ResultPortAcceptableCountLimited());
|
2021-12-07 07:11:26 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
Result SetCurrentProcess(const ams::sf::ClientProcessId &client_pid) {
|
|
|
|
AMS_UNUSED(client_pid);
|
2022-03-24 15:43:40 +00:00
|
|
|
R_THROW(fs::ResultPortAcceptableCountLimited());
|
2021-12-07 07:11:26 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
Result SetEnabledProgramVerification(bool en) {
|
|
|
|
AMS_UNUSED(en);
|
2022-03-24 15:43:40 +00:00
|
|
|
R_THROW(fs::ResultPortAcceptableCountLimited());
|
2021-12-07 07:11:26 +00:00
|
|
|
}
|
|
|
|
};
|
|
|
|
static_assert(sf::IsIProgramRegistry<InvalidProgramRegistryImpl>);
|
|
|
|
|
|
|
|
}
|