ams: use R_SUCCEED, R_THROW globally

This commit is contained in:
Michael Scire
2022-03-26 00:14:36 -07:00
parent e5b1739f65
commit dd78ede99f
370 changed files with 2107 additions and 2107 deletions

View File

@@ -37,7 +37,7 @@ namespace ams::cal {
/* Write the output. */
*out = battery_version[0];
return ResultSuccess();
R_SUCCEED();
}
Result GetBatteryVendor(size_t *out_vendor_size, void *dst, size_t dst_size) {
@@ -47,7 +47,7 @@ namespace ams::cal {
/* Copy output. */
*out_vendor_size = static_cast<size_t>(util::Strlcpy(static_cast<char *>(dst), battery_lot, std::min(dst_size, BatteryVendorSizeMax)));
return ResultSuccess();
R_SUCCEED();
}
}

View File

@@ -47,7 +47,7 @@ namespace ams::cal::impl {
const u16 crc = *reinterpret_cast<const u16 *>(reinterpret_cast<uintptr_t>(data) + size - sizeof(u16));
R_UNLESS(CalculateCrc16(data, size - sizeof(u16)) == crc, cal::ResultCalibrationDataCrcError());
return ResultSuccess();
R_SUCCEED();
}
}

View File

@@ -30,7 +30,7 @@ namespace ams::cal::impl {
/* Validate the crc. */
R_TRY(ValidateCalibrationCrc(dst, block_size));
return ResultSuccess();
R_SUCCEED();
}
}

View File

@@ -51,7 +51,7 @@ namespace ams::capsrv {
*out_width = static_cast<s32>(width);
*out_height = static_cast<s32>(height);
return ResultSuccess();
R_SUCCEED();
#else
AMS_UNUSED(out_data_size, out_width, out_height, layer_stack, timeout);
AMS_ABORT("TODO");
@@ -64,7 +64,7 @@ namespace ams::capsrv {
R_TRY(::capsscReadRawScreenShotReadStream(std::addressof(read_size), dst, dst_size, static_cast<u64>(offset)));
*out_read_size = static_cast<size_t>(read_size);
return ResultSuccess();
R_SUCCEED();
#else
AMS_UNUSED(out_read_size, dst, dst_size, offset);
AMS_ABORT("TODO");

View File

@@ -39,7 +39,7 @@ namespace ams::capsrv::server {
/* We're initialized. */
g_initialized = true;
return ResultSuccess();
R_SUCCEED();
}
void FinalizeForDecoderServer() {

View File

@@ -29,7 +29,7 @@ namespace ams::capsrv::server {
/* Initialize the idle event, we're idle initially. */
os::InitializeEvent(std::addressof(m_idle_event), true, os::EventClearMode_ManualClear);
return ResultSuccess();
R_SUCCEED();
}
void DecoderControlServerManager::Finalize() {

View File

@@ -64,7 +64,7 @@ namespace ams::capsrv::server {
/* We succeeded, so we shouldn't clear the output memory. */
clear_guard.Cancel();
return ResultSuccess();
R_SUCCEED();
}
}

View File

@@ -49,9 +49,9 @@ namespace ams::capsrv::server::jpeg {
case JpegLibraryType::J_MESSAGE_CODE::JERR_TFILE_READ:
case JpegLibraryType::J_MESSAGE_CODE::JERR_TFILE_SEEK:
case JpegLibraryType::J_MESSAGE_CODE::JERR_TFILE_WRITE:
return capsrv::ResultInternalJpegWorkMemoryShortage();
R_THROW(capsrv::ResultInternalJpegWorkMemoryShortage());
default:
return capsrv::ResultInternalJpegEncoderError();
R_THROW(capsrv::ResultInternalJpegEncoderError());
}
}
};

View File

@@ -51,7 +51,7 @@ namespace ams::capsrv::server::jpeg {
/* Return the output to the caller. */
*out_size = rgb_size;
*out_stride = rgb_stride;
return ResultSuccess();
R_SUCCEED();
}
}
@@ -172,14 +172,14 @@ namespace ams::capsrv::server::jpeg {
R_UNLESS(jpeg_finish_decompress(std::addressof(cinfo)) == TRUE, capsrv::ResultAlbumInvalidFileData());
} else {
/* Some unknown error was caught by our handler. */
return capsrv::ResultAlbumInvalidFileData();
R_THROW(capsrv::ResultAlbumInvalidFileData());
}
/* Write the size we decoded to output. */
*output.out_width = static_cast<s32>(cinfo.output_width);
*output.out_width = static_cast<s32>(cinfo.output_height);
return ResultSuccess();
R_SUCCEED();
}
}

View File

@@ -38,7 +38,7 @@ namespace ams::dd {
/* We succeeded. */
state_guard.Cancel();
return ResultSuccess();
R_SUCCEED();
}
Result CreateDeviceAddressSpace(DeviceAddressSpaceType *das, u64 size) {

View File

@@ -32,7 +32,7 @@ namespace ams::dd::impl {
} R_END_TRY_CATCH_WITH_ABORT_UNLESS;
*out = static_cast<DeviceAddressSpaceHandle>(handle);
return ResultSuccess();
R_SUCCEED();
}
void DeviceAddressSpaceImplByHorizon::Close(DeviceAddressSpaceHandle handle) {
@@ -55,7 +55,7 @@ namespace ams::dd::impl {
R_CONVERT(svc::ResultInvalidCurrentMemory, dd::ResultInvalidMemoryState())
} R_END_TRY_CATCH_WITH_ABORT_UNLESS;
return ResultSuccess();
R_SUCCEED();
}
Result DeviceAddressSpaceImplByHorizon::MapNotAligned(DeviceAddressSpaceHandle handle, ProcessHandle process_handle, u64 process_address, size_t process_size, DeviceVirtualAddress device_address, dd::MemoryPermission device_perm) {
@@ -66,7 +66,7 @@ namespace ams::dd::impl {
R_CONVERT(svc::ResultInvalidCurrentMemory, dd::ResultInvalidMemoryState())
} R_END_TRY_CATCH_WITH_ABORT_UNLESS;
return ResultSuccess();
R_SUCCEED();
}
void DeviceAddressSpaceImplByHorizon::Unmap(DeviceAddressSpaceHandle handle, ProcessHandle process_handle, u64 process_address, size_t process_size, DeviceVirtualAddress device_address) {
@@ -78,7 +78,7 @@ namespace ams::dd::impl {
R_CONVERT(svc::ResultOutOfMemory, dd::ResultOutOfMemory())
} R_END_TRY_CATCH_WITH_ABORT_UNLESS;
return ResultSuccess();
R_SUCCEED();
}
void DeviceAddressSpaceImplByHorizon::Detach(DeviceAddressSpaceType *das, DeviceName device_name) {

View File

@@ -43,7 +43,7 @@ namespace ams::ddsf {
/* Link the new holder. */
holder->AddTo(m_entry_list);
return ResultSuccess();
R_SUCCEED();
}
bool DeviceCodeEntryManager::Remove(DeviceCode device_code) {
@@ -90,7 +90,7 @@ namespace ams::ddsf {
/* Check that we found the device. */
R_UNLESS(found, ddsf::ResultDeviceCodeNotFound());
return ResultSuccess();
R_SUCCEED();
}
Result DeviceCodeEntryManager::FindDeviceCodeEntry(const DeviceCodeEntry **out, DeviceCode device_code) const {
@@ -112,7 +112,7 @@ namespace ams::ddsf {
/* Check that we found the device. */
R_UNLESS(found, ddsf::ResultDeviceCodeNotFound());
return ResultSuccess();
R_SUCCEED();
}
Result DeviceCodeEntryManager::FindDevice(IDevice **out, DeviceCode device_code) {
@@ -128,7 +128,7 @@ namespace ams::ddsf {
*out = std::addressof(entry->GetDevice());
}
return ResultSuccess();
R_SUCCEED();
}
Result DeviceCodeEntryManager::FindDevice(const IDevice **out, DeviceCode device_code) const {
@@ -144,7 +144,7 @@ namespace ams::ddsf {
*out = std::addressof(entry->GetDevice());
}
return ResultSuccess();
R_SUCCEED();
}
}

View File

@@ -32,7 +32,7 @@ namespace ams::ddsf {
/* We succeeded. */
session_guard.Cancel();
return ResultSuccess();
R_SUCCEED();
}
void CloseSession(ISession *session) {

View File

@@ -48,7 +48,7 @@ namespace ams::erpt::srv {
switch (type) {
case AttachmentOpenType_Create: return this->OpenStream(this->FileName().name, StreamMode_Write, AttachmentStreamBufferSize);
case AttachmentOpenType_Read: return this->OpenStream(this->FileName().name, StreamMode_Read, AttachmentStreamBufferSize);
default: return erpt::ResultInvalidArgument();
default: R_THROW(erpt::ResultInvalidArgument());
}
}
@@ -66,7 +66,7 @@ namespace ams::erpt::srv {
Result Attachment::GetFlags(AttachmentFlagSet *out) const {
*out = m_record->m_info.flags;
return ResultSuccess();
R_SUCCEED();
}
Result Attachment::SetFlags(AttachmentFlagSet flags) {
@@ -74,7 +74,7 @@ namespace ams::erpt::srv {
m_record->m_info.flags |= flags;
return Journal::Commit();
}
return ResultSuccess();
R_SUCCEED();
}
Result Attachment::GetSize(s64 *out) const {

View File

@@ -40,7 +40,7 @@ namespace ams::erpt::srv {
R_TRY(m_attachment->Open(AttachmentOpenType_Read));
attachment_guard.Cancel();
return ResultSuccess();
R_SUCCEED();
}
Result AttachmentImpl::Read(ams::sf::Out<u32> out_count, const ams::sf::OutBuffer &out_buffer) {
@@ -67,7 +67,7 @@ namespace ams::erpt::srv {
delete m_attachment;
m_attachment = nullptr;
}
return ResultSuccess();
R_SUCCEED();
}
Result AttachmentImpl::GetSize(ams::sf::Out<s64> out) {

View File

@@ -62,12 +62,12 @@ namespace ams::erpt::srv {
case FieldType_I8Array: R_TRY(Cipher::AddField(report, field->id, reinterpret_cast< s8 *>(arr_buf + field->value_array.start_idx), field->value_array.size / sizeof(s8))); break;
case FieldType_I32Array: R_TRY(Cipher::AddField(report, field->id, reinterpret_cast< s32 *>(arr_buf + field->value_array.start_idx), field->value_array.size / sizeof(s32))); break;
case FieldType_I64Array: R_TRY(Cipher::AddField(report, field->id, reinterpret_cast< s64 *>(arr_buf + field->value_array.start_idx), field->value_array.size / sizeof(s64))); break;
default: return erpt::ResultInvalidArgument();
default: R_THROW(erpt::ResultInvalidArgument());
}
}
}
return ResultSuccess();
R_SUCCEED();
}
Result Context::AddContextToCategory(const ContextEntry *entry, const u8 *data, u32 data_size) {
@@ -77,7 +77,7 @@ namespace ams::erpt::srv {
R_TRY(record->Initialize(entry, data, data_size));
this->AddContextRecordToCategory(std::move(record));
return ResultSuccess();
R_SUCCEED();
}
Result Context::AddContextRecordToCategory(std::unique_ptr<ContextRecord> record) {
@@ -91,7 +91,7 @@ namespace ams::erpt::srv {
delete back;
}
return ResultSuccess();
R_SUCCEED();
}
Result Context::SubmitContext(const ContextEntry *entry, const u8 *data, u32 data_size) {
@@ -123,7 +123,7 @@ namespace ams::erpt::srv {
Cipher::End(report);
report->Close();
return ResultSuccess();
R_SUCCEED();
}
Result Context::ClearContext(CategoryId cat) {

View File

@@ -54,7 +54,7 @@ namespace ams::erpt::srv {
ManagerImpl::NotifyAll();
return ResultSuccess();
R_SUCCEED();
}
Result ContextImpl::CreateReportV0(ReportType report_type, const ams::sf::InBuffer &ctx_buffer, const ams::sf::InBuffer &data_buffer, const ams::sf::InBuffer &meta_buffer) {
@@ -63,22 +63,22 @@ namespace ams::erpt::srv {
Result ContextImpl::SetInitialLaunchSettingsCompletionTime(const time::SteadyClockTimePoint &time_point) {
Reporter::SetInitialLaunchSettingsCompletionTime(time_point);
return ResultSuccess();
R_SUCCEED();
}
Result ContextImpl::ClearInitialLaunchSettingsCompletionTime() {
Reporter::ClearInitialLaunchSettingsCompletionTime();
return ResultSuccess();
R_SUCCEED();
}
Result ContextImpl::UpdatePowerOnTime() {
/* NOTE: Prior to 12.0.0, this set the power on time, but now erpt does it during initialization. */
return ResultSuccess();
R_SUCCEED();
}
Result ContextImpl::UpdateAwakeTime() {
/* NOTE: Prior to 12.0.0, this set the power on time, but now erpt does it during initialization. */
return ResultSuccess();
R_SUCCEED();
}
Result ContextImpl::SubmitMultipleCategoryContext(const MultipleCategoryContextEntry &ctx_entry, const ams::sf::InBuffer &str_buffer) {
@@ -107,17 +107,17 @@ namespace ams::erpt::srv {
total_arr_count += ctx_entry.array_buf_counts[i];
}
return ResultSuccess();
R_SUCCEED();
}
Result ContextImpl::UpdateApplicationLaunchTime() {
Reporter::UpdateApplicationLaunchTime();
return ResultSuccess();
R_SUCCEED();
}
Result ContextImpl::ClearApplicationLaunchTime() {
Reporter::ClearApplicationLaunchTime();
return ResultSuccess();
R_SUCCEED();
}
Result ContextImpl::SubmitAttachment(ams::sf::Out<AttachmentId> out, const ams::sf::InBuffer &attachment_name, const ams::sf::InBuffer &attachment_data) {
@@ -154,7 +154,7 @@ namespace ams::erpt::srv {
ManagerImpl::NotifyAll();
return ResultSuccess();
R_SUCCEED();
}
Result ContextImpl::CreateReportWithAttachmentsDeprecated(ReportType report_type, const ams::sf::InBuffer &ctx_buffer, const ams::sf::InBuffer &data_buffer, const ams::sf::InBuffer &attachment_ids_buffer) {
@@ -176,7 +176,7 @@ namespace ams::erpt::srv {
Result ContextImpl::InvalidateForcedShutdownDetection() {
/* NOTE: Nintendo does not check the result here. */
erpt::srv::InvalidateForcedShutdownDetection();
return ResultSuccess();
R_SUCCEED();
}
}

View File

@@ -106,7 +106,7 @@ namespace ams::erpt::srv {
guard.Cancel();
s_record_count += m_ctx.field_count;
return ResultSuccess();
R_SUCCEED();
}
Result ContextRecord::Add(FieldId field_id, bool value_bool) {
@@ -120,7 +120,7 @@ namespace ams::erpt::srv {
field.value_bool = value_bool;
return ResultSuccess();
R_SUCCEED();
}
Result ContextRecord::Add(FieldId field_id, u32 value_u32) {
@@ -134,7 +134,7 @@ namespace ams::erpt::srv {
field.value_u32 = value_u32;
return ResultSuccess();
R_SUCCEED();
}
Result ContextRecord::Add(FieldId field_id, u64 value_u64) {
@@ -148,7 +148,7 @@ namespace ams::erpt::srv {
field.value_u64 = value_u64;
return ResultSuccess();
R_SUCCEED();
}
Result ContextRecord::Add(FieldId field_id, s32 value_i32) {
@@ -162,7 +162,7 @@ namespace ams::erpt::srv {
field.value_i32 = value_i32;
return ResultSuccess();
R_SUCCEED();
}
Result ContextRecord::Add(FieldId field_id, s64 value_i64) {
@@ -176,7 +176,7 @@ namespace ams::erpt::srv {
field.value_i64 = value_i64;
return ResultSuccess();
R_SUCCEED();
}
Result ContextRecord::Add(FieldId field_id, const void *arr, u32 size, FieldType type) {
@@ -198,7 +198,7 @@ namespace ams::erpt::srv {
};
std::memcpy(m_ctx.array_buffer + start_idx, arr, size);
return ResultSuccess();
R_SUCCEED();
}
Result ContextRecord::Add(FieldId field_id, const char *str, u32 str_size) {

View File

@@ -70,7 +70,7 @@ namespace ams::erpt::srv {
/* Commit the context. */
R_TRY(Stream::CommitStream());
return ResultSuccess();
R_SUCCEED();
}
Result CreateReportForForcedShutdown() {
@@ -88,7 +88,7 @@ namespace ams::erpt::srv {
/* Create report. */
R_TRY(Reporter::CreateReport(ReportType_Invisible, ResultSuccess(), std::move(record), nullptr, nullptr, 0));
return ResultSuccess();
R_SUCCEED();
}
Result LoadForcedShutdownContext() {
@@ -162,7 +162,7 @@ namespace ams::erpt::srv {
R_TRY(Context::SubmitContextRecord(std::move(record)));
}
return ResultSuccess();
R_SUCCEED();
}
u32 GetForcedShutdownContextCount() {
@@ -215,7 +215,7 @@ namespace ams::erpt::srv {
/* Commit the context. */
R_TRY(Stream::CommitStream());
return ResultSuccess();
R_SUCCEED();
}
}
@@ -324,7 +324,7 @@ namespace ams::erpt::srv {
/* Commit the deletion. */
R_TRY(Stream::CommitStream());
return ResultSuccess();
R_SUCCEED();
}

View File

@@ -56,7 +56,7 @@ namespace ams::erpt::srv {
R_TRY(report->Write(str, str_len));
return ResultSuccess();
R_SUCCEED();
}
static Result AddId(Report *report, FieldId field_id) {
@@ -64,7 +64,7 @@ namespace ams::erpt::srv {
R_TRY(AddStringValue(report, FieldString[field_id], strnlen(FieldString[field_id], MaxFieldStringSize)));
return ResultSuccess();
R_SUCCEED();
}
template<typename T>
@@ -77,7 +77,7 @@ namespace ams::erpt::srv {
R_TRY(report->Write(tag));
R_TRY(report->Write(reinterpret_cast<u8 *>(std::addressof(big_endian_value)), sizeof(big_endian_value)));
return ResultSuccess();
R_SUCCEED();
}
template<typename T>
@@ -98,21 +98,21 @@ namespace ams::erpt::srv {
R_TRY(AddValue(report, arr[i]));
}
return ResultSuccess();
R_SUCCEED();
}
template<typename T>
static Result AddIdValuePair(Report *report, FieldId field_id, T value) {
R_TRY(AddId(report, field_id));
R_TRY(AddValue(report, value));
return ResultSuccess();
R_SUCCEED();
}
template<typename T>
static Result AddIdValueArray(Report *report, FieldId field_id, T *arr, u32 arr_size) {
R_TRY(AddId(report, field_id));
R_TRY(AddValueArray(report, arr, arr_size));
return ResultSuccess();
R_SUCCEED();
}
public:
static Result Begin(Report *report, u32 record_count) {
@@ -128,12 +128,12 @@ namespace ams::erpt::srv {
R_TRY(report->Write(be_count));
}
return ResultSuccess();
R_SUCCEED();
}
static Result End(Report *report) {
AMS_UNUSED(report);
return ResultSuccess();
R_SUCCEED();
}
template<typename T>
@@ -149,7 +149,7 @@ namespace ams::erpt::srv {
static Result AddField(Report *report, FieldId field_id, bool value) {
R_TRY(AddId(report, field_id));
R_TRY(report->Write(static_cast<u8>(value ? ValueTypeTag::True : ValueTypeTag::False)));
return ResultSuccess();
R_SUCCEED();
}
static Result AddField(Report *report, FieldId field_id, char *str, u32 len) {
@@ -157,7 +157,7 @@ namespace ams::erpt::srv {
R_TRY(AddStringValue(report, str, len));
return ResultSuccess();
R_SUCCEED();
}
static Result AddField(Report *report, FieldId field_id, u8 *bin, u32 len) {
@@ -177,7 +177,7 @@ namespace ams::erpt::srv {
R_TRY(report->Write(bin, len));
return ResultSuccess();
R_SUCCEED();
}
};

View File

@@ -44,7 +44,7 @@ namespace ams::erpt::srv {
stream.CloseStream();
stream.CommitStream();
return ResultSuccess();
R_SUCCEED();
}
Result Journal::Delete(ReportId report_id) {
@@ -97,7 +97,7 @@ namespace ams::erpt::srv {
/* Restore the attachments. */
R_TRY(JournalForAttachments::RestoreJournal(std::addressof(stream)));
return ResultSuccess();
R_SUCCEED();
}
JournalRecord<ReportInfo> *Journal::Retrieve(ReportId report_id) {

View File

@@ -50,7 +50,7 @@ namespace ams::erpt::srv {
for (auto it = s_attachment_list.crbegin(); it != s_attachment_list.crend(); it++) {
R_TRY(stream->WriteStream(reinterpret_cast<const u8 *>(std::addressof(it->m_info)), sizeof(it->m_info)));
}
return ResultSuccess();
R_SUCCEED();
}
Result JournalForAttachments::DeleteAttachments(ReportId report_id) {
@@ -74,7 +74,7 @@ namespace ams::erpt::srv {
it++;
}
}
return ResultSuccess();
R_SUCCEED();
}
Result JournalForAttachments::GetAttachmentList(AttachmentList *out, ReportId report_id) {
@@ -85,7 +85,7 @@ namespace ams::erpt::srv {
}
}
out->attachment_count = count;
return ResultSuccess();
R_SUCCEED();
}
u32 JournalForAttachments::GetUsedStorage() {
@@ -133,7 +133,7 @@ namespace ams::erpt::srv {
}
cleanup_guard.Cancel();
return ResultSuccess();
R_SUCCEED();
}
JournalRecord<AttachmentInfo> *JournalForAttachments::RetrieveRecord(AttachmentId attachment_id) {
@@ -153,10 +153,10 @@ namespace ams::erpt::srv {
record->m_info.owner_report_id = report_id;
record->m_info.flags.Set<AttachmentFlag::HasOwner>();
return ResultSuccess();
R_SUCCEED();
}
}
return erpt::ResultInvalidArgument();
R_THROW(erpt::ResultInvalidArgument());
}
Result JournalForAttachments::StoreRecord(JournalRecord<AttachmentInfo> *record) {
@@ -173,7 +173,7 @@ namespace ams::erpt::srv {
s_attachment_count++;
s_used_storage += static_cast<u32>(record->m_info.attachment_size);
return ResultSuccess();
R_SUCCEED();
}
Result JournalForAttachments::SubmitAttachment(AttachmentId *out, char *name, const u8 *data, u32 data_size) {
@@ -217,7 +217,7 @@ namespace ams::erpt::srv {
*out = info.attachment_id;
return ResultSuccess();
R_SUCCEED();
}
}

View File

@@ -35,7 +35,7 @@ namespace ams::erpt::srv {
if (R_FAILED(stream->ReadStream(std::addressof(size), reinterpret_cast<u8 *>(std::addressof(s_journal_meta)), sizeof(s_journal_meta))) || size != sizeof(s_journal_meta)) {
InitializeJournal();
}
return ResultSuccess();
R_SUCCEED();
}
u32 JournalForMeta::GetTransmittedCount(ReportType type) {

View File

@@ -46,7 +46,7 @@ namespace ams::erpt::srv {
for (auto it = s_record_list.crbegin(); it != s_record_list.crend(); it++) {
R_TRY(stream->WriteStream(reinterpret_cast<const u8 *>(std::addressof(it->m_info)), sizeof(it->m_info)));
}
return ResultSuccess();
R_SUCCEED();
}
void JournalForReports::EraseReportImpl(JournalRecord<ReportInfo> *record, bool increment_count, bool force_delete_attachments) {
@@ -80,10 +80,10 @@ namespace ams::erpt::srv {
auto *record = std::addressof(*it);
if (record->m_info.id == report_id) {
EraseReportImpl(record, false, false);
return ResultSuccess();
R_SUCCEED();
}
}
return erpt::ResultInvalidArgument();
R_THROW(erpt::ResultInvalidArgument());
}
Result JournalForReports::DeleteReportWithAttachments() {
@@ -91,10 +91,10 @@ namespace ams::erpt::srv {
auto *record = std::addressof(*it);
if (record->m_info.flags.Test<ReportFlag::HasAttachment>()) {
EraseReportImpl(record, true, true);
return ResultSuccess();
R_SUCCEED();
}
}
return erpt::ResultNotFound();
R_THROW(erpt::ResultNotFound());
}
s64 JournalForReports::GetMaxReportSize() {
@@ -113,7 +113,7 @@ namespace ams::erpt::srv {
}
}
out->report_count = count;
return ResultSuccess();
R_SUCCEED();
}
u32 JournalForReports::GetStoredReportCount(ReportType type) {
@@ -169,7 +169,7 @@ namespace ams::erpt::srv {
}
cleanup_guard.Cancel();
return ResultSuccess();
R_SUCCEED();
}
JournalRecord<ReportInfo> *JournalForReports::RetrieveRecord(ReportId report_id) {
@@ -222,7 +222,7 @@ namespace ams::erpt::srv {
s_record_count_by_type[record->m_info.type]++;
s_used_storage += static_cast<u32>(record->m_info.report_size);
return ResultSuccess();
R_SUCCEED();
}
}

View File

@@ -49,7 +49,7 @@ namespace ams::erpt::srv {
}
}
return ResultSuccess();
R_SUCCEED();
}
Result MountSystemSaveData() {
@@ -66,7 +66,7 @@ namespace ams::erpt::srv {
}
} R_END_TRY_CATCH;
return ResultSuccess();
R_SUCCEED();
}
}
@@ -115,7 +115,7 @@ namespace ams::erpt::srv {
Reporter::UpdatePowerOnTime();
Reporter::UpdateAwakeTime();
return ResultSuccess();
R_SUCCEED();
}
Result InitializeAndStartService() {
@@ -138,7 +138,7 @@ namespace ams::erpt::srv {
R_TRY(record->Add(FieldId_ProductModel, model, model_len));
R_TRY(Context::SubmitContextRecord(std::move(record)));
return ResultSuccess();
R_SUCCEED();
}
Result SetRegionSetting(const char *region, u32 region_len) {
@@ -149,17 +149,17 @@ namespace ams::erpt::srv {
R_TRY(record->Add(FieldId_RegionSetting, region, region_len));
R_TRY(Context::SubmitContextRecord(std::move(record)));
return ResultSuccess();
R_SUCCEED();
}
Result SetRedirectNewReportsToSdCard(bool redirect) {
Reporter::SetRedirectNewReportsToSdCard(redirect);
return ResultSuccess();
R_SUCCEED();
}
Result SetEnabledAutomaticReportCleanup(bool en) {
g_automatic_report_cleanup_enabled = en;
return ResultSuccess();
R_SUCCEED();
}
void Wait() {

View File

@@ -43,7 +43,7 @@ namespace ams::erpt::srv {
for (auto &manager : g_manager_list) {
manager.NotifyOne();
}
return ResultSuccess();
R_SUCCEED();
}
Result ManagerImpl::GetReportList(const ams::sf::OutBuffer &out_list, ReportType type_filter) {
@@ -54,7 +54,7 @@ namespace ams::erpt::srv {
Result ManagerImpl::GetEvent(ams::sf::OutCopyHandle out) {
out.SetValue(m_system_event.GetReadableHandle(), false);
return ResultSuccess();
R_SUCCEED();
}
Result ManagerImpl::CleanupReports() {
@@ -83,7 +83,7 @@ namespace ams::erpt::srv {
}
out.SetValue(stats);
return ResultSuccess();
R_SUCCEED();
}
Result ManagerImpl::GetAttachmentList(const ams::sf::OutBuffer &out_list, const ReportId &report_id) {

View File

@@ -54,7 +54,7 @@ namespace ams::erpt::srv {
switch (type) {
case ReportOpenType_Create: return this->OpenStream(this->FileName().name, StreamMode_Write, ReportStreamBufferSize);
case ReportOpenType_Read: return this->OpenStream(this->FileName().name, StreamMode_Read, ReportStreamBufferSize);
default: return erpt::ResultInvalidArgument();
default: R_THROW(erpt::ResultInvalidArgument());
}
}
@@ -72,7 +72,7 @@ namespace ams::erpt::srv {
Result Report::GetFlags(ReportFlagSet *out) const {
*out = m_record->m_info.flags;
return ResultSuccess();
R_SUCCEED();
}
Result Report::SetFlags(ReportFlagSet flags) {
@@ -80,7 +80,7 @@ namespace ams::erpt::srv {
m_record->m_info.flags |= flags;
return Journal::Commit();
}
return ResultSuccess();
R_SUCCEED();
}
Result Report::GetSize(s64 *out) const {

View File

@@ -40,7 +40,7 @@ namespace ams::erpt::srv {
R_TRY(m_report->Open(ReportOpenType_Read));
report_guard.Cancel();
return ResultSuccess();
R_SUCCEED();
}
Result ReportImpl::Read(ams::sf::Out<u32> out_count, const ams::sf::OutBuffer &out_buffer) {
@@ -67,7 +67,7 @@ namespace ams::erpt::srv {
delete m_report;
m_report = nullptr;
}
return ResultSuccess();
R_SUCCEED();
}
Result ReportImpl::GetSize(ams::sf::Out<s64> out) {

View File

@@ -96,7 +96,7 @@ namespace ams::erpt::srv {
*out_total_size = total_size;
*out_size = size;
return ResultSuccess();
R_SUCCEED();
}
void SubmitErrorContext(ContextRecord *record, Result result) {
@@ -238,7 +238,7 @@ namespace ams::erpt::srv {
});
R_UNLESS(found_error_code, erpt::ResultRequiredFieldMissing());
return ResultSuccess();
R_SUCCEED();
}
Result SubmitReportDefaults(const ContextEntry *ctx) {
@@ -270,7 +270,7 @@ namespace ams::erpt::srv {
R_TRY(Context::SubmitContextRecord(std::move(record)));
return ResultSuccess();
R_SUCCEED();
}
void SaveSyslogReportIfRequired(const ContextEntry *ctx, const ReportId &report_id) {
@@ -342,7 +342,7 @@ namespace ams::erpt::srv {
for (u32 i = 0; i < num_attachments; i++) {
R_TRY(JournalForAttachments::SetOwner(attachments[i], report_id));
}
return ResultSuccess();
R_SUCCEED();
}
Result CreateReportFile(const ReportId &report_id, ReportType type, const ReportMetaData *meta, u32 num_attachments, const time::PosixTime &timestamp_user, const time::PosixTime &timestamp_network, bool redirect_new_reports) {
@@ -393,24 +393,24 @@ namespace ams::erpt::srv {
R_TRY(Journal::Commit());
report_guard.Cancel();
return ResultSuccess();
R_SUCCEED();
}
}
Result Reporter::RegisterRunningApplet(ncm::ProgramId program_id) {
g_applet_active_time_info_list.Register(program_id);
return ResultSuccess();
R_SUCCEED();
}
Result Reporter::UnregisterRunningApplet(ncm::ProgramId program_id) {
g_applet_active_time_info_list.Unregister(program_id);
return ResultSuccess();
R_SUCCEED();
}
Result Reporter::UpdateAppletSuspendedDuration(ncm::ProgramId program_id, TimeSpan duration) {
g_applet_active_time_info_list.UpdateSuspendedDuration(program_id, duration);
return ResultSuccess();
R_SUCCEED();
}
Result Reporter::CreateReport(ReportType type, Result ctx_result, const ContextEntry *ctx, const u8 *data, u32 data_size, const ReportMetaData *meta, const AttachmentId *attachments, u32 num_attachments) {
@@ -465,7 +465,7 @@ namespace ams::erpt::srv {
/* Create the report file. */
R_TRY(CreateReportFile(report_id, type, meta, num_attachments, timestamp_user, timestamp_network, s_redirect_new_reports));
return ResultSuccess();
R_SUCCEED();
}
Result Reporter::SubmitReportContexts(const ReportId &report_id, ReportType type, Result ctx_result, std::unique_ptr<ContextRecord> record, const time::PosixTime &timestamp_user, const time::PosixTime &timestamp_network) {
@@ -530,7 +530,7 @@ namespace ams::erpt::srv {
SubmitResourceLimitContexts();
#endif
return ResultSuccess();
R_SUCCEED();
}
}

View File

@@ -47,7 +47,7 @@ namespace ams::erpt::srv {
std::memcpy(s_serial_number, sn, sn_len);
std::memcpy(s_os_version, os, os_len);
std::memcpy(s_private_os_version, os_priv, os_priv_len);
return ResultSuccess();
R_SUCCEED();
}
static Result RegisterRunningApplet(ncm::ProgramId program_id);

View File

@@ -71,7 +71,7 @@ namespace ams::erpt::srv {
case PortIndex_Context:
return AcceptImpl(server, m_context_session_object.GetShared());
default:
return erpt::ResultNotSupported();
R_THROW(erpt::ResultNotSupported());
}
}
public:
@@ -86,7 +86,7 @@ namespace ams::erpt::srv {
os::StartThread(std::addressof(m_thread));
return ResultSuccess();
R_SUCCEED();
}
void Wait() {

View File

@@ -33,7 +33,7 @@ namespace ams::erpt::srv {
/* Return it. */
out.SetValue(intf);
return ResultSuccess();
R_SUCCEED();
}
}

View File

@@ -37,7 +37,7 @@ namespace ams::erpt::srv {
std::scoped_lock lk(s_fs_commit_mutex);
fs::CommitSaveData(ReportStoragePath);
return ResultSuccess();
R_SUCCEED();
}
Result Stream::GetStreamSize(s64 *out, const char *path) {
@@ -109,7 +109,7 @@ namespace ams::erpt::srv {
file_guard.Cancel();
lock_guard.Cancel();
return ResultSuccess();
R_SUCCEED();
}
Result Stream::ReadStream(u32 *out, u8 *dst, u32 dst_size) {
@@ -153,7 +153,7 @@ namespace ams::erpt::srv {
read_count = static_cast<u32>(fs_read_size);
}
return ResultSuccess();
R_SUCCEED();
}
Result Stream::WriteStream(const u8 *src, u32 src_size) {
@@ -180,7 +180,7 @@ namespace ams::erpt::srv {
m_file_position += src_size;
}
return ResultSuccess();
R_SUCCEED();
}
void Stream::CloseStream() {
@@ -217,7 +217,7 @@ namespace ams::erpt::srv {
m_file_position += m_buffer_count;
m_buffer_count = 0;
return ResultSuccess();
R_SUCCEED();
}
}

View File

@@ -42,7 +42,7 @@ namespace ams::fs {
R_TRY(file_bucket.GetSize(std::addressof(file_bucket_size)));
R_TRY(FileEntryMapTable::Format(file_bucket, FileEntryMapTable::QueryBucketCount(file_bucket_size)));
return ResultSuccess();
R_SUCCEED();
}
HierarchicalRomFileTable::HierarchicalRomFileTable() { /* ... */ }
@@ -56,7 +56,7 @@ namespace ams::fs {
R_TRY(file_bucket.GetSize(std::addressof(file_bucket_size)));
R_TRY(m_file_table.Initialize(file_bucket, FileEntryMapTable::QueryBucketCount(file_bucket_size), file_entry));
return ResultSuccess();
R_SUCCEED();
}
void HierarchicalRomFileTable::Finalize() {
@@ -123,7 +123,7 @@ namespace ams::fs {
}
}
return ResultSuccess();
R_SUCCEED();
}
Result HierarchicalRomFileTable::CreateFile(RomFileId *out, const RomPathChar *path, const FileInfo &info) {
@@ -170,7 +170,7 @@ namespace ams::fs {
}
}
return ResultSuccess();
R_SUCCEED();
}
Result HierarchicalRomFileTable::ConvertPathToDirectoryId(RomDirectoryId *out, const RomPathChar *path) {
@@ -186,7 +186,7 @@ namespace ams::fs {
R_TRY(this->GetDirectoryEntry(std::addressof(pos), std::addressof(entry), key));
*out = PositionToDirectoryId(pos);
return ResultSuccess();
R_SUCCEED();
}
Result HierarchicalRomFileTable::ConvertPathToFileId(RomFileId *out, const RomPathChar *path) {
@@ -202,7 +202,7 @@ namespace ams::fs {
R_TRY(this->GetFileEntry(std::addressof(pos), std::addressof(entry), key));
*out = PositionToFileId(pos);
return ResultSuccess();
R_SUCCEED();
}
Result HierarchicalRomFileTable::GetDirectoryInformation(DirectoryInfo *out, const RomPathChar *path) {
@@ -224,7 +224,7 @@ namespace ams::fs {
AMS_UNUSED(out);
return ResultSuccess();
R_SUCCEED();
}
Result HierarchicalRomFileTable::OpenFile(FileInfo *out, const RomPathChar *path) {
@@ -245,7 +245,7 @@ namespace ams::fs {
R_TRY(this->GetFileEntry(std::addressof(entry), id));
*out = entry.info;
return ResultSuccess();
R_SUCCEED();
}
Result HierarchicalRomFileTable::FindOpen(FindPosition *out, const RomPathChar *path) {
@@ -271,7 +271,7 @@ namespace ams::fs {
out->next_dir = entry.dir;
out->next_file = entry.file;
return ResultSuccess();
R_SUCCEED();
}
Result HierarchicalRomFileTable::FindNextDirectory(RomPathChar *out, FindPosition *find, size_t length) {
@@ -291,7 +291,7 @@ namespace ams::fs {
out[aux_size / sizeof(RomPathChar)] = RomStringTraits::NullTerminator;
find->next_dir = entry.next;
return ResultSuccess();
R_SUCCEED();
}
Result HierarchicalRomFileTable::FindNextFile(RomPathChar *out, FindPosition *find, size_t length) {
@@ -311,7 +311,7 @@ namespace ams::fs {
out[aux_size / sizeof(RomPathChar)] = RomStringTraits::NullTerminator;
find->next_file = entry.next;
return ResultSuccess();
R_SUCCEED();
}
Result HierarchicalRomFileTable::QueryRomFileSystemSize(s64 *out_dir_entry_size, s64 *out_file_entry_size) {
@@ -320,7 +320,7 @@ namespace ams::fs {
*out_dir_entry_size = m_dir_table.GetTotalEntrySize();
*out_file_entry_size = m_file_table.GetTotalEntrySize();
return ResultSuccess();
R_SUCCEED();
}
Result HierarchicalRomFileTable::GetGrandParent(Position *out_pos, EntryKey *out_dir_key, RomDirectoryEntry *out_dir_entry, Position pos, RomPathTool::RomEntryName name, const RomPathChar *path) {
@@ -338,7 +338,7 @@ namespace ams::fs {
R_TRY(this->GetDirectoryEntry(out_pos, out_dir_entry, *out_dir_key));
return ResultSuccess();
R_SUCCEED();
}
Result HierarchicalRomFileTable::FindParentDirectoryRecursive(Position *out_pos, EntryKey *out_dir_key, RomDirectoryEntry *out_dir_entry, RomPathTool::PathParser *parser, const RomPathChar *path) {
@@ -382,7 +382,7 @@ namespace ams::fs {
*out_pos = parent_pos;
*out_dir_key = dir_key;
*out_dir_entry = dir_entry;
return ResultSuccess();
R_SUCCEED();
}
Result HierarchicalRomFileTable::FindPathRecursive(EntryKey *out_key, RomDirectoryEntry *out_dir_entry, bool is_dir, const RomPathChar *path) {
@@ -434,7 +434,7 @@ namespace ams::fs {
R_TRY(parser.GetAsFileName(std::addressof(out_key->name)));
}
return ResultSuccess();
R_SUCCEED();
}
Result HierarchicalRomFileTable::FindDirectoryRecursive(EntryKey *out_key, RomDirectoryEntry *out_dir_entry, const RomPathChar *path) {
@@ -475,7 +475,7 @@ namespace ams::fs {
return if_exists;
}
}
return ResultSuccess();
R_SUCCEED();
}
Result HierarchicalRomFileTable::GetDirectoryEntry(Position *out_pos, RomDirectoryEntry *out_entry, const EntryKey &key) {
@@ -551,7 +551,7 @@ namespace ams::fs {
AMS_UNUSED(out);
return ResultSuccess();
R_SUCCEED();
}
Result HierarchicalRomFileTable::OpenFile(FileInfo *out, const EntryKey &key) {
@@ -562,7 +562,7 @@ namespace ams::fs {
R_TRY(this->GetFileEntry(std::addressof(pos), std::addressof(entry), key));
*out = entry.info;
return ResultSuccess();
R_SUCCEED();
}
Result HierarchicalRomFileTable::FindOpen(FindPosition *out, const EntryKey &key) {
@@ -578,7 +578,7 @@ namespace ams::fs {
out->next_dir = entry.dir;
out->next_file = entry.file;
return ResultSuccess();
R_SUCCEED();
}
}

View File

@@ -32,7 +32,7 @@ namespace ams::fs::RomPathTool {
/* ... */
}
return ResultSuccess();
R_SUCCEED();
}
void PathParser::Finalize() {
@@ -97,7 +97,7 @@ namespace ams::fs::RomPathTool {
}
}
return ResultSuccess();
R_SUCCEED();
}
Result PathParser::GetAsDirectoryName(RomEntryName *out) const {
@@ -111,7 +111,7 @@ namespace ams::fs::RomPathTool {
out->length = len;
out->path = m_prev_path_start;
return ResultSuccess();
R_SUCCEED();
}
Result PathParser::GetAsFileName(RomEntryName *out) const {
@@ -125,7 +125,7 @@ namespace ams::fs::RomPathTool {
out->length = len;
out->path = m_prev_path_start;
return ResultSuccess();
R_SUCCEED();
}
Result GetParentDirectoryName(RomEntryName *out, const RomEntryName &cur, const RomPathChar *p) {
@@ -186,7 +186,7 @@ namespace ams::fs::RomPathTool {
out->length = end - start + 1;
}
return ResultSuccess();
R_SUCCEED();
}
}

View File

@@ -62,7 +62,7 @@ namespace ams::fs {
Result FileStorage::GetSize(s64 *out_size) {
R_TRY(this->UpdateSize());
*out_size = m_size;
return ResultSuccess();
R_SUCCEED();
}
Result FileStorage::SetSize(s64 size) {
@@ -100,7 +100,7 @@ namespace ams::fs {
this->SetFile(std::move(base_file));
m_base_file_system = std::move(base_file_system);
return ResultSuccess();
R_SUCCEED();
}
Result FileHandleStorage::UpdateSize() {
@@ -153,7 +153,7 @@ namespace ams::fs {
Result FileHandleStorage::GetSize(s64 *out_size) {
R_TRY(this->UpdateSize());
*out_size = m_size;
return ResultSuccess();
R_SUCCEED();
}
Result FileHandleStorage::SetSize(s64 size) {
@@ -172,7 +172,7 @@ namespace ams::fs {
return QueryRange(static_cast<QueryRangeInfo *>(dst), m_handle, offset, size);
default:
return fs::ResultUnsupportedOperateRangeForFileHandleStorage();
R_THROW(fs::ResultUnsupportedOperateRangeForFileHandleStorage());
}
}

View File

@@ -40,7 +40,7 @@ namespace ams::fs {
AMS_ASSERT(static_cast<size_t>(size) == needed_size - 1);
AMS_UNUSED(size);
return ResultSuccess();
R_SUCCEED();
}
};

View File

@@ -38,7 +38,7 @@ namespace ams::fs {
AMS_ASSERT(static_cast<size_t>(size) == needed_size - 1);
AMS_UNUSED(size);
return ResultSuccess();
R_SUCCEED();
}
};

View File

@@ -39,7 +39,7 @@ namespace ams::fs::impl {
R_UNLESS(storage != nullptr, fs::ResultAllocationMemoryFailedInDataA());
*out = std::move(storage);
return ResultSuccess();
R_SUCCEED();
}
Result MountDataImpl(const char *name, ncm::DataId data_id, ncm::StorageId storage_id, void *cache_buffer, size_t cache_size, bool use_cache, bool use_data_cache, bool use_path_cache) {
@@ -66,7 +66,7 @@ namespace ams::fs::impl {
constexpr size_t MinimumCacheSize = 32;
*out = std::max(size, MinimumCacheSize);
return ResultSuccess();
R_SUCCEED();
}
Result MountData(const char *name, ncm::DataId data_id, ncm::StorageId storage_id) {

View File

@@ -48,7 +48,7 @@ namespace ams::fs {
AMS_ASSERT(static_cast<size_t>(size) == needed_size - 1);
AMS_UNUSED(size);
return ResultSuccess();
R_SUCCEED();
}
};

View File

@@ -48,7 +48,7 @@ namespace ams::fs {
/* Set allocators. */
g_allocate_func = allocator;
g_deallocate_func = deallocator;
return ResultSuccess();
R_SUCCEED();
}
}

View File

@@ -64,7 +64,7 @@ namespace ams::fs {
/* Set output. */
*out = priority_raw;
return ResultSuccess();
R_SUCCEED();
}
Result GetPriorityImpl(fs::Priority *out, os::ThreadType *thread) {
@@ -77,7 +77,7 @@ namespace ams::fs {
/* Set output. */
*out = ConvertPriorityRawToPriority(priority_raw);
return ResultSuccess();
R_SUCCEED();
}
Result SetPriorityRawImpl(os::ThreadType *thread, fs::PriorityRaw priority_raw) {
@@ -91,7 +91,7 @@ namespace ams::fs {
/* Update the priority. */
UpdateTlsIoPriority(thread, tls_io);
return ResultSuccess();
R_SUCCEED();
}
Result SetPriorityImpl(os::ThreadType *thread, fs::Priority priority) {
@@ -105,7 +105,7 @@ namespace ams::fs {
/* Update the priority. */
UpdateTlsIoPriority(thread, tls_io);
return ResultSuccess();
R_SUCCEED();
}
}

View File

@@ -43,7 +43,7 @@ namespace ams::fs {
} R_END_TRY_CATCH;
AMS_ASSERT(false);
return fs::ResultNcaCorrupted();
R_THROW(fs::ResultNcaCorrupted());
}
Result ConvertIntegrityVerificationStorageCorruptedResult(Result res) {
@@ -60,7 +60,7 @@ namespace ams::fs {
} R_END_TRY_CATCH;
AMS_ASSERT(false);
return fs::ResultIntegrityVerificationStorageCorrupted();
R_THROW(fs::ResultIntegrityVerificationStorageCorrupted());
}
Result ConvertBuiltInStorageCorruptedResult(Result res) {
@@ -72,7 +72,7 @@ namespace ams::fs {
} R_END_TRY_CATCH;
AMS_ASSERT(false);
return fs::ResultBuiltInStorageCorrupted();
R_THROW(fs::ResultBuiltInStorageCorrupted());
}
Result ConvertPartitionFileSystemCorruptedResult(Result res) {
@@ -89,7 +89,7 @@ namespace ams::fs {
} R_END_TRY_CATCH;
AMS_ASSERT(false);
return fs::ResultPartitionFileSystemCorrupted();
R_THROW(fs::ResultPartitionFileSystemCorrupted());
}
Result ConvertFatFileSystemCorruptedResult(Result res) {
@@ -110,7 +110,7 @@ namespace ams::fs {
} R_END_TRY_CATCH;
AMS_ASSERT(false);
return fs::ResultHostFileSystemCorrupted();
R_THROW(fs::ResultHostFileSystemCorrupted());
}
Result ConvertDatabaseCorruptedResult(Result res) {
@@ -123,7 +123,7 @@ namespace ams::fs {
} R_END_TRY_CATCH;
AMS_ASSERT(false);
return fs::ResultDatabaseCorrupted();
R_THROW(fs::ResultDatabaseCorrupted());
}
Result ConvertRomFsResult(Result res) {
@@ -141,7 +141,7 @@ namespace ams::fs {
R_CONVERT(fs::ResultIncompatiblePath, fs::ResultPathNotFound())
} R_END_TRY_CATCH;
return ResultSuccess();
R_SUCCEED();
}
Result ReadFile(IStorage *storage, s64 offset, void *buffer, size_t size) {
@@ -181,7 +181,7 @@ namespace ams::fs {
AMS_ASSERT(buf != nullptr || size == 0);
AMS_UNUSED(buf);
return ResultSuccess();
R_SUCCEED();
}
Result ConvertResult(Result res) const {
@@ -207,26 +207,26 @@ namespace ams::fs {
R_TRY(this->ConvertResult(this->GetStorage()->Read(offset + m_start, buffer, size)));
*out = read_size;
return ResultSuccess();
R_SUCCEED();
}
virtual Result DoGetSize(s64 *out) override {
*out = this->GetSize();
return ResultSuccess();
R_SUCCEED();
}
virtual Result DoFlush() override {
return ResultSuccess();
R_SUCCEED();
}
virtual Result DoWrite(s64 offset, const void *buffer, size_t size, const fs::WriteOption &option) override {
AMS_UNUSED(offset, buffer, size, option);
return fs::ResultUnsupportedWriteForRomFsFile();
R_THROW(fs::ResultUnsupportedWriteForRomFsFile());
}
virtual Result DoSetSize(s64 size) override {
AMS_UNUSED(size);
return fs::ResultUnsupportedWriteForRomFsFile();
R_THROW(fs::ResultUnsupportedWriteForRomFsFile());
}
virtual Result DoOperateRange(void *dst, size_t dst_size, fs::OperationId op_id, s64 offset, s64 size, const void *src, size_t src_size) override {
@@ -245,7 +245,7 @@ namespace ams::fs {
return this->GetStorage()->OperateRange(dst, dst_size, op_id, m_start + offset, operate_size, src, src_size);
}
default:
return fs::ResultUnsupportedOperateRangeForRomFsFile();
R_THROW(fs::ResultUnsupportedOperateRangeForRomFsFile());
}
}
public:
@@ -330,7 +330,7 @@ namespace ams::fs {
}
*out_count = i;
return ResultSuccess();
R_SUCCEED();
}
public:
virtual sf::cmif::DomainObjectId GetDomainObjectId() const override {
@@ -354,7 +354,7 @@ namespace ams::fs {
R_TRY(ReadFileHeader(storage, std::addressof(header)));
*out = CalculateRequiredWorkingMemorySize(header);
return ResultSuccess();
R_SUCCEED();
}
Result RomFsFileSystem::Initialize(IStorage *base, void *work, size_t work_size, bool use_cache) {
@@ -411,7 +411,7 @@ namespace ams::fs {
/* Set members. */
m_entry_size = header.body_offset;
m_base_storage = base;
return ResultSuccess();
R_SUCCEED();
}
Result RomFsFileSystem::Initialize(std::unique_ptr<IStorage>&& base, void *work, size_t work_size, bool use_cache) {
@@ -424,7 +424,7 @@ namespace ams::fs {
R_CONVERT(fs::ResultDbmNotFound, fs::ResultPathNotFound());
R_CONVERT(fs::ResultDbmInvalidOperation, fs::ResultPathNotFound());
} R_END_TRY_CATCH;
return ResultSuccess();
R_SUCCEED();
}
IStorage *RomFsFileSystem::GetBaseStorage() {
@@ -442,42 +442,42 @@ namespace ams::fs {
RomFileTable::FileInfo info;
R_TRY(this->GetFileInfo(std::addressof(info), path));
*out = m_entry_size + info.offset.Get();
return ResultSuccess();
R_SUCCEED();
}
Result RomFsFileSystem::DoCreateFile(const fs::Path &path, s64 size, int flags) {
AMS_UNUSED(path, size, flags);
return fs::ResultUnsupportedWriteForRomFsFileSystem();
R_THROW(fs::ResultUnsupportedWriteForRomFsFileSystem());
}
Result RomFsFileSystem::DoDeleteFile(const fs::Path &path) {
AMS_UNUSED(path);
return fs::ResultUnsupportedWriteForRomFsFileSystem();
R_THROW(fs::ResultUnsupportedWriteForRomFsFileSystem());
}
Result RomFsFileSystem::DoCreateDirectory(const fs::Path &path) {
AMS_UNUSED(path);
return fs::ResultUnsupportedWriteForRomFsFileSystem();
R_THROW(fs::ResultUnsupportedWriteForRomFsFileSystem());
}
Result RomFsFileSystem::DoDeleteDirectory(const fs::Path &path) {
AMS_UNUSED(path);
return fs::ResultUnsupportedWriteForRomFsFileSystem();
R_THROW(fs::ResultUnsupportedWriteForRomFsFileSystem());
}
Result RomFsFileSystem::DoDeleteDirectoryRecursively(const fs::Path &path) {
AMS_UNUSED(path);
return fs::ResultUnsupportedWriteForRomFsFileSystem();
R_THROW(fs::ResultUnsupportedWriteForRomFsFileSystem());
}
Result RomFsFileSystem::DoRenameFile(const fs::Path &old_path, const fs::Path &new_path) {
AMS_UNUSED(old_path, new_path);
return fs::ResultUnsupportedWriteForRomFsFileSystem();
R_THROW(fs::ResultUnsupportedWriteForRomFsFileSystem());
}
Result RomFsFileSystem::DoRenameDirectory(const fs::Path &old_path, const fs::Path &new_path) {
AMS_UNUSED(old_path, new_path);
return fs::ResultUnsupportedWriteForRomFsFileSystem();
R_THROW(fs::ResultUnsupportedWriteForRomFsFileSystem());
}
Result RomFsFileSystem::DoGetEntryType(fs::DirectoryEntryType *out, const fs::Path &path) {
@@ -488,12 +488,12 @@ namespace ams::fs {
RomFileTable::FileInfo file_info;
R_TRY(this->GetFileInfo(std::addressof(file_info), path.GetString()));
*out = fs::DirectoryEntryType_File;
return ResultSuccess();
R_SUCCEED();
}
} R_END_TRY_CATCH;
*out = fs::DirectoryEntryType_Directory;
return ResultSuccess();
R_SUCCEED();
}
Result RomFsFileSystem::DoOpenFile(std::unique_ptr<fs::fsa::IFile> *out_file, const fs::Path &path, fs::OpenMode mode) {
@@ -508,7 +508,7 @@ namespace ams::fs {
R_UNLESS(file != nullptr, fs::ResultAllocationMemoryFailedInRomFsFileSystemB());
*out_file = std::move(file);
return ResultSuccess();
R_SUCCEED();
}
Result RomFsFileSystem::DoOpenDirectory(std::unique_ptr<fs::fsa::IDirectory> *out_dir, const fs::Path &path, fs::OpenDirectoryMode mode) {
@@ -524,36 +524,36 @@ namespace ams::fs {
R_UNLESS(dir != nullptr, fs::ResultAllocationMemoryFailedInRomFsFileSystemC());
*out_dir = std::move(dir);
return ResultSuccess();
R_SUCCEED();
}
Result RomFsFileSystem::DoCommit() {
return ResultSuccess();
R_SUCCEED();
}
Result RomFsFileSystem::DoGetFreeSpaceSize(s64 *out, const fs::Path &path) {
AMS_UNUSED(path);
*out = 0;
return ResultSuccess();
R_SUCCEED();
}
Result RomFsFileSystem::DoGetTotalSpaceSize(s64 *out, const fs::Path &path) {
AMS_UNUSED(out, path);
return fs::ResultUnsupportedGetTotalSpaceSizeForRomFsFileSystem();
R_THROW(fs::ResultUnsupportedGetTotalSpaceSizeForRomFsFileSystem());
}
Result RomFsFileSystem::DoCleanDirectoryRecursively(const fs::Path &path) {
AMS_UNUSED(path);
return fs::ResultUnsupportedWriteForRomFsFileSystem();
R_THROW(fs::ResultUnsupportedWriteForRomFsFileSystem());
}
Result RomFsFileSystem::DoCommitProvisionally(s64 counter) {
AMS_UNUSED(counter);
return fs::ResultUnsupportedCommitProvisionallyForRomFsFileSystem();
R_THROW(fs::ResultUnsupportedCommitProvisionallyForRomFsFileSystem());
}
Result RomFsFileSystem::DoRollback() {
return ResultSuccess();
R_SUCCEED();
}
}

View File

@@ -124,7 +124,7 @@ namespace ams::fs {
R_TRY(impl::ReadSaveDataFileSystemExtraData(std::addressof(extra_data), id));
*out = extra_data.flags;
return ResultSuccess();
R_SUCCEED();
}
Result GetSaveDataFlags(u32 *out, SaveDataSpaceId space_id, SaveDataId id) {
@@ -132,7 +132,7 @@ namespace ams::fs {
R_TRY(impl::ReadSaveDataFileSystemExtraData(std::addressof(extra_data), space_id, id));
*out = extra_data.flags;
return ResultSuccess();
R_SUCCEED();
}
Result SetSaveDataFlags(SaveDataId id, SaveDataSpaceId space_id, u32 flags) {
@@ -147,7 +147,7 @@ namespace ams::fs {
R_TRY(impl::ReadSaveDataFileSystemExtraData(std::addressof(extra_data), id));
*out = extra_data.available_size;
return ResultSuccess();
R_SUCCEED();
}
Result GetSaveDataJournalSize(s64 *out, SaveDataId id) {
@@ -155,7 +155,7 @@ namespace ams::fs {
R_TRY(impl::ReadSaveDataFileSystemExtraData(std::addressof(extra_data), id));
*out = extra_data.journal_size;
return ResultSuccess();
R_SUCCEED();
}
Result ExtendSaveData(SaveDataSpaceId space_id, SaveDataId id, s64 available_size, s64 journal_size) {

View File

@@ -41,7 +41,7 @@ namespace ams::fs {
AMS_ASSERT(static_cast<size_t>(size) == needed_size - 1);
AMS_UNUSED(size);
return ResultSuccess();
R_SUCCEED();
}
};
@@ -107,7 +107,7 @@ namespace ams::fs {
AMS_FS_R_UNLESS(adapter != nullptr, fs::ResultAllocationMemoryFailedInSdCardB());
*out = std::move(adapter);
return ResultSuccess();
R_SUCCEED();
}
bool IsSdCardInserted() {

View File

@@ -82,7 +82,7 @@ namespace ams::fs::impl {
setter.Set(option.HasFlushFlag() ? WriteState::None : WriteState::NeedsFlush);
return ResultSuccess();
R_SUCCEED();
}
Result FileAccessor::Flush() {
@@ -93,7 +93,7 @@ namespace ams::fs::impl {
R_TRY(this->UpdateLastResult(m_impl->Flush()));
setter.Set(WriteState::None);
return ResultSuccess();
R_SUCCEED();
}
Result FileAccessor::SetSize(s64 size) {
@@ -110,7 +110,7 @@ namespace ams::fs::impl {
}
setter.Set(old_write_state);
return ResultSuccess();
R_SUCCEED();
}
Result FileAccessor::GetSize(s64 *out) {

View File

@@ -41,7 +41,7 @@ namespace ams::fs::impl {
R_UNLESS(this->CanAcceptMountName(fs->GetName()), fs::ResultMountNameAlreadyExists());
m_fs_list.push_back(*fs.release());
return ResultSuccess();
R_SUCCEED();
}
Result MountTable::Find(FileSystemAccessor **out, const char *name) {
@@ -50,11 +50,11 @@ namespace ams::fs::impl {
for (auto &fs : m_fs_list) {
if (MatchesName(fs, name)) {
*out = std::addressof(fs);
return ResultSuccess();
R_SUCCEED();
}
}
return fs::ResultNotMounted();
R_THROW(fs::ResultNotMounted());
}
void MountTable::Unmount(const char *name) {

View File

@@ -106,13 +106,13 @@ namespace ams::fs::impl {
Result CheckMountName(const char *name) {
R_TRY(CheckMountNameAllowingReserved(name));
R_UNLESS(!impl::IsReservedMountName(name), fs::ResultInvalidMountName());
return ResultSuccess();
R_SUCCEED();
}
Result CheckMountNameAllowingReserved(const char *name) {
R_UNLESS(name != nullptr, fs::ResultInvalidMountName());
R_UNLESS(impl::IsValidMountName(name), fs::ResultInvalidMountName());
return ResultSuccess();
R_SUCCEED();
}
Result FindFileSystem(FileSystemAccessor **out_accessor, const char **out_sub_path, const char *path) {
@@ -137,7 +137,7 @@ namespace ams::fs::impl {
}
impl::Unregister(name);
return ResultSuccess();
R_SUCCEED();
}
}
@@ -162,7 +162,7 @@ namespace ams::fs {
const auto common_path_len = util::SNPrintf(dst + mount_name_len, dst_size - mount_name_len, "%s", sub_path);
AMS_FS_R_UNLESS(static_cast<size_t>(common_path_len) < dst_size - mount_name_len, fs::ResultTooLongPath());
return ResultSuccess();
R_SUCCEED();
}
void Unmount(const char *mount_name) {

View File

@@ -29,12 +29,12 @@ namespace ams::fs {
Result ReadDirectory(s64 *out_count, DirectoryEntry *out_entries, DirectoryHandle handle, s64 max_entries) {
AMS_FS_R_TRY(AMS_FS_IMPL_ACCESS_LOG(Get(handle)->Read(out_count, out_entries, max_entries), handle, AMS_FS_IMPL_ACCESS_LOG_FORMAT_READ_DIRECTORY(out_count, max_entries)));
return ResultSuccess();
R_SUCCEED();
}
Result GetDirectoryEntryCount(s64 *out, DirectoryHandle handle) {
AMS_FS_R_TRY(AMS_FS_IMPL_ACCESS_LOG(Get(handle)->GetEntryCount(out), handle, AMS_FS_IMPL_ACCESS_LOG_FORMAT_GET_DIRECTORY_ENTRY_COUNT(out)));
return ResultSuccess();
R_SUCCEED();
}
void CloseDirectory(DirectoryHandle handle) {

View File

@@ -27,7 +27,7 @@ namespace ams::fs {
Result ReadFileImpl(size_t *out, FileHandle handle, s64 offset, void *buffer, size_t size, const fs::ReadOption &option) {
R_TRY(Get(handle)->Read(out, offset, buffer, size, option));
return ResultSuccess();
R_SUCCEED();
}
}
@@ -36,44 +36,44 @@ namespace ams::fs {
size_t read_size;
AMS_FS_R_TRY(ReadFileImpl(std::addressof(read_size), handle, offset, buffer, size, option));
AMS_FS_R_UNLESS(read_size == size, fs::ResultOutOfRange());
return ResultSuccess();
R_SUCCEED();
}
Result ReadFile(FileHandle handle, s64 offset, void *buffer, size_t size) {
size_t read_size;
AMS_FS_R_TRY(ReadFileImpl(std::addressof(read_size), handle, offset, buffer, size, ReadOption()));
AMS_FS_R_UNLESS(read_size == size, fs::ResultOutOfRange());
return ResultSuccess();
R_SUCCEED();
}
Result ReadFile(size_t *out, FileHandle handle, s64 offset, void *buffer, size_t size, const fs::ReadOption &option) {
AMS_FS_R_TRY(ReadFileImpl(out, handle, offset, buffer, size, option));
return ResultSuccess();
R_SUCCEED();
}
Result ReadFile(size_t *out, FileHandle handle, s64 offset, void *buffer, size_t size) {
AMS_FS_R_TRY(ReadFileImpl(out, handle, offset, buffer, size, ReadOption()));
return ResultSuccess();
R_SUCCEED();
}
Result GetFileSize(s64 *out, FileHandle handle) {
AMS_FS_R_TRY(AMS_FS_IMPL_ACCESS_LOG(Get(handle)->GetSize(out), handle, AMS_FS_IMPL_ACCESS_LOG_FORMAT_GET_FILE_SIZE(out)));
return ResultSuccess();
R_SUCCEED();
}
Result FlushFile(FileHandle handle) {
AMS_FS_R_TRY(AMS_FS_IMPL_ACCESS_LOG(Get(handle)->Flush(), handle, AMS_FS_IMPL_ACCESS_LOG_FORMAT_NONE));
return ResultSuccess();
R_SUCCEED();
}
Result WriteFile(FileHandle handle, s64 offset, const void *buffer, size_t size, const fs::WriteOption &option) {
AMS_FS_R_TRY(AMS_FS_IMPL_ACCESS_LOG(Get(handle)->Write(offset, buffer, size, option), handle, AMS_FS_IMPL_ACCESS_LOG_FORMAT_WRITE_FILE(option), offset, size));
return ResultSuccess();
R_SUCCEED();
}
Result SetFileSize(FileHandle handle, s64 size) {
AMS_FS_R_TRY(AMS_FS_IMPL_ACCESS_LOG(Get(handle)->SetSize(size), handle, AMS_FS_IMPL_ACCESS_LOG_FORMAT_SIZE, size));
return ResultSuccess();
R_SUCCEED();
}
int GetFileOpenMode(FileHandle handle) {
@@ -88,7 +88,7 @@ namespace ams::fs {
Result QueryRange(QueryRangeInfo *out, FileHandle handle, s64 offset, s64 size) {
AMS_FS_R_TRY(Get(handle)->OperateRange(out, sizeof(*out), OperationId::QueryRange, offset, size, nullptr, 0));
return ResultSuccess();
R_SUCCEED();
}
}

View File

@@ -32,7 +32,7 @@ namespace ams::fs {
AMS_FS_R_TRY(AMS_FS_IMPL_ACCESS_LOG_UNLESS_R_SUCCEEDED(impl::FindFileSystem(std::addressof(accessor), std::addressof(sub_path), path), AMS_FS_IMPL_ACCESS_LOG_FORMAT_PATH, path));
AMS_FS_R_TRY(AMS_FS_IMPL_ACCESS_LOG_FILESYSTEM(accessor->CreateFile(sub_path, size, option), nullptr, accessor, AMS_FS_IMPL_ACCESS_LOG_FORMAT_PATH_AND_SIZE, path, size));
return ResultSuccess();
R_SUCCEED();
}
Result DeleteFile(const char *path) {
@@ -41,7 +41,7 @@ namespace ams::fs {
AMS_FS_R_TRY(AMS_FS_IMPL_ACCESS_LOG_UNLESS_R_SUCCEEDED(impl::FindFileSystem(std::addressof(accessor), std::addressof(sub_path), path), AMS_FS_IMPL_ACCESS_LOG_FORMAT_PATH, path));
AMS_FS_R_TRY(AMS_FS_IMPL_ACCESS_LOG_FILESYSTEM(accessor->DeleteFile(sub_path), nullptr, accessor, AMS_FS_IMPL_ACCESS_LOG_FORMAT_PATH, path));
return ResultSuccess();
R_SUCCEED();
}
Result CreateDirectory(const char *path) {
@@ -50,7 +50,7 @@ namespace ams::fs {
AMS_FS_R_TRY(AMS_FS_IMPL_ACCESS_LOG_UNLESS_R_SUCCEEDED(impl::FindFileSystem(std::addressof(accessor), std::addressof(sub_path), path), AMS_FS_IMPL_ACCESS_LOG_FORMAT_PATH, path));
AMS_FS_R_TRY(AMS_FS_IMPL_ACCESS_LOG_FILESYSTEM(accessor->CreateDirectory(sub_path), nullptr, accessor, AMS_FS_IMPL_ACCESS_LOG_FORMAT_PATH, path));
return ResultSuccess();
R_SUCCEED();
}
Result DeleteDirectory(const char *path) {
@@ -59,7 +59,7 @@ namespace ams::fs {
AMS_FS_R_TRY(AMS_FS_IMPL_ACCESS_LOG_UNLESS_R_SUCCEEDED(impl::FindFileSystem(std::addressof(accessor), std::addressof(sub_path), path), AMS_FS_IMPL_ACCESS_LOG_FORMAT_PATH, path));
AMS_FS_R_TRY(AMS_FS_IMPL_ACCESS_LOG_FILESYSTEM(accessor->DeleteDirectory(sub_path), nullptr, accessor, AMS_FS_IMPL_ACCESS_LOG_FORMAT_PATH, path));
return ResultSuccess();
R_SUCCEED();
}
Result DeleteDirectoryRecursively(const char *path) {
@@ -68,7 +68,7 @@ namespace ams::fs {
AMS_FS_R_TRY(AMS_FS_IMPL_ACCESS_LOG_UNLESS_R_SUCCEEDED(impl::FindFileSystem(std::addressof(accessor), std::addressof(sub_path), path), AMS_FS_IMPL_ACCESS_LOG_FORMAT_PATH, path));
AMS_FS_R_TRY(AMS_FS_IMPL_ACCESS_LOG_FILESYSTEM(accessor->DeleteDirectoryRecursively(sub_path), nullptr, accessor, AMS_FS_IMPL_ACCESS_LOG_FORMAT_PATH, path));
return ResultSuccess();
R_SUCCEED();
}
Result RenameFile(const char *old_path, const char *new_path) {
@@ -82,11 +82,11 @@ namespace ams::fs {
auto rename_impl = [=]() -> Result {
R_UNLESS(old_accessor == new_accessor, fs::ResultRenameToOtherFileSystem());
R_TRY(old_accessor->RenameFile(old_sub_path, new_sub_path));
return ResultSuccess();
R_SUCCEED();
};
AMS_FS_R_TRY(AMS_FS_IMPL_ACCESS_LOG_FILESYSTEM(rename_impl(), nullptr, old_accessor, AMS_FS_IMPL_ACCESS_LOG_FORMAT_RENAME, old_path, new_path));
return ResultSuccess();
R_SUCCEED();
}
Result RenameDirectory(const char *old_path, const char *new_path) {
@@ -100,11 +100,11 @@ namespace ams::fs {
auto rename_impl = [=]() -> Result {
R_UNLESS(old_accessor == new_accessor, fs::ResultRenameToOtherFileSystem());
R_TRY(old_accessor->RenameDirectory(old_sub_path, new_sub_path));
return ResultSuccess();
R_SUCCEED();
};
AMS_FS_R_TRY(AMS_FS_IMPL_ACCESS_LOG_FILESYSTEM(rename_impl(), nullptr, old_accessor, AMS_FS_IMPL_ACCESS_LOG_FORMAT_RENAME, old_path, new_path));
return ResultSuccess();
R_SUCCEED();
}
Result GetEntryType(DirectoryEntryType *out, const char *path) {
@@ -113,7 +113,7 @@ namespace ams::fs {
AMS_FS_R_TRY(AMS_FS_IMPL_ACCESS_LOG_UNLESS_R_SUCCEEDED(impl::FindFileSystem(std::addressof(accessor), std::addressof(sub_path), path), AMS_FS_IMPL_ACCESS_LOG_FORMAT_PATH, path));
AMS_FS_R_TRY(AMS_FS_IMPL_ACCESS_LOG_FILESYSTEM(accessor->GetEntryType(out, sub_path), nullptr, accessor, AMS_FS_IMPL_ACCESS_LOG_FORMAT_GET_ENTRY_TYPE(out, path)));
return ResultSuccess();
R_SUCCEED();
}
Result OpenFile(FileHandle *out_file, const char *path, int mode) {
@@ -126,13 +126,13 @@ namespace ams::fs {
auto open_impl = [&]() -> Result {
R_UNLESS(out_file != nullptr, fs::ResultNullptrArgument());
R_TRY(accessor->OpenFile(std::addressof(file_accessor), sub_path, static_cast<OpenMode>(mode)));
return ResultSuccess();
R_SUCCEED();
};
AMS_FS_R_TRY(AMS_FS_IMPL_ACCESS_LOG_FILESYSTEM(open_impl(), nullptr, accessor, AMS_FS_IMPL_ACCESS_LOG_FORMAT_PATH_AND_OPEN_MODE, path, static_cast<u32>(mode)));
out_file->handle = file_accessor.release();
return ResultSuccess();
R_SUCCEED();
}
Result OpenDirectory(DirectoryHandle *out_dir, const char *path, int mode) {
@@ -145,13 +145,13 @@ namespace ams::fs {
auto open_impl = [&]() -> Result {
R_UNLESS(out_dir != nullptr, fs::ResultNullptrArgument());
R_TRY(accessor->OpenDirectory(std::addressof(dir_accessor), sub_path, static_cast<OpenDirectoryMode>(mode)));
return ResultSuccess();
R_SUCCEED();
};
AMS_FS_R_TRY(AMS_FS_IMPL_ACCESS_LOG_FILESYSTEM(open_impl(), nullptr, accessor, AMS_FS_IMPL_ACCESS_LOG_FORMAT_PATH_AND_OPEN_MODE, path, static_cast<u32>(mode)));
out_dir->handle = dir_accessor.release();
return ResultSuccess();
R_SUCCEED();
}
Result CleanDirectoryRecursively(const char *path) {
@@ -160,7 +160,7 @@ namespace ams::fs {
AMS_FS_R_TRY(AMS_FS_IMPL_ACCESS_LOG_UNLESS_R_SUCCEEDED(impl::FindFileSystem(std::addressof(accessor), std::addressof(sub_path), path), AMS_FS_IMPL_ACCESS_LOG_FORMAT_PATH, path));
AMS_FS_R_TRY(AMS_FS_IMPL_ACCESS_LOG_FILESYSTEM(accessor->CleanDirectoryRecursively(sub_path), nullptr, accessor, AMS_FS_IMPL_ACCESS_LOG_FORMAT_PATH, path));
return ResultSuccess();
R_SUCCEED();
}
Result GetFreeSpaceSize(s64 *out, const char *path) {

View File

@@ -31,7 +31,7 @@ namespace ams::fs {
R_TRY(accessor->GetFileTimeStampRaw(out, sub_path));
return ResultSuccess();
R_SUCCEED();
}
}

View File

@@ -34,7 +34,7 @@ namespace ams::fs::impl {
os::AttachReadableHandleToSystemEvent(out, handle.GetOsHandle(), handle.IsManaged(), clear_mode);
handle.Detach();
return ResultSuccess();
R_SUCCEED();
}
};

View File

@@ -27,7 +27,7 @@ namespace ams::fssrv::fscreator {
/* Set the output. */
*out = std::move(fs);
return ResultSuccess();
R_SUCCEED();
}
}

View File

@@ -64,7 +64,7 @@ namespace ams::fssrv::fscreator {
/* Set the output. */
*out = std::move(fs);
return ResultSuccess();
R_SUCCEED();
}
}

View File

@@ -29,7 +29,7 @@ namespace ams::fssrv::fscreator {
/* Set the out storage. */
*out = std::move(storage);
*out_splitter = std::move(splitter);
return ResultSuccess();
R_SUCCEED();
}
Result StorageOnNcaCreator::CreateWithPatch(std::shared_ptr<fs::IStorage> *out, std::shared_ptr<fssystem::IAsynchronousAccessSplitter> *out_splitter, fssystem::NcaFsHeaderReader *out_header_reader, std::shared_ptr<fssystem::NcaReader> original_nca_reader, std::shared_ptr<fssystem::NcaReader> current_nca_reader, s32 index) {
@@ -44,7 +44,7 @@ namespace ams::fssrv::fscreator {
/* Set the out storage. */
*out = std::move(storage);
*out_splitter = std::move(splitter);
return ResultSuccess();
R_SUCCEED();
}
Result StorageOnNcaCreator::CreateNcaReader(std::shared_ptr<fssystem::NcaReader> *out, std::shared_ptr<fs::IStorage> storage) {
@@ -57,7 +57,7 @@ namespace ams::fssrv::fscreator {
/* Set the output. */
*out = std::move(reader);
return ResultSuccess();
R_SUCCEED();
}
#if !defined(ATMOSPHERE_BOARD_NINTENDO_NX)
@@ -73,7 +73,7 @@ namespace ams::fssrv::fscreator {
/* Set the out storage. */
*out = std::move(storage);
*out_splitter = std::move(splitter);
return ResultSuccess();
R_SUCCEED();
}
Result StorageOnNcaCreator::CreateWithPatchWithContext(std::shared_ptr<fs::IStorage> *out, std::shared_ptr<fssystem::IAsynchronousAccessSplitter> *out_splitter, fssystem::NcaFsHeaderReader *out_header_reader, void *ctx, std::shared_ptr<fssystem::NcaReader> original_nca_reader, std::shared_ptr<fssystem::NcaReader> current_nca_reader, s32 index) {
@@ -88,7 +88,7 @@ namespace ams::fssrv::fscreator {
/* Set the out storage. */
*out = std::move(storage);
*out_splitter = std::move(splitter);
return ResultSuccess();
R_SUCCEED();
}
Result StorageOnNcaCreator::CreateByRawStorage(std::shared_ptr<fs::IStorage> *out, std::shared_ptr<fssystem::IAsynchronousAccessSplitter> *out_splitter, const fssystem::NcaFsHeaderReader *header_reader, std::shared_ptr<fs::IStorage> raw_storage, void *ctx, std::shared_ptr<fssystem::NcaReader> nca_reader) {

View File

@@ -66,7 +66,7 @@ namespace ams::fssrv {
R_TRY(this->AcceptImpl(server, impl::GetInvalidProgramRegistryServiceObject()));
}
return ResultSuccess();
R_SUCCEED();
}
break;
case PortIndex_FileSystemProxyForLoader:
@@ -81,7 +81,7 @@ namespace ams::fssrv {
R_TRY(this->AcceptImpl(server, impl::GetInvalidFileSystemProxyForLoaderServiceObject()));
}
return ResultSuccess();
R_SUCCEED();
}
break;
AMS_UNREACHABLE_DEFAULT_CASE();

View File

@@ -71,7 +71,7 @@ namespace ams::fssrv {
/* Set our process id. */
m_process_id = client_pid.GetValue().value;
return ResultSuccess();
R_SUCCEED();
}
Result ProgramRegistryImpl::SetEnabledProgramVerification(bool en) {

View File

@@ -44,7 +44,7 @@ namespace ams::fssrv::impl {
/* Add the node to the registry. */
m_program_info_list.push_back(*new_node.release());
return ResultSuccess();
R_SUCCEED();
}
Result ProgramRegistryManager::UnregisterProgram(u64 process_id) {
@@ -56,12 +56,12 @@ namespace ams::fssrv::impl {
if (node.program_info->Contains(process_id)) {
m_program_info_list.erase(m_program_info_list.iterator_to(node));
delete std::addressof(node);
return ResultSuccess();
R_SUCCEED();
}
}
/* We couldn't find/unregister the process's node. */
return fs::ResultInvalidArgument();
R_THROW(fs::ResultInvalidArgument());
}
Result ProgramRegistryManager::GetProgramInfo(std::shared_ptr<ProgramInfo> *out, u64 process_id) {
@@ -71,19 +71,19 @@ namespace ams::fssrv::impl {
/* Check if we're getting permissions for an initial program. */
if (IsInitialProgram(process_id)) {
*out = ProgramInfo::GetProgramInfoForInitialProcess();
return ResultSuccess();
R_SUCCEED();
}
/* Find a matching node. */
for (const auto &node : m_program_info_list) {
if (node.program_info->Contains(process_id)) {
*out = node.program_info;
return ResultSuccess();
R_SUCCEED();
}
}
/* We didn't find the program info. */
return fs::ResultProgramInfoNotFound();
R_THROW(fs::ResultProgramInfoNotFound());
}
Result ProgramRegistryManager::GetProgramInfoByProgramId(std::shared_ptr<ProgramInfo> *out, u64 program_id) {
@@ -94,12 +94,12 @@ namespace ams::fssrv::impl {
for (const auto &node : m_program_info_list) {
if (node.program_info->GetProgramIdValue() == program_id) {
*out = node.program_info;
return ResultSuccess();
R_SUCCEED();
}
}
/* We didn't find the program info. */
return fs::ResultProgramInfoNotFound();
R_THROW(fs::ResultProgramInfoNotFound());
}
}

View File

@@ -176,7 +176,7 @@ namespace ams::fssystem {
} while (m_block_size <= remaining);
}
return ResultSuccess();
R_SUCCEED();
}
void FileSystemBuddyHeap::Finalize() {

View File

@@ -40,7 +40,7 @@ namespace ams::fssystem {
m_cache_count_min = max_cache_count / 16;
m_cache_size_min = m_cache_count_min * 0x100;
return ResultSuccess();
R_SUCCEED();
}
void FileSystemBufferManager::CacheHandleTable::Finalize() {

View File

@@ -49,14 +49,14 @@ namespace ams::fssystem {
std::unique_ptr<IDecryptor> decryptor = std::make_unique<ExternalDecryptor>(func, key_index, key_generation);
R_UNLESS(decryptor != nullptr, fs::ResultAllocationMemoryFailedInAesCtrCounterExtendedStorageA());
*out = std::move(decryptor);
return ResultSuccess();
R_SUCCEED();
}
Result AesCtrCounterExtendedStorage::CreateSoftwareDecryptor(std::unique_ptr<IDecryptor> *out) {
std::unique_ptr<IDecryptor> decryptor = std::make_unique<SoftwareDecryptor>();
R_UNLESS(decryptor != nullptr, fs::ResultAllocationMemoryFailedInAesCtrCounterExtendedStorageA());
*out = std::move(decryptor);
return ResultSuccess();
R_SUCCEED();
}
Result AesCtrCounterExtendedStorage::Initialize(IAllocator *allocator, const void *key, size_t key_size, u32 secure_value, fs::SubStorage data_storage, fs::SubStorage table_storage) {
@@ -96,7 +96,7 @@ namespace ams::fssystem {
m_counter_offset = counter_offset;
m_decryptor = std::move(decryptor);
return ResultSuccess();
R_SUCCEED();
}
void AesCtrCounterExtendedStorage::Finalize() {
@@ -189,7 +189,7 @@ namespace ams::fssystem {
cur_offset += cur_size;
}
return ResultSuccess();
R_SUCCEED();
}
Result AesCtrCounterExtendedStorage::OperateRange(void *dst, size_t dst_size, fs::OperationId op_id, s64 offset, s64 size, const void *src, size_t src_size) {
@@ -205,7 +205,7 @@ namespace ams::fssystem {
/* Operate on our data storage. */
R_TRY(m_data_storage.OperateRange(fs::OperationId::Invalidate, 0, std::numeric_limits<s64>::max()));
return ResultSuccess();
R_SUCCEED();
}
case fs::OperationId::QueryRange:
{
@@ -220,7 +220,7 @@ namespace ams::fssystem {
/* Succeed if there's nothing to operate on. */
if (size == 0) {
reinterpret_cast<fs::QueryRangeInfo *>(dst)->Clear();
return ResultSuccess();
R_SUCCEED();
}
/* Validate arguments. */
@@ -243,10 +243,10 @@ namespace ams::fssystem {
/* Merge in the new info. */
reinterpret_cast<fs::QueryRangeInfo *>(dst)->Merge(new_info);
return ResultSuccess();
R_SUCCEED();
}
default:
return fs::ResultUnsupportedOperateRangeForAesCtrCounterExtendedStorage();
R_THROW(fs::ResultUnsupportedOperateRangeForAesCtrCounterExtendedStorage());
}
}

View File

@@ -70,7 +70,7 @@ namespace ams::fssystem {
auto dec_size = crypto::DecryptAes128Ctr(buffer, size, m_key, KeySize, ctr, IvSize, buffer, size);
R_UNLESS(size == dec_size, fs::ResultUnexpectedInAesCtrStorageA());
return ResultSuccess();
R_SUCCEED();
}
template<typename BasePointer>
@@ -124,7 +124,7 @@ namespace ams::fssystem {
}
}
return ResultSuccess();
R_SUCCEED();
}
template<typename BasePointer>
@@ -135,7 +135,7 @@ namespace ams::fssystem {
template<typename BasePointer>
Result AesCtrStorage<BasePointer>::SetSize(s64 size) {
AMS_UNUSED(size);
return fs::ResultUnsupportedSetSizeForAesCtrStorage();
R_THROW(fs::ResultUnsupportedSetSizeForAesCtrStorage());
}
template<typename BasePointer>
@@ -154,7 +154,7 @@ namespace ams::fssystem {
reinterpret_cast<fs::QueryRangeInfo *>(dst)->Clear();
}
return ResultSuccess();
R_SUCCEED();
}
/* Ensure alignment. */
@@ -183,7 +183,7 @@ namespace ams::fssystem {
break;
}
return ResultSuccess();
R_SUCCEED();
}
template class AesCtrStorage<fs::IStorage *>;

View File

@@ -115,7 +115,7 @@ namespace ams::fssystem {
tail_offset += cur_size;
}
return ResultSuccess();
R_SUCCEED();
}
Result AlignmentMatchingStorageImpl::Write(fs::IStorage *base_storage, char *work_buf, size_t work_buf_size, size_t data_alignment, size_t buffer_alignment, s64 offset, const char *buffer, size_t size) {
@@ -186,7 +186,7 @@ namespace ams::fssystem {
tail_offset += cur_size;
}
return ResultSuccess();
R_SUCCEED();
}
template<>
@@ -216,7 +216,7 @@ namespace ams::fssystem {
if (aligned_size <= pooled_buffer.GetSize()) {
R_TRY(m_base_storage->Read(aligned_offset, pooled_buffer.GetBuffer(), aligned_size));
std::memcpy(buffer, pooled_buffer.GetBuffer() + (offset - aligned_offset), size);
return ResultSuccess();
R_SUCCEED();
} else {
pooled_buffer.Shrink(m_data_align);
}
@@ -255,7 +255,7 @@ namespace ams::fssystem {
std::memcpy(tail_buffer, pooled_buffer.GetBuffer(), tail_size);
}
return ResultSuccess();
R_SUCCEED();
}
}

View File

@@ -107,7 +107,7 @@ namespace ams::fssystem {
}
m_index = static_cast<s32>(pos - m_start) - 1;
return ResultSuccess();
R_SUCCEED();
}
};
@@ -126,7 +126,7 @@ namespace ams::fssystem {
R_UNLESS(this->magic == Magic, fs::ResultInvalidBucketTreeSignature());
R_UNLESS(this->entry_count >= 0, fs::ResultInvalidBucketTreeEntryCount());
R_UNLESS(this->version <= Version, fs::ResultUnsupportedVersion());
return ResultSuccess();
R_SUCCEED();
}
Result BucketTree::NodeHeader::Verify(s32 node_index, size_t node_size, size_t entry_size) const {
@@ -137,7 +137,7 @@ namespace ams::fssystem {
R_UNLESS(this->count > 0 && static_cast<size_t>(this->count) <= max_entry_count, fs::ResultInvalidBucketTreeNodeEntryCount());
R_UNLESS(this->offset >= 0, fs::ResultInvalidBucketTreeNodeOffset());
return ResultSuccess();
R_SUCCEED();
}
Result BucketTree::Initialize(IAllocator *allocator, fs::SubStorage node_storage, fs::SubStorage entry_storage, size_t node_size, size_t entry_size, s32 entry_count) {
@@ -300,7 +300,7 @@ namespace ams::fssystem {
m_offsets = offsets;
}
return ResultSuccess();
R_SUCCEED();
}
Result BucketTree::Visitor::MoveNext() {
@@ -336,7 +336,7 @@ namespace ams::fssystem {
/* Note that we changed index. */
m_entry_index = entry_index;
return ResultSuccess();
R_SUCCEED();
}
Result BucketTree::Visitor::MovePrevious() {
@@ -374,7 +374,7 @@ namespace ams::fssystem {
/* Note that we changed index. */
m_entry_index = entry_index;
return ResultSuccess();
R_SUCCEED();
}
Result BucketTree::Visitor::Find(s64 virtual_address) {
@@ -421,7 +421,7 @@ namespace ams::fssystem {
/* Set count. */
m_entry_set_count = m_tree->m_entry_set_count;
return ResultSuccess();
R_SUCCEED();
}
Result BucketTree::Visitor::FindEntrySet(s32 *out_index, s64 virtual_address, s32 node_index) {
@@ -457,7 +457,7 @@ namespace ams::fssystem {
/* Return the index. */
*out_index = m_tree->GetEntrySetIndex(header.index, node.GetIndex());
return ResultSuccess();
R_SUCCEED();
}
Result BucketTree::Visitor::FindEntrySetWithoutBuffer(s32 *out_index, s64 virtual_address, s32 node_index) {
@@ -478,7 +478,7 @@ namespace ams::fssystem {
/* Return the index. */
*out_index = m_tree->GetEntrySetIndex(header.index, node.GetIndex());
return ResultSuccess();
R_SUCCEED();
}
Result BucketTree::Visitor::FindEntry(s64 virtual_address, s32 entry_set_index) {
@@ -522,7 +522,7 @@ namespace ams::fssystem {
m_entry_set = entry_set;
m_entry_index = entry_index;
return ResultSuccess();
R_SUCCEED();
}
Result BucketTree::Visitor::FindEntryWithoutBuffer(s64 virtual_address, s32 entry_set_index) {
@@ -551,7 +551,7 @@ namespace ams::fssystem {
m_entry_set = entry_set;
m_entry_index = entry_index;
return ResultSuccess();
R_SUCCEED();
}
}

View File

@@ -238,7 +238,7 @@ namespace ams::fssystem {
buffers::EnableBlockingBufferManagerAllocation();
}
return ResultSuccess();
R_SUCCEED();
}
const std::pair<Result, bool> PrepareFetch() {
@@ -295,7 +295,7 @@ namespace ams::fssystem {
m_offset = fetch_param.offset;
AMS_ASSERT(this->Hits(offset, 1));
return ResultSuccess();
R_SUCCEED();
}
Result FetchFromBuffer(s64 offset, const void *buffer, size_t buffer_size) {
@@ -321,7 +321,7 @@ namespace ams::fssystem {
m_offset = fetch_param.offset;
AMS_ASSERT(this->Hits(offset, 1));
return ResultSuccess();
R_SUCCEED();
}
bool TryAcquireCache() {
@@ -369,7 +369,7 @@ namespace ams::fssystem {
}, AMS_CURRENT_FUNCTION_NAME));
range_guard.Cancel();
return ResultSuccess();
R_SUCCEED();
}
void CalcFetchParameter(FetchParameter *out, s64 offset) const {
@@ -579,7 +579,7 @@ namespace ams::fssystem {
Result FetchFromBuffer(s64 offset, const void *buffer, size_t buffer_size) {
AMS_ASSERT(m_cache != nullptr);
R_TRY(m_cache->FetchFromBuffer(offset, buffer, buffer_size));
return ResultSuccess();
R_SUCCEED();
}
};
@@ -616,7 +616,7 @@ namespace ams::fssystem {
}
m_next_acquire_cache = std::addressof(m_caches[0]);
return ResultSuccess();
R_SUCCEED();
}
void BufferedStorage::Finalize() {
@@ -638,7 +638,7 @@ namespace ams::fssystem {
/* Do the read. */
R_TRY(this->ReadCore(offset, buffer, size));
return ResultSuccess();
R_SUCCEED();
}
Result BufferedStorage::Write(s64 offset, const void *buffer, size_t size) {
@@ -652,7 +652,7 @@ namespace ams::fssystem {
/* Do the write. */
R_TRY(this->WriteCore(offset, buffer, size));
return ResultSuccess();
R_SUCCEED();
}
Result BufferedStorage::GetSize(s64 *out) {
@@ -660,7 +660,7 @@ namespace ams::fssystem {
AMS_ASSERT(this->IsInitialized());
*out = m_base_storage_size;
return ResultSuccess();
R_SUCCEED();
}
Result BufferedStorage::SetSize(s64 size) {
@@ -700,7 +700,7 @@ namespace ams::fssystem {
R_TRY(m_base_storage.GetSize(std::addressof(new_size)));
m_base_storage_size = new_size;
return ResultSuccess();
R_SUCCEED();
}
Result BufferedStorage::Flush() {
@@ -714,7 +714,7 @@ namespace ams::fssystem {
/* Flush the base storage. */
R_TRY(m_base_storage.Flush());
return ResultSuccess();
R_SUCCEED();
}
Result BufferedStorage::OperateRange(void *dst, size_t dst_size, fs::OperationId op_id, s64 offset, s64 size, const void *src, size_t src_size) {
@@ -745,7 +745,7 @@ namespace ams::fssystem {
if (m_buffer_manager->GetTotalAllocatableSize() < flush_threshold) {
R_TRY(this->Flush());
}
return ResultSuccess();
R_SUCCEED();
}
Result BufferedStorage::ControlDirtiness() {
@@ -760,7 +760,7 @@ namespace ams::fssystem {
}
}
}
return ResultSuccess();
R_SUCCEED();
}
Result BufferedStorage::ReadCore(s64 offset, void *buffer, size_t size) {
@@ -800,7 +800,7 @@ namespace ams::fssystem {
}
} R_END_TRY_CATCH;
return ResultSuccess();
R_SUCCEED();
} while(0);
}
}
@@ -854,7 +854,7 @@ namespace ams::fssystem {
buf_offset += cur_size;
}
return ResultSuccess();
R_SUCCEED();
}
bool BufferedStorage::ReadHeadCache(s64 *offset, void *buffer, size_t *size, s64 *buffer_offset) {
@@ -1007,7 +1007,7 @@ namespace ams::fssystem {
R_TRY(this->ControlDirtiness());
}
return ResultSuccess();
R_SUCCEED();
}
Result BufferedStorage::WriteCore(s64 offset, const void *buffer, size_t size) {
@@ -1079,7 +1079,7 @@ namespace ams::fssystem {
buf_offset += cur_size;
}
return ResultSuccess();
R_SUCCEED();
}
}

View File

@@ -22,7 +22,7 @@ namespace ams::fssystem {
Result DecompressLz4(void *dst, size_t dst_size, const void *src, size_t src_size) {
R_UNLESS(util::DecompressLZ4(dst, dst_size, src, src_size) == static_cast<int>(dst_size), fs::ResultUnexpectedInCompressedStorageC());
return ResultSuccess();
R_SUCCEED();
}
constexpr DecompressorFunction GetNcaDecompressorFunction(CompressionType type) {

View File

@@ -62,7 +62,7 @@ namespace ams::fssystem {
g_hnd_map.Emplace(program_id, client);
*out = server;
return ResultSuccess();
R_SUCCEED();
}
void DestroyExternalCode(ncm::ProgramId program_id) {

View File

@@ -78,7 +78,7 @@ namespace ams::fssystem {
m_hash_generator_factory->GenerateHash(calc_hash, sizeof(calc_hash), m_hash_buffer, static_cast<size_t>(hash_storage_size));
R_UNLESS(crypto::IsSameBytes(master_hash, calc_hash, HashSize), fs::ResultHierarchicalSha256HashVerificationFailed());
return ResultSuccess();
R_SUCCEED();
}
template<typename BaseStorageType>
@@ -126,7 +126,7 @@ namespace ams::fssystem {
remaining_size -= cur_size;
}
return ResultSuccess();
R_SUCCEED();
}
template<typename BaseStorageType>
@@ -169,7 +169,7 @@ namespace ams::fssystem {
remaining_size -= cur_size;
}
return ResultSuccess();
R_SUCCEED();
}
template<typename BaseStorageType>

View File

@@ -53,7 +53,7 @@ namespace ams::fssystem {
virtual Result SetSize(s64 size) override {
AMS_UNUSED(size);
return fs::ResultUnsupportedSetSizeForHierarchicalSha256Storage();
R_THROW(fs::ResultUnsupportedSetSizeForHierarchicalSha256Storage());
}
};

View File

@@ -171,7 +171,7 @@ namespace ams::fssystem {
R_SUCCEED();
}
default:
return fs::ResultUnsupportedOperateRangeForIndirectStorage();
R_THROW(fs::ResultUnsupportedOperateRangeForIndirectStorage());
}
R_SUCCEED();

View File

@@ -93,12 +93,12 @@ namespace ams::fssystem {
*out = std::move(accessor);
this->UpdateMru(list, it);
return ResultSuccess();
R_SUCCEED();
}
}
}
return fs::ResultTargetNotFound();
R_THROW(fs::ResultTargetNotFound());
}
void AddEntry(KeySlotCacheEntry *entry) {
@@ -122,7 +122,7 @@ namespace ams::fssystem {
src_list.pop_back();
dst_list.push_front(*entry);
return ResultSuccess();
R_SUCCEED();
}
void UpdateMru(KeySlotCacheEntryList *list, KeySlotCacheEntryList::iterator it) {

View File

@@ -30,7 +30,7 @@ namespace ams::fssystem {
/* Verify the magic is the current one. */
R_UNLESS(magic == NcaHeader::Magic3, fs::ResultInvalidNcaSignature());
return ResultSuccess();
R_SUCCEED();
}
}
@@ -176,7 +176,7 @@ namespace ams::fssystem {
m_header_storage = std::move(work_header_storage);
m_body_storage = std::move(base_storage);
return ResultSuccess();
R_SUCCEED();
}
std::shared_ptr<fs::IStorage> NcaReader::GetSharedBodyStorage() {
@@ -435,7 +435,7 @@ namespace ams::fssystem {
/* Set our index. */
m_fs_index = index;
return ResultSuccess();
R_SUCCEED();
}
void NcaFsHeaderReader::GetRawData(void *dst, size_t dst_size) const {

View File

@@ -75,7 +75,7 @@ namespace ams::fssystem {
/* Mark as initialized. */
m_initialized = true;
return ResultSuccess();
R_SUCCEED();
}
template <typename Format>
@@ -156,7 +156,7 @@ namespace ams::fssystem {
/* Output size. */
*out_size = sizeof(PartitionFileSystemHeader) + header.entry_count * sizeof(typename Format::PartitionEntry) + header.name_table_size;
return ResultSuccess();
R_SUCCEED();
}
template class PartitionFileSystemMetaCore<impl::PartitionFileSystemFormat>;
@@ -213,7 +213,7 @@ namespace ams::fssystem {
/* We initialized. */
m_initialized = true;
return ResultSuccess();
R_SUCCEED();
}
}

View File

@@ -210,7 +210,7 @@ namespace ams::fssystem {
g_heap_size = size;
g_heap_free_size_peak = size;
return ResultSuccess();
R_SUCCEED();
}
Result InitializeBufferPool(char *buffer, size_t size, char *work, size_t work_size) {
@@ -227,7 +227,7 @@ namespace ams::fssystem {
g_heap_size = size;
g_heap_free_size_peak = size;
return ResultSuccess();
R_SUCCEED();
}
bool IsPooledBuffer(const void *buffer) {

View File

@@ -67,7 +67,7 @@ namespace ams::fssystem {
bool found = m_block_cache.FindValueAndUpdateMru(std::addressof(cached_buffer), offset / m_block_size);
if (found) {
std::memcpy(buffer, cached_buffer, size);
return ResultSuccess();
R_SUCCEED();
}
}
@@ -82,7 +82,7 @@ namespace ams::fssystem {
m_block_cache.PushMruNode(std::move(lru), offset / m_block_size);
}
return ResultSuccess();
R_SUCCEED();
} else {
return m_base_storage->Read(offset, buffer, size);
}
@@ -98,7 +98,7 @@ namespace ams::fssystem {
m_block_cache.PushMruNode(std::move(lru), -1);
}
return ResultSuccess();
R_SUCCEED();
} else {
/* Validate preconditions. */
AMS_ASSERT(util::IsAligned(offset, m_block_size));
@@ -114,17 +114,17 @@ namespace ams::fssystem {
}
virtual Result Flush() override {
return ResultSuccess();
R_SUCCEED();
}
virtual Result Write(s64 offset, const void *buffer, size_t size) override {
AMS_UNUSED(offset, buffer, size);
return fs::ResultUnsupportedWriteForReadOnlyBlockCacheStorage();
R_THROW(fs::ResultUnsupportedWriteForReadOnlyBlockCacheStorage());
}
virtual Result SetSize(s64 size) override {
AMS_UNUSED(size);
return fs::ResultUnsupportedSetSizeForReadOnlyBlockCacheStorage();
R_THROW(fs::ResultUnsupportedSetSizeForReadOnlyBlockCacheStorage());
}
};

View File

@@ -38,11 +38,11 @@ namespace ams::fssystem {
} else {
R_TRY((this->OperatePerEntry<false, true>(offset, size, [=](fs::IStorage *storage, s64 data_offset, s64 cur_offset, s64 cur_size) -> Result {
R_TRY(storage->Read(data_offset, reinterpret_cast<u8 *>(buffer) + (cur_offset - offset), static_cast<size_t>(cur_size)));
return ResultSuccess();
R_SUCCEED();
})));
}
return ResultSuccess();
R_SUCCEED();
}
}

View File

@@ -114,7 +114,7 @@ namespace ams::gpio::driver::board::nintendo::nx::impl {
/* Read the pad address to make sure our configuration takes. */
reg::Read(pad_address);
return ResultSuccess();
R_SUCCEED();
}
void DriverImpl::FinalizePad(Pad *pad) {
@@ -143,7 +143,7 @@ namespace ams::gpio::driver::board::nintendo::nx::impl {
*out = Direction_Input;
}
return ResultSuccess();
R_SUCCEED();
}
@@ -162,7 +162,7 @@ namespace ams::gpio::driver::board::nintendo::nx::impl {
/* Read the pad address to make sure our configuration takes. */
reg::Read(pad_address);
return ResultSuccess();
R_SUCCEED();
}
Result DriverImpl::GetValue(GpioValue *out, Pad *pad) const {
@@ -183,7 +183,7 @@ namespace ams::gpio::driver::board::nintendo::nx::impl {
*out = GpioValue_Low;
}
return ResultSuccess();
R_SUCCEED();
}
Result DriverImpl::SetValue(Pad *pad, GpioValue value) {
@@ -201,7 +201,7 @@ namespace ams::gpio::driver::board::nintendo::nx::impl {
/* Read the pad address to make sure our configuration takes. */
reg::Read(pad_address);
return ResultSuccess();
R_SUCCEED();
}
Result DriverImpl::GetInterruptMode(InterruptMode *out, Pad *pad) const {
@@ -225,7 +225,7 @@ namespace ams::gpio::driver::board::nintendo::nx::impl {
AMS_UNREACHABLE_DEFAULT_CASE();
}
return ResultSuccess();
R_SUCCEED();
}
Result DriverImpl::SetInterruptMode(Pad *pad, InterruptMode mode) {
@@ -251,7 +251,7 @@ namespace ams::gpio::driver::board::nintendo::nx::impl {
/* Read the pad address to make sure our configuration takes. */
reg::Read(pad_address);
return ResultSuccess();
R_SUCCEED();
}
Result DriverImpl::SetInterruptEnabled(Pad *pad, bool en) {

View File

@@ -30,7 +30,7 @@ namespace ams::gpio::driver {
R_TRY(session->Open(pad, access_mode));
session_guard.Cancel();
return ResultSuccess();
R_SUCCEED();
}
}
@@ -54,7 +54,7 @@ namespace ams::gpio::driver {
}
} R_END_TRY_CATCH;
return ResultSuccess();
R_SUCCEED();
}
void CloseSession(GpioPadSession *session) {
@@ -77,7 +77,7 @@ namespace ams::gpio::driver {
/* Perform the call. */
R_TRY(pad.GetDriver().SafeCastTo<IGpioDriver>().SetDirection(std::addressof(pad), direction));
return ResultSuccess();
R_SUCCEED();
}
Result GetDirection(gpio::Direction *out, GpioPadSession *session) {
@@ -95,7 +95,7 @@ namespace ams::gpio::driver {
/* Perform the call. */
R_TRY(pad.GetDriver().SafeCastTo<IGpioDriver>().GetDirection(out, std::addressof(pad)));
return ResultSuccess();
R_SUCCEED();
}
Result SetValue(GpioPadSession *session, gpio::GpioValue value) {
@@ -113,7 +113,7 @@ namespace ams::gpio::driver {
/* Perform the call. */
R_TRY(pad.GetDriver().SafeCastTo<IGpioDriver>().SetValue(std::addressof(pad), value));
return ResultSuccess();
R_SUCCEED();
}
Result GetValue(gpio::GpioValue *out, GpioPadSession *session) {
@@ -131,7 +131,7 @@ namespace ams::gpio::driver {
/* Perform the call. */
R_TRY(pad.GetDriver().SafeCastTo<IGpioDriver>().GetValue(out, std::addressof(pad)));
return ResultSuccess();
R_SUCCEED();
}
}

View File

@@ -93,7 +93,7 @@ namespace ams::gpio::driver::impl {
Result RegisterDeviceCode(DeviceCode device_code, Pad *pad) {
AMS_ASSERT(pad != nullptr);
R_TRY(GetDeviceCodeEntryManager().Add(device_code, pad));
return ResultSuccess();
R_SUCCEED();
}
bool UnregisterDeviceCode(DeviceCode device_code) {
@@ -120,7 +120,7 @@ namespace ams::gpio::driver::impl {
/* Set output. */
*out = device->SafeCastToPointer<Pad>();
return ResultSuccess();
R_SUCCEED();
}
Result FindPadByNumber(Pad **out, int pad_number) {
@@ -145,7 +145,7 @@ namespace ams::gpio::driver::impl {
/* Check that we found the pad. */
R_UNLESS(found, ddsf::ResultDeviceCodeNotFound());
return ResultSuccess();
R_SUCCEED();
}
}

View File

@@ -32,7 +32,7 @@ namespace ams::gpio::driver::impl {
/* We opened successfully. */
pad_guard.Cancel();
return ResultSuccess();
R_SUCCEED();
}
void PadSessionImpl::Close() {
@@ -82,7 +82,7 @@ namespace ams::gpio::driver::impl {
/* We succeeded. */
hl_guard.Cancel();
ev_guard.Cancel();
return ResultSuccess();
R_SUCCEED();
}
void PadSessionImpl::UnbindInterrupt() {
@@ -115,7 +115,7 @@ namespace ams::gpio::driver::impl {
Result PadSessionImpl::GetInterruptEnabled(bool *out) const {
*out = this->GetDevice().SafeCastTo<Pad>().IsInterruptEnabled();
return ResultSuccess();
R_SUCCEED();
}
Result PadSessionImpl::SetInterruptEnabled(bool en) {
@@ -133,7 +133,7 @@ namespace ams::gpio::driver::impl {
R_TRY(this->UpdateDriverInterruptEnabled());
pad_guard.Cancel();
return ResultSuccess();
R_SUCCEED();
}
void PadSessionImpl::SignalInterruptBoundEvent() {

View File

@@ -92,7 +92,7 @@ namespace ams::gpio {
out_session->_event = nullptr;
/* We succeeded. */
return ResultSuccess();
R_SUCCEED();
}
void CloseSession(GpioPadSession *session) {
@@ -115,7 +115,7 @@ namespace ams::gpio {
R_TRY(g_manager->IsWakeEventActive(out_is_active, ConvertToGpioPadName(device_code)));
}
return ResultSuccess();
R_SUCCEED();
}
Direction GetDirection(GpioPadSession *session) {
@@ -198,7 +198,7 @@ namespace ams::gpio {
handle.Detach();
session->_event = event;
return ResultSuccess();
R_SUCCEED();
}
void UnbindInterrupt(GpioPadSession *session) {

View File

@@ -39,7 +39,7 @@ namespace ams::gpio {
R_TRY(::gpioOpenSession(std::addressof(p), static_cast<::GpioPadName>(static_cast<u32>(pad_name))));
out.SetValue(RemoteObjectFactory::CreateSharedEmplaced<gpio::sf::IPadSession, RemotePadSessionImpl>(p));
return ResultSuccess();
R_SUCCEED();
}
Result RemoteManagerImpl::OpenSession2(ams::sf::Out<ams::sf::SharedPointer<gpio::sf::IPadSession>> out, DeviceCode device_code, ddsf::AccessMode access_mode) {
@@ -47,7 +47,7 @@ namespace ams::gpio {
R_TRY(::gpioOpenSession2(std::addressof(p), device_code.GetInternalValue(), access_mode));
out.SetValue(RemoteObjectFactory::CreateSharedEmplaced<gpio::sf::IPadSession, RemotePadSessionImpl>(p));
return ResultSuccess();
R_SUCCEED();
}
#endif

View File

@@ -76,7 +76,7 @@ namespace ams::gpio {
::Event ev;
R_TRY(::gpioPadBindInterrupt(std::addressof(m_srv), std::addressof(ev)));
out.SetValue(ev.revent, true);
return ResultSuccess();
R_SUCCEED();
}
Result UnbindInterrupt() {

View File

@@ -76,7 +76,7 @@ namespace ams::gpio::server {
/* We succeeded. */
*out = std::move(session);
return ResultSuccess();
R_SUCCEED();
}
Result ManagerImpl::IsWakeEventActive2(ams::sf::Out<bool> out, DeviceCode device_code) {

View File

@@ -40,7 +40,7 @@ namespace ams::gpio::server {
R_TRY(gpio::driver::OpenSession(std::addressof(m_internal_pad_session), device_code, access_mode));
m_has_session = true;
return ResultSuccess();
R_SUCCEED();
}
public:
/* Actual commands. */
@@ -54,7 +54,7 @@ namespace ams::gpio::server {
/* Invoke the driver library. */
R_TRY(gpio::driver::SetDirection(std::addressof(m_internal_pad_session), direction));
return ResultSuccess();
R_SUCCEED();
}
Result GetDirection(ams::sf::Out<gpio::Direction> out) {
@@ -64,7 +64,7 @@ namespace ams::gpio::server {
/* Invoke the driver library. */
R_TRY(gpio::driver::GetDirection(out.GetPointer(), std::addressof(m_internal_pad_session)));
return ResultSuccess();
R_SUCCEED();
}
Result SetInterruptMode(gpio::InterruptMode mode) {
@@ -130,7 +130,7 @@ namespace ams::gpio::server {
/* Invoke the driver library. */
R_TRY(gpio::driver::SetValue(std::addressof(m_internal_pad_session), value));
return ResultSuccess();
R_SUCCEED();
}
Result GetValue(ams::sf::Out<gpio::GpioValue> out) {
@@ -140,7 +140,7 @@ namespace ams::gpio::server {
/* Invoke the driver library. */
R_TRY(gpio::driver::GetValue(out.GetPointer(), std::addressof(m_internal_pad_session)));
return ResultSuccess();
R_SUCCEED();
}
Result BindInterrupt(ams::sf::OutCopyHandle out) {

View File

@@ -59,7 +59,7 @@ namespace ams::hid {
g_initialized_hid = true;
}
return ResultSuccess();
R_SUCCEED();
}
u64 ReadHidNpad(HidNpadIdType id) {
@@ -86,7 +86,7 @@ namespace ams::hid {
*out |= ReadHidNpad(static_cast<HidNpadIdType>(controller));
}
return ResultSuccess();
R_SUCCEED();
}
#endif

View File

@@ -30,7 +30,7 @@ namespace ams::hos {
} R_END_TRY_CATCH_WITH_ABORT_UNLESS;
*out = { exosphere_cfg };
return ResultSuccess();
R_SUCCEED();
}
#if defined(ATMOSPHERE_OS_HORIZON)
@@ -42,7 +42,7 @@ namespace ams::hos {
} R_END_TRY_CATCH_WITH_ABORT_UNLESS;
*out = { exosphere_cfg };
return ResultSuccess();
R_SUCCEED();
}
#endif

View File

@@ -61,7 +61,7 @@ namespace ams::htc::server::driver {
m_manager->SetReceiveBuffer(GetHtclowChannel(channel, m_module_id), receive_buffer, receive_buffer_size);
m_manager->SetSendBuffer(GetHtclowChannel(channel, m_module_id), send_buffer, send_buffer_size);
return ResultSuccess();
R_SUCCEED();
}
void HtclowDriver::Close(htclow::ChannelId channel) {
@@ -84,7 +84,7 @@ namespace ams::htc::server::driver {
/* Finish connecting. */
R_TRY(m_manager->ConnectEnd(GetHtclowChannel(channel, m_module_id), task_id));
return ResultSuccess();
R_SUCCEED();
}
void HtclowDriver::Shutdown(htclow::ChannelId channel) {
@@ -117,7 +117,7 @@ namespace ams::htc::server::driver {
/* Set the output sent size. */
*out = static_cast<s64>(sent);
return ResultSuccess();
R_SUCCEED();
}
Result HtclowDriver::ReceiveInternal(size_t *out, void *dst, size_t dst_size, htclow::ChannelId channel, htclow::ReceiveOption option) {
@@ -173,7 +173,7 @@ namespace ams::htc::server::driver {
/* Set the output received size. */
*out = static_cast<s64>(received);
return ResultSuccess();
R_SUCCEED();
}
htclow::ChannelState HtclowDriver::GetChannelState(htclow::ChannelId channel) {

View File

@@ -39,7 +39,7 @@ namespace ams::htc::server {
/* Set the output size. */
*out_size = static_cast<s32>(var_size);
return ResultSuccess();
R_SUCCEED();
}
Result HtcServiceObject::GetEnvironmentVariableLength(sf::Out<s32> out_size, const sf::InBuffer &name) {
@@ -52,19 +52,19 @@ namespace ams::htc::server {
/* Set the output size. */
*out_size = static_cast<s32>(var_size);
return ResultSuccess();
R_SUCCEED();
}
Result HtcServiceObject::GetHostConnectionEvent(sf::OutCopyHandle out) {
/* Set the output handle. */
out.SetValue(m_observer.GetConnectEvent()->GetReadableHandle(), false);
return ResultSuccess();
R_SUCCEED();
}
Result HtcServiceObject::GetHostDisconnectionEvent(sf::OutCopyHandle out) {
/* Set the output handle. */
out.SetValue(m_observer.GetDisconnectEvent()->GetReadableHandle(), false);
return ResultSuccess();
R_SUCCEED();
}
Result HtcServiceObject::GetHostConnectionEventForSystem(sf::OutCopyHandle out) {
@@ -100,7 +100,7 @@ namespace ams::htc::server {
/* Set the output event. */
out.SetValue(event_handle, true);
return ResultSuccess();
R_SUCCEED();
}
Result HtcServiceObject::RunOnHostResults(sf::Out<s32> out_result, u32 id) {

View File

@@ -91,7 +91,7 @@ namespace ams::htc::server {
/* Finish the task. */
R_TRY(m_rpc_client.End<rpc::GetEnvironmentVariableTask>(task_id, out_size, dst, dst_size));
return ResultSuccess();
R_SUCCEED();
}
Result HtcmiscImpl::GetEnvironmentVariableLength(size_t *out_size, const char *name, size_t name_size) {
@@ -105,7 +105,7 @@ namespace ams::htc::server {
/* Finish the task. */
R_TRY(m_rpc_client.End<rpc::GetEnvironmentVariableLengthTask>(task_id, out_size));
return ResultSuccess();
R_SUCCEED();
}
Result HtcmiscImpl::RunOnHostBegin(u32 *out_task_id, os::NativeHandle *out_event, const char *args, size_t args_size) {
@@ -117,7 +117,7 @@ namespace ams::htc::server {
*out_task_id = task_id;
*out_event = m_rpc_client.DetachReadableHandle(task_id);
return ResultSuccess();
R_SUCCEED();
}
Result HtcmiscImpl::RunOnHostEnd(s32 *out_result, u32 task_id) {
@@ -128,7 +128,7 @@ namespace ams::htc::server {
/* Set output. */
*out_result = res;
return ResultSuccess();
R_SUCCEED();
}
void HtcmiscImpl::ClientThread() {

View File

@@ -56,7 +56,7 @@ namespace ams::htc::server {
/* Start our thread. */
os::StartThread(std::addressof(m_observer_thread));
return ResultSuccess();
R_SUCCEED();
}
void Observer::UpdateEvent() {

View File

@@ -62,7 +62,7 @@ namespace ams::htc::server::rpc {
m_cancelled = false;
m_thread_running = true;
return ResultSuccess();
R_SUCCEED();
}
void HtcmiscRpcServer::Cancel() {
@@ -147,7 +147,7 @@ namespace ams::htc::server::rpc {
/* Check size. */
R_UNLESS(static_cast<size_t>(received) == sizeof(*header), htc::ResultInvalidSize());
return ResultSuccess();
R_SUCCEED();
}
Result HtcmiscRpcServer::ReceiveBody(char *dst, size_t size) {
@@ -158,7 +158,7 @@ namespace ams::htc::server::rpc {
/* Check size. */
R_UNLESS(static_cast<size_t>(received) == size, htc::ResultInvalidSize());
return ResultSuccess();
R_SUCCEED();
}
Result HtcmiscRpcServer::SendRequest(const char *src, size_t size) {
@@ -172,7 +172,7 @@ namespace ams::htc::server::rpc {
/* Check that we sent the right amount. */
R_UNLESS(sent == static_cast<s64>(size), htc::ResultInvalidSize());
return ResultSuccess();
R_SUCCEED();
}
}

View File

@@ -27,7 +27,7 @@ namespace ams::htc::server::rpc {
R_UNLESS(size == copied || size == copied + 1, htc::ResultUnknown());
return ResultSuccess();
R_SUCCEED();
}
void GetEnvironmentVariableTask::Complete(HtcmiscResult result, const char *data, size_t size) {
@@ -78,7 +78,7 @@ namespace ams::htc::server::rpc {
/* Set the output size. */
*out = m_value_size;
return ResultSuccess();
R_SUCCEED();
}
Result GetEnvironmentVariableTask::CreateRequest(size_t *out, char *data, size_t size, u32 task_id) {
@@ -106,7 +106,7 @@ namespace ams::htc::server::rpc {
/* Set the output size. */
*out = sizeof(*packet) + this->GetNameSize();
return ResultSuccess();
R_SUCCEED();
}
Result GetEnvironmentVariableTask::ProcessResponse(const char *data, size_t size) {
@@ -119,7 +119,7 @@ namespace ams::htc::server::rpc {
/* Complete the task. */
Task::Complete();
return ResultSuccess();
R_SUCCEED();
}
Result GetEnvironmentVariableLengthTask::SetArguments(const char *args, size_t size) {
@@ -131,7 +131,7 @@ namespace ams::htc::server::rpc {
R_UNLESS(size == copied || size == copied + 1, htc::ResultUnknown());
return ResultSuccess();
R_SUCCEED();
}
void GetEnvironmentVariableLengthTask::Complete(HtcmiscResult result, const char *data, size_t size) {
@@ -177,7 +177,7 @@ namespace ams::htc::server::rpc {
/* Set the output size. */
*out = m_value_size;
return ResultSuccess();
R_SUCCEED();
}
Result GetEnvironmentVariableLengthTask::CreateRequest(size_t *out, char *data, size_t size, u32 task_id) {
@@ -205,7 +205,7 @@ namespace ams::htc::server::rpc {
/* Set the output size. */
*out = sizeof(*packet) + this->GetNameSize();
return ResultSuccess();
R_SUCCEED();
}
Result GetEnvironmentVariableLengthTask::ProcessResponse(const char *data, size_t size) {
@@ -218,7 +218,7 @@ namespace ams::htc::server::rpc {
/* Complete the task. */
Task::Complete();
return ResultSuccess();
R_SUCCEED();
}
Result RunOnHostTask::SetArguments(const char *args, size_t size) {
@@ -229,7 +229,7 @@ namespace ams::htc::server::rpc {
std::memcpy(m_command, args, size);
m_command_size = size;
return ResultSuccess();
R_SUCCEED();
}
void RunOnHostTask::Complete(int host_result) {
@@ -245,7 +245,7 @@ namespace ams::htc::server::rpc {
Result RunOnHostTask::GetResult(int *out) const {
*out = m_host_result;
return ResultSuccess();
R_SUCCEED();
}
void RunOnHostTask::Cancel(RpcTaskCancelReason reason) {
@@ -281,7 +281,7 @@ namespace ams::htc::server::rpc {
/* Set the output size. */
*out = sizeof(*packet) + this->GetCommandSize();
return ResultSuccess();
R_SUCCEED();
}
Result RunOnHostTask::ProcessResponse(const char *data, size_t size) {
@@ -290,7 +290,7 @@ namespace ams::htc::server::rpc {
AMS_UNUSED(size);
this->Complete(reinterpret_cast<const HtcmiscRpcPacket *>(data)->params[0]);
return ResultSuccess();
R_SUCCEED();
}
os::SystemEventType *RunOnHostTask::GetSystemEvent() {

View File

@@ -139,7 +139,7 @@ namespace ams::htc::server::rpc {
os::ClearEvent(std::addressof(m_send_buffer_available_events[i]));
}
return ResultSuccess();
R_SUCCEED();
}
void RpcClient::Cancel() {
@@ -251,7 +251,7 @@ namespace ams::htc::server::rpc {
R_TRY(task->ProcessNotification(m_receive_buffer, received));
break;
default:
return htc::ResultInvalidCategory();
R_THROW(htc::ResultInvalidCategory());
}
/* If we used the receive buffer, signal that we're done with it. */
@@ -269,7 +269,7 @@ namespace ams::htc::server::rpc {
/* Check size. */
R_UNLESS(static_cast<size_t>(received) == sizeof(*header), htc::ResultInvalidSize());
return ResultSuccess();
R_SUCCEED();
}
Result RpcClient::ReceiveBody(char *dst, size_t size) {
@@ -280,7 +280,7 @@ namespace ams::htc::server::rpc {
/* Check size. */
R_UNLESS(static_cast<size_t>(received) == size, htc::ResultInvalidSize());
return ResultSuccess();
R_SUCCEED();
}
Result RpcClient::SendThread() {
@@ -325,7 +325,7 @@ namespace ams::htc::server::rpc {
R_TRY(this->SendRequest(m_send_buffer, packet_size));
}
return htc::ResultCancelled();
R_THROW(htc::ResultCancelled());
}
Result RpcClient::SendRequest(const char *src, size_t size) {
@@ -339,7 +339,7 @@ namespace ams::htc::server::rpc {
/* Check that we sent the right amount. */
R_UNLESS(sent == static_cast<s64>(size), htc::ResultInvalidSize());
return ResultSuccess();
R_SUCCEED();
}
void RpcClient::CancelBySocket(s32 handle) {

View File

@@ -147,7 +147,7 @@ namespace ams::htc::server::rpc {
/* We succeeded. */
task_guard.Cancel();
return ResultSuccess();
R_SUCCEED();
}
template<typename T, typename... Args> requires (IsRpcTask<T> && sizeof...(Args) == std::tuple_size<RpcTaskResultsType<T>>::value)
@@ -165,7 +165,7 @@ namespace ams::htc::server::rpc {
/* Get the task's result. */
R_TRY(task->GetResult(std::forward<Args>(args)...));
return ResultSuccess();
R_SUCCEED();
}
template<typename T, typename... Args> requires (IsRpcTask<T> && sizeof...(Args) == std::tuple_size<RpcTaskResultsType<T>>::value)
@@ -190,11 +190,11 @@ namespace ams::htc::server::rpc {
switch (task->GetTaskCancelReason()) {
case RpcTaskCancelReason::BySocket:
task_guard.Cancel();
return htc::ResultTaskCancelled();
R_THROW(htc::ResultTaskCancelled());
case RpcTaskCancelReason::ClientFinalized:
return htc::ResultCancelled();
R_THROW(htc::ResultCancelled());
case RpcTaskCancelReason::QueueNotAvailable:
return htc::ResultTaskQueueNotAvailable();
R_THROW(htc::ResultTaskQueueNotAvailable());
AMS_UNREACHABLE_DEFAULT_CASE();
}
}
@@ -202,7 +202,7 @@ namespace ams::htc::server::rpc {
/* Get the task's result. */
R_TRY(task->GetResult(std::forward<Args>(args)...));
return ResultSuccess();
R_SUCCEED();
}
template<typename T> requires IsRpcTask<T>
@@ -217,7 +217,7 @@ namespace ams::htc::server::rpc {
/* Check the task handle. */
R_UNLESS(task->GetHandle() == handle, htc::ResultInvalidTaskId());
return ResultSuccess();
R_SUCCEED();
}
template<typename T> requires IsRpcTask<T>
@@ -235,7 +235,7 @@ namespace ams::htc::server::rpc {
/* Add notification to our queue. */
m_task_queue.Add(task_id, PacketCategory::Notification);
return ResultSuccess();
R_SUCCEED();
}
template<typename T> requires IsRpcTask<T>
@@ -291,9 +291,9 @@ namespace ams::htc::server::rpc {
if (task->GetTaskState() == RpcTaskState::Cancelled) {
switch (task->GetTaskCancelReason()) {
case RpcTaskCancelReason::QueueNotAvailable:
return htc::ResultTaskQueueNotAvailable();
R_THROW(htc::ResultTaskQueueNotAvailable());
default:
return htc::ResultTaskCancelled();
R_THROW(htc::ResultTaskCancelled());
}
}
@@ -303,7 +303,7 @@ namespace ams::htc::server::rpc {
os::SignalEvent(std::addressof(m_send_buffer_available_events[task_id]));
}
return ResultSuccess();
R_SUCCEED();
}
template<typename T> requires IsRpcTask<T>
@@ -323,9 +323,9 @@ namespace ams::htc::server::rpc {
if (task->GetTaskState() == RpcTaskState::Cancelled) {
switch (task->GetTaskCancelReason()) {
case RpcTaskCancelReason::QueueNotAvailable:
return htc::ResultTaskQueueNotAvailable();
R_THROW(htc::ResultTaskQueueNotAvailable());
default:
return htc::ResultTaskCancelled();
R_THROW(htc::ResultTaskCancelled());
}
}
@@ -349,7 +349,7 @@ namespace ams::htc::server::rpc {
std::memcpy(buffer, result_buffer, result_size);
return ResultSuccess();
R_SUCCEED();
}
};

View File

@@ -43,7 +43,7 @@ namespace ams::htc::server::rpc {
/* Get the task id. */
*out = m_task_ids[index];
return ResultSuccess();
R_SUCCEED();
}
void Free(u32 task_id) {

View File

@@ -96,7 +96,7 @@ namespace ams::htc::server::rpc {
/* Return the task info. */
*out_id = m_task_ids[index];
*out_category = m_task_categories[index];
return ResultSuccess();
R_SUCCEED();
}
};

View File

@@ -89,22 +89,22 @@ namespace ams::htc::server::rpc {
virtual Result ProcessResponse(const char *data, size_t size) {
AMS_UNUSED(data, size);
return ResultSuccess();
R_SUCCEED();
}
virtual Result CreateRequest(size_t *out, char *data, size_t size, u32 task_id) {
AMS_UNUSED(out, data, size, task_id);
return ResultSuccess();
R_SUCCEED();
}
virtual Result ProcessNotification(const char *data, size_t size) {
AMS_UNUSED(data, size);
return ResultSuccess();
R_SUCCEED();
}
virtual Result CreateNotification(size_t *out, char *data, size_t size, u32 task_id) {
AMS_UNUSED(out, data, size, task_id);
return ResultSuccess();
R_SUCCEED();
}
virtual bool IsReceiveBufferRequired() {

View File

@@ -21,7 +21,7 @@ namespace ams::htc::tenv {
Result ServiceManager::GetServiceInterface(sf::Out<sf::SharedPointer<htc::tenv::IService>> out, const sf::ClientProcessId &process_id) {
*out = impl::SfObjectFactory::CreateSharedEmplaced<htc::tenv::IService, Service>(process_id.GetValue());
return ResultSuccess();
R_SUCCEED();
}
}

Some files were not shown because too many files have changed in this diff Show More