ams: globally prefer R_RETURN to return for ams::Result

This commit is contained in:
Michael Scire 2022-03-26 14:48:33 -07:00
parent dd78ede99f
commit bbf22b4c60
325 changed files with 1955 additions and 1993 deletions

View file

@ -44,12 +44,12 @@ namespace ams::mitm::fs {
Result CreateSdFile(const char *path, s64 size, s32 option) {
R_TRY(EnsureSdInitialized());
return fsFsCreateFile(std::addressof(g_sd_filesystem), path, size, option);
R_RETURN(fsFsCreateFile(std::addressof(g_sd_filesystem), path, size, option));
}
Result DeleteSdFile(const char *path) {
R_TRY(EnsureSdInitialized());
return fsFsDeleteFile(std::addressof(g_sd_filesystem), path);
R_RETURN(fsFsDeleteFile(std::addressof(g_sd_filesystem), path));
}
bool HasSdFile(const char *path) {
@ -74,82 +74,82 @@ namespace ams::mitm::fs {
Result DeleteAtmosphereSdFile(const char *path) {
char fixed_path[ams::fs::EntryNameLengthMax + 1];
FormatAtmosphereSdPath(fixed_path, sizeof(fixed_path), path);
return DeleteSdFile(fixed_path);
R_RETURN(DeleteSdFile(fixed_path));
}
Result CreateAtmosphereSdFile(const char *path, s64 size, s32 option) {
char fixed_path[ams::fs::EntryNameLengthMax + 1];
FormatAtmosphereSdPath(fixed_path, sizeof(fixed_path), path);
return CreateSdFile(fixed_path, size, option);
R_RETURN(CreateSdFile(fixed_path, size, option));
}
Result OpenSdFile(FsFile *out, const char *path, u32 mode) {
R_TRY(EnsureSdInitialized());
return fsFsOpenFile(std::addressof(g_sd_filesystem), path, mode, out);
R_RETURN(fsFsOpenFile(std::addressof(g_sd_filesystem), path, mode, out));
}
Result OpenAtmosphereSdFile(FsFile *out, const char *path, u32 mode) {
char fixed_path[ams::fs::EntryNameLengthMax + 1];
FormatAtmosphereSdPath(fixed_path, sizeof(fixed_path), path);
return OpenSdFile(out, fixed_path, mode);
R_RETURN(OpenSdFile(out, fixed_path, mode));
}
Result OpenAtmosphereSdFile(FsFile *out, ncm::ProgramId program_id, const char *path, u32 mode) {
char fixed_path[ams::fs::EntryNameLengthMax + 1];
FormatAtmosphereSdPath(fixed_path, sizeof(fixed_path), program_id, path);
return OpenSdFile(out, fixed_path, mode);
R_RETURN(OpenSdFile(out, fixed_path, mode));
}
Result OpenAtmosphereSdRomfsFile(FsFile *out, ncm::ProgramId program_id, const char *path, u32 mode) {
char fixed_path[ams::fs::EntryNameLengthMax + 1];
FormatAtmosphereRomfsPath(fixed_path, sizeof(fixed_path), program_id, path);
return OpenSdFile(out, fixed_path, mode);
R_RETURN(OpenSdFile(out, fixed_path, mode));
}
Result OpenAtmosphereRomfsFile(FsFile *out, ncm::ProgramId program_id, const char *path, u32 mode, FsFileSystem *fs) {
char fixed_path[ams::fs::EntryNameLengthMax + 1];
FormatAtmosphereRomfsPath(fixed_path, sizeof(fixed_path), program_id, path);
return fsFsOpenFile(fs, fixed_path, mode, out);
R_RETURN(fsFsOpenFile(fs, fixed_path, mode, out));
}
Result CreateSdDirectory(const char *path) {
R_TRY(EnsureSdInitialized());
return fsFsCreateDirectory(std::addressof(g_sd_filesystem), path);
R_RETURN(fsFsCreateDirectory(std::addressof(g_sd_filesystem), path));
}
Result CreateAtmosphereSdDirectory(const char *path) {
char fixed_path[ams::fs::EntryNameLengthMax + 1];
FormatAtmosphereSdPath(fixed_path, sizeof(fixed_path), path);
return CreateSdDirectory(fixed_path);
R_RETURN(CreateSdDirectory(fixed_path));
}
Result OpenSdDirectory(FsDir *out, const char *path, u32 mode) {
R_TRY(EnsureSdInitialized());
return fsFsOpenDirectory(std::addressof(g_sd_filesystem), path, mode, out);
R_RETURN(fsFsOpenDirectory(std::addressof(g_sd_filesystem), path, mode, out));
}
Result OpenAtmosphereSdDirectory(FsDir *out, const char *path, u32 mode) {
char fixed_path[ams::fs::EntryNameLengthMax + 1];
FormatAtmosphereSdPath(fixed_path, sizeof(fixed_path), path);
return OpenSdDirectory(out, fixed_path, mode);
R_RETURN(OpenSdDirectory(out, fixed_path, mode));
}
Result OpenAtmosphereSdDirectory(FsDir *out, ncm::ProgramId program_id, const char *path, u32 mode) {
char fixed_path[ams::fs::EntryNameLengthMax + 1];
FormatAtmosphereSdPath(fixed_path, sizeof(fixed_path), program_id, path);
return OpenSdDirectory(out, fixed_path, mode);
R_RETURN(OpenSdDirectory(out, fixed_path, mode));
}
Result OpenAtmosphereSdRomfsDirectory(FsDir *out, ncm::ProgramId program_id, const char *path, u32 mode) {
char fixed_path[ams::fs::EntryNameLengthMax + 1];
FormatAtmosphereRomfsPath(fixed_path, sizeof(fixed_path), program_id, path);
return OpenSdDirectory(out, fixed_path, mode);
R_RETURN(OpenSdDirectory(out, fixed_path, mode));
}
Result OpenAtmosphereRomfsDirectory(FsDir *out, ncm::ProgramId program_id, const char *path, u32 mode, FsFileSystem *fs) {
char fixed_path[ams::fs::EntryNameLengthMax + 1];
FormatAtmosphereRomfsPath(fixed_path, sizeof(fixed_path), program_id, path);
return fsFsOpenDirectory(fs, fixed_path, mode, out);
R_RETURN(fsFsOpenDirectory(fs, fixed_path, mode, out));
}
void FormatAtmosphereSdPath(char *dst_path, size_t dst_path_size, const char *src_path) {

View file

@ -56,7 +56,7 @@ namespace ams::mitm::bpc {
switch (port_index) {
case PortIndex_Mitm:
return this->AcceptMitmImpl(server, sf::CreateSharedObjectEmplaced<impl::IBpcMitmInterface, BpcMitmService>(decltype(fsrv)(fsrv), client_info), fsrv);
R_RETURN(this->AcceptMitmImpl(server, sf::CreateSharedObjectEmplaced<impl::IBpcMitmInterface, BpcMitmService>(decltype(fsrv)(fsrv), client_info), fsrv));
AMS_UNREACHABLE_DEFAULT_CASE();
}
}

View file

@ -58,7 +58,7 @@ namespace ams::mitm::socket::resolver {
switch (port_index) {
case PortIndex_Mitm:
return this->AcceptMitmImpl(server, sf::CreateSharedObjectEmplaced<IResolver, ResolverImpl>(decltype(fsrv)(fsrv), client_info), fsrv);
R_RETURN(this->AcceptMitmImpl(server, sf::CreateSharedObjectEmplaced<IResolver, ResolverImpl>(decltype(fsrv)(fsrv), client_info), fsrv));
AMS_UNREACHABLE_DEFAULT_CASE();
}
}

View file

@ -157,17 +157,17 @@ namespace ams::mitm::fs {
R_UNLESS(try_program_specific, sm::mitm::ResultShouldForwardToSession());
/* If we're not opening a HBL filesystem, just try to open a generic one. */
return OpenProgramSpecificWebContentFileSystem(out, program_id, filesystem_type, fwd, path, with_id);
R_RETURN(OpenProgramSpecificWebContentFileSystem(out, program_id, filesystem_type, fwd, path, with_id));
}
}
Result FsMitmService::OpenFileSystemWithPatch(sf::Out<sf::SharedPointer<ams::fssrv::sf::IFileSystem>> out, ncm::ProgramId program_id, u32 _filesystem_type) {
return OpenWebContentFileSystem(out, m_client_info.program_id, program_id, static_cast<FsFileSystemType>(_filesystem_type), m_forward_service.get(), nullptr, false, m_client_info.override_status.IsProgramSpecific());
R_RETURN(OpenWebContentFileSystem(out, m_client_info.program_id, program_id, static_cast<FsFileSystemType>(_filesystem_type), m_forward_service.get(), nullptr, false, m_client_info.override_status.IsProgramSpecific()));
}
Result FsMitmService::OpenFileSystemWithId(sf::Out<sf::SharedPointer<ams::fssrv::sf::IFileSystem>> out, const fssrv::sf::Path &path, ncm::ProgramId program_id, u32 _filesystem_type) {
return OpenWebContentFileSystem(out, m_client_info.program_id, program_id, static_cast<FsFileSystemType>(_filesystem_type), m_forward_service.get(), std::addressof(path), true, m_client_info.override_status.IsProgramSpecific());
R_RETURN(OpenWebContentFileSystem(out, m_client_info.program_id, program_id, static_cast<FsFileSystemType>(_filesystem_type), m_forward_service.get(), std::addressof(path), true, m_client_info.override_status.IsProgramSpecific()));
}
Result FsMitmService::OpenSdCardFileSystem(sf::Out<sf::SharedPointer<ams::fssrv::sf::IFileSystem>> out) {

View file

@ -74,7 +74,7 @@ namespace ams::mitm::fs {
/* Check if we have nothing to do. */
R_SUCCEED_IF(size == 0);
return Base::Read(offset, _buffer, size);
R_RETURN(Base::Read(offset, _buffer, size));
}
Result Boot0Storage::Write(s64 offset, const void *_buffer, size_t size) {
@ -115,7 +115,7 @@ namespace ams::mitm::fs {
/* We want to protect AutoRCM from NS on ipatched units. If we can modify bct pubks or we're not touching any of them, proceed. */
if (this->CanModifyBctPublicKey() || offset >= BctEndOffset || (util::AlignUp(offset, BctSize) >= BctEndOffset && (offset % BctSize) >= BctPubkEnd)) {
return Base::Write(offset, buffer, size);
R_RETURN(Base::Write(offset, buffer, size));
}
/* Handle any data written past the end of the pubk region. */
@ -136,7 +136,7 @@ namespace ams::mitm::fs {
}
}
return Base::Write(0, g_boot0_bct_buffer, BctEndOffset);
R_RETURN(Base::Write(0, g_boot0_bct_buffer, BctEndOffset));
}
CustomPublicKeyBoot0Storage::CustomPublicKeyBoot0Storage(FsStorage &s, const sm::MitmProcessInfo &c, spl::SocType soc) : Base(s), m_client_info(c), m_soc_type(soc) {
@ -174,7 +174,7 @@ namespace ams::mitm::fs {
R_SUCCEED_IF(size == 0);
/* Perform whatever remains of the read. */
return Base::Read(offset, buffer, size);
R_RETURN(Base::Read(offset, buffer, size));
}
Result CustomPublicKeyBoot0Storage::Write(s64 offset, const void *_buffer, size_t size) {
@ -236,7 +236,7 @@ namespace ams::mitm::fs {
R_SUCCEED_IF(size == 0);
/* Perform whatever remains of the write. */
return Base::Write(offset, buffer, size);
R_RETURN(Base::Write(offset, buffer, size));
}
bool DetectBoot0CustomPublicKey(::FsStorage &storage) {

View file

@ -41,7 +41,7 @@ namespace ams::mitm::fs {
/* Fast case. */
if (sector_ofs == 0 && util::IsAligned(size, SectorSize)) {
return Base::Read(offset, buffer, size);
R_RETURN(Base::Read(offset, buffer, size));
}
R_TRY(Base::Read(seek, m_sector_buf, SectorSize));
@ -85,7 +85,7 @@ namespace ams::mitm::fs {
/* Fast case. */
if (sector_ofs == 0 && util::IsAligned(size, SectorSize)) {
return Base::Write(offset, buffer, size);
R_RETURN(Base::Write(offset, buffer, size));
}
/* Load existing sector data. */

View file

@ -25,6 +25,7 @@ namespace ams::mitm::fs {
constinit os::SdkMutex g_cal0_access_mutex;
}
Result CalibrationBinaryStorage::Read(s64 offset, void *_buffer, size_t size) {
/* Acquire exclusive calibration binary access. */
std::scoped_lock lk(g_cal0_access_mutex);
@ -74,7 +75,7 @@ namespace ams::mitm::fs {
R_SUCCEED_IF(size == 0);
/* Handle any remaining data. */
return Base::Read(offset, buffer, size);
R_RETURN(Base::Read(offset, buffer, size));
}
Result CalibrationBinaryStorage::Write(s64 offset, const void *_buffer, size_t size) {
@ -129,7 +130,7 @@ namespace ams::mitm::fs {
R_SUCCEED_IF(size == 0);
/* Handle any remaining data. */
return Base::Write(offset, buffer, size);
R_RETURN(Base::Write(offset, buffer, size));
}
}

View file

@ -179,31 +179,31 @@ namespace ams::mitm::fs {
virtual Result Read(s64 offset, void *buffer, size_t size) override {
return m_impl->Read(offset, buffer, size);
R_RETURN(m_impl->Read(offset, buffer, size));
}
virtual Result GetSize(s64 *out_size) override {
return m_impl->GetSize(out_size);
R_RETURN(m_impl->GetSize(out_size));
}
virtual Result Flush() override {
return m_impl->Flush();
R_RETURN(m_impl->Flush());
}
virtual Result OperateRange(void *dst, size_t dst_size, ams::fs::OperationId op_id, s64 offset, s64 size, const void *src, size_t src_size) override {
return m_impl->OperateRange(dst, dst_size, op_id, offset, size, src, src_size);
R_RETURN(m_impl->OperateRange(dst, dst_size, op_id, offset, size, src, src_size));
}
virtual Result Write(s64 offset, const void *buffer, size_t size) override {
/* TODO: Better result code? */
AMS_UNUSED(offset, buffer, size);
return ams::fs::ResultUnsupportedOperation();
R_THROW(ams::fs::ResultUnsupportedOperation())
}
virtual Result SetSize(s64 size) override {
/* TODO: Better result code? */
AMS_UNUSED(size);
return ams::fs::ResultUnsupportedOperation();
R_THROW(ams::fs::ResultUnsupportedOperation())
}
};

View file

@ -53,7 +53,7 @@ namespace ams::mitm::fs {
switch (port_index) {
case PortIndex_Mitm:
return this->AcceptMitmImpl(server, sf::CreateSharedObjectEmplaced<IFsMitmInterface, FsMitmService>(decltype(fsrv)(fsrv), client_info), fsrv);
R_RETURN(this->AcceptMitmImpl(server, sf::CreateSharedObjectEmplaced<IFsMitmInterface, FsMitmService>(decltype(fsrv)(fsrv), client_info), fsrv));
AMS_UNREACHABLE_DEFAULT_CASE();
}
}

View file

@ -29,52 +29,52 @@ namespace ams::mitm::fs {
private:
virtual Result DoCreateFile(const ams::fs::Path &path, s64 size, int flags) override final {
AMS_UNUSED(path, size, flags);
return ams::fs::ResultUnsupportedOperation();
R_THROW(ams::fs::ResultUnsupportedOperation())
}
virtual Result DoDeleteFile(const ams::fs::Path &path) override final {
AMS_UNUSED(path);
return ams::fs::ResultUnsupportedOperation();
R_THROW(ams::fs::ResultUnsupportedOperation())
}
virtual Result DoCreateDirectory(const ams::fs::Path &path) override final {
AMS_UNUSED(path);
return ams::fs::ResultUnsupportedOperation();
R_THROW(ams::fs::ResultUnsupportedOperation())
}
virtual Result DoDeleteDirectory(const ams::fs::Path &path) override final {
AMS_UNUSED(path);
return ams::fs::ResultUnsupportedOperation();
R_THROW(ams::fs::ResultUnsupportedOperation())
}
virtual Result DoDeleteDirectoryRecursively(const ams::fs::Path &path) override final {
AMS_UNUSED(path);
return ams::fs::ResultUnsupportedOperation();
R_THROW(ams::fs::ResultUnsupportedOperation())
}
virtual Result DoRenameFile(const ams::fs::Path &old_path, const ams::fs::Path &new_path) override final {
AMS_UNUSED(old_path, new_path);
return ams::fs::ResultUnsupportedOperation();
R_THROW(ams::fs::ResultUnsupportedOperation())
}
virtual Result DoRenameDirectory(const ams::fs::Path &old_path, const ams::fs::Path &new_path) override final {
AMS_UNUSED(old_path, new_path);
return ams::fs::ResultUnsupportedOperation();
R_THROW(ams::fs::ResultUnsupportedOperation())
}
virtual Result DoGetEntryType(ams::fs::DirectoryEntryType *out, const ams::fs::Path &path) override final {
R_SUCCEED_IF(R_SUCCEEDED(m_fs_1.GetEntryType(out, path)));
return m_fs_2.GetEntryType(out, path);
R_RETURN(m_fs_2.GetEntryType(out, path));
}
virtual Result DoOpenFile(std::unique_ptr<ams::fs::fsa::IFile> *out_file, const ams::fs::Path &path, ams::fs::OpenMode mode) override final {
R_SUCCEED_IF(R_SUCCEEDED(m_fs_1.OpenFile(out_file, path, mode)));
return m_fs_2.OpenFile(out_file, path, mode);
R_RETURN(m_fs_2.OpenFile(out_file, path, mode));
}
virtual Result DoOpenDirectory(std::unique_ptr<ams::fs::fsa::IDirectory> *out_dir, const ams::fs::Path &path, ams::fs::OpenDirectoryMode mode) override final {
R_SUCCEED_IF(R_SUCCEEDED(m_fs_1.OpenDirectory(out_dir, path, mode)));
return m_fs_2.OpenDirectory(out_dir, path, mode);
R_RETURN(m_fs_2.OpenDirectory(out_dir, path, mode));
}
virtual Result DoCommit() override final {
@ -83,22 +83,22 @@ namespace ams::mitm::fs {
virtual Result DoGetFreeSpaceSize(s64 *out, const ams::fs::Path &path) {
AMS_UNUSED(out, path);
return ams::fs::ResultUnsupportedOperation();
R_THROW(ams::fs::ResultUnsupportedOperation())
}
virtual Result DoGetTotalSpaceSize(s64 *out, const ams::fs::Path &path) {
AMS_UNUSED(out, path);
return ams::fs::ResultUnsupportedOperation();
R_THROW(ams::fs::ResultUnsupportedOperation())
}
virtual Result DoCleanDirectoryRecursively(const ams::fs::Path &path) {
AMS_UNUSED(path);
return ams::fs::ResultUnsupportedOperation();
R_THROW(ams::fs::ResultUnsupportedOperation())
}
virtual Result DoGetFileTimeStampRaw(ams::fs::FileTimeStampRaw *out, const ams::fs::Path &path) {
R_SUCCEED_IF(R_SUCCEEDED(m_fs_1.GetFileTimeStampRaw(out, path)));
return m_fs_2.GetFileTimeStampRaw(out, path);
R_RETURN(m_fs_2.GetFileTimeStampRaw(out, path));
}
};

View file

@ -20,7 +20,7 @@
namespace ams::mitm::ns {
Result NsAmMitmService::GetApplicationContentPath(const sf::OutBuffer &out_path, ncm::ProgramId application_id, u8 content_type) {
return nsamGetApplicationContentPathFwd(m_forward_service.get(), out_path.GetPointer(), out_path.GetSize(), static_cast<u64>(application_id), static_cast<NcmContentType>(content_type));
R_RETURN(nsamGetApplicationContentPathFwd(m_forward_service.get(), out_path.GetPointer(), out_path.GetSize(), static_cast<u64>(application_id), static_cast<NcmContentType>(content_type)));
}
Result NsAmMitmService::ResolveApplicationContentPath(ncm::ProgramId application_id, u8 content_type) {
@ -31,11 +31,11 @@ namespace ams::mitm::ns {
nsamResolveApplicationContentPathFwd(m_forward_service.get(), static_cast<u64>(application_id), static_cast<NcmContentType>(content_type));
R_SUCCEED();
}
return nsamResolveApplicationContentPathFwd(m_forward_service.get(), static_cast<u64>(application_id), static_cast<NcmContentType>(content_type));
R_RETURN(nsamResolveApplicationContentPathFwd(m_forward_service.get(), static_cast<u64>(application_id), static_cast<NcmContentType>(content_type)));
}
Result NsAmMitmService::GetRunningApplicationProgramId(sf::Out<ncm::ProgramId> out, ncm::ProgramId application_id) {
return nsamGetRunningApplicationProgramIdFwd(m_forward_service.get(), reinterpret_cast<u64 *>(out.GetPointer()), static_cast<u64>(application_id));
R_RETURN(nsamGetRunningApplicationProgramIdFwd(m_forward_service.get(), reinterpret_cast<u64 *>(out.GetPointer()), static_cast<u64>(application_id)));
}
}

View file

@ -19,7 +19,7 @@
namespace ams::mitm::ns {
Result NsDocumentService::GetApplicationContentPath(const sf::OutBuffer &out_path, ncm::ProgramId application_id, u8 content_type) {
return nswebGetApplicationContentPath(m_srv.get(), out_path.GetPointer(), out_path.GetSize(), static_cast<u64>(application_id), static_cast<NcmContentType>(content_type));
R_RETURN(nswebGetApplicationContentPath(m_srv.get(), out_path.GetPointer(), out_path.GetSize(), static_cast<u64>(application_id), static_cast<NcmContentType>(content_type)));
}
Result NsDocumentService::ResolveApplicationContentPath(ncm::ProgramId application_id, u8 content_type) {
@ -30,11 +30,11 @@ namespace ams::mitm::ns {
nswebResolveApplicationContentPath(m_srv.get(), static_cast<u64>(application_id), static_cast<NcmContentType>(content_type));
R_SUCCEED();
}
return nswebResolveApplicationContentPath(m_srv.get(), static_cast<u64>(application_id), static_cast<NcmContentType>(content_type));
R_RETURN(nswebResolveApplicationContentPath(m_srv.get(), static_cast<u64>(application_id), static_cast<NcmContentType>(content_type)));
}
Result NsDocumentService::GetRunningApplicationProgramId(sf::Out<ncm::ProgramId> out, ncm::ProgramId application_id) {
return nswebGetRunningApplicationProgramId(m_srv.get(), reinterpret_cast<u64 *>(out.GetPointer()), static_cast<u64>(application_id));
R_RETURN(nswebGetRunningApplicationProgramId(m_srv.get(), reinterpret_cast<u64 *>(out.GetPointer()), static_cast<u64>(application_id)));
}
Result NsWebMitmService::GetDocumentInterface(sf::Out<sf::SharedPointer<impl::IDocumentInterface>> out) {

View file

@ -57,9 +57,9 @@ namespace ams::mitm::ns {
switch (port_index) {
case PortIndex_Mitm:
if (hos::GetVersion() < hos::Version_3_0_0) {
return this->AcceptMitmImpl(server, sf::CreateSharedObjectEmplaced<impl::IAmMitmInterface, NsAmMitmService>(decltype(fsrv)(fsrv), client_info), fsrv);
R_RETURN(this->AcceptMitmImpl(server, sf::CreateSharedObjectEmplaced<impl::IAmMitmInterface, NsAmMitmService>(decltype(fsrv)(fsrv), client_info), fsrv));
} else {
return this->AcceptMitmImpl(server, sf::CreateSharedObjectEmplaced<impl::IWebMitmInterface, NsWebMitmService>(decltype(fsrv)(fsrv), client_info), fsrv);
R_RETURN(this->AcceptMitmImpl(server, sf::CreateSharedObjectEmplaced<impl::IWebMitmInterface, NsWebMitmService>(decltype(fsrv)(fsrv), client_info), fsrv));
}
AMS_UNREACHABLE_DEFAULT_CASE();

View file

@ -57,9 +57,9 @@ namespace ams::mitm::settings {
switch (port_index) {
case PortIndex_SetMitm:
return this->AcceptMitmImpl(server, sf::CreateSharedObjectEmplaced<ISetMitmInterface, SetMitmService>(decltype(fsrv)(fsrv), client_info), fsrv);
R_RETURN(this->AcceptMitmImpl(server, sf::CreateSharedObjectEmplaced<ISetMitmInterface, SetMitmService>(decltype(fsrv)(fsrv), client_info), fsrv));
case PortIndex_SetSysMitm:
return this->AcceptMitmImpl(server, sf::CreateSharedObjectEmplaced<ISetSysMitmInterface, SetSysMitmService>(decltype(fsrv)(fsrv), client_info), fsrv);
R_RETURN(this->AcceptMitmImpl(server, sf::CreateSharedObjectEmplaced<ISetSysMitmInterface, SetSysMitmService>(decltype(fsrv)(fsrv), client_info), fsrv));
AMS_UNREACHABLE_DEFAULT_CASE();
}
}

View file

@ -99,7 +99,7 @@ namespace ams::mitm::settings {
}
Result SetSysMitmService::GetFirmwareVersion2(sf::Out<settings::FirmwareVersion> out) {
return GetFirmwareVersionImpl(out.GetPointer(), m_client_info);
R_RETURN(GetFirmwareVersionImpl(out.GetPointer(), m_client_info));
}
Result SetSysMitmService::GetSettingsItemValueSize(sf::Out<u64> out_size, const settings::SettingsName &name, const settings::SettingsItemKey &key) {

View file

@ -273,7 +273,7 @@ namespace ams::settings::fwdbg {
Result ParseSettingsItemValue(const char *name, const char *key, const char *value) {
R_TRY(ValidateSettingsName(name));
R_TRY(ValidateSettingsItemKey(key));
return ParseSettingsItemValueImpl(name, key, value);
R_RETURN(ParseSettingsItemValueImpl(name, key, value));
}
static int SystemSettingsIniHandler(void *user, const char *name, const char *key, const char *value) {

View file

@ -70,7 +70,7 @@ namespace ams::mitm::sysupdater {
}
Result AsyncPrepareSdCardUpdateImpl::Execute() {
return m_task->PrepareAndExecute();
R_RETURN(m_task->PrepareAndExecute());
}
void AsyncPrepareSdCardUpdateImpl::CancelImpl() {

View file

@ -29,28 +29,21 @@ namespace ams::mitm::sysupdater {
template<typename T>
Result SaveErrorContextIfFailed(T &async, Result result) {
if (R_FAILED(result)) {
async.GetErrorContext(std::addressof(m_error_context));
return result;
}
ON_RESULT_FAILURE { async.GetErrorContext(std::addressof(m_error_context)); };
R_SUCCEED();
R_RETURN(result);
}
template<typename T>
Result GetAndSaveErrorContext(T &async) {
R_TRY(this->SaveErrorContextIfFailed(async, async.Get()));
R_SUCCEED();
R_RETURN(this->SaveErrorContextIfFailed(async, async.Get()));
}
template<typename T>
Result SaveInternalTaskErrorContextIfFailed(T &async, Result result) {
if (R_FAILED(result)) {
async.CreateErrorContext(std::addressof(m_error_context));
return result;
}
ON_RESULT_FAILURE { async.CreateErrorContext(std::addressof(m_error_context)); };
R_SUCCEED();
R_RETURN(result);
}
const err::ErrorContext &GetErrorContextImpl() {
@ -82,7 +75,7 @@ namespace ams::mitm::sysupdater {
virtual ~AsyncResultBase() { /* ... */ }
Result Get() {
return ToAsyncResult(this->GetImpl());
R_RETURN(ToAsyncResult(this->GetImpl()));
}
private:
virtual Result GetImpl() = 0;

View file

@ -208,8 +208,8 @@ namespace ams::mitm::sysupdater {
/* Open the appropriate interface. */
const auto * const creator_intfs = fssystem::GetFileSystemCreatorInterfaces();
switch (fs_type) {
case fssystem::NcaFsHeader::FsType::PartitionFs: return creator_intfs->partition_fs_creator->Create(out, std::move(storage));
case fssystem::NcaFsHeader::FsType::RomFs: return creator_intfs->rom_fs_creator->Create(out, std::move(storage));
case fssystem::NcaFsHeader::FsType::PartitionFs: R_RETURN(creator_intfs->partition_fs_creator->Create(out, std::move(storage)));
case fssystem::NcaFsHeader::FsType::RomFs: R_RETURN(creator_intfs->rom_fs_creator->Create(out, std::move(storage)));
default:
R_THROW(fs::ResultInvalidNcaFileSystemType());
}
@ -248,7 +248,7 @@ namespace ams::mitm::sysupdater {
R_UNLESS(unique_fs != nullptr, fs::ResultAllocationMemoryFailedNew());
/* Register the fs. */
return ams::fs::fsa::Register(mount_name, std::move(unique_fs));
R_RETURN(ams::fs::fsa::Register(mount_name, std::move(unique_fs)));
}
}

View file

@ -60,7 +60,7 @@ namespace ams::mitm::sysupdater {
const size_t path_len = util::SNPrintf(package_path, sizeof(package_path), "%s%s", package_root_path, entry_path);
AMS_ABORT_UNLESS(path_len < ams::fs::EntryNameLengthMax);
return ams::fs::ConvertToFsCommonPath(dst, dst_size, package_path);
R_RETURN(ams::fs::ConvertToFsCommonPath(dst, dst_size, package_path));
}
Result LoadContentMeta(ncm::AutoBuffer *out, const char *package_root_path, const fs::DirectoryEntry &entry) {
@ -69,7 +69,7 @@ namespace ams::mitm::sysupdater {
char path[ams::fs::EntryNameLengthMax];
R_TRY(ConvertToFsCommonPath(path, sizeof(path), package_root_path, entry.name));
return ncm::ReadContentMetaPathAlongWithExtendedDataAndDigest(out, path);
R_RETURN(ncm::ReadContentMetaPathAlongWithExtendedDataAndDigest(out, path));
}
Result ReadContentMetaPath(ncm::AutoBuffer *out, const char *package_root, const ncm::ContentInfo &content_info) {
@ -84,7 +84,7 @@ namespace ams::mitm::sysupdater {
R_TRY(ConvertToFsCommonPath(content_path.str, sizeof(content_path.str), package_root, cnmt_nca_name));
/* Read the content meta path. */
return ncm::ReadContentMetaPathAlongWithExtendedDataAndDigest(out, content_path.str);
R_RETURN(ncm::ReadContentMetaPathAlongWithExtendedDataAndDigest(out, content_path.str));
}
Result GetSystemUpdateUpdateContentInfoFromPackage(ncm::ContentInfo *out, const char *package_root) {
@ -154,7 +154,7 @@ namespace ams::mitm::sysupdater {
/* Declare helper for result validation. */
auto ValidateResult = [&](Result result) ALWAYS_INLINE_LAMBDA -> Result {
*out_result = result;
return result;
R_RETURN(result);
};
/* Iterate over all files to find all content metas. */
@ -411,11 +411,11 @@ namespace ams::mitm::sysupdater {
};
Result SystemUpdateService::SetupUpdate(sf::CopyHandle &&transfer_memory, u64 transfer_memory_size, const ncm::Path &path, bool exfat) {
return this->SetupUpdateImpl(std::move(transfer_memory), transfer_memory_size, path, exfat, GetFirmwareVariationId());
R_RETURN(this->SetupUpdateImpl(std::move(transfer_memory), transfer_memory_size, path, exfat, GetFirmwareVariationId()));
}
Result SystemUpdateService::SetupUpdateWithVariation(sf::CopyHandle &&transfer_memory, u64 transfer_memory_size, const ncm::Path &path, bool exfat, ncm::FirmwareVariationId firmware_variation_id) {
return this->SetupUpdateImpl(std::move(transfer_memory), transfer_memory_size, path, exfat, firmware_variation_id);
R_RETURN(this->SetupUpdateImpl(std::move(transfer_memory), transfer_memory_size, path, exfat, firmware_variation_id));
}
Result SystemUpdateService::RequestPrepareUpdate(sf::OutCopyHandle out_event_handle, sf::Out<sf::SharedPointer<ns::impl::IAsyncResult>> out_async) {

View file

@ -46,35 +46,35 @@ namespace ams::boot {
}
Result GetChargePercentage(float *out) {
return powctl::GetBatteryChargePercentage(out, s_battery_session);
R_RETURN(powctl::GetBatteryChargePercentage(out, s_battery_session));
}
Result GetAverageVCell(int *out) {
return powctl::GetBatteryAverageVCell(out, s_battery_session);
R_RETURN(powctl::GetBatteryAverageVCell(out, s_battery_session));
}
Result GetVoltageFuelGaugePercentage(float *out) {
return powctl::GetBatteryVoltageFuelGaugePercentage(out, s_battery_session);
R_RETURN(powctl::GetBatteryVoltageFuelGaugePercentage(out, s_battery_session));
}
Result GetAverageCurrent(int *out) {
return powctl::GetBatteryAverageCurrent(out, s_battery_session);
R_RETURN(powctl::GetBatteryAverageCurrent(out, s_battery_session));
}
Result GetCurrent(int *out) {
return powctl::GetBatteryCurrent(out, s_battery_session);
R_RETURN(powctl::GetBatteryCurrent(out, s_battery_session));
}
Result GetTemperature(float *out) {
return powctl::GetBatteryTemperature(out, s_battery_session);
R_RETURN(powctl::GetBatteryTemperature(out, s_battery_session));
}
Result IsI2cShutdownEnabled(bool *out) {
return powctl::IsBatteryI2cShutdownEnabled(out, s_battery_session);
R_RETURN(powctl::IsBatteryI2cShutdownEnabled(out, s_battery_session));
}
Result SetI2cShutdownEnabled(bool en) {
return powctl::SetBatteryI2cShutdownEnabled(s_battery_session, en);
R_RETURN(powctl::SetBatteryI2cShutdownEnabled(s_battery_session, en));
}
};

View file

@ -62,35 +62,35 @@ namespace ams::boot {
}
Result GetChargeCurrentState(powctl::ChargeCurrentState *out) {
return powctl::GetChargerChargeCurrentState(out, m_charger_session);
R_RETURN(powctl::GetChargerChargeCurrentState(out, m_charger_session));
}
Result SetChargeCurrentState(powctl::ChargeCurrentState state) {
return powctl::SetChargerChargeCurrentState(m_charger_session, state);
R_RETURN(powctl::SetChargerChargeCurrentState(m_charger_session, state));
}
Result GetInputCurrentLimit(int *out) {
return powctl::GetChargerInputCurrentLimit(out, m_charger_session);
R_RETURN(powctl::GetChargerInputCurrentLimit(out, m_charger_session));
}
Result SetChargerConfiguration(powctl::ChargerConfiguration cfg) {
return powctl::SetChargerChargerConfiguration(m_charger_session, cfg);
R_RETURN(powctl::SetChargerChargerConfiguration(m_charger_session, cfg));
}
Result GetFastChargeCurrentLimit(int *out) {
return powctl::GetChargerFastChargeCurrentLimit(out, m_charger_session);
R_RETURN(powctl::GetChargerFastChargeCurrentLimit(out, m_charger_session));
}
Result SetFastChargeCurrentLimit(int limit) {
return powctl::SetChargerFastChargeCurrentLimit(m_charger_session, limit);
R_RETURN(powctl::SetChargerFastChargeCurrentLimit(m_charger_session, limit));
}
Result GetChargeVoltageLimit(int *out) {
return powctl::GetChargerChargeVoltageLimit(out, m_charger_session);
R_RETURN(powctl::GetChargerChargeVoltageLimit(out, m_charger_session));
}
Result SetChargeVoltageLimit(int limit) {
return powctl::SetChargerChargeVoltageLimit(m_charger_session, limit);
R_RETURN(powctl::SetChargerChargeVoltageLimit(m_charger_session, limit));
}
Result GetChargerStatus(boot::ChargerStatus *out) {
@ -111,19 +111,19 @@ namespace ams::boot {
}
Result GetBatteryCompensation(int *out) {
return powctl::GetChargerBatteryCompensation(out, m_charger_session);
R_RETURN(powctl::GetChargerBatteryCompensation(out, m_charger_session));
}
Result SetBatteryCompensation(int v) {
return powctl::SetChargerBatteryCompensation(m_charger_session, v);
R_RETURN(powctl::SetChargerBatteryCompensation(m_charger_session, v));
}
Result GetVoltageClamp(int *out) {
return powctl::GetChargerVoltageClamp(out, m_charger_session);
R_RETURN(powctl::GetChargerVoltageClamp(out, m_charger_session));
}
Result SetVoltageClamp(int v) {
return powctl::SetChargerVoltageClamp(m_charger_session, v);
R_RETURN(powctl::SetChargerVoltageClamp(m_charger_session, v));
}
};

View file

@ -49,7 +49,7 @@ namespace ams::boot {
R_ABORT_UNLESS(formatter.EnqueueSendCommand(i2c::TransactionOption_StartCondition, cmd, cmd_size));
R_ABORT_UNLESS(formatter.EnqueueReceiveCommand(static_cast<i2c::TransactionOption>(i2c::TransactionOption_StartCondition | i2c::TransactionOption_StopCondition), dst_size));
return RetryUntilSuccess([&]() { return i2c::driver::ExecuteCommandList(dst, dst_size, session, cmd_list, formatter.GetCurrentLength()); });
R_RETURN(RetryUntilSuccess([&]() { R_RETURN(i2c::driver::ExecuteCommandList(dst, dst_size, session, cmd_list, formatter.GetCurrentLength())); }));
}
Result WriteI2cRegister(i2c::driver::I2cSession &session, const u8 *src, size_t src_size, const u8 *cmd, size_t cmd_size) {
@ -62,11 +62,11 @@ namespace ams::boot {
std::memcpy(cmd_list + 0, cmd, cmd_size);
std::memcpy(cmd_list + cmd_size, src, src_size);
return RetryUntilSuccess([&]() { return i2c::driver::Send(session, cmd_list, src_size + cmd_size, static_cast<i2c::TransactionOption>(i2c::TransactionOption_StartCondition | i2c::TransactionOption_StopCondition)); });
R_RETURN(RetryUntilSuccess([&]() { R_RETURN(i2c::driver::Send(session, cmd_list, src_size + cmd_size, static_cast<i2c::TransactionOption>(i2c::TransactionOption_StartCondition | i2c::TransactionOption_StopCondition))); }));
}
Result WriteI2cRegister(i2c::driver::I2cSession &session, const u8 address, const u8 value) {
return WriteI2cRegister(session, std::addressof(value), sizeof(value), &address, sizeof(address));
R_RETURN(WriteI2cRegister(session, std::addressof(value), sizeof(value), &address, sizeof(address)));
}
}

View file

@ -36,17 +36,17 @@ namespace ams::boot {
Result PmicDriver::GetOnOffIrq(u8 *out) {
const u8 addr = 0x0B;
return ReadI2cRegister(m_i2c_session, out, sizeof(*out), std::addressof(addr), sizeof(addr));
R_RETURN(ReadI2cRegister(m_i2c_session, out, sizeof(*out), std::addressof(addr), sizeof(addr)));
}
Result PmicDriver::GetPowerStatus(u8 *out) {
const u8 addr = 0x15;
return ReadI2cRegister(m_i2c_session, out, sizeof(*out), std::addressof(addr), sizeof(addr));
R_RETURN(ReadI2cRegister(m_i2c_session, out, sizeof(*out), std::addressof(addr), sizeof(addr)));
}
Result PmicDriver::GetNvErc(u8 *out) {
const u8 addr = 0x0C;
return ReadI2cRegister(m_i2c_session, out, sizeof(*out), std::addressof(addr), sizeof(addr));
R_RETURN(ReadI2cRegister(m_i2c_session, out, sizeof(*out), std::addressof(addr), sizeof(addr)));
}
Result PmicDriver::GetPowerButtonPressed(bool *out) {

View file

@ -23,17 +23,17 @@ namespace ams::boot {
const u8 update_val = 0x10;
R_TRY(WriteI2cRegister(m_i2c_session, &update_val, sizeof(update_val), &update_addr, sizeof(update_addr)));
os::SleepThread(TimeSpan::FromMilliSeconds(16));
return ReadI2cRegister(m_i2c_session, out, sizeof(*out), &address, sizeof(address));
R_RETURN(ReadI2cRegister(m_i2c_session, out, sizeof(*out), &address, sizeof(address)));
}
Result RtcDriver::GetRtcIntr(u8 *out) {
const u8 addr = 0x00;
return ReadI2cRegister(m_i2c_session, out, sizeof(*out), &addr, sizeof(addr));
R_RETURN(ReadI2cRegister(m_i2c_session, out, sizeof(*out), &addr, sizeof(addr)));
}
Result RtcDriver::GetRtcIntrM(u8 *out) {
const u8 addr = 0x01;
return this->ReadRtcRegister(out, addr);
R_RETURN(this->ReadRtcRegister(out, addr));
}
}

View file

@ -48,7 +48,7 @@ namespace ams::dmnt {
AMS_DMNT2_GDB_LOG_DEBUG("BreakPointManager::SetBreakPoint %p 0x%lx !!! Fail 0x%08x !!!\n", bp, bp->m_address, result.GetValue());
}
return result;
R_RETURN(result);
}
}

View file

@ -45,7 +45,7 @@ namespace ams::dmnt {
for (size_t i = 0; (bp = static_cast<BreakPointBase *>(this->GetBreakPoint(i))) != nullptr; ++i) {
if (bp->m_in_use && bp->m_address == address) {
AMS_ABORT_UNLESS(bp->m_size == size);
return bp->Clear(m_debug_process);
R_RETURN(bp->Clear(m_debug_process));
}
}
R_SUCCEED();

View file

@ -281,24 +281,24 @@ namespace ams::dmnt {
}
Result DebugProcess::GetThreadContext(svc::ThreadContext *out, u64 thread_id, u32 flags) {
return svc::GetDebugThreadContext(out, m_debug_handle, thread_id, flags);
R_RETURN(svc::GetDebugThreadContext(out, m_debug_handle, thread_id, flags));
}
Result DebugProcess::SetThreadContext(const svc::ThreadContext *ctx, u64 thread_id, u32 flags) {
return svc::SetDebugThreadContext(m_debug_handle, thread_id, ctx, flags);
R_RETURN(svc::SetDebugThreadContext(m_debug_handle, thread_id, ctx, flags));
}
Result DebugProcess::ReadMemory(void *dst, uintptr_t address, size_t size) {
return svc::ReadDebugProcessMemory(reinterpret_cast<uintptr_t>(dst), m_debug_handle, address, size);
R_RETURN(svc::ReadDebugProcessMemory(reinterpret_cast<uintptr_t>(dst), m_debug_handle, address, size));
}
Result DebugProcess::WriteMemory(const void *src, uintptr_t address, size_t size) {
return svc::WriteDebugProcessMemory(m_debug_handle, reinterpret_cast<uintptr_t>(src), address, size);
R_RETURN(svc::WriteDebugProcessMemory(m_debug_handle, reinterpret_cast<uintptr_t>(src), address, size));
}
Result DebugProcess::QueryMemory(svc::MemoryInfo *out, uintptr_t address) {
svc::PageInfo dummy;
return svc::QueryDebugProcessMemory(out, std::addressof(dummy), m_debug_handle, address);
R_RETURN(svc::QueryDebugProcessMemory(out, std::addressof(dummy), m_debug_handle, address));
}
Result DebugProcess::Continue() {
@ -333,7 +333,7 @@ namespace ams::dmnt {
Result DebugProcess::Step() {
AMS_DMNT2_GDB_LOG_DEBUG("DebugProcess::Step() all\n");
return this->Step(this->GetLastThreadId());
R_RETURN(this->Step(this->GetLastThreadId()));
}
Result DebugProcess::Step(u64 thread_id) {
@ -385,7 +385,7 @@ namespace ams::dmnt {
Result DebugProcess::Break() {
if (this->GetStatus() == ProcessStatus_Running) {
AMS_DMNT2_GDB_LOG_DEBUG("DebugProcess::Break\n");
return svc::BreakDebugProcess(m_debug_handle);
R_RETURN(svc::BreakDebugProcess(m_debug_handle));
} else {
AMS_DMNT2_GDB_LOG_ERROR("DebugProcess::Break called on non-running process!\n");
R_SUCCEED();
@ -467,7 +467,7 @@ namespace ams::dmnt {
}
Result DebugProcess::SetBreakPoint(uintptr_t address, size_t size, bool is_step) {
return m_software_breakpoints.SetBreakPoint(address, size, is_step);
R_RETURN(m_software_breakpoints.SetBreakPoint(address, size, is_step));
}
Result DebugProcess::ClearBreakPoint(uintptr_t address, size_t size) {
@ -476,7 +476,7 @@ namespace ams::dmnt {
}
Result DebugProcess::SetHardwareBreakPoint(uintptr_t address, size_t size, bool is_step) {
return m_hardware_breakpoints.SetBreakPoint(address, size, is_step);
R_RETURN(m_hardware_breakpoints.SetBreakPoint(address, size, is_step));
}
Result DebugProcess::ClearHardwareBreakPoint(uintptr_t address, size_t size) {
@ -485,15 +485,15 @@ namespace ams::dmnt {
}
Result DebugProcess::SetWatchPoint(u64 address, u64 size, bool read, bool write) {
return m_hardware_watchpoints.SetWatchPoint(address, size, read, write);
R_RETURN(m_hardware_watchpoints.SetWatchPoint(address, size, read, write));
}
Result DebugProcess::ClearWatchPoint(u64 address, u64 size) {
return m_hardware_watchpoints.ClearBreakPoint(address, size);
R_RETURN(m_hardware_watchpoints.ClearBreakPoint(address, size));
}
Result DebugProcess::GetWatchPointInfo(u64 address, bool &read, bool &write) {
return m_hardware_watchpoints.GetWatchPointInfo(address, read, write);
R_RETURN(m_hardware_watchpoints.GetWatchPointInfo(address, read, write));
}
bool DebugProcess::IsValidWatchPoint(u64 address, u64 size) {

View file

@ -957,7 +957,7 @@ namespace ams::dmnt {
s32 dummy = -1;
svc::Handle handle = m_debug_process.GetHandle();
return svc::WaitSynchronization(std::addressof(dummy), std::addressof(handle), 1, TimeSpan::FromMilliSeconds(20).GetNanoSeconds());
R_RETURN(svc::WaitSynchronization(std::addressof(dummy), std::addressof(handle), 1, TimeSpan::FromMilliSeconds(20).GetNanoSeconds()));
}();
/* Check if we're killed. */

View file

@ -99,7 +99,7 @@ namespace ams::dmnt {
result = HardwareBreakPointManager::SetExecutionBreakPoint(m_reg, m_ctx, 0);
this->Reset();
}
return result;
R_RETURN(result);
}
Result HardwareBreakPoint::Set(DebugProcess *debug_process, uintptr_t address, size_t size, bool is_step) {
@ -159,7 +159,7 @@ namespace ams::dmnt {
AMS_DMNT2_GDB_LOG_ERROR("SetContextBreakPoint FAIL 0x%08x ctx=%d\n", result.GetValue(), ctx);
}
return result;
R_RETURN(result);
}
svc::HardwareBreakPointRegisterName HardwareBreakPointManager::GetWatchPointContextRegister() {
@ -176,7 +176,7 @@ namespace ams::dmnt {
AMS_DMNT2_GDB_LOG_ERROR("SetContextBreakPoint FAIL 0x%08x reg=%d, ctx=%d, address=%lx\n", result.GetValue(), reg, ctx, address);
}
return result;
R_RETURN(result);
}
void HardwareBreakPointManager::CountBreakPointRegisters() {

View file

@ -50,7 +50,7 @@ namespace ams::dmnt {
if (R_FAILED(result)) {
AMS_DMNT2_GDB_LOG_ERROR("SetDataBreakPoint FAIL 0x%08x, reg=%d, address=0x%lx\n", result.GetValue(), reg, address);
}
return result;
R_RETURN(result);
}
}
@ -101,7 +101,7 @@ namespace ams::dmnt {
result = SetDataBreakPoint(m_reg, m_ctx, 0, 0, false, false);
this->Reset();
}
return result;
R_RETURN(result);
}
Result WatchPoint::Set(DebugProcess *debug_process, uintptr_t address, size_t size, bool read, bool write) {
@ -143,7 +143,7 @@ namespace ams::dmnt {
R_UNLESS(bp != nullptr, svc::ResultOutOfHandles());
/* Set the watchpoint. */
return bp->Set(m_debug_process, address, size, read, write);
R_RETURN(bp->Set(m_debug_process, address, size, read, write));
}
Result HardwareWatchPointManager::GetWatchPointInfo(u64 address, bool &read, bool &write) {

View file

@ -43,7 +43,7 @@ namespace ams::dmnt {
AMS_DMNT2_GDB_LOG_ERROR("SoftwareBreakPoint::Clear %p 0x%lx, insn=0x%x, !!! Null Address !!!\n", this, m_address, m_insn);
}
}
return result;
R_RETURN(result);
}
Result SoftwareBreakPoint::Set(DebugProcess *debug_process, uintptr_t address, size_t size, bool is_step) {
@ -76,7 +76,7 @@ namespace ams::dmnt {
m_in_use = true;
}
return result;
R_RETURN(result);
}
SoftwareBreakPointManager::SoftwareBreakPointManager(DebugProcess *debug_process) : BreakPointManager(debug_process) {

View file

@ -32,7 +32,7 @@ namespace ams::dmnt::cheat {
}
Result CheatService::GetCheatProcessMetadata(sf::Out<CheatProcessMetadata> out_metadata) {
return dmnt::cheat::impl::GetCheatProcessMetadata(out_metadata.GetPointer());
R_RETURN(dmnt::cheat::impl::GetCheatProcessMetadata(out_metadata.GetPointer()));
}
Result CheatService::ForceOpenCheatProcess() {
@ -41,15 +41,15 @@ namespace ams::dmnt::cheat {
}
Result CheatService::PauseCheatProcess() {
return dmnt::cheat::impl::PauseCheatProcess();
R_RETURN(dmnt::cheat::impl::PauseCheatProcess());
}
Result CheatService::ResumeCheatProcess() {
return dmnt::cheat::impl::ResumeCheatProcess();
R_RETURN(dmnt::cheat::impl::ResumeCheatProcess());
}
Result CheatService::ForceCloseCheatProcess() {
return dmnt::cheat::impl::ForceCloseCheatProcess();
R_RETURN(dmnt::cheat::impl::ForceCloseCheatProcess());
}
/* ========================================================================================= */
@ -57,26 +57,26 @@ namespace ams::dmnt::cheat {
/* ========================================================================================= */
Result CheatService::GetCheatProcessMappingCount(sf::Out<u64> out_count) {
return dmnt::cheat::impl::GetCheatProcessMappingCount(out_count.GetPointer());
R_RETURN(dmnt::cheat::impl::GetCheatProcessMappingCount(out_count.GetPointer()));
}
Result CheatService::GetCheatProcessMappings(const sf::OutArray<svc::MemoryInfo> &mappings, sf::Out<u64> out_count, u64 offset) {
R_UNLESS(mappings.GetPointer() != nullptr, dmnt::cheat::ResultCheatNullBuffer());
return dmnt::cheat::impl::GetCheatProcessMappings(mappings.GetPointer(), mappings.GetSize(), out_count.GetPointer(), offset);
R_RETURN(dmnt::cheat::impl::GetCheatProcessMappings(mappings.GetPointer(), mappings.GetSize(), out_count.GetPointer(), offset));
}
Result CheatService::ReadCheatProcessMemory(const sf::OutBuffer &buffer, u64 address, u64 out_size) {
R_UNLESS(buffer.GetPointer() != nullptr, dmnt::cheat::ResultCheatNullBuffer());
return dmnt::cheat::impl::ReadCheatProcessMemory(address, buffer.GetPointer(), std::min(out_size, buffer.GetSize()));
R_RETURN(dmnt::cheat::impl::ReadCheatProcessMemory(address, buffer.GetPointer(), std::min(out_size, buffer.GetSize())));
}
Result CheatService::WriteCheatProcessMemory(const sf::InBuffer &buffer, u64 address, u64 in_size) {
R_UNLESS(buffer.GetPointer() != nullptr, dmnt::cheat::ResultCheatNullBuffer());
return dmnt::cheat::impl::WriteCheatProcessMemory(address, buffer.GetPointer(), std::min(in_size, buffer.GetSize()));
R_RETURN(dmnt::cheat::impl::WriteCheatProcessMemory(address, buffer.GetPointer(), std::min(in_size, buffer.GetSize())));
}
Result CheatService::QueryCheatProcessMemory(sf::Out<svc::MemoryInfo> mapping, u64 address) {
return dmnt::cheat::impl::QueryCheatProcessMemory(mapping.GetPointer(), address);
R_RETURN(dmnt::cheat::impl::QueryCheatProcessMemory(mapping.GetPointer(), address));
}
/* ========================================================================================= */
@ -84,44 +84,44 @@ namespace ams::dmnt::cheat {
/* ========================================================================================= */
Result CheatService::GetCheatCount(sf::Out<u64> out_count) {
return dmnt::cheat::impl::GetCheatCount(out_count.GetPointer());
R_RETURN(dmnt::cheat::impl::GetCheatCount(out_count.GetPointer()));
}
Result CheatService::GetCheats(const sf::OutArray<CheatEntry> &cheats, sf::Out<u64> out_count, u64 offset) {
R_UNLESS(cheats.GetPointer() != nullptr, dmnt::cheat::ResultCheatNullBuffer());
return dmnt::cheat::impl::GetCheats(cheats.GetPointer(), cheats.GetSize(), out_count.GetPointer(), offset);
R_RETURN(dmnt::cheat::impl::GetCheats(cheats.GetPointer(), cheats.GetSize(), out_count.GetPointer(), offset));
}
Result CheatService::GetCheatById(sf::Out<CheatEntry> cheat, u32 cheat_id) {
return dmnt::cheat::impl::GetCheatById(cheat.GetPointer(), cheat_id);
R_RETURN(dmnt::cheat::impl::GetCheatById(cheat.GetPointer(), cheat_id));
}
Result CheatService::ToggleCheat(u32 cheat_id) {
return dmnt::cheat::impl::ToggleCheat(cheat_id);
R_RETURN(dmnt::cheat::impl::ToggleCheat(cheat_id));
}
Result CheatService::AddCheat(const CheatDefinition &cheat, sf::Out<u32> out_cheat_id, bool enabled) {
return dmnt::cheat::impl::AddCheat(out_cheat_id.GetPointer(), cheat, enabled);
R_RETURN(dmnt::cheat::impl::AddCheat(out_cheat_id.GetPointer(), cheat, enabled));
}
Result CheatService::RemoveCheat(u32 cheat_id) {
return dmnt::cheat::impl::RemoveCheat(cheat_id);
R_RETURN(dmnt::cheat::impl::RemoveCheat(cheat_id));
}
Result CheatService::ReadStaticRegister(sf::Out<u64> out, u8 which) {
return dmnt::cheat::impl::ReadStaticRegister(out.GetPointer(), which);
R_RETURN(dmnt::cheat::impl::ReadStaticRegister(out.GetPointer(), which));
}
Result CheatService::WriteStaticRegister(u8 which, u64 value) {
return dmnt::cheat::impl::WriteStaticRegister(which, value);
R_RETURN(dmnt::cheat::impl::WriteStaticRegister(which, value));
}
Result CheatService::ResetStaticRegisters() {
return dmnt::cheat::impl::ResetStaticRegisters();
R_RETURN(dmnt::cheat::impl::ResetStaticRegisters());
}
Result CheatService::SetMasterCheat(const CheatDefinition &cheat) {
return dmnt::cheat::impl::SetMasterCheat(cheat);
R_RETURN(dmnt::cheat::impl::SetMasterCheat(cheat));
}
/* ========================================================================================= */
@ -129,16 +129,16 @@ namespace ams::dmnt::cheat {
/* ========================================================================================= */
Result CheatService::GetFrozenAddressCount(sf::Out<u64> out_count) {
return dmnt::cheat::impl::GetFrozenAddressCount(out_count.GetPointer());
R_RETURN(dmnt::cheat::impl::GetFrozenAddressCount(out_count.GetPointer()));
}
Result CheatService::GetFrozenAddresses(const sf::OutArray<FrozenAddressEntry> &addresses, sf::Out<u64> out_count, u64 offset) {
R_UNLESS(addresses.GetPointer() != nullptr, dmnt::cheat::ResultCheatNullBuffer());
return dmnt::cheat::impl::GetFrozenAddresses(addresses.GetPointer(), addresses.GetSize(), out_count.GetPointer(), offset);
R_RETURN(dmnt::cheat::impl::GetFrozenAddresses(addresses.GetPointer(), addresses.GetSize(), out_count.GetPointer(), offset));
}
Result CheatService::GetFrozenAddress(sf::Out<FrozenAddressEntry> entry, u64 address) {
return dmnt::cheat::impl::GetFrozenAddress(entry.GetPointer(), address);
R_RETURN(dmnt::cheat::impl::GetFrozenAddress(entry.GetPointer(), address));
}
Result CheatService::EnableFrozenAddress(sf::Out<u64> out_value, u64 address, u64 width) {
@ -146,11 +146,11 @@ namespace ams::dmnt::cheat {
R_UNLESS(width > 0, dmnt::cheat::ResultFrozenAddressInvalidWidth());
R_UNLESS(width <= sizeof(u64), dmnt::cheat::ResultFrozenAddressInvalidWidth());
R_UNLESS((width & (width - 1)) == 0, dmnt::cheat::ResultFrozenAddressInvalidWidth());
return dmnt::cheat::impl::EnableFrozenAddress(out_value.GetPointer(), address, width);
R_RETURN(dmnt::cheat::impl::EnableFrozenAddress(out_value.GetPointer(), address, width));
}
Result CheatService::DisableFrozenAddress(u64 address) {
return dmnt::cheat::impl::DisableFrozenAddress(address);
R_RETURN(dmnt::cheat::impl::DisableFrozenAddress(address));
}
}

View file

@ -301,7 +301,7 @@ namespace ams::dmnt::cheat::impl {
}
Result ForceOpenCheatProcess() {
return this->AttachToApplicationProcess(false);
R_RETURN(this->AttachToApplicationProcess(false));
}
Result ForceCloseCheatProcess() {
@ -310,7 +310,7 @@ namespace ams::dmnt::cheat::impl {
}
Result ReadCheatProcessMemoryUnsafe(u64 proc_addr, void *out_data, size_t size) {
return svc::ReadDebugProcessMemory(reinterpret_cast<uintptr_t>(out_data), this->GetCheatProcessHandle(), proc_addr, size);
R_RETURN(svc::ReadDebugProcessMemory(reinterpret_cast<uintptr_t>(out_data), this->GetCheatProcessHandle(), proc_addr, size));
}
Result WriteCheatProcessMemoryUnsafe(u64 proc_addr, const void *data, size_t size) {
@ -340,7 +340,7 @@ namespace ams::dmnt::cheat::impl {
Result PauseCheatProcessUnsafe() {
m_broken_unsafe = true;
m_unsafe_break_event.Clear();
return svc::BreakDebugProcess(this->GetCheatProcessHandle());
R_RETURN(svc::BreakDebugProcess(this->GetCheatProcessHandle()));
}
Result ResumeCheatProcessUnsafe() {
@ -406,7 +406,7 @@ namespace ams::dmnt::cheat::impl {
R_TRY(this->EnsureCheatProcess());
return this->ReadCheatProcessMemoryUnsafe(proc_addr, out_data, size);
R_RETURN(this->ReadCheatProcessMemoryUnsafe(proc_addr, out_data, size));
}
Result WriteCheatProcessMemory(u64 proc_addr, const void *data, size_t size) {
@ -414,7 +414,7 @@ namespace ams::dmnt::cheat::impl {
R_TRY(this->EnsureCheatProcess());
return this->WriteCheatProcessMemoryUnsafe(proc_addr, data, size);
R_RETURN(this->WriteCheatProcessMemoryUnsafe(proc_addr, data, size));
}
Result QueryCheatProcessMemory(svc::MemoryInfo *mapping, u64 address) {
@ -423,7 +423,7 @@ namespace ams::dmnt::cheat::impl {
R_TRY(this->EnsureCheatProcess());
svc::PageInfo page_info;
return svc::QueryDebugProcessMemory(mapping, std::addressof(page_info), this->GetCheatProcessHandle(), address);
R_RETURN(svc::QueryDebugProcessMemory(mapping, std::addressof(page_info), this->GetCheatProcessHandle(), address));
}
Result PauseCheatProcess() {
@ -431,7 +431,7 @@ namespace ams::dmnt::cheat::impl {
R_TRY(this->EnsureCheatProcess());
return this->PauseCheatProcessUnsafe();
R_RETURN(this->PauseCheatProcessUnsafe());
}
Result ResumeCheatProcess() {
@ -439,7 +439,7 @@ namespace ams::dmnt::cheat::impl {
R_TRY(this->EnsureCheatProcess());
return this->ResumeCheatProcessUnsafe();
R_RETURN(this->ResumeCheatProcessUnsafe());
}
Result GetCheatCount(u64 *out_count) {
@ -844,7 +844,7 @@ namespace ams::dmnt::cheat::impl {
} else if (num_modules == 1 && !on_process_launch) {
proc_module = std::addressof(proc_modules[0]);
} else {
return dmnt::cheat::ResultCheatNotAttached();
R_THROW(dmnt::cheat::ResultCheatNotAttached());
}
m_cheat_process_metadata.main_nso_extents.base = proc_module->address;
@ -1198,119 +1198,119 @@ namespace ams::dmnt::cheat::impl {
}
Result GetCheatProcessMetadata(CheatProcessMetadata *out) {
return GetReference(g_cheat_process_manager).GetCheatProcessMetadata(out);
R_RETURN(GetReference(g_cheat_process_manager).GetCheatProcessMetadata(out));
}
Result ForceOpenCheatProcess() {
return GetReference(g_cheat_process_manager).ForceOpenCheatProcess();
R_RETURN(GetReference(g_cheat_process_manager).ForceOpenCheatProcess());
}
Result PauseCheatProcess() {
return GetReference(g_cheat_process_manager).PauseCheatProcess();
R_RETURN(GetReference(g_cheat_process_manager).PauseCheatProcess());
}
Result ResumeCheatProcess() {
return GetReference(g_cheat_process_manager).ResumeCheatProcess();
R_RETURN(GetReference(g_cheat_process_manager).ResumeCheatProcess());
}
Result ForceCloseCheatProcess() {
return GetReference(g_cheat_process_manager).ForceCloseCheatProcess();
R_RETURN(GetReference(g_cheat_process_manager).ForceCloseCheatProcess());
}
Result ReadCheatProcessMemoryUnsafe(u64 process_addr, void *out_data, size_t size) {
return GetReference(g_cheat_process_manager).ReadCheatProcessMemoryUnsafe(process_addr, out_data, size);
R_RETURN(GetReference(g_cheat_process_manager).ReadCheatProcessMemoryUnsafe(process_addr, out_data, size));
}
Result WriteCheatProcessMemoryUnsafe(u64 process_addr, void *data, size_t size) {
return GetReference(g_cheat_process_manager).WriteCheatProcessMemoryUnsafe(process_addr, data, size);
R_RETURN(GetReference(g_cheat_process_manager).WriteCheatProcessMemoryUnsafe(process_addr, data, size));
}
Result PauseCheatProcessUnsafe() {
return GetReference(g_cheat_process_manager).PauseCheatProcessUnsafe();
R_RETURN(GetReference(g_cheat_process_manager).PauseCheatProcessUnsafe());
}
Result ResumeCheatProcessUnsafe() {
return GetReference(g_cheat_process_manager).ResumeCheatProcessUnsafe();
R_RETURN(GetReference(g_cheat_process_manager).ResumeCheatProcessUnsafe());
}
Result GetCheatProcessMappingCount(u64 *out_count) {
return GetReference(g_cheat_process_manager).GetCheatProcessMappingCount(out_count);
R_RETURN(GetReference(g_cheat_process_manager).GetCheatProcessMappingCount(out_count));
}
Result GetCheatProcessMappings(svc::MemoryInfo *mappings, size_t max_count, u64 *out_count, u64 offset) {
return GetReference(g_cheat_process_manager).GetCheatProcessMappings(mappings, max_count, out_count, offset);
R_RETURN(GetReference(g_cheat_process_manager).GetCheatProcessMappings(mappings, max_count, out_count, offset));
}
Result ReadCheatProcessMemory(u64 proc_addr, void *out_data, size_t size) {
return GetReference(g_cheat_process_manager).ReadCheatProcessMemory(proc_addr, out_data, size);
R_RETURN(GetReference(g_cheat_process_manager).ReadCheatProcessMemory(proc_addr, out_data, size));
}
Result WriteCheatProcessMemory(u64 proc_addr, const void *data, size_t size) {
return GetReference(g_cheat_process_manager).WriteCheatProcessMemory(proc_addr, data, size);
R_RETURN(GetReference(g_cheat_process_manager).WriteCheatProcessMemory(proc_addr, data, size));
}
Result QueryCheatProcessMemory(svc::MemoryInfo *mapping, u64 address) {
return GetReference(g_cheat_process_manager).QueryCheatProcessMemory(mapping, address);
R_RETURN(GetReference(g_cheat_process_manager).QueryCheatProcessMemory(mapping, address));
}
Result GetCheatCount(u64 *out_count) {
return GetReference(g_cheat_process_manager).GetCheatCount(out_count);
R_RETURN(GetReference(g_cheat_process_manager).GetCheatCount(out_count));
}
Result GetCheats(CheatEntry *cheats, size_t max_count, u64 *out_count, u64 offset) {
return GetReference(g_cheat_process_manager).GetCheats(cheats, max_count, out_count, offset);
R_RETURN(GetReference(g_cheat_process_manager).GetCheats(cheats, max_count, out_count, offset));
}
Result GetCheatById(CheatEntry *out_cheat, u32 cheat_id) {
return GetReference(g_cheat_process_manager).GetCheatById(out_cheat, cheat_id);
R_RETURN(GetReference(g_cheat_process_manager).GetCheatById(out_cheat, cheat_id));
}
Result ToggleCheat(u32 cheat_id) {
return GetReference(g_cheat_process_manager).ToggleCheat(cheat_id);
R_RETURN(GetReference(g_cheat_process_manager).ToggleCheat(cheat_id));
}
Result AddCheat(u32 *out_id, const CheatDefinition &def, bool enabled) {
return GetReference(g_cheat_process_manager).AddCheat(out_id, def, enabled);
R_RETURN(GetReference(g_cheat_process_manager).AddCheat(out_id, def, enabled));
}
Result RemoveCheat(u32 cheat_id) {
return GetReference(g_cheat_process_manager).RemoveCheat(cheat_id);
R_RETURN(GetReference(g_cheat_process_manager).RemoveCheat(cheat_id));
}
Result SetMasterCheat(const CheatDefinition &def) {
return GetReference(g_cheat_process_manager).SetMasterCheat(def);
R_RETURN(GetReference(g_cheat_process_manager).SetMasterCheat(def));
}
Result ReadStaticRegister(u64 *out, size_t which) {
return GetReference(g_cheat_process_manager).ReadStaticRegister(out, which);
R_RETURN(GetReference(g_cheat_process_manager).ReadStaticRegister(out, which));
}
Result WriteStaticRegister(size_t which, u64 value) {
return GetReference(g_cheat_process_manager).WriteStaticRegister(which, value);
R_RETURN(GetReference(g_cheat_process_manager).WriteStaticRegister(which, value));
}
Result ResetStaticRegisters() {
return GetReference(g_cheat_process_manager).ResetStaticRegisters();
R_RETURN(GetReference(g_cheat_process_manager).ResetStaticRegisters());
}
Result GetFrozenAddressCount(u64 *out_count) {
return GetReference(g_cheat_process_manager).GetFrozenAddressCount(out_count);
R_RETURN(GetReference(g_cheat_process_manager).GetFrozenAddressCount(out_count));
}
Result GetFrozenAddresses(FrozenAddressEntry *frz_addrs, size_t max_count, u64 *out_count, u64 offset) {
return GetReference(g_cheat_process_manager).GetFrozenAddresses(frz_addrs, max_count, out_count, offset);
R_RETURN(GetReference(g_cheat_process_manager).GetFrozenAddresses(frz_addrs, max_count, out_count, offset));
}
Result GetFrozenAddress(FrozenAddressEntry *frz_addr, u64 address) {
return GetReference(g_cheat_process_manager).GetFrozenAddress(frz_addr, address);
R_RETURN(GetReference(g_cheat_process_manager).GetFrozenAddress(frz_addr, address));
}
Result EnableFrozenAddress(u64 *out_value, u64 address, u64 width) {
return GetReference(g_cheat_process_manager).EnableFrozenAddress(out_value, address, width);
R_RETURN(GetReference(g_cheat_process_manager).EnableFrozenAddress(out_value, address, width));
}
Result DisableFrozenAddress(u64 address) {
return GetReference(g_cheat_process_manager).DisableFrozenAddress(address);
R_RETURN(GetReference(g_cheat_process_manager).DisableFrozenAddress(address));
}
}

View file

@ -84,9 +84,9 @@ namespace ams::dmnt::cheat::impl {
Result ContinueDebugEvent(os::NativeHandle debug_handle) {
if (hos::GetVersion() >= hos::Version_3_0_0) {
return svc::ContinueDebugEvent(debug_handle, svc::ContinueFlag_ExceptionHandled | svc::ContinueFlag_ContinueAll, nullptr, 0);
R_RETURN(svc::ContinueDebugEvent(debug_handle, svc::ContinueFlag_ExceptionHandled | svc::ContinueFlag_ContinueAll, nullptr, 0));
} else {
return svc::LegacyContinueDebugEvent(debug_handle, svc::ContinueFlag_ExceptionHandled | svc::ContinueFlag_ContinueAll, 0);
R_RETURN(svc::LegacyContinueDebugEvent(debug_handle, svc::ContinueFlag_ExceptionHandled | svc::ContinueFlag_ContinueAll, 0));
}
}
@ -138,7 +138,7 @@ namespace ams::dmnt::cheat::impl {
/* Send handle to correct core, wait for continue to finish. */
this->SendHandle(target_core, cheat_dbg_hnd);
return this->GetContinueResult(target_core);
R_RETURN(this->GetContinueResult(target_core));
}
};
@ -152,7 +152,7 @@ namespace ams::dmnt::cheat::impl {
}
Result ContinueCheatProcess(os::NativeHandle cheat_dbg_hnd) {
return GetReference(g_events_manager).ContinueCheatProcess(cheat_dbg_hnd);
R_RETURN(GetReference(g_events_manager).ContinueCheatProcess(cheat_dbg_hnd));
}
}

View file

@ -70,7 +70,7 @@ namespace ams::fatal::srv {
}
Result AdjustClockTask::Run() {
return AdjustClock();
R_RETURN(AdjustClock());
}
}

View file

@ -495,7 +495,7 @@ namespace ams::fatal::srv {
/* Don't show the fatal error screen until we've verified the battery is okay. */
m_context->battery_event->Wait();
return ShowFatal();
R_RETURN(ShowFatal());
}
void BacklightControlTask::TurnOnBacklight() {

View file

@ -44,7 +44,7 @@ namespace ams::ldr {
path[sizeof(path) - 1] = '\x00';
/* Create the process. */
return ldr::CreateProcess(out, pin_id, loc, override_status, path, g_argument_store.Get(loc.program_id), flags, resource_limit);
R_RETURN(ldr::CreateProcess(out, pin_id, loc, override_status, path, g_argument_store.Get(loc.program_id), flags, resource_limit));
}
Result LoaderService::GetProgramInfo(ProgramInfo *out, cfg::OverrideStatus *out_status, const ncm::ProgramLocation &loc) {
@ -81,29 +81,29 @@ namespace ams::ldr {
Result LoaderService::PinProgram(PinId *out, const ncm::ProgramLocation &loc, const cfg::OverrideStatus &status) {
*out = {};
return ldr::PinProgram(out, loc, status);
R_RETURN(ldr::PinProgram(out, loc, status));
}
Result LoaderService::UnpinProgram(PinId id) {
return ldr::UnpinProgram(id);
R_RETURN(ldr::UnpinProgram(id));
}
Result LoaderService::SetProgramArgument(ncm::ProgramId program_id, const void *argument, size_t size) {
return g_argument_store.Set(program_id, argument, size);
R_RETURN(g_argument_store.Set(program_id, argument, size));
}
Result LoaderService::FlushArguments() {
return g_argument_store.Flush();
R_RETURN(g_argument_store.Flush());
}
Result LoaderService::GetProcessModuleInfo(u32 *out_count, ModuleInfo *out, size_t max_out_count, os::ProcessId process_id) {
*out_count = 0;
std::memset(out, 0, max_out_count * sizeof(*out));
return ldr::GetProcessModuleInfo(out_count, out, max_out_count, process_id);
R_RETURN(ldr::GetProcessModuleInfo(out_count, out, max_out_count, process_id));
}
Result LoaderService::RegisterExternalCode(os::NativeHandle *out, ncm::ProgramId program_id) {
return fssystem::CreateExternalCode(out, program_id);
R_RETURN(fssystem::CreateExternalCode(out, program_id));
}
void LoaderService::UnregisterExternalCode(ncm::ProgramId program_id) {

View file

@ -22,29 +22,30 @@ namespace ams::ldr {
public:
/* Official commands. */
Result CreateProcess(sf::OutMoveHandle proc_h, PinId id, u32 flags, sf::CopyHandle &&reslimit_h) {
/* Create a handle to set the output to when done. */
os::NativeHandle handle = os::InvalidNativeHandle;
const auto result = this->CreateProcess(std::addressof(handle), id, flags, reslimit_h.GetOsHandle());
proc_h.SetValue(handle, true);
return result;
ON_SCOPE_EXIT { proc_h.SetValue(handle, true); };
R_RETURN(this->CreateProcess(std::addressof(handle), id, flags, reslimit_h.GetOsHandle()));
}
Result GetProgramInfo(sf::Out<ProgramInfo> out_program_info, const ncm::ProgramLocation &loc) {
return this->GetProgramInfo(out_program_info.GetPointer(), nullptr, loc);
R_RETURN(this->GetProgramInfo(out_program_info.GetPointer(), nullptr, loc));
}
Result PinProgram(sf::Out<PinId> out_id, const ncm::ProgramLocation &loc) {
return this->PinProgram(out_id.GetPointer(), loc, cfg::OverrideStatus{});
R_RETURN(this->PinProgram(out_id.GetPointer(), loc, cfg::OverrideStatus{}));
}
Result UnpinProgram(PinId id);
Result SetProgramArgumentDeprecated(ncm::ProgramId program_id, const sf::InPointerBuffer &args, u32 args_size) {
AMS_UNUSED(args_size);
return this->SetProgramArgument(program_id, args.GetPointer(), std::min<size_t>(args_size, args.GetSize()));
R_RETURN(this->SetProgramArgument(program_id, args.GetPointer(), std::min<size_t>(args_size, args.GetSize())));
}
Result SetProgramArgument(ncm::ProgramId program_id, const sf::InPointerBuffer &args) {
return this->SetProgramArgument(program_id, args.GetPointer(), args.GetSize());
R_RETURN(this->SetProgramArgument(program_id, args.GetPointer(), args.GetSize()));
}
Result FlushArguments();
@ -52,17 +53,18 @@ namespace ams::ldr {
Result GetProcessModuleInfo(sf::Out<u32> count, const sf::OutPointerArray<ModuleInfo> &out, os::ProcessId process_id) {
R_UNLESS(out.GetSize() <= std::numeric_limits<s32>::max(), ldr::ResultInvalidSize());
return this->GetProcessModuleInfo(count.GetPointer(), out.GetPointer(), out.GetSize(), process_id);
R_RETURN(this->GetProcessModuleInfo(count.GetPointer(), out.GetPointer(), out.GetSize(), process_id));
}
Result SetEnabledProgramVerification(bool enabled);
/* Atmosphere commands. */
Result AtmosphereRegisterExternalCode(sf::OutMoveHandle out, ncm::ProgramId program_id) {
/* Create a handle to set the output to when done. */
os::NativeHandle handle = os::InvalidNativeHandle;
const auto result = this->RegisterExternalCode(std::addressof(handle), program_id);
out.SetValue(handle, true);
return result;
ON_SCOPE_EXIT { out.SetValue(handle, true); };
R_RETURN(this->RegisterExternalCode(std::addressof(handle), program_id));
}
void AtmosphereUnregisterExternalCode(ncm::ProgramId program_id) {
@ -74,11 +76,11 @@ namespace ams::ldr {
}
Result AtmosphereGetProgramInfo(sf::Out<ProgramInfo> out_program_info, sf::Out<cfg::OverrideStatus> out_status, const ncm::ProgramLocation &loc) {
return this->GetProgramInfo(out_program_info.GetPointer(), out_status.GetPointer(), loc);
R_RETURN(this->GetProgramInfo(out_program_info.GetPointer(), out_status.GetPointer(), loc));
}
Result AtmospherePinProgram(sf::Out<PinId> out_id, const ncm::ProgramLocation &loc, const cfg::OverrideStatus &override_status) {
return this->PinProgram(out_id.GetPointer(), loc, override_status);
R_RETURN(this->PinProgram(out_id.GetPointer(), loc, override_status));
}
private:
Result CreateProcess(os::NativeHandle *out, PinId pin_id, u32 flags, os::NativeHandle resource_limit);

View file

@ -275,7 +275,7 @@ namespace ams::ldr {
Result LoadMetaFromCache(Meta *out_meta, const ncm::ProgramLocation &loc, const cfg::OverrideStatus &status) {
if (g_cached_program_id != loc.program_id || g_cached_override_status != status) {
return LoadMeta(out_meta, loc, status);
R_RETURN(LoadMeta(out_meta, loc, status));
}
*out_meta = g_meta_cache.meta;
R_SUCCEED();

View file

@ -76,7 +76,7 @@ namespace ams {
explicit ContentManagerServerManager(sf::SharedPointer<ncm::IContentManager> manager) : m_manager(manager) { /* ... */ }
ams::Result Initialize() {
return this->RegisterObjectForServer(m_manager, ContentManagerServiceName, ContentManagerManagerSessions);
R_RETURN(this->RegisterObjectForServer(m_manager, ContentManagerServiceName, ContentManagerManagerSessions));
}
ams::Result StartThreads() {
@ -120,7 +120,7 @@ namespace ams {
LocationResolverServerManager(sf::SharedPointer<lr::ILocationResolverManager> manager) : m_manager(manager) { /* ... */ }
ams::Result Initialize() {
return this->RegisterObjectForServer(m_manager, LocationResolverServiceName, LocationResolverManagerSessions);
R_RETURN(this->RegisterObjectForServer(m_manager, LocationResolverServiceName, LocationResolverManagerSessions));
}
ams::Result StartThreads() {

View file

@ -526,7 +526,7 @@ namespace ams::ro::impl {
context->SetNrrInfoInUse(nrr_info, false);
std::memset(nrr_info, 0, sizeof(*nrr_info));
}
return UnmapNrr(context->GetProcessHandle(), nrr_backup.mapped_header, nrr_backup.nrr_heap_address, nrr_backup.nrr_heap_size, nrr_backup.mapped_code_address);
R_RETURN(UnmapNrr(context->GetProcessHandle(), nrr_backup.mapped_header, nrr_backup.nrr_heap_address, nrr_backup.nrr_heap_size, nrr_backup.mapped_code_address));
}
Result MapManualLoadModuleMemory(u64 *out_address, size_t context_id, u64 nro_address, u64 nro_size, u64 bss_address, u64 bss_size) {
@ -594,7 +594,7 @@ namespace ams::ro::impl {
context->SetNroInfoInUse(nro_info, false);
std::memset(nro_info, 0, sizeof(*nro_info));
}
return UnmapNro(context->GetProcessHandle(), nro_backup.base_address, nro_backup.nro_heap_address, nro_backup.bss_heap_address, nro_backup.bss_heap_size, nro_backup.code_size, nro_backup.rw_size);
R_RETURN(UnmapNro(context->GetProcessHandle(), nro_backup.base_address, nro_backup.nro_heap_address, nro_backup.bss_heap_address, nro_backup.bss_heap_size, nro_backup.code_size, nro_backup.rw_size));
}
/* Debug service implementations. */

View file

@ -21,7 +21,7 @@ namespace ams::ro {
Result DebugMonitorService::GetProcessModuleInfo(sf::Out<u32> out_count, const sf::OutArray<ldr::ModuleInfo> &out_infos, os::ProcessId process_id) {
R_UNLESS(out_infos.GetSize() <= std::numeric_limits<s32>::max(), ro::ResultInvalidSize());
return impl::GetProcessModuleInfo(out_count.GetPointer(), out_infos.GetPointer(), out_infos.GetSize(), process_id);
R_RETURN(impl::GetProcessModuleInfo(out_count.GetPointer(), out_infos.GetPointer(), out_infos.GetSize(), process_id));
}
}

View file

@ -62,11 +62,11 @@ namespace ams {
ams::Result ServerManager::OnNeedsToAccept(int port_index, Server *server) {
switch (port_index) {
case PortIndex_DebugMonitor:
return this->AcceptImpl(server, ObjectFactory::CreateSharedEmplaced<ro::impl::IDebugMonitorInterface, ro::DebugMonitorService>(std::addressof(g_server_allocator)));
R_RETURN(this->AcceptImpl(server, ObjectFactory::CreateSharedEmplaced<ro::impl::IDebugMonitorInterface, ro::DebugMonitorService>(std::addressof(g_server_allocator))));
case PortIndex_User:
return this->AcceptImpl(server, ObjectFactory::CreateSharedEmplaced<ro::impl::IRoInterface, ro::RoService>(std::addressof(g_server_allocator), ro::NrrKind_User));
R_RETURN(this->AcceptImpl(server, ObjectFactory::CreateSharedEmplaced<ro::impl::IRoInterface, ro::RoService>(std::addressof(g_server_allocator), ro::NrrKind_User)));
case PortIndex_JitPlugin:
return this->AcceptImpl(server, ObjectFactory::CreateSharedEmplaced<ro::impl::IRoInterface, ro::RoService>(std::addressof(g_server_allocator), ro::NrrKind_JitPlugin));
R_RETURN(this->AcceptImpl(server, ObjectFactory::CreateSharedEmplaced<ro::impl::IRoInterface, ro::RoService>(std::addressof(g_server_allocator), ro::NrrKind_JitPlugin)));
AMS_UNREACHABLE_DEFAULT_CASE();
}
}

View file

@ -37,27 +37,27 @@ namespace ams::ro {
Result RoService::MapManualLoadModuleMemory(sf::Out<u64> load_address, const sf::ClientProcessId &client_pid, u64 nro_address, u64 nro_size, u64 bss_address, u64 bss_size) {
R_TRY(impl::ValidateProcess(m_context_id, client_pid.GetValue()));
return impl::MapManualLoadModuleMemory(load_address.GetPointer(), m_context_id, nro_address, nro_size, bss_address, bss_size);
R_RETURN(impl::MapManualLoadModuleMemory(load_address.GetPointer(), m_context_id, nro_address, nro_size, bss_address, bss_size));
}
Result RoService::UnmapManualLoadModuleMemory(const sf::ClientProcessId &client_pid, u64 nro_address) {
R_TRY(impl::ValidateProcess(m_context_id, client_pid.GetValue()));
return impl::UnmapManualLoadModuleMemory(m_context_id, nro_address);
R_RETURN(impl::UnmapManualLoadModuleMemory(m_context_id, nro_address));
}
Result RoService::RegisterModuleInfo(const sf::ClientProcessId &client_pid, u64 nrr_address, u64 nrr_size) {
R_TRY(impl::ValidateProcess(m_context_id, client_pid.GetValue()));
return impl::RegisterModuleInfo(m_context_id, os::InvalidNativeHandle, nrr_address, nrr_size, NrrKind_User, true);
R_RETURN(impl::RegisterModuleInfo(m_context_id, os::InvalidNativeHandle, nrr_address, nrr_size, NrrKind_User, true));
}
Result RoService::UnregisterModuleInfo(const sf::ClientProcessId &client_pid, u64 nrr_address) {
R_TRY(impl::ValidateProcess(m_context_id, client_pid.GetValue()));
return impl::UnregisterModuleInfo(m_context_id, nrr_address);
R_RETURN(impl::UnregisterModuleInfo(m_context_id, nrr_address));
}
Result RoService::RegisterProcessHandle(const sf::ClientProcessId &client_pid, sf::CopyHandle &&process_h) {
/* Register the process. */
return impl::RegisterProcess(std::addressof(m_context_id), std::move(process_h), client_pid.GetValue());
R_RETURN(impl::RegisterProcess(std::addressof(m_context_id), std::move(process_h), client_pid.GetValue()));
}
Result RoService::RegisterProcessModuleInfo(const sf::ClientProcessId &client_pid, u64 nrr_address, u64 nrr_size, sf::CopyHandle &&process_h) {
@ -65,7 +65,7 @@ namespace ams::ro {
R_TRY(impl::ValidateProcess(m_context_id, client_pid.GetValue()));
/* Register the module. */
return impl::RegisterModuleInfo(m_context_id, process_h.GetOsHandle(), nrr_address, nrr_size, m_nrr_kind, m_nrr_kind == NrrKind_JitPlugin);
R_RETURN(impl::RegisterModuleInfo(m_context_id, process_h.GetOsHandle(), nrr_address, nrr_size, m_nrr_kind, m_nrr_kind == NrrKind_JitPlugin));
}
}

View file

@ -30,35 +30,35 @@ namespace ams::spl {
public:
/* Actual commands. */
Result GenerateAesKek(sf::Out<AccessKey> out_access_key, KeySource key_source, u32 generation, u32 option) {
return m_manager.GenerateAesKek(out_access_key.GetPointer(), key_source, generation, option);
R_RETURN(m_manager.GenerateAesKek(out_access_key.GetPointer(), key_source, generation, option));
}
Result LoadAesKey(s32 keyslot, AccessKey access_key, KeySource key_source) {
return m_manager.LoadAesKey(keyslot, this, access_key, key_source);
R_RETURN(m_manager.LoadAesKey(keyslot, this, access_key, key_source));
}
Result GenerateAesKey(sf::Out<AesKey> out_key, AccessKey access_key, KeySource key_source) {
return m_manager.GenerateAesKey(out_key.GetPointer(), access_key, key_source);
R_RETURN(m_manager.GenerateAesKey(out_key.GetPointer(), access_key, key_source));
}
Result DecryptAesKey(sf::Out<AesKey> out_key, KeySource key_source, u32 generation, u32 option) {
return m_manager.DecryptAesKey(out_key.GetPointer(), key_source, generation, option);
R_RETURN(m_manager.DecryptAesKey(out_key.GetPointer(), key_source, generation, option));
}
Result ComputeCtr(const sf::OutNonSecureBuffer &out_buf, s32 keyslot, const sf::InNonSecureBuffer &in_buf, IvCtr iv_ctr) {
return m_manager.ComputeCtr(out_buf.GetPointer(), out_buf.GetSize(), keyslot, this, in_buf.GetPointer(), in_buf.GetSize(), iv_ctr);
R_RETURN(m_manager.ComputeCtr(out_buf.GetPointer(), out_buf.GetSize(), keyslot, this, in_buf.GetPointer(), in_buf.GetSize(), iv_ctr));
}
Result ComputeCmac(sf::Out<Cmac> out_cmac, s32 keyslot, const sf::InPointerBuffer &in_buf) {
return m_manager.ComputeCmac(out_cmac.GetPointer(), keyslot, this, in_buf.GetPointer(), in_buf.GetSize());
R_RETURN(m_manager.ComputeCmac(out_cmac.GetPointer(), keyslot, this, in_buf.GetPointer(), in_buf.GetSize()));
}
Result AllocateAesKeySlot(sf::Out<s32> out_keyslot) {
return m_manager.AllocateAesKeySlot(out_keyslot.GetPointer(), this);
R_RETURN(m_manager.AllocateAesKeySlot(out_keyslot.GetPointer(), this));
}
Result DeallocateAesKeySlot(s32 keyslot) {
return m_manager.DeallocateAesKeySlot(keyslot, this);
R_RETURN(m_manager.DeallocateAesKeySlot(keyslot, this));
}
Result GetAesKeySlotAvailableEvent(sf::OutCopyHandle out_hnd) {

View file

@ -32,99 +32,99 @@ namespace ams::spl {
public:
/* Actual commands. */
Result GetConfig(sf::Out<u64> out, u32 which) {
return m_manager.GetConfig(out.GetPointer(), static_cast<spl::ConfigItem>(which));
R_RETURN(m_manager.GetConfig(out.GetPointer(), static_cast<spl::ConfigItem>(which)));
}
Result ModularExponentiate(const sf::OutPointerBuffer &out, const sf::InPointerBuffer &base, const sf::InPointerBuffer &exp, const sf::InPointerBuffer &mod) {
return m_manager.ModularExponentiate(out.GetPointer(), out.GetSize(), base.GetPointer(), base.GetSize(), exp.GetPointer(), exp.GetSize(), mod.GetPointer(), mod.GetSize());
R_RETURN(m_manager.ModularExponentiate(out.GetPointer(), out.GetSize(), base.GetPointer(), base.GetSize(), exp.GetPointer(), exp.GetSize(), mod.GetPointer(), mod.GetSize()));
}
Result GenerateAesKek(sf::Out<AccessKey> out_access_key, KeySource key_source, u32 generation, u32 option) {
return m_manager.GenerateAesKek(out_access_key.GetPointer(), key_source, generation, option);
R_RETURN(m_manager.GenerateAesKek(out_access_key.GetPointer(), key_source, generation, option));
}
Result LoadAesKey(s32 keyslot, AccessKey access_key, KeySource key_source) {
return m_manager.LoadAesKey(keyslot, this, access_key, key_source);
R_RETURN(m_manager.LoadAesKey(keyslot, this, access_key, key_source));
}
Result GenerateAesKey(sf::Out<AesKey> out_key, AccessKey access_key, KeySource key_source) {
return m_manager.GenerateAesKey(out_key.GetPointer(), access_key, key_source);
R_RETURN(m_manager.GenerateAesKey(out_key.GetPointer(), access_key, key_source));
}
Result SetConfig(u32 which, u64 value) {
return m_manager.SetConfig(static_cast<spl::ConfigItem>(which), value);
R_RETURN(m_manager.SetConfig(static_cast<spl::ConfigItem>(which), value));
}
Result GenerateRandomBytes(const sf::OutPointerBuffer &out) {
return m_manager.GenerateRandomBytes(out.GetPointer(), out.GetSize());
R_RETURN(m_manager.GenerateRandomBytes(out.GetPointer(), out.GetSize()));
}
Result DecryptAndStoreGcKey(const sf::InPointerBuffer &src, AccessKey access_key, KeySource key_source, u32 option) {
return m_manager.DecryptAndStoreGcKey(src.GetPointer(), src.GetSize(), access_key, key_source, option);
R_RETURN(m_manager.DecryptAndStoreGcKey(src.GetPointer(), src.GetSize(), access_key, key_source, option));
}
Result DecryptGcMessage(sf::Out<u32> out_size, const sf::OutPointerBuffer &out, const sf::InPointerBuffer &base, const sf::InPointerBuffer &mod, const sf::InPointerBuffer &label_digest) {
return m_manager.DecryptGcMessage(out_size.GetPointer(), out.GetPointer(), out.GetSize(), base.GetPointer(), base.GetSize(), mod.GetPointer(), mod.GetSize(), label_digest.GetPointer(), label_digest.GetSize());
R_RETURN(m_manager.DecryptGcMessage(out_size.GetPointer(), out.GetPointer(), out.GetSize(), base.GetPointer(), base.GetSize(), mod.GetPointer(), mod.GetSize(), label_digest.GetPointer(), label_digest.GetSize()));
}
Result IsDevelopment(sf::Out<bool> is_dev) {
return m_manager.IsDevelopment(is_dev.GetPointer());
R_RETURN(m_manager.IsDevelopment(is_dev.GetPointer()));
}
Result GenerateSpecificAesKey(sf::Out<AesKey> out_key, KeySource key_source, u32 generation, u32 which) {
return m_manager.GenerateSpecificAesKey(out_key.GetPointer(), key_source, generation, which);
R_RETURN(m_manager.GenerateSpecificAesKey(out_key.GetPointer(), key_source, generation, which));
}
Result DecryptDeviceUniqueData(const sf::OutPointerBuffer &dst, const sf::InPointerBuffer &src, AccessKey access_key, KeySource key_source, u32 option) {
return m_manager.DecryptDeviceUniqueData(dst.GetPointer(), dst.GetSize(), src.GetPointer(), src.GetSize(), access_key, key_source, option);
R_RETURN(m_manager.DecryptDeviceUniqueData(dst.GetPointer(), dst.GetSize(), src.GetPointer(), src.GetSize(), access_key, key_source, option));
}
Result DecryptAesKey(sf::Out<AesKey> out_key, KeySource key_source, u32 generation, u32 option) {
return m_manager.DecryptAesKey(out_key.GetPointer(), key_source, generation, option);
R_RETURN(m_manager.DecryptAesKey(out_key.GetPointer(), key_source, generation, option));
}
Result ComputeCtrDeprecated(const sf::OutBuffer &out_buf, s32 keyslot, const sf::InBuffer &in_buf, IvCtr iv_ctr) {
return m_manager.ComputeCtr(out_buf.GetPointer(), out_buf.GetSize(), keyslot, this, in_buf.GetPointer(), in_buf.GetSize(), iv_ctr);
R_RETURN(m_manager.ComputeCtr(out_buf.GetPointer(), out_buf.GetSize(), keyslot, this, in_buf.GetPointer(), in_buf.GetSize(), iv_ctr));
}
Result ComputeCtr(const sf::OutNonSecureBuffer &out_buf, s32 keyslot, const sf::InNonSecureBuffer &in_buf, IvCtr iv_ctr) {
return m_manager.ComputeCtr(out_buf.GetPointer(), out_buf.GetSize(), keyslot, this, in_buf.GetPointer(), in_buf.GetSize(), iv_ctr);
R_RETURN(m_manager.ComputeCtr(out_buf.GetPointer(), out_buf.GetSize(), keyslot, this, in_buf.GetPointer(), in_buf.GetSize(), iv_ctr));
}
Result ComputeCmac(sf::Out<Cmac> out_cmac, s32 keyslot, const sf::InPointerBuffer &in_buf) {
return m_manager.ComputeCmac(out_cmac.GetPointer(), keyslot, this, in_buf.GetPointer(), in_buf.GetSize());
R_RETURN(m_manager.ComputeCmac(out_cmac.GetPointer(), keyslot, this, in_buf.GetPointer(), in_buf.GetSize()));
}
Result LoadEsDeviceKey(const sf::InPointerBuffer &src, AccessKey access_key, KeySource key_source, u32 option) {
return m_manager.LoadEsDeviceKey(src.GetPointer(), src.GetSize(), access_key, key_source, option);
R_RETURN(m_manager.LoadEsDeviceKey(src.GetPointer(), src.GetSize(), access_key, key_source, option));
}
Result PrepareEsTitleKeyDeprecated(sf::Out<AccessKey> out_access_key, const sf::InPointerBuffer &base, const sf::InPointerBuffer &mod, const sf::InPointerBuffer &label_digest) {
return m_manager.PrepareEsTitleKey(out_access_key.GetPointer(), base.GetPointer(), base.GetSize(), mod.GetPointer(), mod.GetSize(), label_digest.GetPointer(), label_digest.GetSize(), 0);
R_RETURN(m_manager.PrepareEsTitleKey(out_access_key.GetPointer(), base.GetPointer(), base.GetSize(), mod.GetPointer(), mod.GetSize(), label_digest.GetPointer(), label_digest.GetSize(), 0));
}
Result PrepareEsTitleKey(sf::Out<AccessKey> out_access_key, const sf::InPointerBuffer &base, const sf::InPointerBuffer &mod, const sf::InPointerBuffer &label_digest, u32 generation) {
return m_manager.PrepareEsTitleKey(out_access_key.GetPointer(), base.GetPointer(), base.GetSize(), mod.GetPointer(), mod.GetSize(), label_digest.GetPointer(), label_digest.GetSize(), generation);
R_RETURN(m_manager.PrepareEsTitleKey(out_access_key.GetPointer(), base.GetPointer(), base.GetSize(), mod.GetPointer(), mod.GetSize(), label_digest.GetPointer(), label_digest.GetSize(), generation));
}
Result LoadPreparedAesKey(s32 keyslot, AccessKey access_key) {
return m_manager.LoadPreparedAesKey(keyslot, this, access_key);
R_RETURN(m_manager.LoadPreparedAesKey(keyslot, this, access_key));
}
Result PrepareCommonEsTitleKeyDeprecated(sf::Out<AccessKey> out_access_key, KeySource key_source) {
return m_manager.PrepareCommonEsTitleKey(out_access_key.GetPointer(), key_source, 0);
R_RETURN(m_manager.PrepareCommonEsTitleKey(out_access_key.GetPointer(), key_source, 0));
}
Result PrepareCommonEsTitleKey(sf::Out<AccessKey> out_access_key, KeySource key_source, u32 generation) {
return m_manager.PrepareCommonEsTitleKey(out_access_key.GetPointer(), key_source, generation);
R_RETURN(m_manager.PrepareCommonEsTitleKey(out_access_key.GetPointer(), key_source, generation));
}
Result AllocateAesKeySlot(sf::Out<s32> out_keyslot) {
return m_manager.AllocateAesKeySlot(out_keyslot.GetPointer(), this);
R_RETURN(m_manager.AllocateAesKeySlot(out_keyslot.GetPointer(), this));
}
Result DeallocateAesKeySlot(s32 keyslot) {
return m_manager.DeallocateAesKeySlot(keyslot, this);
R_RETURN(m_manager.DeallocateAesKeySlot(keyslot, this));
}
Result GetAesKeySlotAvailableEvent(sf::OutCopyHandle out_hnd) {
@ -133,11 +133,11 @@ namespace ams::spl {
}
Result SetBootReason(BootReasonValue boot_reason) {
return m_manager.SetBootReason(boot_reason);
R_RETURN(m_manager.SetBootReason(boot_reason));
}
Result GetBootReason(sf::Out<BootReasonValue> out) {
return m_manager.GetBootReason(out.GetPointer());
R_RETURN(m_manager.GetBootReason(out.GetPointer()));
}
};
static_assert(spl::impl::IsIDeprecatedGeneralInterface<DeprecatedService>);

View file

@ -25,11 +25,11 @@ namespace ams::spl {
public:
/* Actual commands. */
Result DecryptDeviceUniqueDataDeprecated(const sf::OutPointerBuffer &dst, const sf::InPointerBuffer &src, AccessKey access_key, KeySource key_source, u32 option) {
return m_manager.DecryptDeviceUniqueData(dst.GetPointer(), dst.GetSize(), src.GetPointer(), src.GetSize(), access_key, key_source, option);
R_RETURN(m_manager.DecryptDeviceUniqueData(dst.GetPointer(), dst.GetSize(), src.GetPointer(), src.GetSize(), access_key, key_source, option));
}
Result DecryptDeviceUniqueData(const sf::OutPointerBuffer &dst, const sf::InPointerBuffer &src, AccessKey access_key, KeySource key_source) {
return m_manager.DecryptDeviceUniqueData(dst.GetPointer(), dst.GetSize(), src.GetPointer(), src.GetSize(), access_key, key_source, static_cast<u32>(smc::DeviceUniqueDataMode::DecryptDeviceUniqueData));
R_RETURN(m_manager.DecryptDeviceUniqueData(dst.GetPointer(), dst.GetSize(), src.GetPointer(), src.GetSize(), access_key, key_source, static_cast<u32>(smc::DeviceUniqueDataMode::DecryptDeviceUniqueData)));
}
};
static_assert(spl::impl::IsIDeviceUniqueDataInterface<DeviceUniqueDataService>);

View file

@ -25,35 +25,35 @@ namespace ams::spl {
public:
/* Actual commands. */
Result LoadEsDeviceKeyDeprecated(const sf::InPointerBuffer &src, AccessKey access_key, KeySource key_source, u32 option) {
return m_manager.LoadEsDeviceKey(src.GetPointer(), src.GetSize(), access_key, key_source, option);
R_RETURN(m_manager.LoadEsDeviceKey(src.GetPointer(), src.GetSize(), access_key, key_source, option));
}
Result LoadEsDeviceKey(const sf::InPointerBuffer &src, AccessKey access_key, KeySource key_source) {
return m_manager.LoadEsDeviceKey(src.GetPointer(), src.GetSize(), access_key, key_source, static_cast<u32>(smc::DeviceUniqueDataMode::DecryptAndStoreEsDeviceKey));
R_RETURN(m_manager.LoadEsDeviceKey(src.GetPointer(), src.GetSize(), access_key, key_source, static_cast<u32>(smc::DeviceUniqueDataMode::DecryptAndStoreEsDeviceKey)));
}
Result PrepareEsTitleKey(sf::Out<AccessKey> out_access_key, const sf::InPointerBuffer &base, const sf::InPointerBuffer &mod, const sf::InPointerBuffer &label_digest, u32 generation) {
return m_manager.PrepareEsTitleKey(out_access_key.GetPointer(), base.GetPointer(), base.GetSize(), mod.GetPointer(), mod.GetSize(), label_digest.GetPointer(), label_digest.GetSize(), generation);
R_RETURN(m_manager.PrepareEsTitleKey(out_access_key.GetPointer(), base.GetPointer(), base.GetSize(), mod.GetPointer(), mod.GetSize(), label_digest.GetPointer(), label_digest.GetSize(), generation));
}
Result PrepareCommonEsTitleKey(sf::Out<AccessKey> out_access_key, KeySource key_source, u32 generation) {
return m_manager.PrepareCommonEsTitleKey(out_access_key.GetPointer(), key_source, generation);
R_RETURN(m_manager.PrepareCommonEsTitleKey(out_access_key.GetPointer(), key_source, generation));
}
Result DecryptAndStoreDrmDeviceCertKey(const sf::InPointerBuffer &src, AccessKey access_key, KeySource key_source) {
return m_manager.DecryptAndStoreDrmDeviceCertKey(src.GetPointer(), src.GetSize(), access_key, key_source);
R_RETURN(m_manager.DecryptAndStoreDrmDeviceCertKey(src.GetPointer(), src.GetSize(), access_key, key_source));
}
Result ModularExponentiateWithDrmDeviceCertKey(const sf::OutPointerBuffer &out, const sf::InPointerBuffer &base, const sf::InPointerBuffer &mod) {
return m_manager.ModularExponentiateWithDrmDeviceCertKey(out.GetPointer(), out.GetSize(), base.GetPointer(), base.GetSize(), mod.GetPointer(), mod.GetSize());
R_RETURN(m_manager.ModularExponentiateWithDrmDeviceCertKey(out.GetPointer(), out.GetSize(), base.GetPointer(), base.GetSize(), mod.GetPointer(), mod.GetSize()));
}
Result PrepareEsArchiveKey(sf::Out<AccessKey> out_access_key, const sf::InPointerBuffer &base, const sf::InPointerBuffer &mod, const sf::InPointerBuffer &label_digest, u32 generation) {
return m_manager.PrepareEsArchiveKey(out_access_key.GetPointer(), base.GetPointer(), base.GetSize(), mod.GetPointer(), mod.GetSize(), label_digest.GetPointer(), label_digest.GetSize(), generation);
R_RETURN(m_manager.PrepareEsArchiveKey(out_access_key.GetPointer(), base.GetPointer(), base.GetSize(), mod.GetPointer(), mod.GetSize(), label_digest.GetPointer(), label_digest.GetSize(), generation));
}
Result LoadPreparedAesKey(s32 keyslot, AccessKey access_key) {
return m_manager.LoadPreparedAesKey(keyslot, this, access_key);
R_RETURN(m_manager.LoadPreparedAesKey(keyslot, this, access_key));
}
};
static_assert(spl::impl::IsIEsInterface<EsService>);

View file

@ -25,27 +25,27 @@ namespace ams::spl {
public:
/* Actual commands. */
Result DecryptAndStoreGcKeyDeprecated(const sf::InPointerBuffer &src, AccessKey access_key, KeySource key_source, u32 option) {
return m_manager.DecryptAndStoreGcKey(src.GetPointer(), src.GetSize(), access_key, key_source, option);
R_RETURN(m_manager.DecryptAndStoreGcKey(src.GetPointer(), src.GetSize(), access_key, key_source, option));
}
Result DecryptAndStoreGcKey(const sf::InPointerBuffer &src, AccessKey access_key, KeySource key_source) {
return m_manager.DecryptAndStoreGcKey(src.GetPointer(), src.GetSize(), access_key, key_source, static_cast<u32>(smc::DeviceUniqueDataMode::DecryptAndStoreGcKey));
R_RETURN(m_manager.DecryptAndStoreGcKey(src.GetPointer(), src.GetSize(), access_key, key_source, static_cast<u32>(smc::DeviceUniqueDataMode::DecryptAndStoreGcKey)));
}
Result DecryptGcMessage(sf::Out<u32> out_size, const sf::OutPointerBuffer &out, const sf::InPointerBuffer &base, const sf::InPointerBuffer &mod, const sf::InPointerBuffer &label_digest) {
return m_manager.DecryptGcMessage(out_size.GetPointer(), out.GetPointer(), out.GetSize(), base.GetPointer(), base.GetSize(), mod.GetPointer(), mod.GetSize(), label_digest.GetPointer(), label_digest.GetSize());
R_RETURN(m_manager.DecryptGcMessage(out_size.GetPointer(), out.GetPointer(), out.GetSize(), base.GetPointer(), base.GetSize(), mod.GetPointer(), mod.GetSize(), label_digest.GetPointer(), label_digest.GetSize()));
}
Result GenerateSpecificAesKey(sf::Out<AesKey> out_key, KeySource key_source, u32 generation, u32 which) {
return m_manager.GenerateSpecificAesKey(out_key.GetPointer(), key_source, generation, which);
R_RETURN(m_manager.GenerateSpecificAesKey(out_key.GetPointer(), key_source, generation, which));
}
Result LoadPreparedAesKey(s32 keyslot, AccessKey access_key) {
return m_manager.LoadPreparedAesKey(keyslot, this, access_key);
R_RETURN(m_manager.LoadPreparedAesKey(keyslot, this, access_key));
}
Result GetPackage2Hash(const sf::OutPointerBuffer &dst) {
return m_manager.GetPackage2Hash(dst.GetPointer(), dst.GetSize());
R_RETURN(m_manager.GetPackage2Hash(dst.GetPointer(), dst.GetSize()));
}
};
static_assert(spl::impl::IsIFsInterface<FsService>);

View file

@ -27,31 +27,31 @@ namespace ams::spl {
public:
/* Actual commands. */
Result GetConfig(sf::Out<u64> out, u32 key) {
return m_manager.GetConfig(out.GetPointer(), static_cast<spl::ConfigItem>(key));
R_RETURN(m_manager.GetConfig(out.GetPointer(), static_cast<spl::ConfigItem>(key)));
}
Result ModularExponentiate(const sf::OutPointerBuffer &out, const sf::InPointerBuffer &base, const sf::InPointerBuffer &exp, const sf::InPointerBuffer &mod) {
return m_manager.ModularExponentiate(out.GetPointer(), out.GetSize(), base.GetPointer(), base.GetSize(), exp.GetPointer(), exp.GetSize(), mod.GetPointer(), mod.GetSize());
R_RETURN(m_manager.ModularExponentiate(out.GetPointer(), out.GetSize(), base.GetPointer(), base.GetSize(), exp.GetPointer(), exp.GetSize(), mod.GetPointer(), mod.GetSize()));
}
Result SetConfig(u32 key, u64 value) {
return m_manager.SetConfig(static_cast<spl::ConfigItem>(key), value);
R_RETURN(m_manager.SetConfig(static_cast<spl::ConfigItem>(key), value));
}
Result GenerateRandomBytes(const sf::OutPointerBuffer &out) {
return m_manager.GenerateRandomBytes(out.GetPointer(), out.GetSize());
R_RETURN(m_manager.GenerateRandomBytes(out.GetPointer(), out.GetSize()));
}
Result IsDevelopment(sf::Out<bool> is_dev) {
return m_manager.IsDevelopment(is_dev.GetPointer());
R_RETURN(m_manager.IsDevelopment(is_dev.GetPointer()));
}
Result SetBootReason(BootReasonValue boot_reason) {
return m_manager.SetBootReason(boot_reason);
R_RETURN(m_manager.SetBootReason(boot_reason));
}
Result GetBootReason(sf::Out<BootReasonValue> out) {
return m_manager.GetBootReason(out.GetPointer());
R_RETURN(m_manager.GetBootReason(out.GetPointer()));
}
};
static_assert(spl::impl::IsIGeneralInterface<GeneralService>);

View file

@ -108,22 +108,22 @@ namespace ams {
switch (port_index) {
case PortIndex_General:
if (g_use_new_server) {
return this->AcceptImpl(server, m_general_service_object.GetShared());
R_RETURN(this->AcceptImpl(server, m_general_service_object.GetShared()));
} else {
return this->AcceptImpl(server, ObjectFactory::CreateSharedEmplaced<spl::impl::IDeprecatedGeneralInterface, spl::DeprecatedService>(m_allocator, m_secure_monitor_manager));
R_RETURN(this->AcceptImpl(server, ObjectFactory::CreateSharedEmplaced<spl::impl::IDeprecatedGeneralInterface, spl::DeprecatedService>(m_allocator, m_secure_monitor_manager)));
}
case PortIndex_Random:
return this->AcceptImpl(server, m_random_service_object.GetShared());
R_RETURN(this->AcceptImpl(server, m_random_service_object.GetShared()));
case PortIndex_Crypto:
return this->AcceptImpl(server, ObjectFactory::CreateSharedEmplaced<spl::impl::ICryptoInterface, spl::CryptoService>(m_allocator, m_secure_monitor_manager));
R_RETURN(this->AcceptImpl(server, ObjectFactory::CreateSharedEmplaced<spl::impl::ICryptoInterface, spl::CryptoService>(m_allocator, m_secure_monitor_manager)));
case PortIndex_Fs:
return this->AcceptImpl(server, ObjectFactory::CreateSharedEmplaced<spl::impl::IFsInterface, spl::FsService>(m_allocator, m_secure_monitor_manager));
R_RETURN(this->AcceptImpl(server, ObjectFactory::CreateSharedEmplaced<spl::impl::IFsInterface, spl::FsService>(m_allocator, m_secure_monitor_manager)));
case PortIndex_Ssl:
return this->AcceptImpl(server, ObjectFactory::CreateSharedEmplaced<spl::impl::ISslInterface, spl::SslService>(m_allocator, m_secure_monitor_manager));
R_RETURN(this->AcceptImpl(server, ObjectFactory::CreateSharedEmplaced<spl::impl::ISslInterface, spl::SslService>(m_allocator, m_secure_monitor_manager)));
case PortIndex_Es:
return this->AcceptImpl(server, ObjectFactory::CreateSharedEmplaced<spl::impl::IEsInterface, spl::EsService>(m_allocator, m_secure_monitor_manager));
R_RETURN(this->AcceptImpl(server, ObjectFactory::CreateSharedEmplaced<spl::impl::IEsInterface, spl::EsService>(m_allocator, m_secure_monitor_manager)));
case PortIndex_Manu:
return this->AcceptImpl(server, ObjectFactory::CreateSharedEmplaced<spl::impl::IManuInterface, spl::ManuService>(m_allocator, m_secure_monitor_manager));
R_RETURN(this->AcceptImpl(server, ObjectFactory::CreateSharedEmplaced<spl::impl::IManuInterface, spl::ManuService>(m_allocator, m_secure_monitor_manager)));
AMS_UNREACHABLE_DEFAULT_CASE();
}
}

View file

@ -25,7 +25,7 @@ namespace ams::spl {
public:
/* Actual commands. */
Result ReencryptDeviceUniqueData(const sf::OutPointerBuffer &out, const sf::InPointerBuffer &src, AccessKey access_key_dec, KeySource source_dec, AccessKey access_key_enc, KeySource source_enc, u32 option) {
return m_manager.ReencryptDeviceUniqueData(out.GetPointer(), out.GetSize(), src.GetPointer(), src.GetSize(), access_key_dec, source_dec, access_key_enc, source_enc, option);
R_RETURN(m_manager.ReencryptDeviceUniqueData(out.GetPointer(), out.GetSize(), src.GetPointer(), src.GetSize(), access_key_dec, source_dec, access_key_enc, source_enc, option));
}
};
static_assert(spl::impl::IsIManuInterface<ManuService>);

View file

@ -27,7 +27,7 @@ namespace ams::spl {
public:
/* Actual commands. */
Result GenerateRandomBytes(const sf::OutBuffer &out) {
return m_manager.GenerateRandomBytes(out.GetPointer(), out.GetSize());
R_RETURN(m_manager.GenerateRandomBytes(out.GetPointer(), out.GetSize()));
}
};
static_assert(spl::impl::IsIRandomInterface<RandomService>);

View file

@ -23,111 +23,111 @@ namespace ams::spl {
}
Result SecureMonitorManager::ModularExponentiate(void *out, size_t out_size, const void *base, size_t base_size, const void *exp, size_t exp_size, const void *mod, size_t mod_size) {
return impl::ModularExponentiate(out, out_size, base, base_size, exp, exp_size, mod, mod_size);
R_RETURN(impl::ModularExponentiate(out, out_size, base, base_size, exp, exp_size, mod, mod_size));
}
Result SecureMonitorManager::GenerateAesKek(AccessKey *out_access_key, const KeySource &key_source, u32 generation, u32 option) {
return impl::GenerateAesKek(out_access_key, key_source, generation, option);
R_RETURN(impl::GenerateAesKek(out_access_key, key_source, generation, option));
}
Result SecureMonitorManager::LoadAesKey(s32 keyslot, const void *owner, const AccessKey &access_key, const KeySource &key_source) {
R_TRY(this->TestAesKeySlot(nullptr, keyslot, owner));
return impl::LoadAesKey(keyslot, access_key, key_source);
R_RETURN(impl::LoadAesKey(keyslot, access_key, key_source));
}
Result SecureMonitorManager::GenerateAesKey(AesKey *out_key, const AccessKey &access_key, const KeySource &key_source) {
return impl::GenerateAesKey(out_key, access_key, key_source);
R_RETURN(impl::GenerateAesKey(out_key, access_key, key_source));
}
Result SecureMonitorManager::DecryptDeviceUniqueData(void *dst, size_t dst_size, const void *src, size_t src_size, const AccessKey &access_key, const KeySource &key_source, u32 option) {
return impl::DecryptDeviceUniqueData(dst, dst_size, src, src_size, access_key, key_source, option);
R_RETURN(impl::DecryptDeviceUniqueData(dst, dst_size, src, src_size, access_key, key_source, option));
}
Result SecureMonitorManager::ReencryptDeviceUniqueData(void *dst, size_t dst_size, const void *src, size_t src_size, const AccessKey &access_key_dec, const KeySource &source_dec, const AccessKey &access_key_enc, const KeySource &source_enc, u32 option) {
return impl::ReencryptDeviceUniqueData(dst, dst_size, src, src_size, access_key_dec, source_dec, access_key_enc, source_enc, option);
R_RETURN(impl::ReencryptDeviceUniqueData(dst, dst_size, src, src_size, access_key_dec, source_dec, access_key_enc, source_enc, option));
}
Result SecureMonitorManager::GetConfig(u64 *out, spl::ConfigItem key) {
return impl::GetConfig(out, key);
R_RETURN(impl::GetConfig(out, key));
}
Result SecureMonitorManager::SetConfig(spl::ConfigItem key, u64 value) {
return impl::SetConfig(key, value);
R_RETURN(impl::SetConfig(key, value));
}
Result SecureMonitorManager::GetPackage2Hash(void *dst, const size_t size) {
return impl::GetPackage2Hash(dst, size);
R_RETURN(impl::GetPackage2Hash(dst, size));
}
Result SecureMonitorManager::GenerateRandomBytes(void *out, size_t size) {
return impl::GenerateRandomBytes(out, size);
R_RETURN(impl::GenerateRandomBytes(out, size));
}
Result SecureMonitorManager::DecryptAndStoreGcKey(const void *src, size_t src_size, const AccessKey &access_key, const KeySource &key_source, u32 option) {
return impl::DecryptAndStoreGcKey(src, src_size, access_key, key_source, option);
R_RETURN(impl::DecryptAndStoreGcKey(src, src_size, access_key, key_source, option));
}
Result SecureMonitorManager::DecryptGcMessage(u32 *out_size, void *dst, size_t dst_size, const void *base, size_t base_size, const void *mod, size_t mod_size, const void *label_digest, size_t label_digest_size) {
return impl::DecryptGcMessage(out_size, dst, dst_size, base, base_size, mod, mod_size, label_digest, label_digest_size);
R_RETURN(impl::DecryptGcMessage(out_size, dst, dst_size, base, base_size, mod, mod_size, label_digest, label_digest_size));
}
Result SecureMonitorManager::DecryptAndStoreSslClientCertKey(const void *src, size_t src_size, const AccessKey &access_key, const KeySource &key_source) {
return impl::DecryptAndStoreSslClientCertKey(src, src_size, access_key, key_source);
R_RETURN(impl::DecryptAndStoreSslClientCertKey(src, src_size, access_key, key_source));
}
Result SecureMonitorManager::ModularExponentiateWithSslClientCertKey(void *out, size_t out_size, const void *base, size_t base_size, const void *mod, size_t mod_size) {
return impl::ModularExponentiateWithSslClientCertKey(out, out_size, base, base_size, mod, mod_size);
R_RETURN(impl::ModularExponentiateWithSslClientCertKey(out, out_size, base, base_size, mod, mod_size));
}
Result SecureMonitorManager::DecryptAndStoreDrmDeviceCertKey(const void *src, size_t src_size, const AccessKey &access_key, const KeySource &key_source) {
return impl::DecryptAndStoreDrmDeviceCertKey(src, src_size, access_key, key_source);
R_RETURN(impl::DecryptAndStoreDrmDeviceCertKey(src, src_size, access_key, key_source));
}
Result SecureMonitorManager::ModularExponentiateWithDrmDeviceCertKey(void *out, size_t out_size, const void *base, size_t base_size, const void *mod, size_t mod_size) {
return impl::ModularExponentiateWithDrmDeviceCertKey(out, out_size, base, base_size, mod, mod_size);
R_RETURN(impl::ModularExponentiateWithDrmDeviceCertKey(out, out_size, base, base_size, mod, mod_size));
}
Result SecureMonitorManager::IsDevelopment(bool *out) {
return impl::IsDevelopment(out);
R_RETURN(impl::IsDevelopment(out));
}
Result SecureMonitorManager::GenerateSpecificAesKey(AesKey *out_key, const KeySource &key_source, u32 generation, u32 which) {
return impl::GenerateSpecificAesKey(out_key, key_source, generation, which);
R_RETURN(impl::GenerateSpecificAesKey(out_key, key_source, generation, which));
}
Result SecureMonitorManager::DecryptAesKey(AesKey *out_key, const KeySource &key_source, u32 generation, u32 option) {
return impl::DecryptAesKey(out_key, key_source, generation, option);
R_RETURN(impl::DecryptAesKey(out_key, key_source, generation, option));
}
Result SecureMonitorManager::ComputeCtr(void *dst, size_t dst_size, s32 keyslot, const void *owner, const void *src, size_t src_size, const IvCtr &iv_ctr) {
R_TRY(this->TestAesKeySlot(nullptr, keyslot, owner));
return impl::ComputeCtr(dst, dst_size, keyslot, src, src_size, iv_ctr);
R_RETURN(impl::ComputeCtr(dst, dst_size, keyslot, src, src_size, iv_ctr));
}
Result SecureMonitorManager::ComputeCmac(Cmac *out_cmac, s32 keyslot, const void *owner, const void *data, size_t size) {
R_TRY(this->TestAesKeySlot(nullptr, keyslot, owner));
return impl::ComputeCmac(out_cmac, keyslot, data, size);
R_RETURN(impl::ComputeCmac(out_cmac, keyslot, data, size));
}
Result SecureMonitorManager::LoadEsDeviceKey(const void *src, size_t src_size, const AccessKey &access_key, const KeySource &key_source, u32 option) {
return impl::LoadEsDeviceKey(src, src_size, access_key, key_source, option);
R_RETURN(impl::LoadEsDeviceKey(src, src_size, access_key, key_source, option));
}
Result SecureMonitorManager::PrepareEsTitleKey(AccessKey *out_access_key, const void *base, size_t base_size, const void *mod, size_t mod_size, const void *label_digest, size_t label_digest_size, u32 generation) {
return impl::PrepareEsTitleKey(out_access_key, base, base_size, mod, mod_size, label_digest, label_digest_size, generation);
R_RETURN(impl::PrepareEsTitleKey(out_access_key, base, base_size, mod, mod_size, label_digest, label_digest_size, generation));
}
Result SecureMonitorManager::PrepareEsArchiveKey(AccessKey *out_access_key, const void *base, size_t base_size, const void *mod, size_t mod_size, const void *label_digest, size_t label_digest_size, u32 generation) {
return impl::PrepareEsArchiveKey(out_access_key, base, base_size, mod, mod_size, label_digest, label_digest_size, generation);
R_RETURN(impl::PrepareEsArchiveKey(out_access_key, base, base_size, mod, mod_size, label_digest, label_digest_size, generation));
}
Result SecureMonitorManager::PrepareCommonEsTitleKey(AccessKey *out_access_key, const KeySource &key_source, u32 generation) {
return impl::PrepareCommonEsTitleKey(out_access_key, key_source, generation);
R_RETURN(impl::PrepareCommonEsTitleKey(out_access_key, key_source, generation));
}
Result SecureMonitorManager::LoadPreparedAesKey(s32 keyslot, const void *owner, const AccessKey &access_key) {
R_TRY(this->TestAesKeySlot(nullptr, keyslot, owner));
return impl::LoadPreparedAesKey(keyslot, access_key);
R_RETURN(impl::LoadPreparedAesKey(keyslot, access_key));
}
Result SecureMonitorManager::AllocateAesKeySlot(s32 *out_keyslot, const void *owner) {
@ -153,7 +153,7 @@ namespace ams::spl {
R_TRY(this->TestAesKeySlot(std::addressof(index), keyslot, owner));
m_aes_keyslot_owners[index] = nullptr;
return impl::DeallocateAesKeySlot(keyslot);
R_RETURN(impl::DeallocateAesKeySlot(keyslot));
}
void SecureMonitorManager::DeallocateAesKeySlots(const void *owner) {
@ -166,11 +166,11 @@ namespace ams::spl {
}
Result SecureMonitorManager::SetBootReason(BootReasonValue boot_reason) {
return impl::SetBootReason(boot_reason);
R_RETURN(impl::SetBootReason(boot_reason));
}
Result SecureMonitorManager::GetBootReason(BootReasonValue *out) {
return impl::GetBootReason(out);
R_RETURN(impl::GetBootReason(out));
}
os::SystemEvent *SecureMonitorManager::GetAesKeySlotAvailableEvent() {

View file

@ -25,11 +25,11 @@ namespace ams::spl {
public:
/* Actual commands. */
Result DecryptAndStoreSslClientCertKey(const sf::InPointerBuffer &src, AccessKey access_key, KeySource key_source) {
return m_manager.DecryptAndStoreSslClientCertKey(src.GetPointer(), src.GetSize(), access_key, key_source);
R_RETURN(m_manager.DecryptAndStoreSslClientCertKey(src.GetPointer(), src.GetSize(), access_key, key_source));
}
Result ModularExponentiateWithSslClientCertKey(const sf::OutPointerBuffer &out, const sf::InPointerBuffer &base, const sf::InPointerBuffer &mod) {
return m_manager.ModularExponentiateWithSslClientCertKey(out.GetPointer(), out.GetSize(), base.GetPointer(), base.GetSize(), mod.GetPointer(), mod.GetSize());
R_RETURN(m_manager.ModularExponentiateWithSslClientCertKey(out.GetPointer(), out.GetSize(), base.GetPointer(), base.GetSize(), mod.GetPointer(), mod.GetSize()));
}
};
static_assert(spl::impl::IsISslInterface<SslService>);