sf: add new debug-interface-id in cmif out header

This commit is contained in:
Michael Scire
2022-03-22 05:19:18 -07:00
parent 41e2c24101
commit 36ab24f93a
100 changed files with 381 additions and 146 deletions

View File

@@ -26,10 +26,10 @@ namespace ams::capsrv::server {
static constexpr inline size_t MaxSessions = 2;
static constexpr inline sm::ServiceName ServiceName = sm::ServiceName::Encode("caps:dc");
using ServiceHolderType = sf::UnmanagedServiceObject<IDecoderControlService, DecoderControlService>;
using ServiceHolderType = ams::sf::UnmanagedServiceObject<capsrv::sf::IDecoderControlService, DecoderControlService>;
using ServerOptions = sf::hipc::DefaultServerManagerOptions;
using ServerManager = sf::hipc::ServerManager<NumServers, ServerOptions, MaxSessions>;
using ServerOptions = ams::sf::hipc::DefaultServerManagerOptions;
using ServerManager = ams::sf::hipc::ServerManager<NumServers, ServerOptions, MaxSessions>;
private:
util::optional<ServiceHolderType> m_service_holder;
util::optional<ServerManager> m_server_manager_holder;

View File

@@ -69,7 +69,7 @@ namespace ams::capsrv::server {
}
Result DecoderControlService::DecodeJpeg(const sf::OutNonSecureBuffer &out, const sf::InBuffer &in, u32 width, u32 height, const ScreenShotDecodeOption &option) {
Result DecoderControlService::DecodeJpeg(const ams::sf::OutNonSecureBuffer &out, const ams::sf::InBuffer &in, u32 width, u32 height, const ScreenShotDecodeOption &option) {
/* Get the work buffer. */
void *work = g_work_memory.jpeg_decoder_memory;
size_t work_size = sizeof(g_work_memory.jpeg_decoder_memory);

View File

@@ -17,16 +17,16 @@
#include <stratosphere.hpp>
#define AMS_CAPSRV_DECODER_CONTROL_SERVICE_INTERFACE_INFO(C, H) \
AMS_SF_METHOD_INFO(C, H, 3001, Result, DecodeJpeg, (const sf::OutNonSecureBuffer &out, const sf::InBuffer &in, u32 width, u32 height, const capsrv::ScreenShotDecodeOption &option), (out, in, width, height, option))
AMS_SF_METHOD_INFO(C, H, 3001, Result, DecodeJpeg, (const ams::sf::OutNonSecureBuffer &out, const ams::sf::InBuffer &in, u32 width, u32 height, const capsrv::ScreenShotDecodeOption &option), (out, in, width, height, option))
AMS_SF_DEFINE_INTERFACE(ams::capsrv::server, IDecoderControlService, AMS_CAPSRV_DECODER_CONTROL_SERVICE_INTERFACE_INFO)
AMS_SF_DEFINE_INTERFACE(ams::capsrv::sf, IDecoderControlService, AMS_CAPSRV_DECODER_CONTROL_SERVICE_INTERFACE_INFO, 0xD168E90B)
namespace ams::capsrv::server {
class DecoderControlService final {
public:
Result DecodeJpeg(const sf::OutNonSecureBuffer &out, const sf::InBuffer &in, u32 width, u32 height, const ScreenShotDecodeOption &option);
Result DecodeJpeg(const ams::sf::OutNonSecureBuffer &out, const ams::sf::InBuffer &in, u32 width, u32 height, const ScreenShotDecodeOption &option);
};
static_assert(IsIDecoderControlService<DecoderControlService>);
static_assert(capsrv::sf::IsIDecoderControlService<DecoderControlService>);
}

View File

@@ -21,4 +21,4 @@
AMS_SF_METHOD_INFO(C, H, 1, Result, StopLogging, (), ()) \
AMS_SF_METHOD_INFO(C, H, 2, Result, GetLog, (const sf::OutAutoSelectBuffer &message, sf::Out<s64> out_size, sf::Out<u32> out_drop_count), (message, out_size, out_drop_count))
AMS_SF_DEFINE_INTERFACE(ams::lm, ILogGetter, AMS_LM_I_LOG_GETTER_INTERFACE_INFO)
AMS_SF_DEFINE_INTERFACE(ams::lm, ILogGetter, AMS_LM_I_LOG_GETTER_INTERFACE_INFO, 0x565EA15C)

View File

@@ -20,9 +20,9 @@
AMS_SF_METHOD_INFO(C, H, 0, Result, Log, (const sf::InAutoSelectBuffer &message), (message)) \
AMS_SF_METHOD_INFO(C, H, 1, Result, SetDestination, (u32 destination), (destination))
AMS_SF_DEFINE_INTERFACE(ams::lm, ILogger, AMS_LM_I_LOGGER_INTERFACE_INFO)
AMS_SF_DEFINE_INTERFACE(ams::lm, ILogger, AMS_LM_I_LOGGER_INTERFACE_INFO, 0x3E81DAD2)
#define AMS_LM_I_LOG_SERVICE_INTERFACE_INFO(C, H) \
AMS_SF_METHOD_INFO(C, H, 0, Result, OpenLogger, (sf::Out<sf::SharedPointer<::ams::lm::ILogger>> out, const sf::ClientProcessId &client_process_id), (out, client_process_id))
AMS_SF_DEFINE_INTERFACE(ams::lm, ILogService, AMS_LM_I_LOG_SERVICE_INTERFACE_INFO)
AMS_SF_DEFINE_INTERFACE(ams::lm, ILogService, AMS_LM_I_LOG_SERVICE_INTERFACE_INFO, 0xE1D7F748)

View File

@@ -83,7 +83,7 @@ namespace ams::sf::cmif {
}
Result impl::ServiceDispatchTableBase::ProcessMessageImpl(ServiceDispatchContext &ctx, const cmif::PointerAndSize &in_raw_data, const ServiceCommandMeta *entries, const size_t entry_count) const {
Result impl::ServiceDispatchTableBase::ProcessMessageImpl(ServiceDispatchContext &ctx, const cmif::PointerAndSize &in_raw_data, const ServiceCommandMeta *entries, const size_t entry_count, u32 interface_id_for_debug) const {
/* Get versioning info. */
const auto hos_version = hos::GetVersion();
const u32 max_cmif_version = hos_version >= hos::Version_5_0_0 ? 1 : 0;
@@ -115,13 +115,13 @@ namespace ams::sf::cmif {
}
/* Write output header to raw data. */
*out_header = CmifOutHeader{OutHeaderMagic, 0, command_result.GetValue(), 0};
*out_header = CmifOutHeader{OutHeaderMagic, 0, command_result.GetValue(), interface_id_for_debug};
return ResultSuccess();
}
#if AMS_SF_MITM_SUPPORTED
Result impl::ServiceDispatchTableBase::ProcessMessageForMitmImpl(ServiceDispatchContext &ctx, const cmif::PointerAndSize &in_raw_data, const ServiceCommandMeta *entries, const size_t entry_count) const {
Result impl::ServiceDispatchTableBase::ProcessMessageForMitmImpl(ServiceDispatchContext &ctx, const cmif::PointerAndSize &in_raw_data, const ServiceCommandMeta *entries, const size_t entry_count, u32 interface_id_for_debug) const {
/* Get versioning info. */
const auto hos_version = hos::GetVersion();
const u32 max_cmif_version = hos_version >= hos::Version_5_0_0 ? 1 : 0;
@@ -162,7 +162,7 @@ namespace ams::sf::cmif {
}
/* Write output header to raw data. */
*out_header = CmifOutHeader{OutHeaderMagic, 0, command_result.GetValue(), 0};
*out_header = CmifOutHeader{OutHeaderMagic, 0, command_result.GetValue(), interface_id_for_debug};
return ResultSuccess();
}

View File

@@ -21,7 +21,7 @@
#define AMS_SF_HIPC_IMPL_I_MITM_QUERY_SERVICE_INTERFACE_INFO(C, H) \
AMS_SF_METHOD_INFO(C, H, 65000, void, ShouldMitm, (sf::Out<bool> out, const sm::MitmProcessInfo &client_info), (out, client_info))
AMS_SF_DEFINE_INTERFACE(ams::sf::hipc::impl, IMitmQueryService, AMS_SF_HIPC_IMPL_I_MITM_QUERY_SERVICE_INTERFACE_INFO)
AMS_SF_DEFINE_INTERFACE(ams::sf::hipc::impl, IMitmQueryService, AMS_SF_HIPC_IMPL_I_MITM_QUERY_SERVICE_INTERFACE_INFO, 0xEC6BE3FF)
namespace ams::sf::hipc::impl {

View File

@@ -14,15 +14,7 @@
* along with this program. If not, see <http://www.gnu.org/licenses/>.
*/
#include <stratosphere.hpp>
#define AMS_SF_HIPC_IMPL_I_HIPC_MANAGER_INTERFACE_INFO(C, H) \
AMS_SF_METHOD_INFO(C, H, 0, Result, ConvertCurrentObjectToDomain, (ams::sf::Out<ams::sf::cmif::DomainObjectId> out), (out)) \
AMS_SF_METHOD_INFO(C, H, 1, Result, CopyFromCurrentDomain, (ams::sf::OutMoveHandle out, ams::sf::cmif::DomainObjectId object_id), (out, object_id)) \
AMS_SF_METHOD_INFO(C, H, 2, Result, CloneCurrentObject, (ams::sf::OutMoveHandle out), (out)) \
AMS_SF_METHOD_INFO(C, H, 3, void, QueryPointerBufferSize, (ams::sf::Out<u16> out), (out)) \
AMS_SF_METHOD_INFO(C, H, 4, Result, CloneCurrentObjectEx, (ams::sf::OutMoveHandle out, u32 tag), (out, tag))
AMS_SF_DEFINE_INTERFACE(ams::sf::hipc::impl, IHipcManager, AMS_SF_HIPC_IMPL_I_HIPC_MANAGER_INTERFACE_INFO)
#include "sf_i_hipc_manager.hpp"
namespace ams::sf::hipc {

View File

@@ -0,0 +1,26 @@
/*
* 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/>.
*/
#include <stratosphere.hpp>
#pragma once
#define AMS_SF_HIPC_IMPL_I_HIPC_MANAGER_INTERFACE_INFO(C, H) \
AMS_SF_METHOD_INFO(C, H, 0, Result, ConvertCurrentObjectToDomain, (ams::sf::Out<ams::sf::cmif::DomainObjectId> out), (out)) \
AMS_SF_METHOD_INFO(C, H, 1, Result, CopyFromCurrentDomain, (ams::sf::OutMoveHandle out, ams::sf::cmif::DomainObjectId object_id), (out, object_id)) \
AMS_SF_METHOD_INFO(C, H, 2, Result, CloneCurrentObject, (ams::sf::OutMoveHandle out), (out)) \
AMS_SF_METHOD_INFO(C, H, 3, void, QueryPointerBufferSize, (ams::sf::Out<u16> out), (out)) \
AMS_SF_METHOD_INFO(C, H, 4, Result, CloneCurrentObjectEx, (ams::sf::OutMoveHandle out, u32 tag), (out, tag))
AMS_SF_DEFINE_INTERFACE(ams::sf::hipc::impl, IHipcManager, AMS_SF_HIPC_IMPL_I_HIPC_MANAGER_INTERFACE_INFO, 0xEC6BE3FF)

View File

@@ -0,0 +1,201 @@
/*
* 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/>.
*/
#include <stratosphere.hpp>
#include "../capsrv/server/decodersrv/decodersrv_decoder_control_service.hpp"
#include "../lm/sf/lm_i_log_getter.hpp"
#include "../lm/sf/lm_i_log_service.hpp"
#include "../sf/hipc/sf_i_hipc_manager.hpp"
#include "../sprofile/srv/sprofile_srv_i_service_getter.hpp"
namespace {
constexpr u32 GenerateInterfaceIdFromName(const char *s) {
/* Get the interface length. */
const auto len = ams::util::Strlen(s);
/* Calculate the sha256. */
u8 hash[ams::crypto::Sha256Generator::HashSize] = {};
ams::crypto::GenerateSha256(hash, sizeof(hash), s, len);
/* Read it out as little endian. */
u32 id = 0;
for (size_t i = 0; i < sizeof(id); ++i) {
id |= static_cast<u32>(hash[i]) << (BITSIZEOF(u8) * i);
}
return id;
}
static_assert(GenerateInterfaceIdFromName("nn::sf::hipc::detail::IHipcManager") == 0xEC6BE3FF);
constexpr void ConvertAtmosphereNameToNintendoName(char *dst, const char *src) {
/* Determine src len. */
const auto len = ams::util::Strlen(src);
const auto *s = src;
/* Atmosphere names begin with ams::, Nintendo names begin with nn::. */
AMS_ASSUME(src[0] == 'a');
AMS_ASSUME(src[1] == 'm');
AMS_ASSERT(src[2] == 's');
dst[0] = 'n';
dst[1] = 'n';
src += 3;
dst += 2;
/* Copy over. */
while ((src - s) < len) {
/* Atmosphere uses ::impl:: instead of ::detail::, ::IDeprecated* for deprecated services. */
if (src[0] == ':' && src[1] == ':' && src[2] == 'i' && src[3] == 'm' && src[4] == 'p' && src[5] == 'l' && src[6] == ':' && src[7] == ':') {
dst[0] = ':';
dst[1] = ':';
dst[2] = 'd';
dst[3] = 'e';
dst[4] = 't';
dst[5] = 'a';
dst[6] = 'i';
dst[7] = 'l';
src += 6; /* ::impl */
dst += 8; /* ::detail */
} else if (src[0] == ':' && src[1] == ':' && src[2] == 'I' && src[3] == 'D' && src[4] == 'e' && src[5] == 'p' && src[6] == 'r' && src[7] == 'e' && src[8] == 'c' && src[9] == 'a' && src[10] == 't' && src[11] == 'e' && src[12] == 'd') {
dst[0] = ':';
dst[1] = ':';
dst[2] = 'I';
src += 13; /* ::IDeprecated */
dst += 3; /* ::I */
} else {
*(dst++) = *(src++);
}
}
*dst = 0;
}
constexpr u32 GenerateInterfaceIdFromAtmosphereName(const char *ams) {
char nn[0x100] = {};
ConvertAtmosphereNameToNintendoName(nn, ams);
return GenerateInterfaceIdFromName(nn);
}
}
#define AMS_IMPL_CHECK_INTERFACE_ID(AMS_INTF) \
static_assert(AMS_INTF::InterfaceIdForDebug == GenerateInterfaceIdFromAtmosphereName( #AMS_INTF ), #AMS_INTF)
AMS_IMPL_CHECK_INTERFACE_ID(ams::capsrv::sf::IDecoderControlService);
AMS_IMPL_CHECK_INTERFACE_ID(ams::erpt::sf::IAttachment);
AMS_IMPL_CHECK_INTERFACE_ID(ams::erpt::sf::IContext);
AMS_IMPL_CHECK_INTERFACE_ID(ams::erpt::sf::IManager);
AMS_IMPL_CHECK_INTERFACE_ID(ams::erpt::sf::IReport);
AMS_IMPL_CHECK_INTERFACE_ID(ams::erpt::sf::ISession);
static_assert(::ams::fatal::impl::IPrivateService::InterfaceIdForDebug == GenerateInterfaceIdFromName("nn::fatalsrv::IPrivateService")); // TODO: FIX-TO-MATCH
static_assert(::ams::fatal::impl::IService::InterfaceIdForDebug == GenerateInterfaceIdFromName("nn::fatalsrv::IService")); // TODO: FIX-TO-MATCH
AMS_IMPL_CHECK_INTERFACE_ID(ams::fssrv::sf::IDirectory);
AMS_IMPL_CHECK_INTERFACE_ID(ams::fssrv::sf::IFile);
AMS_IMPL_CHECK_INTERFACE_ID(ams::fssrv::sf::IFileSystem);
AMS_IMPL_CHECK_INTERFACE_ID(ams::fssrv::sf::IStorage);
AMS_IMPL_CHECK_INTERFACE_ID(ams::fssrv::sf::IDeviceOperator);
AMS_IMPL_CHECK_INTERFACE_ID(ams::fssrv::sf::IEventNotifier);
AMS_IMPL_CHECK_INTERFACE_ID(ams::fssrv::sf::IFileSystemProxy);
AMS_IMPL_CHECK_INTERFACE_ID(ams::fssrv::sf::IFileSystemProxyForLoader);
AMS_IMPL_CHECK_INTERFACE_ID(ams::fssrv::sf::IProgramRegistry);
static_assert(::ams::gpio::sf::IManager::InterfaceIdForDebug == GenerateInterfaceIdFromName("nn::gpio::IManager")); // TODO: FIX-TO-MATCH
static_assert(::ams::gpio::sf::IPadSession::InterfaceIdForDebug == GenerateInterfaceIdFromName("nn::gpio::IPadSession")); // TODO: FIX-TO-MATCH
AMS_IMPL_CHECK_INTERFACE_ID(ams::htc::tenv::IService);
AMS_IMPL_CHECK_INTERFACE_ID(ams::htc::tenv::IServiceManager);
static_assert(::ams::i2c::sf::IManager::InterfaceIdForDebug == GenerateInterfaceIdFromName("nn::i2c::IManager")); // TODO: FIX-TO-MATCH
static_assert(::ams::i2c::sf::ISession::InterfaceIdForDebug == GenerateInterfaceIdFromName("nn::i2c::ISession")); // TODO: FIX-TO-MATCH
AMS_IMPL_CHECK_INTERFACE_ID(ams::ldr::impl::IDebugMonitorInterface);
AMS_IMPL_CHECK_INTERFACE_ID(ams::ldr::impl::IProcessManagerInterface);
AMS_IMPL_CHECK_INTERFACE_ID(ams::ldr::impl::IShellInterface);
AMS_IMPL_CHECK_INTERFACE_ID(ams::lr::IAddOnContentLocationResolver);
AMS_IMPL_CHECK_INTERFACE_ID(ams::lr::ILocationResolver);
AMS_IMPL_CHECK_INTERFACE_ID(ams::lr::ILocationResolverManager);
AMS_IMPL_CHECK_INTERFACE_ID(ams::lr::IRegisteredLocationResolver);
AMS_IMPL_CHECK_INTERFACE_ID(ams::lm::ILogGetter);
AMS_IMPL_CHECK_INTERFACE_ID(ams::lm::ILogger);
AMS_IMPL_CHECK_INTERFACE_ID(ams::lm::ILogService);
AMS_IMPL_CHECK_INTERFACE_ID(ams::ncm::IContentManager);
AMS_IMPL_CHECK_INTERFACE_ID(ams::ncm::IContentMetaDatabase);
AMS_IMPL_CHECK_INTERFACE_ID(ams::ncm::IContentStorage);
AMS_IMPL_CHECK_INTERFACE_ID(ams::ns::impl::IAsyncResult);
//AMS_IMPL_CHECK_INTERFACE_ID(ams::pgl::sf::IEventObserver);
//AMS_IMPL_CHECK_INTERFACE_ID(ams::pgl::sf::IShellInterface);
AMS_IMPL_CHECK_INTERFACE_ID(ams::pm::impl::IBootModeInterface);
AMS_IMPL_CHECK_INTERFACE_ID(ams::pm::impl::IDebugMonitorInterface);
AMS_IMPL_CHECK_INTERFACE_ID(ams::pm::impl::IDeprecatedDebugMonitorInterface);
AMS_IMPL_CHECK_INTERFACE_ID(ams::pm::impl::IInformationInterface);
AMS_IMPL_CHECK_INTERFACE_ID(ams::pm::impl::IShellInterface);
AMS_IMPL_CHECK_INTERFACE_ID(ams::pm::impl::IDeprecatedShellInterface);
AMS_IMPL_CHECK_INTERFACE_ID(ams::psc::sf::IPmModule);
AMS_IMPL_CHECK_INTERFACE_ID(ams::psc::sf::IPmService);
static_assert(::ams::pwm::sf::IChannelSession::InterfaceIdForDebug == GenerateInterfaceIdFromName("nn::pwm::IChannelSession")); // TODO: FIX-TO-MATCH
static_assert(::ams::pwm::sf::IManager::InterfaceIdForDebug == GenerateInterfaceIdFromName("nn::pwm::IManager")); // TODO: FIX-TO-MATCH
AMS_IMPL_CHECK_INTERFACE_ID(ams::ro::impl::IDebugMonitorInterface);
AMS_IMPL_CHECK_INTERFACE_ID(ams::ro::impl::IRoInterface);
//AMS_IMPL_CHECK_INTERFACE_ID(ams::sf::hipc::impl::IMitmQueryService);
AMS_IMPL_CHECK_INTERFACE_ID(ams::sf::hipc::impl::IHipcManager);
AMS_IMPL_CHECK_INTERFACE_ID(ams::spl::impl::ICryptoInterface);
AMS_IMPL_CHECK_INTERFACE_ID(ams::spl::impl::IDeprecatedGeneralInterface);
AMS_IMPL_CHECK_INTERFACE_ID(ams::spl::impl::IDeviceUniqueDataInterface);
AMS_IMPL_CHECK_INTERFACE_ID(ams::spl::impl::IEsInterface);
AMS_IMPL_CHECK_INTERFACE_ID(ams::spl::impl::IFsInterface);
AMS_IMPL_CHECK_INTERFACE_ID(ams::spl::impl::IGeneralInterface);
AMS_IMPL_CHECK_INTERFACE_ID(ams::spl::impl::IManuInterface);
AMS_IMPL_CHECK_INTERFACE_ID(ams::spl::impl::IRandomInterface);
AMS_IMPL_CHECK_INTERFACE_ID(ams::spl::impl::ISslInterface);
AMS_IMPL_CHECK_INTERFACE_ID(ams::sprofile::srv::IProfileControllerForDebug);
AMS_IMPL_CHECK_INTERFACE_ID(ams::sprofile::srv::IProfileImporter);
AMS_IMPL_CHECK_INTERFACE_ID(ams::sprofile::srv::IProfileReader);
AMS_IMPL_CHECK_INTERFACE_ID(ams::sprofile::srv::IProfileUpdateObserver);
AMS_IMPL_CHECK_INTERFACE_ID(ams::sprofile::srv::ISprofileServiceForBgAgent);
AMS_IMPL_CHECK_INTERFACE_ID(ams::sprofile::srv::ISprofileServiceForSystemProcess);
AMS_IMPL_CHECK_INTERFACE_ID(ams::sprofile::srv::IServiceGetter);
AMS_IMPL_CHECK_INTERFACE_ID(ams::tma::IDirectoryAccessor);
AMS_IMPL_CHECK_INTERFACE_ID(ams::tma::IFileAccessor);
AMS_IMPL_CHECK_INTERFACE_ID(ams::tma::IFileManager);
AMS_IMPL_CHECK_INTERFACE_ID(ams::tma::IDeprecatedFileManager);
AMS_IMPL_CHECK_INTERFACE_ID(ams::tma::IHtcsManager);
AMS_IMPL_CHECK_INTERFACE_ID(ams::tma::IHtcManager);
AMS_IMPL_CHECK_INTERFACE_ID(ams::tma::ISocket);
AMS_IMPL_CHECK_INTERFACE_ID(ams::usb::ds::IDsEndpoint);
AMS_IMPL_CHECK_INTERFACE_ID(ams::usb::ds::IDsInterface);
AMS_IMPL_CHECK_INTERFACE_ID(ams::usb::ds::IDsService);
AMS_IMPL_CHECK_INTERFACE_ID(ams::usb::ds::IDsRootSession);

View File

@@ -21,4 +21,4 @@
AMS_SF_METHOD_INFO(C, H, 2001, Result, GetRaw, (sf::Out<u8> out_type, sf::Out<u64> out_value, sprofile::Identifier profile, sprofile::Identifier key), (out_type, out_value, profile, key))
AMS_SF_DEFINE_INTERFACE(ams::sprofile::srv, IProfileControllerForDebug, AMS_SPROFILE_I_PROFILE_CONTROLLER_FOR_DEBUG_INTERFACE_INFO)
AMS_SF_DEFINE_INTERFACE(ams::sprofile::srv, IProfileControllerForDebug, AMS_SPROFILE_I_PROFILE_CONTROLLER_FOR_DEBUG_INTERFACE_INFO, 0xA8C14F64)

View File

@@ -22,4 +22,4 @@
AMS_SF_METHOD_INFO(C, H, 1, Result, Commit, (), ()) \
AMS_SF_METHOD_INFO(C, H, 2, Result, ImportMetadata, (const sprofile::srv::ProfileMetadataForImportMetadata &import), (import)) \
AMS_SF_DEFINE_INTERFACE(ams::sprofile::srv, IProfileImporter, AMS_SPROFILE_I_PROFILE_IMPORTER_INTERFACE_INFO)
AMS_SF_DEFINE_INTERFACE(ams::sprofile::srv, IProfileImporter, AMS_SPROFILE_I_PROFILE_IMPORTER_INTERFACE_INFO, 0x1629C4E6)

View File

@@ -23,4 +23,4 @@
AMS_SF_METHOD_INFO(C, H, 3, Result, GetUnsigned32, (sf::Out<u32> out, sprofile::Identifier profile, sprofile::Identifier key), (out, profile, key)) \
AMS_SF_METHOD_INFO(C, H, 4, Result, GetByte, (sf::Out<u8> out, sprofile::Identifier profile, sprofile::Identifier key), (out, profile, key))
AMS_SF_DEFINE_INTERFACE(ams::sprofile::srv, IProfileReader, AMS_SPROFILE_I_PROFILE_READER_INTERFACE_INFO)
AMS_SF_DEFINE_INTERFACE(ams::sprofile::srv, IProfileReader, AMS_SPROFILE_I_PROFILE_READER_INTERFACE_INFO, 0x97090D4D)

View File

@@ -21,4 +21,4 @@
AMS_SF_METHOD_INFO(C, H, 1, Result, Unlisten, (sprofile::Identifier profile), (profile)) \
AMS_SF_METHOD_INFO(C, H, 2, Result, GetEventHandle, (ams::sf::OutCopyHandle out), (out))
AMS_SF_DEFINE_INTERFACE(ams::sprofile::srv, IProfileUpdateObserver, AMS_SPROFILE_I_PROFILE_UPDATE_OBSERVER_INTERFACE_INFO)
AMS_SF_DEFINE_INTERFACE(ams::sprofile::srv, IProfileUpdateObserver, AMS_SPROFILE_I_PROFILE_UPDATE_OBSERVER_INTERFACE_INFO, 0xB52A765C)

View File

@@ -23,4 +23,4 @@
AMS_SF_METHOD_INFO(C, H, 201, Result, IsUpdateNeeded, (sf::Out<bool> out, sprofile::Identifier revision_key), (out, revision_key)) \
AMS_SF_METHOD_INFO(C, H, 2000, Result, Reset, (), ())
AMS_SF_DEFINE_INTERFACE(ams::sprofile::srv, ISprofileServiceForBgAgent, AMS_SPROFILE_I_SPROFILE_SERVICE_FOR_BG_AGENT_INTERFACE_INFO)
AMS_SF_DEFINE_INTERFACE(ams::sprofile::srv, ISprofileServiceForBgAgent, AMS_SPROFILE_I_SPROFILE_SERVICE_FOR_BG_AGENT_INTERFACE_INFO, 0xCCD828EC)

View File

@@ -24,4 +24,4 @@
AMS_SF_METHOD_INFO(C, H, 101, Result, OpenProfileUpdateObserver, (sf::Out<sf::SharedPointer<::ams::sprofile::srv::IProfileUpdateObserver>> out), (out)) \
AMS_SF_METHOD_INFO(C, H, 900, Result, OpenProfileControllerForDebug, (sf::Out<sf::SharedPointer<::ams::sprofile::srv::IProfileControllerForDebug>> out), (out))
AMS_SF_DEFINE_INTERFACE(ams::sprofile::srv, ISprofileServiceForSystemProcess, AMS_SPROFILE_I_SPROFILE_SERVICE_FOR_SYSTEM_PROCESS_INTERFACE_INFO)
AMS_SF_DEFINE_INTERFACE(ams::sprofile::srv, ISprofileServiceForSystemProcess, AMS_SPROFILE_I_SPROFILE_SERVICE_FOR_SYSTEM_PROCESS_INTERFACE_INFO, 0x919612FB)

View File

@@ -22,4 +22,4 @@
AMS_SF_METHOD_INFO(C, H, 0, Result, GetServiceForSystemProcess, (sf::Out<sf::SharedPointer<sprofile::srv::ISprofileServiceForSystemProcess>> out), (out)) \
AMS_SF_METHOD_INFO(C, H, 1, Result, GetServiceForBgAgent, (sf::Out<sf::SharedPointer<sprofile::srv::ISprofileServiceForBgAgent>> out), (out))
AMS_SF_DEFINE_INTERFACE(ams::sprofile::srv, IServiceGetter, AMS_SPROFILE_I_SERVICE_GETTER_INTERFACE_INFO)
AMS_SF_DEFINE_INTERFACE(ams::sprofile::srv, IServiceGetter, AMS_SPROFILE_I_SERVICE_GETTER_INTERFACE_INFO, 0x2CFB8417)

View File

@@ -14,7 +14,7 @@
* along with this program. If not, see <http://www.gnu.org/licenses/>.
*/
#include <stratosphere.hpp>
#include "usb_remote_ds_root_service.hpp"
#include "usb_remote_ds_root_session.hpp"
#include "usb_remote_ds_service.hpp"
#include "impl/usb_util.hpp"
@@ -48,9 +48,9 @@ namespace ams::usb {
using ObjectFactory = sf::ObjectFactory<Allocator::Policy>;
if (hos::GetVersion() >= hos::Version_11_0_0) {
m_root_service = ObjectFactory::CreateSharedEmplaced<ds::IDsRootService, RemoteDsRootService>(std::addressof(m_allocator), srv, std::addressof(m_allocator));
m_root_session = ObjectFactory::CreateSharedEmplaced<ds::IDsRootSession, RemoteDsRootSession>(std::addressof(m_allocator), srv, std::addressof(m_allocator));
R_TRY(m_root_service->GetService(std::addressof(m_ds_service)));
R_TRY(m_root_session->GetService(std::addressof(m_ds_service)));
} else {
m_ds_service = ObjectFactory::CreateSharedEmplaced<ds::IDsService, RemoteDsService>(std::addressof(m_allocator), srv, std::addressof(m_allocator));
}
@@ -102,7 +102,7 @@ namespace ams::usb {
/* Destroy interface objects. */
m_ds_service = nullptr;
m_root_service = nullptr;
m_root_session = nullptr;
return ResultSuccess();
}

View File

@@ -14,13 +14,13 @@
* along with this program. If not, see <http://www.gnu.org/licenses/>.
*/
#include <stratosphere.hpp>
#include "usb_remote_ds_root_service.hpp"
#include "usb_remote_ds_root_session.hpp"
#include "usb_remote_ds_service.hpp"
namespace ams::usb {
#if defined(ATMOSPHERE_OS_HORIZON)
Result RemoteDsRootService::GetService(sf::Out<sf::SharedPointer<usb::ds::IDsService>> out) {
Result RemoteDsRootSession::GetService(sf::Out<sf::SharedPointer<usb::ds::IDsService>> out) {
Service srv;
serviceAssumeDomain(std::addressof(m_srv));

View File

@@ -19,7 +19,7 @@
namespace ams::usb {
#if defined(ATMOSPHERE_OS_HORIZON)
class RemoteDsRootService {
class RemoteDsRootSession {
private:
using Allocator = sf::ExpHeapAllocator;
using ObjectFactory = sf::ObjectFactory<Allocator::Policy>;
@@ -27,12 +27,12 @@ namespace ams::usb {
Service m_srv;
Allocator *m_allocator;
public:
RemoteDsRootService(Service &srv, sf::ExpHeapAllocator *allocator) : m_srv(srv), m_allocator(allocator) { /* ... */ }
virtual ~RemoteDsRootService() { serviceClose(std::addressof(m_srv)); }
RemoteDsRootSession(Service &srv, sf::ExpHeapAllocator *allocator) : m_srv(srv), m_allocator(allocator) { /* ... */ }
virtual ~RemoteDsRootSession() { serviceClose(std::addressof(m_srv)); }
public:
Result GetService(sf::Out<sf::SharedPointer<usb::ds::IDsService>> out);
};
static_assert(ds::IsIDsRootService<RemoteDsRootService>);
static_assert(ds::IsIDsRootSession<RemoteDsRootSession>);
#endif
}