diff options
Diffstat (limited to 'src/core/hle/service/filesystem/filesystem.cpp')
-rw-r--r-- | src/core/hle/service/filesystem/filesystem.cpp | 27 |
1 files changed, 12 insertions, 15 deletions
diff --git a/src/core/hle/service/filesystem/filesystem.cpp b/src/core/hle/service/filesystem/filesystem.cpp index f8f9e32f7..3703ca4c6 100644 --- a/src/core/hle/service/filesystem/filesystem.cpp +++ b/src/core/hle/service/filesystem/filesystem.cpp @@ -13,7 +13,6 @@ #include "core/file_sys/control_metadata.h" #include "core/file_sys/errors.h" #include "core/file_sys/mode.h" -#include "core/file_sys/partition_filesystem.h" #include "core/file_sys/patch_manager.h" #include "core/file_sys/registered_cache.h" #include "core/file_sys/romfs_factory.h" @@ -21,7 +20,6 @@ #include "core/file_sys/sdmc_factory.h" #include "core/file_sys/vfs.h" #include "core/file_sys/vfs_offset.h" -#include "core/hle/kernel/k_process.h" #include "core/hle/service/filesystem/filesystem.h" #include "core/hle/service/filesystem/fsp_ldr.h" #include "core/hle/service/filesystem/fsp_pr.h" @@ -226,11 +224,10 @@ ResultVal<FileSys::VirtualFile> VfsDirectoryServiceWrapper::OpenFile(const std:: } if (mode == FileSys::Mode::Append) { - return MakeResult<FileSys::VirtualFile>( - std::make_shared<FileSys::OffsetVfsFile>(file, 0, file->GetSize())); + return std::make_shared<FileSys::OffsetVfsFile>(file, 0, file->GetSize()); } - return MakeResult<FileSys::VirtualFile>(file); + return file; } ResultVal<FileSys::VirtualDir> VfsDirectoryServiceWrapper::OpenDirectory(const std::string& path_) { @@ -240,7 +237,7 @@ ResultVal<FileSys::VirtualDir> VfsDirectoryServiceWrapper::OpenDirectory(const s // TODO(DarkLordZach): Find a better error code for this return FileSys::ERROR_PATH_NOT_FOUND; } - return MakeResult(dir); + return dir; } ResultVal<FileSys::EntryType> VfsDirectoryServiceWrapper::GetEntryType( @@ -252,12 +249,12 @@ ResultVal<FileSys::EntryType> VfsDirectoryServiceWrapper::GetEntryType( auto filename = Common::FS::GetFilename(path); // TODO(Subv): Some games use the '/' path, find out what this means. if (filename.empty()) - return MakeResult(FileSys::EntryType::Directory); + return FileSys::EntryType::Directory; if (dir->GetFile(filename) != nullptr) - return MakeResult(FileSys::EntryType::File); + return FileSys::EntryType::File; if (dir->GetSubdirectory(filename) != nullptr) - return MakeResult(FileSys::EntryType::Directory); + return FileSys::EntryType::Directory; return FileSys::ERROR_PATH_NOT_FOUND; } @@ -270,7 +267,7 @@ ResultVal<FileSys::FileTimeStampRaw> VfsDirectoryServiceWrapper::GetFileTimeStam if (GetEntryType(path).Failed()) { return FileSys::ERROR_PATH_NOT_FOUND; } - return MakeResult(dir->GetFileTimeStamp(Common::FS::GetFilename(path))); + return dir->GetFileTimeStamp(Common::FS::GetFilename(path)); } FileSystemController::FileSystemController(Core::System& system_) : system{system_} {} @@ -322,7 +319,7 @@ ResultVal<FileSys::VirtualFile> FileSystemController::OpenRomFSCurrentProcess() return ResultUnknown; } - return romfs_factory->OpenCurrentProcess(system.CurrentProcess()->GetTitleID()); + return romfs_factory->OpenCurrentProcess(system.GetCurrentProcessProgramID()); } ResultVal<FileSys::VirtualFile> FileSystemController::OpenPatchedRomFS( @@ -395,7 +392,7 @@ ResultVal<FileSys::VirtualDir> FileSystemController::OpenSaveDataSpace( return FileSys::ERROR_ENTITY_NOT_FOUND; } - return MakeResult(save_data_factory->GetSaveDataSpaceDirectory(space)); + return save_data_factory->GetSaveDataSpaceDirectory(space); } ResultVal<FileSys::VirtualDir> FileSystemController::OpenSDMC() const { @@ -421,7 +418,7 @@ ResultVal<FileSys::VirtualDir> FileSystemController::OpenBISPartition( return FileSys::ERROR_INVALID_ARGUMENT; } - return MakeResult<FileSys::VirtualDir>(std::move(part)); + return part; } ResultVal<FileSys::VirtualFile> FileSystemController::OpenBISPartitionStorage( @@ -437,7 +434,7 @@ ResultVal<FileSys::VirtualFile> FileSystemController::OpenBISPartitionStorage( return FileSys::ERROR_INVALID_ARGUMENT; } - return MakeResult<FileSys::VirtualFile>(std::move(part)); + return part; } u64 FileSystemController::GetFreeSpaceSize(FileSys::StorageId id) const { @@ -507,7 +504,7 @@ FileSys::SaveDataSize FileSystemController::ReadSaveDataSize(FileSys::SaveDataTy const auto res = system.GetAppLoader().ReadControlData(nacp); if (res != Loader::ResultStatus::Success) { - const FileSys::PatchManager pm{system.CurrentProcess()->GetTitleID(), + const FileSys::PatchManager pm{system.GetCurrentProcessProgramID(), system.GetFileSystemController(), system.GetContentProvider()}; const auto metadata = pm.GetControlMetadata(); |