mirror of
https://github.com/Atmosphere-NX/Atmosphere.git
synced 2025-05-23 03:06:52 -04:00
fs: revise allocation-fail result names
This commit is contained in:
parent
11e4bed199
commit
e13b81aa9e
50 changed files with 304 additions and 218 deletions
|
@ -23,7 +23,7 @@ namespace ams::fssrv::fscreator {
|
|||
|
||||
/* Allocate a local filesystem. */
|
||||
auto local_fs = fs::AllocateShared<fssystem::LocalFileSystem>();
|
||||
R_UNLESS(local_fs != nullptr, fs::ResultAllocationFailureInLocalFileSystemCreatorA());
|
||||
R_UNLESS(local_fs != nullptr, fs::ResultAllocationMemoryFailedInLocalFileSystemCreatorA());
|
||||
|
||||
/* If we're supposed to make sure the root path exists, do so. */
|
||||
if (ensure_root) {
|
||||
|
|
|
@ -20,7 +20,7 @@ namespace ams::fssrv::fscreator {
|
|||
Result PartitionFileSystemCreator::Create(std::shared_ptr<fs::fsa::IFileSystem> *out, std::shared_ptr<fs::IStorage> storage) {
|
||||
/* Allocate a filesystem. */
|
||||
std::shared_ptr fs = fssystem::AllocateShared<fssystem::PartitionFileSystem>();
|
||||
R_UNLESS(fs != nullptr, fs::ResultAllocationFailureInPartitionFileSystemCreatorA());
|
||||
R_UNLESS(fs != nullptr, fs::ResultAllocationMemoryFailedInPartitionFileSystemCreatorA());
|
||||
|
||||
/* Initialize the filesystem. */
|
||||
R_TRY(fs->Initialize(std::move(storage)));
|
||||
|
|
|
@ -57,7 +57,7 @@ namespace ams::fssrv::fscreator {
|
|||
Result RomFileSystemCreator::Create(std::shared_ptr<fs::fsa::IFileSystem> *out, std::shared_ptr<fs::IStorage> storage) {
|
||||
/* Allocate a filesystem. */
|
||||
std::shared_ptr fs = fssystem::AllocateShared<RomFileSystemWithBuffer>(m_allocator);
|
||||
R_UNLESS(fs != nullptr, fs::ResultAllocationFailureInRomFileSystemCreatorA());
|
||||
R_UNLESS(fs != nullptr, fs::ResultAllocationMemoryFailedInRomFileSystemCreatorA());
|
||||
|
||||
/* Initialize the filesystem. */
|
||||
R_TRY(fs->Initialize(std::move(storage)));
|
||||
|
|
|
@ -50,7 +50,7 @@ namespace ams::fssrv::fscreator {
|
|||
Result StorageOnNcaCreator::CreateNcaReader(std::shared_ptr<fssystem::NcaReader> *out, std::shared_ptr<fs::IStorage> storage) {
|
||||
/* Create a reader. */
|
||||
std::shared_ptr reader = fssystem::AllocateShared<fssystem::NcaReader>();
|
||||
R_UNLESS(reader != nullptr, fs::ResultAllocationFailureInStorageOnNcaCreatorB());
|
||||
R_UNLESS(reader != nullptr, fs::ResultAllocationMemoryFailedInStorageOnNcaCreatorB());
|
||||
|
||||
/* Initialize the reader. */
|
||||
R_TRY(reader->Initialize(std::move(storage), m_nca_crypto_cfg, m_nca_compression_cfg, m_hash_generator_factory_selector));
|
||||
|
|
|
@ -26,7 +26,7 @@ namespace ams::fssrv::fscreator {
|
|||
|
||||
/* Allocate a SubDirectoryFileSystem. */
|
||||
auto sub_dir_fs = fs::AllocateShared<fssystem::SubDirectoryFileSystem>(std::move(base_fs));
|
||||
R_UNLESS(sub_dir_fs != nullptr, fs::ResultAllocationFailureInSubDirectoryFileSystemCreatorA());
|
||||
R_UNLESS(sub_dir_fs != nullptr, fs::ResultAllocationMemoryFailedInSubDirectoryFileSystemCreatorA());
|
||||
|
||||
/* Initialize the new filesystem. */
|
||||
R_TRY(sub_dir_fs->Initialize(path));
|
||||
|
|
|
@ -186,7 +186,7 @@ namespace ams::fssrv {
|
|||
|
||||
/* Create an interface adapter. */
|
||||
auto sf_fs = impl::FileSystemObjectFactory::CreateSharedEmplaced<fssrv::sf::IFileSystem, impl::FileSystemInterfaceAdapter>(std::move(fs), host_path_flags, false);
|
||||
R_UNLESS(sf_fs != nullptr, fs::ResultAllocationFailureInFileSystemProxyImplA());
|
||||
R_UNLESS(sf_fs != nullptr, fs::ResultAllocationMemoryFailedInFileSystemProxyImplA());
|
||||
|
||||
/* Set the output. */
|
||||
*out = std::move(sf_fs);
|
||||
|
|
|
@ -251,12 +251,12 @@ namespace ams::fssrv::impl {
|
|||
const auto target_object_id = file->GetDomainObjectId();
|
||||
|
||||
ams::sf::SharedPointer<fssrv::sf::IFile> file_intf = FileSystemObjectFactory::CreateSharedEmplaced<fssrv::sf::IFile, FileInterfaceAdapter>(std::move(file), this, m_allow_all_operations);
|
||||
R_UNLESS(file_intf != nullptr, fs::ResultAllocationFailureInFileSystemInterfaceAdapter());
|
||||
R_UNLESS(file_intf != nullptr, fs::ResultAllocationMemoryFailedInFileSystemInterfaceAdapterA());
|
||||
|
||||
out.SetValue(std::move(file_intf), target_object_id);
|
||||
} else {
|
||||
ams::sf::SharedPointer<fssrv::sf::IFile> file_intf = FileSystemObjectFactory::CreateSharedEmplaced<fssrv::sf::IFile, FileInterfaceAdapter>(std::move(file), this, m_allow_all_operations);
|
||||
R_UNLESS(file_intf != nullptr, fs::ResultAllocationFailureInFileSystemInterfaceAdapter());
|
||||
R_UNLESS(file_intf != nullptr, fs::ResultAllocationMemoryFailedInFileSystemInterfaceAdapterA());
|
||||
|
||||
out.SetValue(std::move(file_intf));
|
||||
}
|
||||
|
@ -281,12 +281,12 @@ namespace ams::fssrv::impl {
|
|||
const auto target_object_id = dir->GetDomainObjectId();
|
||||
|
||||
ams::sf::SharedPointer<fssrv::sf::IDirectory> dir_intf = FileSystemObjectFactory::CreateSharedEmplaced<fssrv::sf::IDirectory, DirectoryInterfaceAdapter>(std::move(dir), this, m_allow_all_operations);
|
||||
R_UNLESS(dir_intf != nullptr, fs::ResultAllocationFailureInFileSystemInterfaceAdapter());
|
||||
R_UNLESS(dir_intf != nullptr, fs::ResultAllocationMemoryFailedInFileSystemInterfaceAdapterA());
|
||||
|
||||
out.SetValue(std::move(dir_intf), target_object_id);
|
||||
} else {
|
||||
ams::sf::SharedPointer<fssrv::sf::IDirectory> dir_intf = FileSystemObjectFactory::CreateSharedEmplaced<fssrv::sf::IDirectory, DirectoryInterfaceAdapter>(std::move(dir), this, m_allow_all_operations);
|
||||
R_UNLESS(dir_intf != nullptr, fs::ResultAllocationFailureInFileSystemInterfaceAdapter());
|
||||
R_UNLESS(dir_intf != nullptr, fs::ResultAllocationMemoryFailedInFileSystemInterfaceAdapterA());
|
||||
|
||||
out.SetValue(std::move(dir_intf));
|
||||
}
|
||||
|
@ -358,7 +358,7 @@ namespace ams::fssrv::impl {
|
|||
R_TRY(fsFsOpenFile(std::addressof(m_base_fs), path.str, mode, std::addressof(f)));
|
||||
|
||||
auto intf = FileSystemObjectFactory::CreateSharedEmplaced<fssrv::sf::IFile, RemoteFile>(f);
|
||||
R_UNLESS(intf != nullptr, fs::ResultAllocationFailureInFileSystemInterfaceAdapter());
|
||||
R_UNLESS(intf != nullptr, fs::ResultAllocationMemoryFailedInFileSystemInterfaceAdapterA());
|
||||
|
||||
out.SetValue(std::move(intf));
|
||||
R_SUCCEED();
|
||||
|
@ -369,7 +369,7 @@ namespace ams::fssrv::impl {
|
|||
R_TRY(fsFsOpenDirectory(std::addressof(m_base_fs), path.str, mode, std::addressof(d)));
|
||||
|
||||
auto intf = FileSystemObjectFactory::CreateSharedEmplaced<fssrv::sf::IDirectory, RemoteDirectory>(d);
|
||||
R_UNLESS(intf != nullptr, fs::ResultAllocationFailureInFileSystemInterfaceAdapter());
|
||||
R_UNLESS(intf != nullptr, fs::ResultAllocationMemoryFailedInFileSystemInterfaceAdapterA());
|
||||
|
||||
out.SetValue(std::move(intf));
|
||||
R_SUCCEED();
|
||||
|
|
|
@ -21,13 +21,13 @@ namespace ams::fssrv::impl {
|
|||
Result ProgramRegistryManager::RegisterProgram(u64 process_id, u64 program_id, u8 storage_id, const void *data, s64 data_size, const void *desc, s64 desc_size) {
|
||||
/* Allocate a new node. */
|
||||
std::unique_ptr<ProgramInfoNode> new_node(new ProgramInfoNode());
|
||||
R_UNLESS(new_node != nullptr, fs::ResultAllocationFailureInProgramRegistryManagerA());
|
||||
R_UNLESS(new_node != nullptr, fs::ResultAllocationMemoryFailedInProgramRegistryManagerA());
|
||||
|
||||
/* Create a new program info. */
|
||||
{
|
||||
/* Allocate the new info. */
|
||||
auto new_info = fssystem::AllocateShared<ProgramInfo>(process_id, program_id, storage_id, data, data_size, desc, desc_size);
|
||||
R_UNLESS(new_info != nullptr, fs::ResultAllocationFailureInProgramRegistryManagerA());
|
||||
R_UNLESS(new_info != nullptr, fs::ResultAllocationMemoryFailedInProgramRegistryManagerA());
|
||||
|
||||
/* Set the info in the node. */
|
||||
new_node->program_info = std::move(new_info);
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue