2019-06-21 03:23:40 +02:00
|
|
|
/*
|
2021-10-04 21:59:10 +02:00
|
|
|
* Copyright (c) Atmosphère-NX
|
2019-06-21 03:23:40 +02: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/>.
|
|
|
|
*/
|
|
|
|
|
|
|
|
#pragma once
|
2019-10-25 09:12:47 +02:00
|
|
|
#include <stratosphere.hpp>
|
2019-06-21 03:23:40 +02:00
|
|
|
|
2019-10-24 11:30:10 +02:00
|
|
|
namespace ams::sm::impl {
|
2019-06-21 03:23:40 +02:00
|
|
|
|
2020-09-17 17:24:47 +02:00
|
|
|
/* Client disconnection callback. */
|
|
|
|
void OnClientDisconnected(os::ProcessId process_id);
|
|
|
|
|
2019-06-21 03:23:40 +02:00
|
|
|
/* Process management. */
|
2021-04-10 10:58:26 +02:00
|
|
|
Result RegisterProcess(os::ProcessId process_id, ncm::ProgramId program_id, cfg::OverrideStatus override_status, const void *acid_sac, size_t acid_sac_size, const void *aci_sac, size_t aci_sac_size);
|
2019-10-28 05:43:01 +01:00
|
|
|
Result UnregisterProcess(os::ProcessId process_id);
|
2019-06-21 03:23:40 +02:00
|
|
|
|
|
|
|
/* Service management. */
|
|
|
|
Result HasService(bool *out, ServiceName service);
|
2019-07-03 07:21:47 +02:00
|
|
|
Result WaitService(ServiceName service);
|
2021-10-05 02:12:32 +02:00
|
|
|
Result GetServiceHandle(os::NativeHandle *out, os::ProcessId process_id, ServiceName service);
|
|
|
|
Result RegisterService(os::NativeHandle *out, os::ProcessId process_id, ServiceName service, size_t max_sessions, bool is_light);
|
|
|
|
Result RegisterServiceForSelf(os::NativeHandle *out, ServiceName service, size_t max_sessions);
|
2019-10-28 05:43:01 +01:00
|
|
|
Result UnregisterService(os::ProcessId process_id, ServiceName service);
|
2019-06-21 03:23:40 +02:00
|
|
|
|
|
|
|
/* Mitm extensions. */
|
|
|
|
Result HasMitm(bool *out, ServiceName service);
|
2019-07-03 07:21:47 +02:00
|
|
|
Result WaitMitm(ServiceName service);
|
2021-10-05 02:12:32 +02:00
|
|
|
Result InstallMitm(os::NativeHandle *out, os::NativeHandle *out_query, os::ProcessId process_id, ServiceName service);
|
2019-10-28 05:43:01 +01:00
|
|
|
Result UninstallMitm(os::ProcessId process_id, ServiceName service);
|
|
|
|
Result DeclareFutureMitm(os::ProcessId process_id, ServiceName service);
|
2020-09-07 19:40:43 +02:00
|
|
|
Result ClearFutureMitm(os::ProcessId process_id, ServiceName service);
|
2021-10-05 02:12:32 +02:00
|
|
|
Result AcknowledgeMitmSession(MitmProcessInfo *out_info, os::NativeHandle *out_hnd, os::ProcessId process_id, ServiceName service);
|
2019-06-21 03:23:40 +02:00
|
|
|
|
|
|
|
/* Deferral extension (works around FS bug). */
|
|
|
|
Result EndInitialDefers();
|
|
|
|
|
2019-06-21 03:32:00 +02:00
|
|
|
}
|