strat: 0 -> ResultSuccess
This commit is contained in:
@@ -27,7 +27,7 @@ void BpcMitmService::PostProcess(IMitmServiceObject *obj, IpcResponseContext *ct
|
||||
Result BpcMitmService::ShutdownSystem() {
|
||||
/* Use exosphere + reboot to perform real shutdown, instead of fake shutdown. */
|
||||
PerformShutdownSmc();
|
||||
return 0;
|
||||
return ResultSuccess;
|
||||
}
|
||||
|
||||
Result BpcMitmService::RebootSystem() {
|
||||
|
||||
@@ -92,10 +92,10 @@ Result BpcRebootManager::PerformReboot() {
|
||||
return ResultAtmosphereMitmShouldForwardToSession;
|
||||
case BpcRebootType::ToRcm:
|
||||
RebootToRcm();
|
||||
return 0;
|
||||
return ResultSuccess;
|
||||
case BpcRebootType::ToPayload:
|
||||
default:
|
||||
DoRebootToPayload();
|
||||
return 0;
|
||||
return ResultSuccess;
|
||||
}
|
||||
}
|
||||
|
||||
@@ -61,7 +61,7 @@ Result FsDirUtils::CopyFile(IFileSystem *dst_fs, IFileSystem *src_fs, const FsPa
|
||||
offset += read_size;
|
||||
}
|
||||
|
||||
return 0;
|
||||
return ResultSuccess;
|
||||
}
|
||||
|
||||
Result FsDirUtils::CopyDirectoryRecursively(IFileSystem *dst_fs, IFileSystem *src_fs, const FsPath &dst_path, const FsPath &src_path, void *work_buf, size_t work_buf_size) {
|
||||
@@ -88,7 +88,7 @@ Result FsDirUtils::CopyDirectoryRecursively(IFileSystem *dst_fs, IFileSystem *sr
|
||||
}
|
||||
p[1] = 0;
|
||||
|
||||
return 0;
|
||||
return ResultSuccess;
|
||||
},
|
||||
[&](const FsPath &path, const FsDirectoryEntry *dir_ent) -> Result { /* On File */
|
||||
/* Just copy the file to the new fs. */
|
||||
|
||||
@@ -84,7 +84,7 @@ class FsDirUtils {
|
||||
work_path.str[parent_len] = 0;
|
||||
}
|
||||
|
||||
return 0;
|
||||
return ResultSuccess;
|
||||
}
|
||||
|
||||
public:
|
||||
@@ -137,7 +137,7 @@ class FsDirUtils {
|
||||
template<typename F>
|
||||
static Result RetryUntilTargetNotLocked(F f) {
|
||||
const size_t MaxRetries = 10;
|
||||
Result rc = 0;
|
||||
Result rc = ResultSuccess;
|
||||
|
||||
for (size_t i = 0; i < MaxRetries; i++) {
|
||||
rc = f();
|
||||
|
||||
@@ -129,7 +129,7 @@ Result DirectorySaveDataFileSystem::AllocateWorkBuffer(void **out_buf, size_t *o
|
||||
if (buf != nullptr) {
|
||||
*out_buf = buf;
|
||||
*out_size = try_size;
|
||||
return 0;
|
||||
return ResultSuccess;
|
||||
}
|
||||
|
||||
/* Divide size by two. */
|
||||
@@ -303,7 +303,7 @@ Result DirectorySaveDataFileSystem::OpenFileImpl(std::unique_ptr<IFile> &out_fil
|
||||
this->open_writable_files++;
|
||||
}
|
||||
|
||||
return 0;
|
||||
return ResultSuccess;
|
||||
}
|
||||
|
||||
Result DirectorySaveDataFileSystem::OpenDirectoryImpl(std::unique_ptr<IDirectory> &out_dir, const FsPath &path, DirectoryOpenMode mode) {
|
||||
|
||||
@@ -33,7 +33,7 @@ class IDirectory {
|
||||
}
|
||||
if (max_entries == 0) {
|
||||
*out_count = 0;
|
||||
return 0;
|
||||
return ResultSuccess;
|
||||
}
|
||||
if (out_entries == nullptr) {
|
||||
return ResultFsNullptrArgument;
|
||||
|
||||
@@ -40,7 +40,7 @@ class IFile {
|
||||
}
|
||||
if (size == 0) {
|
||||
*out = 0;
|
||||
return 0;
|
||||
return ResultSuccess;
|
||||
}
|
||||
if (buffer == nullptr) {
|
||||
return ResultFsNullptrArgument;
|
||||
@@ -65,7 +65,7 @@ class IFile {
|
||||
|
||||
Result Write(uint64_t offset, void *buffer, uint64_t size, uint32_t flags) {
|
||||
if (size == 0) {
|
||||
return 0;
|
||||
return ResultSuccess;
|
||||
}
|
||||
if (buffer == nullptr) {
|
||||
return ResultFsNullptrArgument;
|
||||
@@ -76,7 +76,7 @@ class IFile {
|
||||
|
||||
Result Write(uint64_t offset, void *buffer, uint64_t size, bool flush = false) {
|
||||
if (size == 0) {
|
||||
return 0;
|
||||
return ResultSuccess;
|
||||
}
|
||||
if (buffer == nullptr) {
|
||||
return ResultFsNullptrArgument;
|
||||
|
||||
@@ -102,7 +102,7 @@ class IROStorage : public IStorage {
|
||||
return ResultFsUnsupportedOperation;
|
||||
};
|
||||
virtual Result Flush() final {
|
||||
return 0x0;
|
||||
return ResultSuccess;
|
||||
};
|
||||
virtual Result SetSize(u64 size) final {
|
||||
(void)(size);
|
||||
|
||||
@@ -28,7 +28,7 @@ Result FsPathUtils::VerifyPath(const char *path, size_t max_path_len, size_t max
|
||||
const char c = *(cur++);
|
||||
/* If terminated, we're done. */
|
||||
if (c == 0) {
|
||||
return 0;
|
||||
return ResultSuccess;
|
||||
}
|
||||
|
||||
/* TODO: Nintendo converts the path from utf-8 to utf-32, one character at a time. */
|
||||
@@ -110,7 +110,7 @@ Result FsPathUtils::IsNormalized(bool *out, const char *path) {
|
||||
/* It is unclear why first separator and separator are separate states... */
|
||||
if (c == '/') {
|
||||
*out = false;
|
||||
return 0;
|
||||
return ResultSuccess;
|
||||
} else if (c == '.') {
|
||||
state = PathState::CurrentDir;
|
||||
} else {
|
||||
@@ -120,7 +120,7 @@ Result FsPathUtils::IsNormalized(bool *out, const char *path) {
|
||||
case PathState::CurrentDir:
|
||||
if (c == '/') {
|
||||
*out = false;
|
||||
return 0;
|
||||
return ResultSuccess;
|
||||
} else if (c == '.') {
|
||||
state = PathState::ParentDir;
|
||||
} else {
|
||||
@@ -130,7 +130,7 @@ Result FsPathUtils::IsNormalized(bool *out, const char *path) {
|
||||
case PathState::ParentDir:
|
||||
if (c == '/') {
|
||||
*out = false;
|
||||
return 0;
|
||||
return ResultSuccess;
|
||||
} else {
|
||||
state = PathState::Normal;
|
||||
}
|
||||
@@ -138,7 +138,7 @@ Result FsPathUtils::IsNormalized(bool *out, const char *path) {
|
||||
case PathState::WindowsDriveLetter:
|
||||
if (c == ':') {
|
||||
*out = true;
|
||||
return 0;
|
||||
return ResultSuccess;
|
||||
} else {
|
||||
return ResultFsInvalidPathFormat;
|
||||
}
|
||||
@@ -161,7 +161,7 @@ Result FsPathUtils::IsNormalized(bool *out, const char *path) {
|
||||
break;
|
||||
}
|
||||
|
||||
return 0;
|
||||
return ResultSuccess;
|
||||
}
|
||||
|
||||
Result FsPathUtils::Normalize(char *out, size_t max_out_size, const char *src, size_t *out_len) {
|
||||
@@ -264,5 +264,5 @@ Result FsPathUtils::Normalize(char *out, size_t max_out_size, const char *src, s
|
||||
std::abort();
|
||||
}
|
||||
|
||||
return 0;
|
||||
return ResultSuccess;
|
||||
}
|
||||
|
||||
@@ -55,7 +55,7 @@ Result SubDirectoryFileSystem::Initialize(const char *bp) {
|
||||
|
||||
std::strncpy(this->base_path, normal_path, this->base_path_len);
|
||||
this->base_path[this->base_path_len-1] = 0;
|
||||
return 0;
|
||||
return ResultSuccess;
|
||||
}
|
||||
|
||||
Result SubDirectoryFileSystem::GetFullPath(char *out, size_t out_size, const char *relative_path) {
|
||||
|
||||
@@ -36,7 +36,7 @@ Result Boot0Storage::Read(void *_buffer, size_t size, u64 offset) {
|
||||
Result Boot0Storage::Write(void *_buffer, size_t size, u64 offset) {
|
||||
std::scoped_lock<HosMutex> lk{g_boot0_mutex};
|
||||
|
||||
Result rc = 0;
|
||||
Result rc = ResultSuccess;
|
||||
u8 *buffer = static_cast<u8 *>(_buffer);
|
||||
|
||||
/* Protect the keyblob region from writes. */
|
||||
@@ -61,7 +61,7 @@ Result Boot0Storage::Write(void *_buffer, size_t size, u64 offset) {
|
||||
if (offset < EksEnd) {
|
||||
if (offset + size < EksEnd) {
|
||||
/* Ignore writes falling strictly within the region. */
|
||||
return 0;
|
||||
return ResultSuccess;
|
||||
} else {
|
||||
/* Only write past the end of the keyblob region. */
|
||||
buffer = buffer + (EksEnd - offset);
|
||||
@@ -74,7 +74,7 @@ Result Boot0Storage::Write(void *_buffer, size_t size, u64 offset) {
|
||||
}
|
||||
|
||||
if (size == 0) {
|
||||
return 0;
|
||||
return ResultSuccess;
|
||||
}
|
||||
|
||||
/* We care about protecting autorcm from NS. */
|
||||
|
||||
@@ -39,7 +39,7 @@ class SectoredProxyStorage : public ProxyStorage {
|
||||
SectoredProxyStorage(FsStorage s) : ProxyStorage(s) { }
|
||||
public:
|
||||
virtual Result Read(void *_buffer, size_t size, u64 offset) override {
|
||||
Result rc = 0;
|
||||
Result rc = ResultSuccess;
|
||||
u8 *buffer = static_cast<u8 *>(_buffer);
|
||||
this->Seek(offset);
|
||||
|
||||
@@ -82,7 +82,7 @@ class SectoredProxyStorage : public ProxyStorage {
|
||||
return rc;
|
||||
};
|
||||
virtual Result Write(void *_buffer, size_t size, u64 offset) override {
|
||||
Result rc = 0;
|
||||
Result rc = ResultSuccess;
|
||||
u8 *buffer = static_cast<u8 *>(_buffer);
|
||||
this->Seek(offset);
|
||||
|
||||
|
||||
@@ -48,7 +48,7 @@ LayeredRomFS::LayeredRomFS(std::shared_ptr<RomInterfaceStorage> s_r, std::shared
|
||||
Result LayeredRomFS::Read(void *buffer, size_t size, u64 offset) {
|
||||
/* Size zero reads should always succeed. */
|
||||
if (size == 0) {
|
||||
return 0;
|
||||
return ResultSuccess;
|
||||
}
|
||||
|
||||
/* Validate size. */
|
||||
@@ -158,16 +158,16 @@ Result LayeredRomFS::Read(void *buffer, size_t size, u64 offset) {
|
||||
}
|
||||
}
|
||||
|
||||
return 0;
|
||||
return ResultSuccess;
|
||||
}
|
||||
Result LayeredRomFS::GetSize(u64 *out_size) {
|
||||
*out_size = (*this->p_source_infos)[this->p_source_infos->size() - 1].virtual_offset + (*this->p_source_infos)[this->p_source_infos->size() - 1].size;
|
||||
return 0x0;
|
||||
return ResultSuccess;
|
||||
}
|
||||
Result LayeredRomFS::OperateRange(u32 operation_type, u64 offset, u64 size, FsRangeInfo *out_range_info) {
|
||||
/* TODO: How should I implement this for a virtual romfs? */
|
||||
if (operation_type == 3) {
|
||||
*out_range_info = {0};
|
||||
}
|
||||
return 0;
|
||||
return ResultSuccess;
|
||||
}
|
||||
|
||||
@@ -86,7 +86,7 @@ void FsMitmService::PostProcess(IMitmServiceObject *obj, IpcResponseContext *ctx
|
||||
Result FsMitmService::OpenHblWebContentFileSystem(Out<std::shared_ptr<IFileSystemInterface>> &out_fs) {
|
||||
std::shared_ptr<IFileSystemInterface> fs = nullptr;
|
||||
u32 out_domain_id = 0;
|
||||
Result rc = 0;
|
||||
Result rc = ResultSuccess;
|
||||
|
||||
ON_SCOPE_EXIT {
|
||||
if (R_SUCCEEDED(rc)) {
|
||||
@@ -162,7 +162,7 @@ Result FsMitmService::OpenFileSystemWithId(Out<std::shared_ptr<IFileSystemInterf
|
||||
Result FsMitmService::OpenBisStorage(Out<std::shared_ptr<IStorageInterface>> out_storage, u32 bis_partition_id) {
|
||||
std::shared_ptr<IStorageInterface> storage = nullptr;
|
||||
u32 out_domain_id = 0;
|
||||
Result rc = 0;
|
||||
Result rc = ResultSuccess;
|
||||
|
||||
ON_SCOPE_EXIT {
|
||||
if (R_SUCCEEDED(rc)) {
|
||||
@@ -219,7 +219,7 @@ Result FsMitmService::OpenBisStorage(Out<std::shared_ptr<IStorageInterface>> out
|
||||
Result FsMitmService::OpenDataStorageByCurrentProcess(Out<std::shared_ptr<IStorageInterface>> out_storage) {
|
||||
std::shared_ptr<IStorageInterface> storage = nullptr;
|
||||
u32 out_domain_id = 0;
|
||||
Result rc = 0;
|
||||
Result rc = ResultSuccess;
|
||||
|
||||
if (!this->should_override_contents) {
|
||||
return ResultAtmosphereMitmShouldForwardToSession;
|
||||
@@ -249,7 +249,7 @@ Result FsMitmService::OpenDataStorageByCurrentProcess(Out<std::shared_ptr<IStora
|
||||
out_domain_id = s.s.object_id;
|
||||
}
|
||||
} else {
|
||||
rc = 0;
|
||||
rc = ResultSuccess;
|
||||
}
|
||||
if (R_FAILED(rc)) {
|
||||
storage.reset();
|
||||
@@ -295,7 +295,7 @@ Result FsMitmService::OpenDataStorageByDataId(Out<std::shared_ptr<IStorageInterf
|
||||
|
||||
std::shared_ptr<IStorageInterface> storage = nullptr;
|
||||
u32 out_domain_id = 0;
|
||||
Result rc = 0;
|
||||
Result rc = ResultSuccess;
|
||||
|
||||
bool has_cache = StorageCacheGetEntry(data_id, &storage);
|
||||
|
||||
@@ -320,7 +320,7 @@ Result FsMitmService::OpenDataStorageByDataId(Out<std::shared_ptr<IStorageInterf
|
||||
out_domain_id = s.s.object_id;
|
||||
}
|
||||
} else {
|
||||
rc = 0;
|
||||
rc = ResultSuccess;
|
||||
}
|
||||
if (R_FAILED(rc)) {
|
||||
storage.reset();
|
||||
|
||||
@@ -26,7 +26,7 @@ void NsWebMitmService::PostProcess(IMitmServiceObject *obj, IpcResponseContext *
|
||||
Result NsWebMitmService::GetDocumentInterface(Out<std::shared_ptr<NsDocumentService>> out_intf) {
|
||||
std::shared_ptr<NsDocumentService> intf = nullptr;
|
||||
u32 out_domain_id = 0;
|
||||
Result rc = 0;
|
||||
Result rc = ResultSuccess;
|
||||
|
||||
ON_SCOPE_EXIT {
|
||||
if (R_SUCCEEDED(rc)) {
|
||||
|
||||
@@ -81,5 +81,5 @@ Result VersionManager::GetFirmwareVersion(u64 title_id, SetSysFirmwareVersion *o
|
||||
*out = g_fw_version;
|
||||
}
|
||||
|
||||
return 0;
|
||||
return ResultSuccess;
|
||||
}
|
||||
@@ -87,7 +87,7 @@ Result SettingsItemManager::ValidateName(const char *name, size_t max_size) {
|
||||
return 0x20A69;
|
||||
}
|
||||
|
||||
return 0x0;
|
||||
return ResultSuccess;
|
||||
}
|
||||
|
||||
Result SettingsItemManager::ValidateName(const char *name) {
|
||||
@@ -110,7 +110,7 @@ Result SettingsItemManager::ValidateKey(const char *key, size_t max_size) {
|
||||
return 0x20C69;
|
||||
}
|
||||
|
||||
return 0x0;
|
||||
return ResultSuccess;
|
||||
}
|
||||
|
||||
Result SettingsItemManager::ValidateKey(const char *key) {
|
||||
@@ -222,7 +222,7 @@ static Result ParseValue(const char *name, const char *key, const char *val_tup)
|
||||
}
|
||||
|
||||
g_settings_items[kv] = value;
|
||||
return 0x0;
|
||||
return ResultSuccess;
|
||||
}
|
||||
|
||||
static int SettingsItemIniHandler(void *user, const char *name, const char *key, const char *value) {
|
||||
@@ -287,7 +287,7 @@ Result SettingsItemManager::GetValueSize(const char *name, const char *key, u64
|
||||
}
|
||||
|
||||
*out_size = it->second.size;
|
||||
return 0x0;
|
||||
return ResultSuccess;
|
||||
}
|
||||
|
||||
Result SettingsItemManager::GetValue(const char *name, const char *key, void *out, size_t max_size, u64 *out_size) {
|
||||
@@ -305,5 +305,5 @@ Result SettingsItemManager::GetValue(const char *name, const char *key, void *ou
|
||||
*out_size = copy_size;
|
||||
|
||||
memcpy(out, it->second.data, copy_size);
|
||||
return 0x0;
|
||||
return ResultSuccess;
|
||||
}
|
||||
|
||||
@@ -343,7 +343,7 @@ Result Utils::SaveSdFileForAtmosphere(u64 title_id, const char *fn, void *data,
|
||||
return ResultFsSdCardNotPresent;
|
||||
}
|
||||
|
||||
Result rc = 0;
|
||||
Result rc = ResultSuccess;
|
||||
|
||||
char path[FS_MAX_PATH];
|
||||
if (*fn == '/') {
|
||||
@@ -458,7 +458,7 @@ Result Utils::GetKeysHeld(u64 *keys) {
|
||||
hidScanInput();
|
||||
*keys = hidKeysHeld(CONTROLLER_P1_AUTO);
|
||||
|
||||
return 0x0;
|
||||
return ResultSuccess;
|
||||
}
|
||||
|
||||
static bool HasOverrideKey(OverrideKey *cfg) {
|
||||
|
||||
Reference in New Issue
Block a user