mirror of
https://github.com/Atmosphere-NX/Atmosphere.git
synced 2025-06-03 08:08:39 -04:00
ams: use R_SUCCEED, R_THROW globally
This commit is contained in:
parent
e5b1739f65
commit
dd78ede99f
370 changed files with 2107 additions and 2107 deletions
|
@ -29,7 +29,7 @@ namespace ams::mitm::fs {
|
|||
/* Helpers. */
|
||||
Result EnsureSdInitialized() {
|
||||
R_UNLESS(serviceIsActive(std::addressof(g_sd_filesystem.s)), ams::fs::ResultSdCardNotPresent());
|
||||
return ResultSuccess();
|
||||
R_SUCCEED();
|
||||
}
|
||||
|
||||
void FormatAtmosphereRomfsPath(char *dst_path, size_t dst_path_size, ncm::ProgramId program_id, const char *src_path) {
|
||||
|
@ -230,7 +230,7 @@ namespace ams::mitm::fs {
|
|||
/* Set output. */
|
||||
file_guard.Cancel();
|
||||
*out = f;
|
||||
return ResultSuccess();
|
||||
R_SUCCEED();
|
||||
}
|
||||
|
||||
Result CreateAndOpenAtmosphereSdFile(FsFile *out, ncm::ProgramId program_id, const char *path, size_t size) {
|
||||
|
@ -254,7 +254,7 @@ namespace ams::mitm::fs {
|
|||
/* Set output. */
|
||||
file_guard.Cancel();
|
||||
*out = f;
|
||||
return ResultSuccess();
|
||||
R_SUCCEED();
|
||||
|
||||
}
|
||||
|
||||
|
|
|
@ -148,7 +148,7 @@ namespace ams::mitm::bpc {
|
|||
/* NOTE: Preferred reboot type will be parsed from settings later on. */
|
||||
g_reboot_type = RebootType::ToPayload;
|
||||
|
||||
return ResultSuccess();
|
||||
R_SUCCEED();
|
||||
}
|
||||
|
||||
Result DetectPreferredRebootFunctionality() {
|
||||
|
@ -163,7 +163,7 @@ namespace ams::mitm::bpc {
|
|||
g_reboot_type = RebootType::ToPayload;
|
||||
}
|
||||
|
||||
return ResultSuccess();
|
||||
R_SUCCEED();
|
||||
}
|
||||
|
||||
}
|
||||
|
|
|
@ -22,12 +22,12 @@ namespace ams::mitm::bpc {
|
|||
Result BpcMitmService::RebootSystem() {
|
||||
R_UNLESS(bpc::IsRebootManaged(), sm::mitm::ResultShouldForwardToSession());
|
||||
bpc::RebootSystem();
|
||||
return ResultSuccess();
|
||||
R_SUCCEED();
|
||||
}
|
||||
|
||||
Result BpcMitmService::ShutdownSystem() {
|
||||
bpc::ShutdownSystem();
|
||||
return ResultSuccess();
|
||||
R_SUCCEED();
|
||||
}
|
||||
|
||||
}
|
||||
|
|
|
@ -105,7 +105,7 @@ namespace ams::mitm::socket::resolver {
|
|||
*out_errno = 0;
|
||||
*out_size = size;
|
||||
|
||||
return ResultSuccess();
|
||||
R_SUCCEED();
|
||||
}
|
||||
|
||||
Result ResolverImpl::GetAddrInfoRequest(u32 cancel_handle, const sf::ClientProcessId &client_pid, bool use_nsd_resolve, const sf::InBuffer &node, const sf::InBuffer &srv, const sf::InBuffer &serialized_hint, const sf::OutBuffer &out_addrinfo, sf::Out<u32> out_errno, sf::Out<s32> out_retval, sf::Out<u32> out_size) {
|
||||
|
@ -144,7 +144,7 @@ namespace ams::mitm::socket::resolver {
|
|||
*out_errno = 0;
|
||||
*out_size = size;
|
||||
|
||||
return ResultSuccess();
|
||||
R_SUCCEED();
|
||||
}
|
||||
|
||||
Result ResolverImpl::GetHostByNameRequestWithOptions(const sf::ClientProcessId &client_pid, const sf::InAutoSelectBuffer &name, const sf::OutAutoSelectBuffer &out_hostent, sf::Out<u32> out_size, u32 options_version, const sf::InAutoSelectBuffer &options, u32 num_options, sf::Out<s32> out_host_error, sf::Out<s32> out_errno) {
|
||||
|
@ -166,7 +166,7 @@ namespace ams::mitm::socket::resolver {
|
|||
*out_errno = 0;
|
||||
*out_size = size;
|
||||
|
||||
return ResultSuccess();
|
||||
R_SUCCEED();
|
||||
}
|
||||
|
||||
Result ResolverImpl::GetAddrInfoRequestWithOptions(const sf::ClientProcessId &client_pid, const sf::InBuffer &node, const sf::InBuffer &srv, const sf::InBuffer &serialized_hint, const sf::OutAutoSelectBuffer &out_addrinfo, sf::Out<u32> out_size, sf::Out<s32> out_retval, u32 options_version, const sf::InAutoSelectBuffer &options, u32 num_options, sf::Out<s32> out_host_error, sf::Out<s32> out_errno) {
|
||||
|
@ -206,13 +206,13 @@ namespace ams::mitm::socket::resolver {
|
|||
*out_errno = 0;
|
||||
*out_size = size;
|
||||
|
||||
return ResultSuccess();
|
||||
R_SUCCEED();
|
||||
}
|
||||
|
||||
Result ResolverImpl::AtmosphereReloadHostsFile() {
|
||||
/* Perform a hosts file reload. */
|
||||
InitializeResolverRedirections();
|
||||
return ResultSuccess();
|
||||
R_SUCCEED();
|
||||
}
|
||||
|
||||
}
|
||||
|
|
|
@ -91,7 +91,7 @@ namespace ams::mitm::fs {
|
|||
R_TRY(subdir_fs->Initialize(AtmosphereHblWebContentDirPath));
|
||||
|
||||
out.SetValue(MakeSharedFileSystem(std::make_shared<fs::ReadOnlyFileSystem>(std::move(subdir_fs)), false), target_object_id);
|
||||
return ResultSuccess();
|
||||
R_SUCCEED();
|
||||
}
|
||||
|
||||
Result OpenProgramSpecificWebContentFileSystem(sf::Out<sf::SharedPointer<ams::fssrv::sf::IFileSystem>> &out, ncm::ProgramId program_id, FsFileSystemType filesystem_type, Service *fwd, const fssrv::sf::Path *path, bool with_id) {
|
||||
|
@ -142,7 +142,7 @@ namespace ams::mitm::fs {
|
|||
out.SetValue(MakeSharedFileSystem(std::move(new_fs), false), target_object_id);
|
||||
}
|
||||
|
||||
return ResultSuccess();
|
||||
R_SUCCEED();
|
||||
}
|
||||
|
||||
Result OpenWebContentFileSystem(sf::Out<sf::SharedPointer<ams::fssrv::sf::IFileSystem>> &out, ncm::ProgramId client_program_id, ncm::ProgramId program_id, FsFileSystemType filesystem_type, Service *fwd, const fssrv::sf::Path *path, bool with_id, bool try_program_specific) {
|
||||
|
@ -185,7 +185,7 @@ namespace ams::mitm::fs {
|
|||
R_TRY(redir_fs->InitializeWithFixedPath("/Nintendo", emummc::GetNintendoDirPath()));
|
||||
|
||||
out.SetValue(MakeSharedFileSystem(std::move(redir_fs), false), target_object_id);
|
||||
return ResultSuccess();
|
||||
R_SUCCEED();
|
||||
}
|
||||
|
||||
Result FsMitmService::OpenSaveDataFileSystem(sf::Out<sf::SharedPointer<ams::fssrv::sf::IFileSystem>> out, u8 _space_id, const fs::SaveDataAttribute &attribute) {
|
||||
|
@ -260,7 +260,7 @@ namespace ams::mitm::fs {
|
|||
|
||||
/* Set output. */
|
||||
out.SetValue(MakeSharedFileSystem(std::move(dirsave_ifs), false), target_object_id);
|
||||
return ResultSuccess();
|
||||
R_SUCCEED();
|
||||
}
|
||||
|
||||
Result FsMitmService::OpenBisStorage(sf::Out<sf::SharedPointer<ams::fssrv::sf::IStorage>> out, u32 _bis_partition_id) {
|
||||
|
@ -302,7 +302,7 @@ namespace ams::mitm::fs {
|
|||
}
|
||||
}
|
||||
|
||||
return ResultSuccess();
|
||||
R_SUCCEED();
|
||||
}
|
||||
|
||||
Result FsMitmService::OpenDataStorageByCurrentProcess(sf::Out<sf::SharedPointer<ams::fssrv::sf::IStorage>> out) {
|
||||
|
@ -319,7 +319,7 @@ namespace ams::mitm::fs {
|
|||
|
||||
/* Get a layered storage for the process romfs. */
|
||||
out.SetValue(MakeSharedStorage(GetLayeredRomfsStorage(m_client_info.program_id, data_storage, true)), target_object_id);
|
||||
return ResultSuccess();
|
||||
R_SUCCEED();
|
||||
}
|
||||
|
||||
Result FsMitmService::OpenDataStorageByDataId(sf::Out<sf::SharedPointer<ams::fssrv::sf::IStorage>> out, ncm::DataId _data_id, u8 storage_id) {
|
||||
|
@ -339,7 +339,7 @@ namespace ams::mitm::fs {
|
|||
|
||||
/* Get a layered storage for the data id. */
|
||||
out.SetValue(MakeSharedStorage(GetLayeredRomfsStorage(data_id, data_storage, false)), target_object_id);
|
||||
return ResultSuccess();
|
||||
R_SUCCEED();
|
||||
}
|
||||
|
||||
Result FsMitmService::OpenDataStorageWithProgramIndex(sf::Out<sf::SharedPointer<ams::fssrv::sf::IStorage>> out, u8 program_index) {
|
||||
|
@ -360,7 +360,7 @@ namespace ams::mitm::fs {
|
|||
|
||||
/* Get a layered storage for the process romfs. */
|
||||
out.SetValue(MakeSharedStorage(GetLayeredRomfsStorage(program_id, data_storage, true)), target_object_id);
|
||||
return ResultSuccess();
|
||||
R_SUCCEED();
|
||||
}
|
||||
|
||||
Result FsMitmService::RegisterProgramIndexMapInfo(const sf::InBuffer &info_buffer, s32 info_count) {
|
||||
|
@ -370,7 +370,7 @@ namespace ams::mitm::fs {
|
|||
/* Register with ourselves. */
|
||||
R_ABORT_UNLESS(g_program_index_map_info_manager.Reset(reinterpret_cast<const fs::ProgramIndexMapInfo *>(info_buffer.GetPointer()), info_count));
|
||||
|
||||
return ResultSuccess();
|
||||
R_SUCCEED();
|
||||
}
|
||||
|
||||
}
|
||||
|
|
|
@ -36,7 +36,7 @@ namespace ams::mitm::fs {
|
|||
|
||||
/* Check if we have nothing to do. */
|
||||
if (size == 0) {
|
||||
return ResultSuccess();
|
||||
R_SUCCEED();
|
||||
}
|
||||
|
||||
/* Fast case. */
|
||||
|
@ -69,7 +69,7 @@ namespace ams::mitm::fs {
|
|||
}
|
||||
}
|
||||
|
||||
return ResultSuccess();
|
||||
R_SUCCEED();
|
||||
}
|
||||
|
||||
virtual Result Write(s64 offset, const void *_buffer, size_t size) override {
|
||||
|
@ -80,7 +80,7 @@ namespace ams::mitm::fs {
|
|||
|
||||
/* Check if we have nothing to do. */
|
||||
if (size == 0) {
|
||||
return ResultSuccess();
|
||||
R_SUCCEED();
|
||||
}
|
||||
|
||||
/* Fast case. */
|
||||
|
@ -117,7 +117,7 @@ namespace ams::mitm::fs {
|
|||
}
|
||||
}
|
||||
|
||||
return ResultSuccess();
|
||||
R_SUCCEED();
|
||||
}
|
||||
};
|
||||
|
||||
|
|
|
@ -368,7 +368,7 @@ namespace ams::mitm::fs {
|
|||
}
|
||||
}
|
||||
|
||||
return ResultSuccess();
|
||||
R_SUCCEED();
|
||||
}
|
||||
|
||||
Result LayeredRomfsStorageImpl::GetSize(s64 *out_size) {
|
||||
|
@ -378,11 +378,11 @@ namespace ams::mitm::fs {
|
|||
}
|
||||
|
||||
*out_size = this->GetSize();
|
||||
return ResultSuccess();
|
||||
R_SUCCEED();
|
||||
}
|
||||
|
||||
Result LayeredRomfsStorageImpl::Flush() {
|
||||
return ResultSuccess();
|
||||
R_SUCCEED();
|
||||
}
|
||||
|
||||
Result LayeredRomfsStorageImpl::OperateRange(void *dst, size_t dst_size, OperationId op_id, s64 offset, s64 size, const void *src, size_t src_size) {
|
||||
|
@ -397,12 +397,12 @@ namespace ams::mitm::fs {
|
|||
R_UNLESS(dst_size == sizeof(QueryRangeInfo), fs::ResultInvalidSize());
|
||||
reinterpret_cast<QueryRangeInfo *>(dst)->Clear();
|
||||
}
|
||||
return ResultSuccess();
|
||||
R_SUCCEED();
|
||||
}
|
||||
/* TODO: How to deal with this? */
|
||||
return fs::ResultUnsupportedOperation();
|
||||
R_THROW(fs::ResultUnsupportedOperation());
|
||||
default:
|
||||
return fs::ResultUnsupportedOperation();
|
||||
R_THROW(fs::ResultUnsupportedOperation());
|
||||
}
|
||||
}
|
||||
|
||||
|
|
|
@ -78,7 +78,7 @@ namespace ams::mitm::fs {
|
|||
}
|
||||
|
||||
virtual Result DoCommit() override final {
|
||||
return ResultSuccess();
|
||||
R_SUCCEED();
|
||||
}
|
||||
|
||||
virtual Result DoGetFreeSpaceSize(s64 *out, const ams::fs::Path &path) {
|
||||
|
|
|
@ -44,10 +44,10 @@ namespace ams::mitm::fs {
|
|||
*out_str = "safe";
|
||||
break;
|
||||
default:
|
||||
return fs::ResultInvalidSaveDataSpaceId();
|
||||
R_THROW(fs::ResultInvalidSaveDataSpaceId());
|
||||
}
|
||||
|
||||
return ResultSuccess();
|
||||
R_SUCCEED();
|
||||
}
|
||||
|
||||
Result GetSaveDataTypeString(const char **out_str, SaveDataType save_data_type) {
|
||||
|
@ -75,10 +75,10 @@ namespace ams::mitm::fs {
|
|||
break;
|
||||
default:
|
||||
/* TODO: Better result? */
|
||||
return fs::ResultInvalidArgument();
|
||||
R_THROW(fs::ResultInvalidArgument());
|
||||
}
|
||||
|
||||
return ResultSuccess();
|
||||
R_SUCCEED();
|
||||
}
|
||||
|
||||
constexpr inline bool IsEmptyAccountId(const UserId &uid) {
|
||||
|
@ -108,7 +108,7 @@ namespace ams::mitm::fs {
|
|||
|
||||
R_UNLESS(out_path_len < dst_size, fs::ResultTooLongPath());
|
||||
|
||||
return ResultSuccess();
|
||||
R_SUCCEED();
|
||||
}
|
||||
|
||||
}
|
||||
|
|
|
@ -29,7 +29,7 @@ namespace ams::mitm::ns {
|
|||
bool is_hbl;
|
||||
if (R_SUCCEEDED(pm::info::IsHblProgramId(&is_hbl, application_id)) && is_hbl) {
|
||||
nsamResolveApplicationContentPathFwd(m_forward_service.get(), static_cast<u64>(application_id), static_cast<NcmContentType>(content_type));
|
||||
return ResultSuccess();
|
||||
R_SUCCEED();
|
||||
}
|
||||
return nsamResolveApplicationContentPathFwd(m_forward_service.get(), static_cast<u64>(application_id), static_cast<NcmContentType>(content_type));
|
||||
}
|
||||
|
|
|
@ -28,7 +28,7 @@ namespace ams::mitm::ns {
|
|||
bool is_hbl;
|
||||
if (R_SUCCEEDED(pm::info::IsHblProgramId(std::addressof(is_hbl), application_id)) && is_hbl) {
|
||||
nswebResolveApplicationContentPath(m_srv.get(), static_cast<u64>(application_id), static_cast<NcmContentType>(content_type));
|
||||
return ResultSuccess();
|
||||
R_SUCCEED();
|
||||
}
|
||||
return nswebResolveApplicationContentPath(m_srv.get(), static_cast<u64>(application_id), static_cast<NcmContentType>(content_type));
|
||||
}
|
||||
|
@ -44,7 +44,7 @@ namespace ams::mitm::ns {
|
|||
const sf::cmif::DomainObjectId target_object_id{serviceGetObjectId(std::addressof(doc.s))};
|
||||
|
||||
out.SetValue(sf::CreateSharedObjectEmplaced<impl::IDocumentInterface, NsDocumentService>(m_client_info, std::make_unique<NsDocumentInterface>(doc)), target_object_id);
|
||||
return ResultSuccess();
|
||||
R_SUCCEED();
|
||||
}
|
||||
|
||||
}
|
||||
|
|
|
@ -48,7 +48,7 @@ namespace ams::mitm::settings {
|
|||
Result SetMitmService::EnsureLocale() {
|
||||
/* Optimization: if locale has already been gotten, we can stop. */
|
||||
if (AMS_LIKELY(m_got_locale)) {
|
||||
return ResultSuccess();
|
||||
R_SUCCEED();
|
||||
}
|
||||
|
||||
std::scoped_lock lk(m_lock);
|
||||
|
@ -77,7 +77,7 @@ namespace ams::mitm::settings {
|
|||
}
|
||||
}
|
||||
|
||||
return ResultSuccess();
|
||||
R_SUCCEED();
|
||||
}
|
||||
|
||||
void SetMitmService::InvalidateLocale() {
|
||||
|
@ -105,7 +105,7 @@ namespace ams::mitm::settings {
|
|||
}
|
||||
|
||||
out.SetValue(m_locale.language_code);
|
||||
return ResultSuccess();
|
||||
R_SUCCEED();
|
||||
}
|
||||
|
||||
Result SetMitmService::GetRegionCode(sf::Out<settings::RegionCode> out) {
|
||||
|
@ -124,7 +124,7 @@ namespace ams::mitm::settings {
|
|||
}
|
||||
|
||||
out.SetValue(m_locale.region_code);
|
||||
return ResultSuccess();
|
||||
R_SUCCEED();
|
||||
}
|
||||
|
||||
}
|
||||
|
|
|
@ -84,7 +84,7 @@ namespace ams::mitm::settings {
|
|||
*out = g_firmware_version;
|
||||
}
|
||||
|
||||
return ResultSuccess();
|
||||
R_SUCCEED();
|
||||
}
|
||||
|
||||
}
|
||||
|
@ -95,7 +95,7 @@ namespace ams::mitm::settings {
|
|||
/* GetFirmwareVersion sanitizes the revision fields. */
|
||||
out.GetPointer()->revision_major = 0;
|
||||
out.GetPointer()->revision_minor = 0;
|
||||
return ResultSuccess();
|
||||
R_SUCCEED();
|
||||
}
|
||||
|
||||
Result SetSysMitmService::GetFirmwareVersion2(sf::Out<settings::FirmwareVersion> out) {
|
||||
|
@ -108,7 +108,7 @@ namespace ams::mitm::settings {
|
|||
R_CONVERT_ALL(sm::mitm::ResultShouldForwardToSession());
|
||||
} R_END_TRY_CATCH;
|
||||
|
||||
return ResultSuccess();
|
||||
R_SUCCEED();
|
||||
}
|
||||
|
||||
Result SetSysMitmService::GetSettingsItemValue(sf::Out<u64> out_size, const sf::OutBuffer &out, const settings::SettingsName &name, const settings::SettingsItemKey &key) {
|
||||
|
@ -117,7 +117,7 @@ namespace ams::mitm::settings {
|
|||
R_CONVERT_ALL(sm::mitm::ResultShouldForwardToSession());
|
||||
} R_END_TRY_CATCH;
|
||||
|
||||
return ResultSuccess();
|
||||
R_SUCCEED();
|
||||
}
|
||||
|
||||
Result SetSysMitmService::GetDebugModeFlag(sf::Out<bool> out) {
|
||||
|
@ -129,7 +129,7 @@ namespace ams::mitm::settings {
|
|||
settings::fwdbg::GetSettingsItemValue(std::addressof(en), sizeof(en), "atmosphere", "enable_am_debug_mode");
|
||||
|
||||
out.SetValue(en != 0);
|
||||
return ResultSuccess();
|
||||
R_SUCCEED();
|
||||
}
|
||||
|
||||
}
|
||||
|
|
|
@ -127,7 +127,7 @@ namespace ams::settings::fwdbg {
|
|||
R_UNLESS(len > 0, settings::ResultEmptySettingsName());
|
||||
R_UNLESS(len <= SettingsNameLengthMax, settings::ResultTooLongSettingsName());
|
||||
R_UNLESS(IsValidSettingsFormat(name, len), settings::ResultInvalidFormatSettingsName());
|
||||
return ResultSuccess();
|
||||
R_SUCCEED();
|
||||
}
|
||||
|
||||
Result ValidateSettingsItemKey(const char *key) {
|
||||
|
@ -136,7 +136,7 @@ namespace ams::settings::fwdbg {
|
|||
R_UNLESS(len > 0, settings::ResultEmptySettingsItemKey());
|
||||
R_UNLESS(len <= SettingsNameLengthMax, settings::ResultTooLongSettingsItemKey());
|
||||
R_UNLESS(IsValidSettingsFormat(key, len), settings::ResultInvalidFormatSettingsItemKey());
|
||||
return ResultSuccess();
|
||||
R_SUCCEED();
|
||||
}
|
||||
|
||||
Result AllocateValue(void **out, size_t size) {
|
||||
|
@ -144,35 +144,35 @@ namespace ams::settings::fwdbg {
|
|||
|
||||
*out = g_value_storage + g_allocated_value_storage_size;
|
||||
g_allocated_value_storage_size += size;
|
||||
return ResultSuccess();
|
||||
R_SUCCEED();
|
||||
}
|
||||
|
||||
Result FindSettingsName(const char **out, const char *name) {
|
||||
for (auto &stored : g_names) {
|
||||
if (std::strcmp(stored.value, name) == 0) {
|
||||
*out = stored.value;
|
||||
return ResultSuccess();
|
||||
R_SUCCEED();
|
||||
} else if (std::strcmp(stored.value, "") == 0) {
|
||||
*out = stored.value;
|
||||
std::strcpy(stored.value, name);
|
||||
return ResultSuccess();
|
||||
R_SUCCEED();
|
||||
}
|
||||
}
|
||||
return settings::ResultSettingsItemKeyAllocationFailed();
|
||||
R_THROW(settings::ResultSettingsItemKeyAllocationFailed());
|
||||
}
|
||||
|
||||
Result FindSettingsItemKey(const char **out, const char *key) {
|
||||
for (auto &stored : g_item_keys) {
|
||||
if (std::strcmp(stored.value, key) == 0) {
|
||||
*out = stored.value;
|
||||
return ResultSuccess();
|
||||
R_SUCCEED();
|
||||
} else if (std::strcmp(stored.value, "") == 0) {
|
||||
std::strcpy(stored.value, key);
|
||||
*out = stored.value;
|
||||
return ResultSuccess();
|
||||
R_SUCCEED();
|
||||
}
|
||||
}
|
||||
return settings::ResultSettingsItemKeyAllocationFailed();
|
||||
R_THROW(settings::ResultSettingsItemKeyAllocationFailed());
|
||||
}
|
||||
|
||||
template<typename T>
|
||||
|
@ -182,7 +182,7 @@ namespace ams::settings::fwdbg {
|
|||
|
||||
T value = static_cast<T>(strtoul(value_str, nullptr, 0));
|
||||
std::memcpy(out.value, std::addressof(value), sizeof(T));
|
||||
return ResultSuccess();
|
||||
R_SUCCEED();
|
||||
}
|
||||
|
||||
Result GetEntry(SdKeyValueStoreEntry **out, const char *name, const char *key) {
|
||||
|
@ -200,7 +200,7 @@ namespace ams::settings::fwdbg {
|
|||
R_UNLESS(*it == test_entry, settings::ResultSettingsItemNotFound());
|
||||
|
||||
*out = std::addressof(*it);
|
||||
return ResultSuccess();
|
||||
R_SUCCEED();
|
||||
}
|
||||
|
||||
Result ParseSettingsItemValueImpl(const char *name, const char *key, const char *val_tup) {
|
||||
|
@ -253,7 +253,7 @@ namespace ams::settings::fwdbg {
|
|||
} else if (strncasecmp(type, "u64", type_len) == 0) {
|
||||
R_TRY((ParseSettingsItemIntegralValue<u64>(new_value, value_str)));
|
||||
} else {
|
||||
return settings::ResultInvalidFormatSettingsItemValue();
|
||||
R_THROW(settings::ResultInvalidFormatSettingsItemValue());
|
||||
}
|
||||
|
||||
/* Insert the entry. */
|
||||
|
@ -267,7 +267,7 @@ namespace ams::settings::fwdbg {
|
|||
}
|
||||
|
||||
R_UNLESS(inserted, settings::ResultSettingsItemValueAllocationFailed());
|
||||
return ResultSuccess();
|
||||
R_SUCCEED();
|
||||
}
|
||||
|
||||
Result ParseSettingsItemValue(const char *name, const char *key, const char *value) {
|
||||
|
@ -303,7 +303,7 @@ namespace ams::settings::fwdbg {
|
|||
util::ini::ParseFile(file.get(), std::addressof(parse_result), SystemSettingsIniHandler);
|
||||
R_TRY(parse_result);
|
||||
|
||||
return ResultSuccess();
|
||||
R_SUCCEED();
|
||||
}
|
||||
|
||||
void LoadDefaultCustomSettings() {
|
||||
|
@ -435,7 +435,7 @@ namespace ams::settings::fwdbg {
|
|||
R_TRY(GetEntry(std::addressof(entry), name, key));
|
||||
|
||||
*out_size = entry->value_size;
|
||||
return ResultSuccess();
|
||||
R_SUCCEED();
|
||||
}
|
||||
|
||||
Result GetSdCardKeyValueStoreSettingsItemValue(size_t *out_size, void *dst, size_t dst_size, const char *name, const char *key) {
|
||||
|
@ -449,7 +449,7 @@ namespace ams::settings::fwdbg {
|
|||
std::memcpy(dst, entry->value, size);
|
||||
}
|
||||
*out_size = size;
|
||||
return ResultSuccess();
|
||||
R_SUCCEED();
|
||||
}
|
||||
|
||||
}
|
||||
|
|
|
@ -33,7 +33,7 @@ namespace ams::mitm::sysupdater {
|
|||
R_TRY(updater::MarkVerifyingRequired(updater::BootModeType::Safe, g_boot_image_update_buffer, sizeof(g_boot_image_update_buffer)));
|
||||
|
||||
/* Pre-commit is now marked. */
|
||||
return ResultSuccess();
|
||||
R_SUCCEED();
|
||||
}
|
||||
|
||||
Result UpdateBootImages() {
|
||||
|
@ -59,7 +59,7 @@ namespace ams::mitm::sysupdater {
|
|||
R_TRY(updater::MarkVerified(boot_mode, g_boot_image_update_buffer, sizeof(g_boot_image_update_buffer)));
|
||||
|
||||
/* The boot images are updated. */
|
||||
return ResultSuccess();
|
||||
R_SUCCEED();
|
||||
};
|
||||
|
||||
/* Get the boot image update type. */
|
||||
|
@ -72,7 +72,7 @@ namespace ams::mitm::sysupdater {
|
|||
R_TRY(UpdateBootImageImpl(updater::BootModeType::Normal, boot_image_update_type));
|
||||
|
||||
/* Both sets of images are updated. */
|
||||
return ResultSuccess();
|
||||
R_SUCCEED();
|
||||
}
|
||||
|
||||
}
|
||||
|
@ -92,7 +92,7 @@ namespace ams::mitm::sysupdater {
|
|||
/* Update the boot images. */
|
||||
R_TRY(UpdateBootImages());
|
||||
|
||||
return ResultSuccess();
|
||||
R_SUCCEED();
|
||||
}
|
||||
|
||||
}
|
||||
|
|
|
@ -25,7 +25,7 @@ namespace ams::mitm::sysupdater {
|
|||
R_CONVERT(ncm::ResultInstallTaskCancelled, ns::ResultCanceled());
|
||||
} R_END_TRY_CATCH;
|
||||
|
||||
return ResultSuccess();
|
||||
R_SUCCEED();
|
||||
}
|
||||
|
||||
AsyncPrepareSdCardUpdateImpl::~AsyncPrepareSdCardUpdateImpl() {
|
||||
|
@ -66,7 +66,7 @@ namespace ams::mitm::sysupdater {
|
|||
|
||||
/* Set our thread info. */
|
||||
m_thread_info = info;
|
||||
return ResultSuccess();
|
||||
R_SUCCEED();
|
||||
}
|
||||
|
||||
Result AsyncPrepareSdCardUpdateImpl::Execute() {
|
||||
|
|
|
@ -34,13 +34,13 @@ namespace ams::mitm::sysupdater {
|
|||
return result;
|
||||
}
|
||||
|
||||
return ResultSuccess();
|
||||
R_SUCCEED();
|
||||
}
|
||||
|
||||
template<typename T>
|
||||
Result GetAndSaveErrorContext(T &async) {
|
||||
R_TRY(this->SaveErrorContextIfFailed(async, async.Get()));
|
||||
return ResultSuccess();
|
||||
R_SUCCEED();
|
||||
}
|
||||
|
||||
template<typename T>
|
||||
|
@ -50,7 +50,7 @@ namespace ams::mitm::sysupdater {
|
|||
return result;
|
||||
}
|
||||
|
||||
return ResultSuccess();
|
||||
R_SUCCEED();
|
||||
}
|
||||
|
||||
const err::ErrorContext &GetErrorContextImpl() {
|
||||
|
@ -66,12 +66,12 @@ namespace ams::mitm::sysupdater {
|
|||
|
||||
Result Cancel() {
|
||||
this->CancelImpl();
|
||||
return ResultSuccess();
|
||||
R_SUCCEED();
|
||||
}
|
||||
|
||||
virtual Result GetErrorContext(sf::Out<err::ErrorContext> out) {
|
||||
*out = {};
|
||||
return ResultSuccess();
|
||||
R_SUCCEED();
|
||||
}
|
||||
private:
|
||||
virtual void CancelImpl() = 0;
|
||||
|
@ -105,7 +105,7 @@ namespace ams::mitm::sysupdater {
|
|||
|
||||
virtual Result GetErrorContext(sf::Out<err::ErrorContext> out) override {
|
||||
*out = ErrorContextHolder::GetErrorContextImpl();
|
||||
return ResultSuccess();
|
||||
R_SUCCEED();
|
||||
}
|
||||
|
||||
Result Run();
|
||||
|
|
|
@ -54,7 +54,7 @@ namespace ams::mitm::sysupdater {
|
|||
const bool is_nsp = util::Strnicmp(extension, NspExtension, NcaNspExtensionSize) == 0;
|
||||
R_UNLESS(is_nca || is_nsp, fs::ResultPathNotFound());
|
||||
|
||||
return ResultSuccess();
|
||||
R_SUCCEED();
|
||||
}
|
||||
|
||||
Result ParseMountName(const char **path, std::shared_ptr<ams::fs::fsa::IFileSystem> *out) {
|
||||
|
@ -88,13 +88,13 @@ namespace ams::mitm::sysupdater {
|
|||
/* Set the output fs. */
|
||||
*out = std::move(fsa);
|
||||
} else {
|
||||
return fs::ResultPathNotFound();
|
||||
R_THROW(fs::ResultPathNotFound());
|
||||
}
|
||||
|
||||
/* Ensure that there's something that could be a mount name delimiter. */
|
||||
R_UNLESS(util::Strnlen(*path, fs::EntryNameLengthMax) != 0, fs::ResultPathNotFound());
|
||||
|
||||
return ResultSuccess();
|
||||
R_SUCCEED();
|
||||
}
|
||||
|
||||
Result ParseNsp(const char **path, std::shared_ptr<ams::fs::fsa::IFileSystem> *out, std::shared_ptr<ams::fs::fsa::IFileSystem> base_fs) {
|
||||
|
@ -132,7 +132,7 @@ namespace ams::mitm::sysupdater {
|
|||
/* Update the path. */
|
||||
*path = work_path;
|
||||
|
||||
return ResultSuccess();
|
||||
R_SUCCEED();
|
||||
}
|
||||
|
||||
Result ParseNca(const char **path, std::shared_ptr<fssystem::NcaReader> *out, std::shared_ptr<ams::fs::fsa::IFileSystem> base_fs) {
|
||||
|
@ -154,7 +154,7 @@ namespace ams::mitm::sysupdater {
|
|||
|
||||
/* Set output reader. */
|
||||
*out = std::move(nca_reader);
|
||||
return ResultSuccess();
|
||||
R_SUCCEED();
|
||||
}
|
||||
|
||||
Result OpenMetaStorage(std::shared_ptr<ams::fs::IStorage> *out, std::shared_ptr<fssystem::IAsynchronousAccessSplitter> *out_splitter, std::shared_ptr<fssystem::NcaReader> nca_reader, fssystem::NcaFsHeader::FsType *out_fs_type) {
|
||||
|
@ -173,7 +173,7 @@ namespace ams::mitm::sysupdater {
|
|||
|
||||
/* Set the output fs type. */
|
||||
*out_fs_type = fs_header_reader.GetFsType();
|
||||
return ResultSuccess();
|
||||
R_SUCCEED();
|
||||
}
|
||||
|
||||
Result OpenContentMetaFileSystem(std::shared_ptr<ams::fs::fsa::IFileSystem> *out, const char *path) {
|
||||
|
@ -211,7 +211,7 @@ namespace ams::mitm::sysupdater {
|
|||
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));
|
||||
default:
|
||||
return fs::ResultInvalidNcaFileSystemType();
|
||||
R_THROW(fs::ResultInvalidNcaFileSystemType());
|
||||
}
|
||||
}
|
||||
|
||||
|
|
|
@ -51,7 +51,7 @@ namespace ams::mitm::sysupdater {
|
|||
R_SUCCEED_IF(done);
|
||||
}
|
||||
|
||||
return ResultSuccess();
|
||||
R_SUCCEED();
|
||||
}
|
||||
|
||||
Result ConvertToFsCommonPath(char *dst, size_t dst_size, const char *package_root_path, const char *entry_path) {
|
||||
|
@ -118,13 +118,13 @@ namespace ams::mitm::sysupdater {
|
|||
*out = ncm::ContentInfo::Make(*content_id, entry.file_size, ncm::ContentType::Meta);
|
||||
}
|
||||
|
||||
return ResultSuccess();
|
||||
R_SUCCEED();
|
||||
}));
|
||||
|
||||
/* If we didn't find anything, error. */
|
||||
R_UNLESS(found_system_update, ncm::ResultSystemUpdateNotFoundInPackage());
|
||||
|
||||
return ResultSuccess();
|
||||
R_SUCCEED();
|
||||
}
|
||||
|
||||
Result ValidateSystemUpdate(Result *out_result, Result *out_exfat_result, UpdateValidationInfo *out_info, const ncm::PackagedContentMetaReader &update_reader, const char *package_root) {
|
||||
|
@ -212,7 +212,7 @@ namespace ams::mitm::sysupdater {
|
|||
util::SNPrintf(path, sizeof(path), "%s%s%s", package_root, content_id_str.data, content_info->GetType() == ncm::ContentType::Meta ? ".cnmt.nca" : ".nca");
|
||||
if (R_FAILED(ValidateResult(fs::OpenFile(std::addressof(file), path, ams::fs::OpenMode_Read)))) {
|
||||
*done = true;
|
||||
return ResultSuccess();
|
||||
R_SUCCEED();
|
||||
}
|
||||
}
|
||||
ON_SCOPE_EXIT { fs::CloseFile(file); };
|
||||
|
@ -221,12 +221,12 @@ namespace ams::mitm::sysupdater {
|
|||
s64 file_size;
|
||||
if (R_FAILED(ValidateResult(fs::GetFileSize(std::addressof(file_size), file)))) {
|
||||
*done = true;
|
||||
return ResultSuccess();
|
||||
R_SUCCEED();
|
||||
}
|
||||
if (file_size != content_size) {
|
||||
*out_result = ncm::ResultInvalidContentHash();
|
||||
*done = true;
|
||||
return ResultSuccess();
|
||||
R_SUCCEED();
|
||||
}
|
||||
|
||||
/* Read and hash the file in chunks. */
|
||||
|
@ -238,7 +238,7 @@ namespace ams::mitm::sysupdater {
|
|||
const size_t cur_size = std::min(static_cast<size_t>(content_size - ofs), data_buffer_size);
|
||||
if (R_FAILED(ValidateResult(fs::ReadFile(file, ofs, data_buffer, cur_size)))) {
|
||||
*done = true;
|
||||
return ResultSuccess();
|
||||
R_SUCCEED();
|
||||
}
|
||||
|
||||
sha.Update(data_buffer, cur_size);
|
||||
|
@ -254,7 +254,7 @@ namespace ams::mitm::sysupdater {
|
|||
if (std::memcmp(std::addressof(calc_digest), std::addressof(content_info->digest), sizeof(ncm::Digest)) != 0) {
|
||||
*out_result = ncm::ResultInvalidContentHash();
|
||||
*done = true;
|
||||
return ResultSuccess();
|
||||
R_SUCCEED();
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -262,7 +262,7 @@ namespace ams::mitm::sysupdater {
|
|||
content_meta_valid[validation_index] = true;
|
||||
*out_info = {};
|
||||
|
||||
return ResultSuccess();
|
||||
R_SUCCEED();
|
||||
}));
|
||||
|
||||
/* If we're otherwise going to succeed, ensure that every content was found. */
|
||||
|
@ -284,7 +284,7 @@ namespace ams::mitm::sysupdater {
|
|||
}
|
||||
}
|
||||
|
||||
return ResultSuccess();
|
||||
R_SUCCEED();
|
||||
}
|
||||
|
||||
Result FormatUserPackagePath(ncm::Path *out, const ncm::Path &user_path) {
|
||||
|
@ -300,7 +300,7 @@ namespace ams::mitm::sysupdater {
|
|||
out->str[len - 1] = '\x00';
|
||||
}
|
||||
|
||||
return ResultSuccess();
|
||||
R_SUCCEED();
|
||||
}
|
||||
|
||||
const char *GetFirmwareVariationSettingName(settings::system::PlatformRegion region) {
|
||||
|
@ -382,7 +382,7 @@ namespace ams::mitm::sysupdater {
|
|||
|
||||
/* Set the parsed update info. */
|
||||
out.SetValue(update_info);
|
||||
return ResultSuccess();
|
||||
R_SUCCEED();
|
||||
}
|
||||
|
||||
Result SystemUpdateService::ValidateUpdate(sf::Out<Result> out_validate_result, sf::Out<Result> out_validate_exfat_result, sf::Out<UpdateValidationInfo> out_validate_info, const ncm::Path &path) {
|
||||
|
@ -407,7 +407,7 @@ namespace ams::mitm::sysupdater {
|
|||
R_TRY(ValidateSystemUpdate(out_validate_result.GetPointer(), out_validate_exfat_result.GetPointer(), out_validate_info.GetPointer(), reader, package_root.str));
|
||||
}
|
||||
|
||||
return ResultSuccess();
|
||||
R_SUCCEED();
|
||||
};
|
||||
|
||||
Result SystemUpdateService::SetupUpdate(sf::CopyHandle &&transfer_memory, u64 transfer_memory_size, const ncm::Path &path, bool exfat) {
|
||||
|
@ -435,7 +435,7 @@ namespace ams::mitm::sysupdater {
|
|||
out_event_handle.SetValue(async_result.GetImpl().GetEvent().GetReadableHandle(), false);
|
||||
*out_async = std::move(async_result);
|
||||
|
||||
return ResultSuccess();
|
||||
R_SUCCEED();
|
||||
}
|
||||
|
||||
Result SystemUpdateService::GetPrepareUpdateProgress(sf::Out<SystemUpdateProgress> out) {
|
||||
|
@ -445,7 +445,7 @@ namespace ams::mitm::sysupdater {
|
|||
/* Get the progress. */
|
||||
auto install_progress = m_update_task->GetProgress();
|
||||
out.SetValue({ .current_size = install_progress.installed_size, .total_size = install_progress.total_size });
|
||||
return ResultSuccess();
|
||||
R_SUCCEED();
|
||||
}
|
||||
|
||||
Result SystemUpdateService::HasPreparedUpdate(sf::Out<bool> out) {
|
||||
|
@ -453,7 +453,7 @@ namespace ams::mitm::sysupdater {
|
|||
R_UNLESS(m_setup_update, ns::ResultCardUpdateNotSetup());
|
||||
|
||||
out.SetValue(m_update_task->GetProgress().state == ncm::InstallProgressState::Downloaded);
|
||||
return ResultSuccess();
|
||||
R_SUCCEED();
|
||||
}
|
||||
|
||||
Result SystemUpdateService::ApplyPreparedUpdate() {
|
||||
|
@ -466,7 +466,7 @@ namespace ams::mitm::sysupdater {
|
|||
/* Apply the task. */
|
||||
R_TRY(m_apply_manager.ApplyPackageTask(std::addressof(*m_update_task)));
|
||||
|
||||
return ResultSuccess();
|
||||
R_SUCCEED();
|
||||
}
|
||||
|
||||
Result SystemUpdateService::SetupUpdateImpl(sf::NativeHandle &&transfer_memory, u64 transfer_memory_size, const ncm::Path &path, bool exfat, ncm::FirmwareVariationId firmware_variation_id) {
|
||||
|
@ -485,7 +485,7 @@ namespace ams::mitm::sysupdater {
|
|||
|
||||
/* The update is now set up. */
|
||||
m_setup_update = true;
|
||||
return ResultSuccess();
|
||||
R_SUCCEED();
|
||||
}
|
||||
|
||||
Result SystemUpdateService::InitializeUpdateTask(sf::NativeHandle &&transfer_memory, u64 transfer_memory_size, const ncm::Path &path, bool exfat, ncm::FirmwareVariationId firmware_variation_id) {
|
||||
|
@ -516,7 +516,7 @@ namespace ams::mitm::sysupdater {
|
|||
/* We successfully setup the update. */
|
||||
tmem_guard.Cancel();
|
||||
|
||||
return ResultSuccess();
|
||||
R_SUCCEED();
|
||||
}
|
||||
|
||||
}
|
||||
|
|
|
@ -31,11 +31,11 @@ namespace ams::mitm::sysupdater {
|
|||
.stack_size = m_stack_size,
|
||||
};
|
||||
m_bitmap |= mask;
|
||||
return ResultSuccess();
|
||||
R_SUCCEED();
|
||||
}
|
||||
}
|
||||
|
||||
return ns::ResultOutOfMaxRunningTask();
|
||||
R_THROW(ns::ResultOutOfMaxRunningTask());
|
||||
}
|
||||
|
||||
void ThreadAllocator::Free(const ThreadInfo &info) {
|
||||
|
|
|
@ -144,7 +144,7 @@ namespace ams {
|
|||
Result OpenSession(ClkRstSession *out, DeviceCode device_code) {
|
||||
/* Get the relevant definition. */
|
||||
out->_session = const_cast<ClkRstDefinition *>(GetDefinition(device_code));
|
||||
return ResultSuccess();
|
||||
R_SUCCEED();
|
||||
}
|
||||
|
||||
void CloseSession(ClkRstSession *session) {
|
||||
|
@ -188,21 +188,21 @@ namespace ams {
|
|||
/* Set clock. */
|
||||
SetClockEnabled(GetDefinition(module), en);
|
||||
|
||||
return ResultSuccess();
|
||||
R_SUCCEED();
|
||||
}
|
||||
|
||||
Result SetClockRate(Module module, ClockHz hz) {
|
||||
/* Set the clock rate. */
|
||||
SetClockRate(GetDefinition(module), hz);
|
||||
|
||||
return ResultSuccess();
|
||||
R_SUCCEED();
|
||||
}
|
||||
|
||||
Result SetReset(Module module, bool en) {
|
||||
/* Set reset. */
|
||||
SetResetEnabled(GetDefinition(module), en);
|
||||
|
||||
return ResultSuccess();
|
||||
R_SUCCEED();
|
||||
}
|
||||
|
||||
}
|
||||
|
|
|
@ -27,7 +27,7 @@ namespace ams::regulator {
|
|||
|
||||
Result OpenSession(RegulatorSession *out, DeviceCode device_code) {
|
||||
AMS_UNUSED(out, device_code);
|
||||
return ResultSuccess();
|
||||
R_SUCCEED();
|
||||
}
|
||||
|
||||
void CloseSession(RegulatorSession *session) {
|
||||
|
@ -41,12 +41,12 @@ namespace ams::regulator {
|
|||
|
||||
Result SetVoltageEnabled(RegulatorSession *session, bool enabled) {
|
||||
AMS_UNUSED(session, enabled);
|
||||
return ResultSuccess();
|
||||
R_SUCCEED();
|
||||
}
|
||||
|
||||
Result SetVoltageValue(RegulatorSession *session, u32 micro_volts) {
|
||||
AMS_UNUSED(session, micro_volts);
|
||||
return ResultSuccess();
|
||||
R_SUCCEED();
|
||||
}
|
||||
|
||||
}
|
||||
|
|
|
@ -42,7 +42,7 @@ namespace ams::boot {
|
|||
R_TRY(powctl::IsBatteryPresent(std::addressof(present), s_battery_session));
|
||||
|
||||
*out = !present;
|
||||
return ResultSuccess();
|
||||
R_SUCCEED();
|
||||
}
|
||||
|
||||
Result GetChargePercentage(float *out) {
|
||||
|
|
|
@ -58,7 +58,7 @@ namespace ams::boot {
|
|||
/* Set configuration to charge battery. */
|
||||
R_TRY(powctl::SetChargerChargerConfiguration(m_charger_session, powctl::ChargerConfiguration_ChargeBattery));
|
||||
|
||||
return ResultSuccess();
|
||||
R_SUCCEED();
|
||||
}
|
||||
|
||||
Result GetChargeCurrentState(powctl::ChargeCurrentState *out) {
|
||||
|
@ -107,7 +107,7 @@ namespace ams::boot {
|
|||
case powctl::ChargerStatus_ChargeTerminationDone: *out = boot::ChargerStatus_ChargeTerminationDone; break;
|
||||
}
|
||||
|
||||
return ResultSuccess();
|
||||
R_SUCCEED();
|
||||
}
|
||||
|
||||
Result GetBatteryCompensation(int *out) {
|
||||
|
|
|
@ -31,7 +31,7 @@ namespace ams::boot {
|
|||
u8 power_status;
|
||||
R_TRY(this->GetPowerStatus(std::addressof(power_status)));
|
||||
*out = (power_status & 0x02) != 0;
|
||||
return ResultSuccess();
|
||||
R_SUCCEED();
|
||||
}
|
||||
|
||||
Result PmicDriver::GetOnOffIrq(u8 *out) {
|
||||
|
@ -53,7 +53,7 @@ namespace ams::boot {
|
|||
u8 on_off_irq;
|
||||
R_TRY(this->GetOnOffIrq(std::addressof(on_off_irq)));
|
||||
*out = (on_off_irq & 0x08) != 0;
|
||||
return ResultSuccess();
|
||||
R_SUCCEED();
|
||||
}
|
||||
|
||||
void PmicDriver::ShutdownSystem(bool reboot) {
|
||||
|
|
|
@ -48,7 +48,7 @@ namespace ams::dmnt {
|
|||
return bp->Clear(m_debug_process);
|
||||
}
|
||||
}
|
||||
return ResultSuccess();
|
||||
R_SUCCEED();
|
||||
}
|
||||
|
||||
BreakPointBase *BreakPointManagerBase::GetFreeBreakPoint() {
|
||||
|
|
|
@ -51,7 +51,7 @@ namespace ams::dmnt {
|
|||
/* Get process info. */
|
||||
this->CollectProcessInfo();
|
||||
|
||||
return ResultSuccess();
|
||||
R_SUCCEED();
|
||||
}
|
||||
|
||||
void DebugProcess::Detach() {
|
||||
|
@ -127,7 +127,7 @@ namespace ams::dmnt {
|
|||
m_is_valid = true;
|
||||
this->SetDebugBreaked();
|
||||
|
||||
return ResultSuccess();
|
||||
R_SUCCEED();
|
||||
}
|
||||
|
||||
s32 DebugProcess::ThreadCreate(u64 thread_id) {
|
||||
|
@ -230,7 +230,7 @@ namespace ams::dmnt {
|
|||
address = next_address;
|
||||
}
|
||||
|
||||
return ResultSuccess();
|
||||
R_SUCCEED();
|
||||
}
|
||||
|
||||
void DebugProcess::CollectProcessInfo() {
|
||||
|
@ -254,7 +254,7 @@ namespace ams::dmnt {
|
|||
R_TRY(svc::GetInfo(std::addressof(value), svc::InfoType_IsApplication, handle, 0));
|
||||
m_is_application = value != 0;
|
||||
|
||||
return ResultSuccess();
|
||||
R_SUCCEED();
|
||||
};
|
||||
|
||||
/* Get process info/status. */
|
||||
|
@ -313,7 +313,7 @@ namespace ams::dmnt {
|
|||
this->SetLastThreadId(0);
|
||||
this->SetLastSignal(GdbSignal_Signal0);
|
||||
|
||||
return ResultSuccess();
|
||||
R_SUCCEED();
|
||||
}
|
||||
|
||||
Result DebugProcess::Continue(u64 thread_id) {
|
||||
|
@ -328,7 +328,7 @@ namespace ams::dmnt {
|
|||
this->SetLastThreadId(0);
|
||||
this->SetLastSignal(GdbSignal_Signal0);
|
||||
|
||||
return ResultSuccess();
|
||||
R_SUCCEED();
|
||||
}
|
||||
|
||||
Result DebugProcess::Step() {
|
||||
|
@ -371,7 +371,7 @@ namespace ams::dmnt {
|
|||
bp_guard.Cancel();
|
||||
}
|
||||
|
||||
return ResultSuccess();
|
||||
R_SUCCEED();
|
||||
}
|
||||
|
||||
void DebugProcess::ClearStep() {
|
||||
|
@ -388,7 +388,7 @@ namespace ams::dmnt {
|
|||
return svc::BreakDebugProcess(m_debug_handle);
|
||||
} else {
|
||||
AMS_DMNT2_GDB_LOG_ERROR("DebugProcess::Break called on non-running process!\n");
|
||||
return ResultSuccess();
|
||||
R_SUCCEED();
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -398,7 +398,7 @@ namespace ams::dmnt {
|
|||
this->Detach();
|
||||
}
|
||||
|
||||
return ResultSuccess();
|
||||
R_SUCCEED();
|
||||
}
|
||||
|
||||
void DebugProcess::GetBranchTarget(svc::ThreadContext &ctx, u64 thread_id, u64 ¤t_pc, u64 &target) {
|
||||
|
@ -472,7 +472,7 @@ namespace ams::dmnt {
|
|||
|
||||
Result DebugProcess::ClearBreakPoint(uintptr_t address, size_t size) {
|
||||
m_software_breakpoints.ClearBreakPoint(address, size);
|
||||
return ResultSuccess();
|
||||
R_SUCCEED();
|
||||
}
|
||||
|
||||
Result DebugProcess::SetHardwareBreakPoint(uintptr_t address, size_t size, bool is_step) {
|
||||
|
@ -481,7 +481,7 @@ namespace ams::dmnt {
|
|||
|
||||
Result DebugProcess::ClearHardwareBreakPoint(uintptr_t address, size_t size) {
|
||||
m_hardware_breakpoints.ClearBreakPoint(address, size);
|
||||
return ResultSuccess();
|
||||
R_SUCCEED();
|
||||
}
|
||||
|
||||
Result DebugProcess::SetWatchPoint(u64 address, u64 size, bool read, bool write) {
|
||||
|
@ -507,7 +507,7 @@ namespace ams::dmnt {
|
|||
R_TRY(svc::GetDebugThreadParam(std::addressof(dummy_value), std::addressof(val32), m_debug_handle, thread_id, svc::DebugThreadParam_CurrentCore));
|
||||
|
||||
*out = val32;
|
||||
return ResultSuccess();
|
||||
R_SUCCEED();
|
||||
}
|
||||
|
||||
Result DebugProcess::GetProcessDebugEvent(svc::DebugEventInfo *out) {
|
||||
|
@ -550,7 +550,7 @@ namespace ams::dmnt {
|
|||
this->SetDebugBreaked();
|
||||
}
|
||||
|
||||
return ResultSuccess();
|
||||
R_SUCCEED();
|
||||
}
|
||||
|
||||
u64 DebugProcess::GetLastThreadId() {
|
||||
|
@ -578,7 +578,7 @@ namespace ams::dmnt {
|
|||
}
|
||||
|
||||
*out_count = count;
|
||||
return ResultSuccess();
|
||||
R_SUCCEED();
|
||||
}
|
||||
|
||||
Result DebugProcess::GetThreadInfoList(s32 *out_count, osdbg::ThreadInfo **out_infos, size_t max_count) {
|
||||
|
@ -592,7 +592,7 @@ namespace ams::dmnt {
|
|||
}
|
||||
|
||||
*out_count = count;
|
||||
return ResultSuccess();
|
||||
R_SUCCEED();
|
||||
}
|
||||
|
||||
void DebugProcess::GetThreadName(char *dst, u64 thread_id) const {
|
||||
|
|
|
@ -1915,7 +1915,7 @@ namespace ams::dmnt {
|
|||
break;
|
||||
}
|
||||
|
||||
return ResultSuccess();
|
||||
R_SUCCEED();
|
||||
}
|
||||
|
||||
void GdbServerImpl::q() {
|
||||
|
|
|
@ -116,7 +116,7 @@ namespace ams::dmnt {
|
|||
|
||||
/* Set as in-use. */
|
||||
m_in_use = true;
|
||||
return ResultSuccess();
|
||||
R_SUCCEED();
|
||||
}
|
||||
|
||||
HardwareBreakPointManager::HardwareBreakPointManager(DebugProcess *debug_process) : BreakPointManager(debug_process) {
|
||||
|
@ -147,7 +147,7 @@ namespace ams::dmnt {
|
|||
};
|
||||
R_UNLESS(SendMultiCoreRequest(request), dmnt::ResultUnknown());
|
||||
|
||||
return ResultSuccess();
|
||||
R_SUCCEED();
|
||||
}
|
||||
|
||||
Result HardwareBreakPointManager::SetContextBreakPoint(svc::HardwareBreakPointRegisterName ctx, DebugProcess *debug_process) {
|
||||
|
|
|
@ -119,7 +119,7 @@ namespace ams::dmnt {
|
|||
|
||||
/* Set as in-use. */
|
||||
m_in_use = true;
|
||||
return ResultSuccess();
|
||||
R_SUCCEED();
|
||||
}
|
||||
|
||||
HardwareWatchPointManager::HardwareWatchPointManager(DebugProcess *debug_process) : BreakPointManagerBase(debug_process) {
|
||||
|
@ -153,7 +153,7 @@ namespace ams::dmnt {
|
|||
if (bp.m_address <= address && address < bp.m_address + bp.m_size) {
|
||||
read = bp.m_read;
|
||||
write = bp.m_write;
|
||||
return ResultSuccess();
|
||||
R_SUCCEED();
|
||||
}
|
||||
}
|
||||
}
|
||||
|
@ -163,7 +163,7 @@ namespace ams::dmnt {
|
|||
read = false;
|
||||
write = false;
|
||||
|
||||
return svc::ResultInvalidArgument();
|
||||
R_THROW(svc::ResultInvalidArgument());
|
||||
}
|
||||
|
||||
}
|
||||
|
|
|
@ -37,7 +37,7 @@ namespace ams::dmnt::cheat {
|
|||
|
||||
Result CheatService::ForceOpenCheatProcess() {
|
||||
R_UNLESS(R_SUCCEEDED(dmnt::cheat::impl::ForceOpenCheatProcess()), dmnt::cheat::ResultCheatNotAttached());
|
||||
return ResultSuccess();
|
||||
R_SUCCEED();
|
||||
}
|
||||
|
||||
Result CheatService::PauseCheatProcess() {
|
||||
|
|
|
@ -236,7 +236,7 @@ namespace ams::dmnt::cheat::impl {
|
|||
|
||||
Result EnsureCheatProcess() {
|
||||
R_UNLESS(this->HasActiveCheatProcess(), dmnt::cheat::ResultCheatNotAttached());
|
||||
return ResultSuccess();
|
||||
R_SUCCEED();
|
||||
}
|
||||
|
||||
os::NativeHandle GetCheatProcessHandle() const {
|
||||
|
@ -297,7 +297,7 @@ namespace ams::dmnt::cheat::impl {
|
|||
R_TRY(this->EnsureCheatProcess());
|
||||
|
||||
std::memcpy(out, std::addressof(m_cheat_process_metadata), sizeof(*out));
|
||||
return ResultSuccess();
|
||||
R_SUCCEED();
|
||||
}
|
||||
|
||||
Result ForceOpenCheatProcess() {
|
||||
|
@ -306,7 +306,7 @@ namespace ams::dmnt::cheat::impl {
|
|||
|
||||
Result ForceCloseCheatProcess() {
|
||||
this->CloseActiveCheatProcess();
|
||||
return ResultSuccess();
|
||||
R_SUCCEED();
|
||||
}
|
||||
|
||||
Result ReadCheatProcessMemoryUnsafe(u64 proc_addr, void *out_data, size_t size) {
|
||||
|
@ -334,7 +334,7 @@ namespace ams::dmnt::cheat::impl {
|
|||
}
|
||||
}
|
||||
|
||||
return ResultSuccess();
|
||||
R_SUCCEED();
|
||||
}
|
||||
|
||||
Result PauseCheatProcessUnsafe() {
|
||||
|
@ -347,7 +347,7 @@ namespace ams::dmnt::cheat::impl {
|
|||
m_broken_unsafe = false;
|
||||
m_unsafe_break_event.Signal();
|
||||
dmnt::cheat::impl::ContinueCheatProcess(this->GetCheatProcessHandle());
|
||||
return ResultSuccess();
|
||||
R_SUCCEED();
|
||||
}
|
||||
|
||||
Result GetCheatProcessMappingCount(u64 *out_count) {
|
||||
|
@ -371,7 +371,7 @@ namespace ams::dmnt::cheat::impl {
|
|||
} while (address != 0);
|
||||
|
||||
*out_count = count;
|
||||
return ResultSuccess();
|
||||
R_SUCCEED();
|
||||
}
|
||||
|
||||
Result GetCheatProcessMappings(svc::MemoryInfo *mappings, size_t max_count, u64 *out_count, u64 offset) {
|
||||
|
@ -398,7 +398,7 @@ namespace ams::dmnt::cheat::impl {
|
|||
} while (address != 0 && written_count < max_count);
|
||||
|
||||
*out_count = written_count;
|
||||
return ResultSuccess();
|
||||
R_SUCCEED();
|
||||
}
|
||||
|
||||
Result ReadCheatProcessMemory(u64 proc_addr, void *out_data, size_t size) {
|
||||
|
@ -455,7 +455,7 @@ namespace ams::dmnt::cheat::impl {
|
|||
}
|
||||
|
||||
*out_count = count;
|
||||
return ResultSuccess();
|
||||
R_SUCCEED();
|
||||
}
|
||||
|
||||
Result GetCheats(CheatEntry *out_cheats, size_t max_count, u64 *out_count, u64 offset) {
|
||||
|
@ -474,7 +474,7 @@ namespace ams::dmnt::cheat::impl {
|
|||
}
|
||||
|
||||
*out_count = count;
|
||||
return ResultSuccess();
|
||||
R_SUCCEED();
|
||||
}
|
||||
|
||||
Result GetCheatById(CheatEntry *out_cheat, u32 cheat_id) {
|
||||
|
@ -487,7 +487,7 @@ namespace ams::dmnt::cheat::impl {
|
|||
R_UNLESS(entry->definition.num_opcodes != 0, dmnt::cheat::ResultCheatUnknownId());
|
||||
|
||||
*out_cheat = *entry;
|
||||
return ResultSuccess();
|
||||
R_SUCCEED();
|
||||
}
|
||||
|
||||
Result ToggleCheat(u32 cheat_id) {
|
||||
|
@ -506,7 +506,7 @@ namespace ams::dmnt::cheat::impl {
|
|||
/* Trigger a VM reload. */
|
||||
this->SetNeedsReloadVm(true);
|
||||
|
||||
return ResultSuccess();
|
||||
R_SUCCEED();
|
||||
}
|
||||
|
||||
Result AddCheat(u32 *out_id, const CheatDefinition &def, bool enabled) {
|
||||
|
@ -529,7 +529,7 @@ namespace ams::dmnt::cheat::impl {
|
|||
/* Set output id. */
|
||||
*out_id = new_entry->cheat_id;
|
||||
|
||||
return ResultSuccess();
|
||||
R_SUCCEED();
|
||||
}
|
||||
|
||||
Result RemoveCheat(u32 cheat_id) {
|
||||
|
@ -543,7 +543,7 @@ namespace ams::dmnt::cheat::impl {
|
|||
/* Trigger a VM reload. */
|
||||
this->SetNeedsReloadVm(true);
|
||||
|
||||
return ResultSuccess();
|
||||
R_SUCCEED();
|
||||
}
|
||||
|
||||
Result SetMasterCheat(const CheatDefinition &def) {
|
||||
|
@ -562,7 +562,7 @@ namespace ams::dmnt::cheat::impl {
|
|||
/* Trigger a VM reload. */
|
||||
this->SetNeedsReloadVm(true);
|
||||
|
||||
return ResultSuccess();
|
||||
R_SUCCEED();
|
||||
}
|
||||
|
||||
Result ReadStaticRegister(u64 *out, size_t which) {
|
||||
|
@ -572,7 +572,7 @@ namespace ams::dmnt::cheat::impl {
|
|||
R_UNLESS(which < CheatVirtualMachine::NumStaticRegisters, dmnt::cheat::ResultCheatInvalid());
|
||||
|
||||
*out = m_cheat_vm.GetStaticRegister(which);
|
||||
return ResultSuccess();
|
||||
R_SUCCEED();
|
||||
}
|
||||
|
||||
Result WriteStaticRegister(size_t which, u64 value) {
|
||||
|
@ -582,7 +582,7 @@ namespace ams::dmnt::cheat::impl {
|
|||
R_UNLESS(which < CheatVirtualMachine::NumStaticRegisters, dmnt::cheat::ResultCheatInvalid());
|
||||
|
||||
m_cheat_vm.SetStaticRegister(which, value);
|
||||
return ResultSuccess();
|
||||
R_SUCCEED();
|
||||
}
|
||||
|
||||
Result ResetStaticRegisters() {
|
||||
|
@ -591,7 +591,7 @@ namespace ams::dmnt::cheat::impl {
|
|||
R_TRY(this->EnsureCheatProcess());
|
||||
|
||||
m_cheat_vm.ResetStaticRegisters();
|
||||
return ResultSuccess();
|
||||
R_SUCCEED();
|
||||
}
|
||||
|
||||
Result GetFrozenAddressCount(u64 *out_count) {
|
||||
|
@ -600,7 +600,7 @@ namespace ams::dmnt::cheat::impl {
|
|||
R_TRY(this->EnsureCheatProcess());
|
||||
|
||||
*out_count = std::distance(m_frozen_addresses_map.begin(), m_frozen_addresses_map.end());
|
||||
return ResultSuccess();
|
||||
R_SUCCEED();
|
||||
}
|
||||
|
||||
Result GetFrozenAddresses(FrozenAddressEntry *frz_addrs, size_t max_count, u64 *out_count, u64 offset) {
|
||||
|
@ -623,7 +623,7 @@ namespace ams::dmnt::cheat::impl {
|
|||
}
|
||||
|
||||
*out_count = written_count;
|
||||
return ResultSuccess();
|
||||
R_SUCCEED();
|
||||
}
|
||||
|
||||
Result GetFrozenAddress(FrozenAddressEntry *frz_addr, u64 address) {
|
||||
|
@ -636,7 +636,7 @@ namespace ams::dmnt::cheat::impl {
|
|||
|
||||
frz_addr->address = it->GetAddress();
|
||||
frz_addr->value = it->GetValue();
|
||||
return ResultSuccess();
|
||||
R_SUCCEED();
|
||||
}
|
||||
|
||||
Result EnableFrozenAddress(u64 *out_value, u64 address, u64 width) {
|
||||
|
@ -656,7 +656,7 @@ namespace ams::dmnt::cheat::impl {
|
|||
|
||||
m_frozen_addresses_map.insert(*entry);
|
||||
*out_value = value.value;
|
||||
return ResultSuccess();
|
||||
R_SUCCEED();
|
||||
}
|
||||
|
||||
Result DisableFrozenAddress(u64 address) {
|
||||
|
@ -671,7 +671,7 @@ namespace ams::dmnt::cheat::impl {
|
|||
m_frozen_addresses_map.erase(it);
|
||||
DeallocateFrozenAddress(entry);
|
||||
|
||||
return ResultSuccess();
|
||||
R_SUCCEED();
|
||||
}
|
||||
|
||||
};
|
||||
|
@ -884,7 +884,7 @@ namespace ams::dmnt::cheat::impl {
|
|||
/* Signal to our fans. */
|
||||
m_cheat_process_event.Signal();
|
||||
|
||||
return ResultSuccess();
|
||||
R_SUCCEED();
|
||||
}
|
||||
|
||||
#undef R_ABORT_UNLESS_IF_NEW_PROCESS
|
||||
|
|
|
@ -69,7 +69,7 @@ namespace ams::dmnt::cheat::impl {
|
|||
|
||||
/* Set the target core. */
|
||||
*out = target_core;
|
||||
return ResultSuccess();
|
||||
R_SUCCEED();
|
||||
}
|
||||
|
||||
void SendHandle(size_t target_core, os::NativeHandle debug_handle) {
|
||||
|
|
|
@ -32,7 +32,7 @@ namespace ams::fatal::srv {
|
|||
R_UNLESS(m_num_events_gotten < FatalEventManager::NumFatalEvents, fatal::ResultTooManyEvents());
|
||||
|
||||
*out = std::addressof(m_events[m_num_events_gotten++]);
|
||||
return ResultSuccess();
|
||||
R_SUCCEED();
|
||||
}
|
||||
|
||||
void FatalEventManager::SignalEvents() {
|
||||
|
|
|
@ -254,7 +254,7 @@ namespace ams::fatal::srv::font {
|
|||
stbtt_InitFont(std::addressof(g_stb_font), font_buffer, stbtt_GetFontOffsetForIndex(font_buffer, 0));
|
||||
|
||||
SetFontSize(16.0f);
|
||||
return ResultSuccess();
|
||||
R_SUCCEED();
|
||||
}
|
||||
|
||||
}
|
||||
|
|
|
@ -53,7 +53,7 @@ namespace ams::fatal::srv {
|
|||
R_TRY(pcvSetClockRate(module, hz));
|
||||
}
|
||||
|
||||
return ResultSuccess();
|
||||
R_SUCCEED();
|
||||
}
|
||||
|
||||
Result AdjustClockTask::AdjustClock() {
|
||||
|
@ -66,7 +66,7 @@ namespace ams::fatal::srv {
|
|||
R_TRY(AdjustClockForModule(PcvModule_GPU, GPU_CLOCK_307MHZ));
|
||||
R_TRY(AdjustClockForModule(PcvModule_EMC, EMC_CLOCK_1331MHZ));
|
||||
|
||||
return ResultSuccess();
|
||||
R_SUCCEED();
|
||||
}
|
||||
|
||||
Result AdjustClockTask::Run() {
|
||||
|
|
|
@ -165,7 +165,7 @@ namespace ams::fatal::srv {
|
|||
/* Signal we're done with our job. */
|
||||
m_context->erpt_event->Signal();
|
||||
|
||||
return ResultSuccess();
|
||||
R_SUCCEED();
|
||||
}
|
||||
|
||||
}
|
||||
|
|
|
@ -207,18 +207,18 @@ namespace ams::fatal::srv {
|
|||
|
||||
Result PowerControlTask::Run() {
|
||||
this->MonitorBatteryState();
|
||||
return ResultSuccess();
|
||||
R_SUCCEED();
|
||||
}
|
||||
|
||||
Result PowerButtonObserveTask::Run() {
|
||||
this->WaitForPowerButton();
|
||||
return ResultSuccess();
|
||||
R_SUCCEED();
|
||||
}
|
||||
|
||||
Result StateTransitionStopTask::Run() {
|
||||
/* Nintendo ignores the output of this call... */
|
||||
spsmPutErrorState();
|
||||
return ResultSuccess();
|
||||
R_SUCCEED();
|
||||
}
|
||||
|
||||
}
|
||||
|
|
|
@ -125,7 +125,7 @@ namespace ams::fatal::srv {
|
|||
/* Set alpha to 1.0f. */
|
||||
R_TRY(viSetDisplayAlpha(std::addressof(temp_display), 1.0f));
|
||||
|
||||
return ResultSuccess();
|
||||
R_SUCCEED();
|
||||
}
|
||||
|
||||
Result ShowFatalTask::SetupDisplayExternal() {
|
||||
|
@ -141,7 +141,7 @@ namespace ams::fatal::srv {
|
|||
/* Set alpha to 1.0f. */
|
||||
R_TRY(viSetDisplayAlpha(std::addressof(temp_display), 1.0f));
|
||||
|
||||
return ResultSuccess();
|
||||
R_SUCCEED();
|
||||
}
|
||||
|
||||
Result ShowFatalTask::PrepareScreenForDrawing() {
|
||||
|
@ -196,7 +196,7 @@ namespace ams::fatal::srv {
|
|||
R_TRY(this->InitializeNativeWindow());
|
||||
}
|
||||
|
||||
return ResultSuccess();
|
||||
R_SUCCEED();
|
||||
}
|
||||
|
||||
void ShowFatalTask::PreRenderFrameBuffer() {
|
||||
|
@ -468,7 +468,7 @@ namespace ams::fatal::srv {
|
|||
R_TRY(nwindowConfigureBuffer(std::addressof(m_win), 0, std::addressof(grbuf)));
|
||||
}
|
||||
|
||||
return ResultSuccess();
|
||||
R_SUCCEED();
|
||||
}
|
||||
|
||||
void ShowFatalTask::DisplayPreRenderedFrame() {
|
||||
|
@ -488,7 +488,7 @@ namespace ams::fatal::srv {
|
|||
/* Display the pre-rendered frame. */
|
||||
this->DisplayPreRenderedFrame();
|
||||
|
||||
return ResultSuccess();
|
||||
R_SUCCEED();
|
||||
}
|
||||
|
||||
Result ShowFatalTask::Run() {
|
||||
|
@ -506,7 +506,7 @@ namespace ams::fatal::srv {
|
|||
|
||||
Result BacklightControlTask::Run() {
|
||||
TurnOnBacklight();
|
||||
return ResultSuccess();
|
||||
R_SUCCEED();
|
||||
}
|
||||
|
||||
}
|
||||
|
|
|
@ -82,7 +82,7 @@ namespace ams::fatal::srv {
|
|||
|
||||
Result StopSoundTask::Run() {
|
||||
StopSound();
|
||||
return ResultSuccess();
|
||||
R_SUCCEED();
|
||||
}
|
||||
|
||||
}
|
||||
|
|
|
@ -56,7 +56,7 @@ namespace ams::ldr {
|
|||
entry.argument_size = size;
|
||||
std::memcpy(entry.argument, argument, entry.argument_size);
|
||||
|
||||
return ResultSuccess();
|
||||
R_SUCCEED();
|
||||
}
|
||||
|
||||
}
|
||||
|
|
|
@ -43,7 +43,7 @@ namespace ams::ldr {
|
|||
for (auto &entry : m_argument_map) {
|
||||
entry.program_id = ncm::InvalidProgramId;
|
||||
}
|
||||
return ResultSuccess();
|
||||
R_SUCCEED();
|
||||
}
|
||||
private:
|
||||
static int FindIndex(Entry *map, ncm::ProgramId program_id);
|
||||
|
|
|
@ -353,7 +353,7 @@ namespace ams::ldr {
|
|||
#undef VALIDATE_CASE
|
||||
}
|
||||
|
||||
return ResultSuccess();
|
||||
R_SUCCEED();
|
||||
}
|
||||
|
||||
u16 MakeProgramInfoFlag(const util::BitPack32 *kac, size_t count) {
|
||||
|
|
|
@ -68,7 +68,7 @@ namespace ams::ldr {
|
|||
m_mounted_code = true;
|
||||
}
|
||||
|
||||
return ResultSuccess();
|
||||
R_SUCCEED();
|
||||
}
|
||||
|
||||
void ScopedCodeMount::EnsureOverrideStatus(const ncm::ProgramLocation &loc) {
|
||||
|
@ -85,7 +85,7 @@ namespace ams::ldr {
|
|||
if (static_cast<ncm::StorageId>(loc.storage_id) == ncm::StorageId::None) {
|
||||
std::memset(out_path, 0, out_size);
|
||||
std::memcpy(out_path, "/", std::min<size_t>(out_size, 2));
|
||||
return ResultSuccess();
|
||||
R_SUCCEED();
|
||||
}
|
||||
|
||||
lr::Path path;
|
||||
|
@ -118,13 +118,13 @@ namespace ams::ldr {
|
|||
std::memset(out_path, 0, out_size);
|
||||
std::memcpy(out_path, path.str, std::min(out_size, sizeof(path)));
|
||||
|
||||
return ResultSuccess();
|
||||
R_SUCCEED();
|
||||
}
|
||||
|
||||
Result RedirectProgramPath(const char *path, size_t size, const ncm::ProgramLocation &loc) {
|
||||
/* Check for storage id none. */
|
||||
if (static_cast<ncm::StorageId>(loc.storage_id) == ncm::StorageId::None) {
|
||||
return ResultSuccess();
|
||||
R_SUCCEED();
|
||||
}
|
||||
|
||||
/* Open location resolver. */
|
||||
|
@ -139,7 +139,7 @@ namespace ams::ldr {
|
|||
/* Redirect the path. */
|
||||
lr.RedirectProgramPath(lr_path, loc.program_id);
|
||||
|
||||
return ResultSuccess();
|
||||
R_SUCCEED();
|
||||
}
|
||||
|
||||
Result RedirectHtmlDocumentPathForHbl(const ncm::ProgramLocation &loc) {
|
||||
|
@ -156,7 +156,7 @@ namespace ams::ldr {
|
|||
R_TRY(lr.ResolveProgramPath(std::addressof(path), loc.program_id));
|
||||
lr.RedirectApplicationHtmlDocumentPath(path, loc.program_id, loc.program_id);
|
||||
|
||||
return ResultSuccess();
|
||||
R_SUCCEED();
|
||||
}
|
||||
|
||||
}
|
||||
|
|
|
@ -74,7 +74,7 @@ namespace ams::pm::info {
|
|||
|
||||
Result HasLaunchedBootProgram(bool *out, ncm::ProgramId program_id) {
|
||||
*out = ldr::HasLaunchedBootProgram(program_id);
|
||||
return ResultSuccess();
|
||||
R_SUCCEED();
|
||||
}
|
||||
|
||||
}
|
||||
|
|
|
@ -76,7 +76,7 @@ namespace ams::ldr {
|
|||
*out_status = status;
|
||||
}
|
||||
|
||||
return ResultSuccess();
|
||||
R_SUCCEED();
|
||||
}
|
||||
|
||||
Result LoaderService::PinProgram(PinId *out, const ncm::ProgramLocation &loc, const cfg::OverrideStatus &status) {
|
||||
|
@ -116,7 +116,7 @@ namespace ams::ldr {
|
|||
|
||||
Result LoaderService::SetEnabledProgramVerification(bool enabled) {
|
||||
ldr::SetEnabledProgramVerification(enabled);
|
||||
return ResultSuccess();
|
||||
R_SUCCEED();
|
||||
}
|
||||
|
||||
}
|
||||
|
|
|
@ -47,7 +47,7 @@ namespace ams::ldr {
|
|||
R_UNLESS(allowed_start <= start, ldr::ResultInvalidMeta());
|
||||
R_UNLESS(start <= allowed_end, ldr::ResultInvalidMeta());
|
||||
R_UNLESS(start + size <= allowed_end, ldr::ResultInvalidMeta());
|
||||
return ResultSuccess();
|
||||
R_SUCCEED();
|
||||
}
|
||||
|
||||
Result ValidateNpdm(const Npdm *npdm, size_t size) {
|
||||
|
@ -77,7 +77,7 @@ namespace ams::ldr {
|
|||
/* Validate Aci extends. */
|
||||
R_TRY(ValidateSubregion(sizeof(Npdm), size, npdm->aci_offset, npdm->aci_size, sizeof(Aci)));
|
||||
|
||||
return ResultSuccess();
|
||||
R_SUCCEED();
|
||||
}
|
||||
|
||||
Result ValidateAcid(const Acid *acid, size_t size) {
|
||||
|
@ -94,7 +94,7 @@ namespace ams::ldr {
|
|||
R_TRY(ValidateSubregion(sizeof(Acid), size, acid->sac_offset, acid->sac_size));
|
||||
R_TRY(ValidateSubregion(sizeof(Acid), size, acid->kac_offset, acid->kac_size));
|
||||
|
||||
return ResultSuccess();
|
||||
R_SUCCEED();
|
||||
}
|
||||
|
||||
Result ValidateAci(const Aci *aci, size_t size) {
|
||||
|
@ -106,7 +106,7 @@ namespace ams::ldr {
|
|||
R_TRY(ValidateSubregion(sizeof(Aci), size, aci->sac_offset, aci->sac_size));
|
||||
R_TRY(ValidateSubregion(sizeof(Aci), size, aci->kac_offset, aci->kac_size));
|
||||
|
||||
return ResultSuccess();
|
||||
R_SUCCEED();
|
||||
}
|
||||
|
||||
const u8 *GetAcidSignatureModulus(u32 key_generation) {
|
||||
|
@ -117,7 +117,7 @@ namespace ams::ldr {
|
|||
/* Loader did not check signatures prior to 10.0.0. */
|
||||
if (hos::GetVersion() < hos::Version_10_0_0) {
|
||||
meta->check_verification_data = false;
|
||||
return ResultSuccess();
|
||||
R_SUCCEED();
|
||||
}
|
||||
|
||||
/* Verify the signature. */
|
||||
|
@ -133,7 +133,7 @@ namespace ams::ldr {
|
|||
R_UNLESS(is_signature_valid || !IsEnabledProgramVerification(), ldr::ResultInvalidAcidSignature());
|
||||
|
||||
meta->check_verification_data = is_signature_valid;
|
||||
return ResultSuccess();
|
||||
R_SUCCEED();
|
||||
}
|
||||
|
||||
Result LoadMetaFromFile(fs::FileHandle file, MetaCache *cache) {
|
||||
|
@ -182,7 +182,7 @@ namespace ams::ldr {
|
|||
meta->modulus = acid->modulus;
|
||||
}
|
||||
|
||||
return ResultSuccess();
|
||||
R_SUCCEED();
|
||||
}
|
||||
|
||||
}
|
||||
|
@ -270,7 +270,7 @@ namespace ams::ldr {
|
|||
g_cached_override_status = status;
|
||||
*out_meta = *meta;
|
||||
|
||||
return ResultSuccess();
|
||||
R_SUCCEED();
|
||||
}
|
||||
|
||||
Result LoadMetaFromCache(Meta *out_meta, const ncm::ProgramLocation &loc, const cfg::OverrideStatus &status) {
|
||||
|
@ -278,7 +278,7 @@ namespace ams::ldr {
|
|||
return LoadMeta(out_meta, loc, status);
|
||||
}
|
||||
*out_meta = g_meta_cache.meta;
|
||||
return ResultSuccess();
|
||||
R_SUCCEED();
|
||||
}
|
||||
|
||||
void InvalidateMetaCache() {
|
||||
|
|
|
@ -126,7 +126,7 @@ namespace ams::ldr {
|
|||
#else
|
||||
AMS_UNUSED(program_id, version);
|
||||
#endif
|
||||
return ResultSuccess();
|
||||
R_SUCCEED();
|
||||
}
|
||||
|
||||
/* Helpers. */
|
||||
|
@ -157,7 +157,7 @@ namespace ams::ldr {
|
|||
|
||||
/* Copy flags. */
|
||||
out->flags = MakeProgramInfoFlag(static_cast<const util::BitPack32 *>(meta->aci_kac), meta->aci->kac_size / sizeof(util::BitPack32));
|
||||
return ResultSuccess();
|
||||
R_SUCCEED();
|
||||
}
|
||||
|
||||
bool IsApplet(const Meta *meta) {
|
||||
|
@ -195,7 +195,7 @@ namespace ams::ldr {
|
|||
}
|
||||
}
|
||||
|
||||
return ResultSuccess();
|
||||
R_SUCCEED();
|
||||
}
|
||||
|
||||
Result ValidateNsoHeaders(const NsoHeader *nso_headers, const bool *has_nso) {
|
||||
|
@ -214,7 +214,7 @@ namespace ams::ldr {
|
|||
R_UNLESS(nso_headers[i].text_dst_offset == 0, ldr::ResultInvalidNso());
|
||||
}
|
||||
|
||||
return ResultSuccess();
|
||||
R_SUCCEED();
|
||||
}
|
||||
|
||||
Result ValidateMeta(const Meta *meta, const ncm::ProgramLocation &loc, const fs::CodeVerificationData &code_verification_data) {
|
||||
|
@ -244,7 +244,7 @@ namespace ams::ldr {
|
|||
}
|
||||
|
||||
/* All good. */
|
||||
return ResultSuccess();
|
||||
R_SUCCEED();
|
||||
}
|
||||
|
||||
Result GetCreateProcessFlags(u32 *out, const Meta *meta, const u32 ldr_flags) {
|
||||
|
@ -272,7 +272,7 @@ namespace ams::ldr {
|
|||
flags |= svc::CreateProcessFlag_AddressSpace64Bit;
|
||||
break;
|
||||
default:
|
||||
return ldr::ResultInvalidMeta();
|
||||
R_THROW(ldr::ResultInvalidMeta());
|
||||
}
|
||||
|
||||
/* Set Enable Debug. */
|
||||
|
@ -317,7 +317,7 @@ namespace ams::ldr {
|
|||
flags |= svc::CreateProcessFlag_PoolPartitionSystemNonSecure;
|
||||
break;
|
||||
default:
|
||||
return ldr::ResultInvalidMeta();
|
||||
R_THROW(ldr::ResultInvalidMeta());
|
||||
}
|
||||
} else if (hos::GetVersion() >= hos::Version_4_0_0) {
|
||||
/* On 4.0.0+, the corresponding bit was simply "UseSecureMemory". */
|
||||
|
@ -332,7 +332,7 @@ namespace ams::ldr {
|
|||
}
|
||||
|
||||
*out = flags;
|
||||
return ResultSuccess();
|
||||
R_SUCCEED();
|
||||
}
|
||||
|
||||
Result GetCreateProcessParameter(svc::CreateProcessParameter *out, const Meta *meta, u32 flags, os::NativeHandle resource_limit) {
|
||||
|
@ -367,7 +367,7 @@ namespace ams::ldr {
|
|||
out->system_resource_num_pages = meta->npdm->system_resource_size >> 12;
|
||||
}
|
||||
|
||||
return ResultSuccess();
|
||||
R_SUCCEED();
|
||||
}
|
||||
|
||||
ALWAYS_INLINE u64 GetCurrentProcessInfo(svc::InfoType info_type) {
|
||||
|
@ -415,7 +415,7 @@ namespace ams::ldr {
|
|||
/* If the memory range is free and big enough, use it. */
|
||||
if (mem_info.state == svc::MemoryState_Free && mapping_size <= ((mem_info.base_address + mem_info.size) - address)) {
|
||||
*out = address;
|
||||
return ResultSuccess();
|
||||
R_SUCCEED();
|
||||
}
|
||||
|
||||
/* Check that we can advance. */
|
||||
|
@ -514,7 +514,7 @@ namespace ams::ldr {
|
|||
out_param->code_address = aslr_start;
|
||||
out_param->code_num_pages = total_size >> 12;
|
||||
|
||||
return ResultSuccess();
|
||||
R_SUCCEED();
|
||||
}
|
||||
|
||||
Result CreateProcessImpl(ProcessInfo *out, const Meta *meta, const NsoHeader *nso_headers, const bool *has_nso, const ArgumentStore::Entry *argument, u32 flags, os::NativeHandle resource_limit) {
|
||||
|
@ -532,7 +532,7 @@ namespace ams::ldr {
|
|||
/* Set the output handle. */
|
||||
out->process_handle = process_handle;
|
||||
|
||||
return ResultSuccess();
|
||||
R_SUCCEED();
|
||||
}
|
||||
|
||||
Result LoadNsoSegment(fs::FileHandle file, const NsoHeader::SegmentInfo *segment, size_t file_size, const u8 *file_hash, bool is_compressed, bool check_hash, uintptr_t map_base, uintptr_t map_end) {
|
||||
|
@ -565,7 +565,7 @@ namespace ams::ldr {
|
|||
R_UNLESS(std::memcmp(hash, file_hash, sizeof(hash)) == 0, ldr::ResultInvalidNso());
|
||||
}
|
||||
|
||||
return ResultSuccess();
|
||||
R_SUCCEED();
|
||||
}
|
||||
|
||||
Result LoadAutoLoadModule(os::NativeHandle process_handle, fs::FileHandle file, uintptr_t map_address, const NsoHeader *nso_header, uintptr_t nso_address, size_t nso_size) {
|
||||
|
@ -612,7 +612,7 @@ namespace ams::ldr {
|
|||
R_TRY(svc::SetProcessMemoryPermission(process_handle, nso_address + nso_header->rw_dst_offset, rw_size, svc::MemoryPermission_ReadWrite));
|
||||
}
|
||||
|
||||
return ResultSuccess();
|
||||
R_SUCCEED();
|
||||
}
|
||||
|
||||
Result LoadAutoLoadModules(const ProcessInfo *process_info, const NsoHeader *nso_headers, const bool *has_nso, const ArgumentStore::Entry *argument) {
|
||||
|
@ -651,7 +651,7 @@ namespace ams::ldr {
|
|||
R_TRY(svc::SetProcessMemoryPermission(process_info->process_handle, process_info->args_address, process_info->args_size, svc::MemoryPermission_ReadWrite));
|
||||
}
|
||||
|
||||
return ResultSuccess();
|
||||
R_SUCCEED();
|
||||
}
|
||||
|
||||
}
|
||||
|
@ -742,22 +742,22 @@ namespace ams::ldr {
|
|||
|
||||
Result PinProgram(PinId *out_id, const ncm::ProgramLocation &loc, const cfg::OverrideStatus &override_status) {
|
||||
R_UNLESS(RoManager::GetInstance().Allocate(out_id, loc, override_status), ldr::ResultMaxProcess());
|
||||
return ResultSuccess();
|
||||
R_SUCCEED();
|
||||
}
|
||||
|
||||
Result UnpinProgram(PinId id) {
|
||||
R_UNLESS(RoManager::GetInstance().Free(id), ldr::ResultNotPinned());
|
||||
return ResultSuccess();
|
||||
R_SUCCEED();
|
||||
}
|
||||
|
||||
Result GetProcessModuleInfo(u32 *out_count, ldr::ModuleInfo *out, size_t max_out_count, os::ProcessId process_id) {
|
||||
R_UNLESS(RoManager::GetInstance().GetProcessModuleInfo(out_count, out, max_out_count, process_id), ldr::ResultNotPinned());
|
||||
return ResultSuccess();
|
||||
R_SUCCEED();
|
||||
}
|
||||
|
||||
Result GetProgramLocationAndOverrideStatusFromPinId(ncm::ProgramLocation *out, cfg::OverrideStatus *out_status, PinId pin_id) {
|
||||
R_UNLESS(RoManager::GetInstance().GetProgramLocationAndStatus(out, out_status, pin_id), ldr::ResultNotPinned());
|
||||
return ResultSuccess();
|
||||
R_SUCCEED();
|
||||
}
|
||||
|
||||
}
|
||||
|
|
|
@ -83,7 +83,7 @@ namespace ams {
|
|||
R_TRY(os::CreateThread(std::addressof(m_thread), ThreadFunction, this, g_content_manager_thread_stack, sizeof(g_content_manager_thread_stack), AMS_GET_SYSTEM_THREAD_PRIORITY(ncm, ContentManagerServerIpcSession)));
|
||||
os::SetThreadNamePointer(std::addressof(m_thread), AMS_GET_SYSTEM_THREAD_NAME(ncm, ContentManagerServerIpcSession));
|
||||
os::StartThread(std::addressof(m_thread));
|
||||
return ResultSuccess();
|
||||
R_SUCCEED();
|
||||
}
|
||||
|
||||
void Wait() {
|
||||
|
@ -127,7 +127,7 @@ namespace ams {
|
|||
R_TRY(os::CreateThread(std::addressof(m_thread), ThreadFunction, this, g_location_resolver_thread_stack, sizeof(g_location_resolver_thread_stack), AMS_GET_SYSTEM_THREAD_PRIORITY(ncm, LocationResolverServerIpcSession)));
|
||||
os::SetThreadNamePointer(std::addressof(m_thread), AMS_GET_SYSTEM_THREAD_NAME(ncm, LocationResolverServerIpcSession));
|
||||
os::StartThread(std::addressof(m_thread));
|
||||
return ResultSuccess();
|
||||
R_SUCCEED();
|
||||
}
|
||||
|
||||
void Wait() {
|
||||
|
|
|
@ -68,7 +68,7 @@ namespace ams::ro::impl {
|
|||
/* If the memory range is free and big enough, use it. */
|
||||
if (mem_info.state == svc::MemoryState_Free && mapping_size <= ((mem_info.base_address + mem_info.size) - address)) {
|
||||
*out = address;
|
||||
return ResultSuccess();
|
||||
R_SUCCEED();
|
||||
}
|
||||
|
||||
/* Check that we can advance. */
|
||||
|
|
|
@ -74,7 +74,7 @@ namespace ams::ro::impl {
|
|||
bss_mcm.Cancel();
|
||||
|
||||
*out_base_address = base_address;
|
||||
return ResultSuccess();
|
||||
R_SUCCEED();
|
||||
}
|
||||
|
||||
Result SetNroPerms(os::NativeHandle process_handle, u64 base_address, u64 rx_size, u64 ro_size, u64 rw_size) {
|
||||
|
@ -86,7 +86,7 @@ namespace ams::ro::impl {
|
|||
R_TRY(svc::SetProcessMemoryPermission(process_handle, base_address + ro_offset, ro_size, svc::MemoryPermission_Read));
|
||||
R_TRY(svc::SetProcessMemoryPermission(process_handle, base_address + rw_offset, rw_size, svc::MemoryPermission_ReadWrite));
|
||||
|
||||
return ResultSuccess();
|
||||
R_SUCCEED();
|
||||
}
|
||||
|
||||
Result UnmapNro(os::NativeHandle process_handle, u64 base_address, u64 nro_heap_address, u64 bss_heap_address, u64 bss_heap_size, u64 code_size, u64 rw_size) {
|
||||
|
@ -103,7 +103,7 @@ namespace ams::ro::impl {
|
|||
/* Finally, unmap .text + .rodata. */
|
||||
R_TRY(svc::UnmapProcessCodeMemory(process_handle, base_address, nro_heap_address, code_size));
|
||||
|
||||
return ResultSuccess();
|
||||
R_SUCCEED();
|
||||
}
|
||||
|
||||
}
|
||||
|
|
|
@ -119,7 +119,7 @@ namespace ams::ro::impl {
|
|||
}
|
||||
|
||||
*out = IsDevelopmentHardware() ? DevModuli[key_generation] : ProdModuli[key_generation];
|
||||
return ResultSuccess();
|
||||
R_SUCCEED();
|
||||
}
|
||||
|
||||
Result ValidateNrrCertification(const NrrHeader *header, const u8 *mod) {
|
||||
|
@ -138,7 +138,7 @@ namespace ams::ro::impl {
|
|||
/* Check ProgramId pattern is valid. */
|
||||
R_UNLESS(header->IsProgramIdValid(), ro::ResultNotAuthorized());
|
||||
|
||||
return ResultSuccess();
|
||||
R_SUCCEED();
|
||||
}
|
||||
|
||||
Result ValidateNrrSignature(const NrrHeader *header) {
|
||||
|
@ -155,7 +155,7 @@ namespace ams::ro::impl {
|
|||
const size_t msg_size = header->GetSignedAreaSize();
|
||||
R_UNLESS(crypto::VerifyRsa2048PssSha256(sig, sig_size, mod, mod_size, exp, exp_size, msg, msg_size), ro::ResultNotAuthorized());
|
||||
|
||||
return ResultSuccess();
|
||||
R_SUCCEED();
|
||||
}
|
||||
|
||||
Result ValidateNrr(const NrrHeader *header, u64 size, ncm::ProgramId program_id, NrrKind nrr_kind, bool enforce_nrr_kind) {
|
||||
|
@ -189,7 +189,7 @@ namespace ams::ro::impl {
|
|||
}
|
||||
}
|
||||
|
||||
return ResultSuccess();
|
||||
R_SUCCEED();
|
||||
}
|
||||
|
||||
}
|
||||
|
@ -246,13 +246,13 @@ namespace ams::ro::impl {
|
|||
|
||||
*out_header = nrr_header;
|
||||
*out_mapped_code_address = code_address;
|
||||
return ResultSuccess();
|
||||
R_SUCCEED();
|
||||
}
|
||||
|
||||
Result UnmapNrr(os::NativeHandle process_handle, const NrrHeader *header, u64 nrr_heap_address, u64 nrr_heap_size, u64 mapped_code_address) {
|
||||
R_TRY(svc::UnmapProcessMemory(reinterpret_cast<uintptr_t>(header), process_handle, mapped_code_address, nrr_heap_size));
|
||||
R_TRY(svc::UnmapProcessCodeMemory(process_handle, mapped_code_address, nrr_heap_address, nrr_heap_size));
|
||||
return ResultSuccess();
|
||||
R_SUCCEED();
|
||||
}
|
||||
|
||||
bool ValidateNrrHashTableEntry(const void *signed_area, size_t signed_area_size, size_t hashes_offset, size_t num_hashes, const void *nrr_hash, const u8 *hash_table, const void *desired_hash) {
|
||||
|
|
|
@ -148,10 +148,10 @@ namespace ams::ro::impl {
|
|||
if (out != nullptr) {
|
||||
*out = m_nrr_infos + i;
|
||||
}
|
||||
return ResultSuccess();
|
||||
R_SUCCEED();
|
||||
}
|
||||
}
|
||||
return ro::ResultNotRegistered();
|
||||
R_THROW(ro::ResultNotRegistered());
|
||||
}
|
||||
|
||||
Result GetFreeNrrInfo(NrrInfo **out) {
|
||||
|
@ -160,10 +160,10 @@ namespace ams::ro::impl {
|
|||
if (out != nullptr) {
|
||||
*out = m_nrr_infos + i;
|
||||
}
|
||||
return ResultSuccess();
|
||||
R_SUCCEED();
|
||||
}
|
||||
}
|
||||
return ro::ResultTooManyNrr();
|
||||
R_THROW(ro::ResultTooManyNrr());
|
||||
}
|
||||
|
||||
Result GetNroInfoByAddress(NroInfo **out, u64 nro_address) {
|
||||
|
@ -172,10 +172,10 @@ namespace ams::ro::impl {
|
|||
if (out != nullptr) {
|
||||
*out = m_nro_infos + i;
|
||||
}
|
||||
return ResultSuccess();
|
||||
R_SUCCEED();
|
||||
}
|
||||
}
|
||||
return ro::ResultNotLoaded();
|
||||
R_THROW(ro::ResultNotLoaded());
|
||||
}
|
||||
|
||||
Result GetNroInfoByModuleId(NroInfo **out, const ModuleId *module_id) {
|
||||
|
@ -184,10 +184,10 @@ namespace ams::ro::impl {
|
|||
if (out != nullptr) {
|
||||
*out = m_nro_infos + i;
|
||||
}
|
||||
return ResultSuccess();
|
||||
R_SUCCEED();
|
||||
}
|
||||
}
|
||||
return ro::ResultNotLoaded();
|
||||
R_THROW(ro::ResultNotLoaded());
|
||||
}
|
||||
|
||||
Result GetFreeNroInfo(NroInfo **out) {
|
||||
|
@ -196,10 +196,10 @@ namespace ams::ro::impl {
|
|||
if (out != nullptr) {
|
||||
*out = m_nro_infos + i;
|
||||
}
|
||||
return ResultSuccess();
|
||||
R_SUCCEED();
|
||||
}
|
||||
}
|
||||
return ro::ResultTooManyNro();
|
||||
R_THROW(ro::ResultTooManyNro());
|
||||
}
|
||||
|
||||
Result ValidateHasNroHash(const NroHeader *nro_header) const {
|
||||
|
@ -241,10 +241,10 @@ namespace ams::ro::impl {
|
|||
}
|
||||
|
||||
/* The hash is valid! */
|
||||
return ResultSuccess();
|
||||
R_SUCCEED();
|
||||
}
|
||||
|
||||
return ro::ResultNotAuthorized();
|
||||
R_THROW(ro::ResultNotAuthorized());
|
||||
}
|
||||
|
||||
Result ValidateNro(ModuleId *out_module_id, u64 *out_rx_size, u64 *out_ro_size, u64 *out_rw_size, u64 base_address, u64 expected_nro_size, u64 expected_bss_size) {
|
||||
|
@ -305,7 +305,7 @@ namespace ams::ro::impl {
|
|||
*out_rx_size = text_size;
|
||||
*out_ro_size = ro_size;
|
||||
*out_rw_size = rw_size;
|
||||
return ResultSuccess();
|
||||
R_SUCCEED();
|
||||
}
|
||||
|
||||
void SetNrrInfoInUse(const NrrInfo *info, bool in_use) {
|
||||
|
@ -391,14 +391,14 @@ namespace ams::ro::impl {
|
|||
R_UNLESS(size != 0, ro::ResultInvalidSize());
|
||||
R_UNLESS(util::IsAligned(size, os::MemoryPageSize), ro::ResultInvalidSize());
|
||||
R_UNLESS(address < address + size, ro::ResultInvalidSize());
|
||||
return ResultSuccess();
|
||||
R_SUCCEED();
|
||||
}
|
||||
|
||||
constexpr inline Result ValidateAddressAndSize(u64 address, u64 size) {
|
||||
R_UNLESS(util::IsAligned(address, os::MemoryPageSize), ro::ResultInvalidAddress());
|
||||
R_UNLESS(util::IsAligned(size, os::MemoryPageSize), ro::ResultInvalidSize());
|
||||
R_UNLESS(size == 0 || address < address + size, ro::ResultInvalidSize());
|
||||
return ResultSuccess();
|
||||
R_SUCCEED();
|
||||
}
|
||||
|
||||
}
|
||||
|
@ -451,14 +451,14 @@ namespace ams::ro::impl {
|
|||
*out_context_id = AllocateContext(process_handle.GetOsHandle(), process_id);
|
||||
process_handle.Detach();
|
||||
|
||||
return ResultSuccess();
|
||||
R_SUCCEED();
|
||||
}
|
||||
|
||||
Result ValidateProcess(size_t context_id, os::ProcessId process_id) {
|
||||
const ProcessContext *ctx = GetContextById(context_id);
|
||||
R_UNLESS(ctx != nullptr, ro::ResultInvalidProcess());
|
||||
R_UNLESS(ctx->GetProcessId() == process_id, ro::ResultInvalidProcess());
|
||||
return ResultSuccess();
|
||||
R_SUCCEED();
|
||||
}
|
||||
|
||||
void UnregisterProcess(size_t context_id) {
|
||||
|
@ -504,7 +504,7 @@ namespace ams::ro::impl {
|
|||
std::memcpy(nrr_info->cached_signed_area, header->GetSignedArea(), std::min(sizeof(nrr_info->cached_signed_area), header->GetHashesOffset() - header->GetSignedAreaOffset()));
|
||||
std::memcpy(std::addressof(nrr_info->signed_area_hash), std::addressof(signed_area_hash), sizeof(signed_area_hash));
|
||||
|
||||
return ResultSuccess();
|
||||
R_SUCCEED();
|
||||
}
|
||||
|
||||
Result UnregisterModuleInfo(size_t context_id, u64 nrr_address) {
|
||||
|
@ -603,7 +603,7 @@ namespace ams::ro::impl {
|
|||
context->GetProcessModuleInfo(out_count, out_infos, max_out_count);
|
||||
}
|
||||
|
||||
return ResultSuccess();
|
||||
R_SUCCEED();
|
||||
}
|
||||
|
||||
}
|
||||
|
|
|
@ -63,7 +63,7 @@ namespace ams::spl {
|
|||
|
||||
Result GetAesKeySlotAvailableEvent(sf::OutCopyHandle out_hnd) {
|
||||
out_hnd.SetValue(m_manager.GetAesKeySlotAvailableEvent()->GetReadableHandle(), false);
|
||||
return ResultSuccess();
|
||||
R_SUCCEED();
|
||||
}
|
||||
};
|
||||
static_assert(spl::impl::IsICryptoInterface<CryptoService>);
|
||||
|
|
|
@ -129,7 +129,7 @@ namespace ams::spl {
|
|||
|
||||
Result GetAesKeySlotAvailableEvent(sf::OutCopyHandle out_hnd) {
|
||||
out_hnd.SetValue(m_manager.GetAesKeySlotAvailableEvent()->GetReadableHandle(), false);
|
||||
return ResultSuccess();
|
||||
R_SUCCEED();
|
||||
}
|
||||
|
||||
Result SetBootReason(BootReasonValue boot_reason) {
|
||||
|
|
|
@ -145,7 +145,7 @@ namespace ams::spl {
|
|||
|
||||
m_aes_keyslot_owners[index] = owner;
|
||||
*out_keyslot = keyslot;
|
||||
return ResultSuccess();
|
||||
R_SUCCEED();
|
||||
}
|
||||
|
||||
Result SecureMonitorManager::DeallocateAesKeySlot(s32 keyslot, const void *owner) {
|
||||
|
@ -190,7 +190,7 @@ namespace ams::spl {
|
|||
if (out_index != nullptr) {
|
||||
*out_index = index;
|
||||
}
|
||||
return ResultSuccess();
|
||||
R_SUCCEED();
|
||||
}
|
||||
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue