diff options
| author | 2021-06-02 15:29:09 -0700 | |
|---|---|---|
| committer | 2021-06-02 15:29:09 -0700 | |
| commit | 4ea171fa5e50723d50b57b26aaaca2fac30eea57 (patch) | |
| tree | ef2f0869252f59b0b8aeb62a48e2a233c0f94664 /src/core/hle/service/filesystem | |
| parent | Merge pull request #6403 from Kewlan/game-list-for-loop-optimization (diff) | |
| parent | general: Replace RESULT_UNKNOWN with ResultUnknown (diff) | |
| download | yuzu-4ea171fa5e50723d50b57b26aaaca2fac30eea57.tar.gz yuzu-4ea171fa5e50723d50b57b26aaaca2fac30eea57.tar.xz yuzu-4ea171fa5e50723d50b57b26aaaca2fac30eea57.zip | |
Merge pull request #6308 from Morph1984/result
general: Replace RESULT_NAME with ResultName
Diffstat (limited to 'src/core/hle/service/filesystem')
| -rw-r--r-- | src/core/hle/service/filesystem/filesystem.cpp | 62 | ||||
| -rw-r--r-- | src/core/hle/service/filesystem/fsp_srv.cpp | 76 |
2 files changed, 69 insertions, 69 deletions
diff --git a/src/core/hle/service/filesystem/filesystem.cpp b/src/core/hle/service/filesystem/filesystem.cpp index 78664439d..4a1908bcb 100644 --- a/src/core/hle/service/filesystem/filesystem.cpp +++ b/src/core/hle/service/filesystem/filesystem.cpp | |||
| @@ -60,27 +60,27 @@ ResultCode VfsDirectoryServiceWrapper::CreateFile(const std::string& path_, u64 | |||
| 60 | } | 60 | } |
| 61 | 61 | ||
| 62 | const auto entry_type = GetEntryType(path); | 62 | const auto entry_type = GetEntryType(path); |
| 63 | if (entry_type.Code() == RESULT_SUCCESS) { | 63 | if (entry_type.Code() == ResultSuccess) { |
| 64 | return FileSys::ERROR_PATH_ALREADY_EXISTS; | 64 | return FileSys::ERROR_PATH_ALREADY_EXISTS; |
| 65 | } | 65 | } |
| 66 | 66 | ||
| 67 | auto file = dir->CreateFile(Common::FS::GetFilename(path)); | 67 | auto file = dir->CreateFile(Common::FS::GetFilename(path)); |
| 68 | if (file == nullptr) { | 68 | if (file == nullptr) { |
| 69 | // TODO(DarkLordZach): Find a better error code for this | 69 | // TODO(DarkLordZach): Find a better error code for this |
| 70 | return RESULT_UNKNOWN; | 70 | return ResultUnknown; |
| 71 | } | 71 | } |
| 72 | if (!file->Resize(size)) { | 72 | if (!file->Resize(size)) { |
| 73 | // TODO(DarkLordZach): Find a better error code for this | 73 | // TODO(DarkLordZach): Find a better error code for this |
| 74 | return RESULT_UNKNOWN; | 74 | return ResultUnknown; |
| 75 | } | 75 | } |
| 76 | return RESULT_SUCCESS; | 76 | return ResultSuccess; |
| 77 | } | 77 | } |
| 78 | 78 | ||
| 79 | ResultCode VfsDirectoryServiceWrapper::DeleteFile(const std::string& path_) const { | 79 | ResultCode VfsDirectoryServiceWrapper::DeleteFile(const std::string& path_) const { |
| 80 | std::string path(Common::FS::SanitizePath(path_)); | 80 | std::string path(Common::FS::SanitizePath(path_)); |
| 81 | if (path.empty()) { | 81 | if (path.empty()) { |
| 82 | // TODO(DarkLordZach): Why do games call this and what should it do? Works as is but... | 82 | // TODO(DarkLordZach): Why do games call this and what should it do? Works as is but... |
| 83 | return RESULT_SUCCESS; | 83 | return ResultSuccess; |
| 84 | } | 84 | } |
| 85 | 85 | ||
| 86 | auto dir = GetDirectoryRelativeWrapped(backing, Common::FS::GetParentPath(path)); | 86 | auto dir = GetDirectoryRelativeWrapped(backing, Common::FS::GetParentPath(path)); |
| @@ -89,10 +89,10 @@ ResultCode VfsDirectoryServiceWrapper::DeleteFile(const std::string& path_) cons | |||
| 89 | } | 89 | } |
| 90 | if (!dir->DeleteFile(Common::FS::GetFilename(path))) { | 90 | if (!dir->DeleteFile(Common::FS::GetFilename(path))) { |
| 91 | // TODO(DarkLordZach): Find a better error code for this | 91 | // TODO(DarkLordZach): Find a better error code for this |
| 92 | return RESULT_UNKNOWN; | 92 | return ResultUnknown; |
| 93 | } | 93 | } |
| 94 | 94 | ||
| 95 | return RESULT_SUCCESS; | 95 | return ResultSuccess; |
| 96 | } | 96 | } |
| 97 | 97 | ||
| 98 | ResultCode VfsDirectoryServiceWrapper::CreateDirectory(const std::string& path_) const { | 98 | ResultCode VfsDirectoryServiceWrapper::CreateDirectory(const std::string& path_) const { |
| @@ -104,9 +104,9 @@ ResultCode VfsDirectoryServiceWrapper::CreateDirectory(const std::string& path_) | |||
| 104 | auto new_dir = dir->CreateSubdirectory(Common::FS::GetFilename(path)); | 104 | auto new_dir = dir->CreateSubdirectory(Common::FS::GetFilename(path)); |
| 105 | if (new_dir == nullptr) { | 105 | if (new_dir == nullptr) { |
| 106 | // TODO(DarkLordZach): Find a better error code for this | 106 | // TODO(DarkLordZach): Find a better error code for this |
| 107 | return RESULT_UNKNOWN; | 107 | return ResultUnknown; |
| 108 | } | 108 | } |
| 109 | return RESULT_SUCCESS; | 109 | return ResultSuccess; |
| 110 | } | 110 | } |
| 111 | 111 | ||
| 112 | ResultCode VfsDirectoryServiceWrapper::DeleteDirectory(const std::string& path_) const { | 112 | ResultCode VfsDirectoryServiceWrapper::DeleteDirectory(const std::string& path_) const { |
| @@ -114,9 +114,9 @@ ResultCode VfsDirectoryServiceWrapper::DeleteDirectory(const std::string& path_) | |||
| 114 | auto dir = GetDirectoryRelativeWrapped(backing, Common::FS::GetParentPath(path)); | 114 | auto dir = GetDirectoryRelativeWrapped(backing, Common::FS::GetParentPath(path)); |
| 115 | if (!dir->DeleteSubdirectory(Common::FS::GetFilename(path))) { | 115 | if (!dir->DeleteSubdirectory(Common::FS::GetFilename(path))) { |
| 116 | // TODO(DarkLordZach): Find a better error code for this | 116 | // TODO(DarkLordZach): Find a better error code for this |
| 117 | return RESULT_UNKNOWN; | 117 | return ResultUnknown; |
| 118 | } | 118 | } |
| 119 | return RESULT_SUCCESS; | 119 | return ResultSuccess; |
| 120 | } | 120 | } |
| 121 | 121 | ||
| 122 | ResultCode VfsDirectoryServiceWrapper::DeleteDirectoryRecursively(const std::string& path_) const { | 122 | ResultCode VfsDirectoryServiceWrapper::DeleteDirectoryRecursively(const std::string& path_) const { |
| @@ -124,9 +124,9 @@ ResultCode VfsDirectoryServiceWrapper::DeleteDirectoryRecursively(const std::str | |||
| 124 | auto dir = GetDirectoryRelativeWrapped(backing, Common::FS::GetParentPath(path)); | 124 | auto dir = GetDirectoryRelativeWrapped(backing, Common::FS::GetParentPath(path)); |
| 125 | if (!dir->DeleteSubdirectoryRecursive(Common::FS::GetFilename(path))) { | 125 | if (!dir->DeleteSubdirectoryRecursive(Common::FS::GetFilename(path))) { |
| 126 | // TODO(DarkLordZach): Find a better error code for this | 126 | // TODO(DarkLordZach): Find a better error code for this |
| 127 | return RESULT_UNKNOWN; | 127 | return ResultUnknown; |
| 128 | } | 128 | } |
| 129 | return RESULT_SUCCESS; | 129 | return ResultSuccess; |
| 130 | } | 130 | } |
| 131 | 131 | ||
| 132 | ResultCode VfsDirectoryServiceWrapper::CleanDirectoryRecursively(const std::string& path) const { | 132 | ResultCode VfsDirectoryServiceWrapper::CleanDirectoryRecursively(const std::string& path) const { |
| @@ -135,10 +135,10 @@ ResultCode VfsDirectoryServiceWrapper::CleanDirectoryRecursively(const std::stri | |||
| 135 | 135 | ||
| 136 | if (!dir->CleanSubdirectoryRecursive(Common::FS::GetFilename(sanitized_path))) { | 136 | if (!dir->CleanSubdirectoryRecursive(Common::FS::GetFilename(sanitized_path))) { |
| 137 | // TODO(DarkLordZach): Find a better error code for this | 137 | // TODO(DarkLordZach): Find a better error code for this |
| 138 | return RESULT_UNKNOWN; | 138 | return ResultUnknown; |
| 139 | } | 139 | } |
| 140 | 140 | ||
| 141 | return RESULT_SUCCESS; | 141 | return ResultSuccess; |
| 142 | } | 142 | } |
| 143 | 143 | ||
| 144 | ResultCode VfsDirectoryServiceWrapper::RenameFile(const std::string& src_path_, | 144 | ResultCode VfsDirectoryServiceWrapper::RenameFile(const std::string& src_path_, |
| @@ -152,14 +152,14 @@ ResultCode VfsDirectoryServiceWrapper::RenameFile(const std::string& src_path_, | |||
| 152 | return FileSys::ERROR_PATH_NOT_FOUND; | 152 | return FileSys::ERROR_PATH_NOT_FOUND; |
| 153 | if (!src->Rename(Common::FS::GetFilename(dest_path))) { | 153 | if (!src->Rename(Common::FS::GetFilename(dest_path))) { |
| 154 | // TODO(DarkLordZach): Find a better error code for this | 154 | // TODO(DarkLordZach): Find a better error code for this |
| 155 | return RESULT_UNKNOWN; | 155 | return ResultUnknown; |
| 156 | } | 156 | } |
| 157 | return RESULT_SUCCESS; | 157 | return ResultSuccess; |
| 158 | } | 158 | } |
| 159 | 159 | ||
| 160 | // Move by hand -- TODO(DarkLordZach): Optimize | 160 | // Move by hand -- TODO(DarkLordZach): Optimize |
| 161 | auto c_res = CreateFile(dest_path, src->GetSize()); | 161 | auto c_res = CreateFile(dest_path, src->GetSize()); |
| 162 | if (c_res != RESULT_SUCCESS) | 162 | if (c_res != ResultSuccess) |
| 163 | return c_res; | 163 | return c_res; |
| 164 | 164 | ||
| 165 | auto dest = backing->GetFileRelative(dest_path); | 165 | auto dest = backing->GetFileRelative(dest_path); |
| @@ -170,10 +170,10 @@ ResultCode VfsDirectoryServiceWrapper::RenameFile(const std::string& src_path_, | |||
| 170 | 170 | ||
| 171 | if (!src->GetContainingDirectory()->DeleteFile(Common::FS::GetFilename(src_path))) { | 171 | if (!src->GetContainingDirectory()->DeleteFile(Common::FS::GetFilename(src_path))) { |
| 172 | // TODO(DarkLordZach): Find a better error code for this | 172 | // TODO(DarkLordZach): Find a better error code for this |
| 173 | return RESULT_UNKNOWN; | 173 | return ResultUnknown; |
| 174 | } | 174 | } |
| 175 | 175 | ||
| 176 | return RESULT_SUCCESS; | 176 | return ResultSuccess; |
| 177 | } | 177 | } |
| 178 | 178 | ||
| 179 | ResultCode VfsDirectoryServiceWrapper::RenameDirectory(const std::string& src_path_, | 179 | ResultCode VfsDirectoryServiceWrapper::RenameDirectory(const std::string& src_path_, |
| @@ -187,9 +187,9 @@ ResultCode VfsDirectoryServiceWrapper::RenameDirectory(const std::string& src_pa | |||
| 187 | return FileSys::ERROR_PATH_NOT_FOUND; | 187 | return FileSys::ERROR_PATH_NOT_FOUND; |
| 188 | if (!src->Rename(Common::FS::GetFilename(dest_path))) { | 188 | if (!src->Rename(Common::FS::GetFilename(dest_path))) { |
| 189 | // TODO(DarkLordZach): Find a better error code for this | 189 | // TODO(DarkLordZach): Find a better error code for this |
| 190 | return RESULT_UNKNOWN; | 190 | return ResultUnknown; |
| 191 | } | 191 | } |
| 192 | return RESULT_SUCCESS; | 192 | return ResultSuccess; |
| 193 | } | 193 | } |
| 194 | 194 | ||
| 195 | // TODO(DarkLordZach): Implement renaming across the tree (move). | 195 | // TODO(DarkLordZach): Implement renaming across the tree (move). |
| @@ -199,7 +199,7 @@ ResultCode VfsDirectoryServiceWrapper::RenameDirectory(const std::string& src_pa | |||
| 199 | src_path, dest_path); | 199 | src_path, dest_path); |
| 200 | 200 | ||
| 201 | // TODO(DarkLordZach): Find a better error code for this | 201 | // TODO(DarkLordZach): Find a better error code for this |
| 202 | return RESULT_UNKNOWN; | 202 | return ResultUnknown; |
| 203 | } | 203 | } |
| 204 | 204 | ||
| 205 | ResultVal<FileSys::VirtualFile> VfsDirectoryServiceWrapper::OpenFile(const std::string& path_, | 205 | ResultVal<FileSys::VirtualFile> VfsDirectoryServiceWrapper::OpenFile(const std::string& path_, |
| @@ -258,7 +258,7 @@ FileSystemController::~FileSystemController() = default; | |||
| 258 | ResultCode FileSystemController::RegisterRomFS(std::unique_ptr<FileSys::RomFSFactory>&& factory) { | 258 | ResultCode FileSystemController::RegisterRomFS(std::unique_ptr<FileSys::RomFSFactory>&& factory) { |
| 259 | romfs_factory = std::move(factory); | 259 | romfs_factory = std::move(factory); |
| 260 | LOG_DEBUG(Service_FS, "Registered RomFS"); | 260 | LOG_DEBUG(Service_FS, "Registered RomFS"); |
| 261 | return RESULT_SUCCESS; | 261 | return ResultSuccess; |
| 262 | } | 262 | } |
| 263 | 263 | ||
| 264 | ResultCode FileSystemController::RegisterSaveData( | 264 | ResultCode FileSystemController::RegisterSaveData( |
| @@ -266,21 +266,21 @@ ResultCode FileSystemController::RegisterSaveData( | |||
| 266 | ASSERT_MSG(save_data_factory == nullptr, "Tried to register a second save data"); | 266 | ASSERT_MSG(save_data_factory == nullptr, "Tried to register a second save data"); |
| 267 | save_data_factory = std::move(factory); | 267 | save_data_factory = std::move(factory); |
| 268 | LOG_DEBUG(Service_FS, "Registered save data"); | 268 | LOG_DEBUG(Service_FS, "Registered save data"); |
| 269 | return RESULT_SUCCESS; | 269 | return ResultSuccess; |
| 270 | } | 270 | } |
| 271 | 271 | ||
| 272 | ResultCode FileSystemController::RegisterSDMC(std::unique_ptr<FileSys::SDMCFactory>&& factory) { | 272 | ResultCode FileSystemController::RegisterSDMC(std::unique_ptr<FileSys::SDMCFactory>&& factory) { |
| 273 | ASSERT_MSG(sdmc_factory == nullptr, "Tried to register a second SDMC"); | 273 | ASSERT_MSG(sdmc_factory == nullptr, "Tried to register a second SDMC"); |
| 274 | sdmc_factory = std::move(factory); | 274 | sdmc_factory = std::move(factory); |
| 275 | LOG_DEBUG(Service_FS, "Registered SDMC"); | 275 | LOG_DEBUG(Service_FS, "Registered SDMC"); |
| 276 | return RESULT_SUCCESS; | 276 | return ResultSuccess; |
| 277 | } | 277 | } |
| 278 | 278 | ||
| 279 | ResultCode FileSystemController::RegisterBIS(std::unique_ptr<FileSys::BISFactory>&& factory) { | 279 | ResultCode FileSystemController::RegisterBIS(std::unique_ptr<FileSys::BISFactory>&& factory) { |
| 280 | ASSERT_MSG(bis_factory == nullptr, "Tried to register a second BIS"); | 280 | ASSERT_MSG(bis_factory == nullptr, "Tried to register a second BIS"); |
| 281 | bis_factory = std::move(factory); | 281 | bis_factory = std::move(factory); |
| 282 | LOG_DEBUG(Service_FS, "Registered BIS"); | 282 | LOG_DEBUG(Service_FS, "Registered BIS"); |
| 283 | return RESULT_SUCCESS; | 283 | return ResultSuccess; |
| 284 | } | 284 | } |
| 285 | 285 | ||
| 286 | void FileSystemController::SetPackedUpdate(FileSys::VirtualFile update_raw) { | 286 | void FileSystemController::SetPackedUpdate(FileSys::VirtualFile update_raw) { |
| @@ -297,7 +297,7 @@ ResultVal<FileSys::VirtualFile> FileSystemController::OpenRomFSCurrentProcess() | |||
| 297 | 297 | ||
| 298 | if (romfs_factory == nullptr) { | 298 | if (romfs_factory == nullptr) { |
| 299 | // TODO(bunnei): Find a better error code for this | 299 | // TODO(bunnei): Find a better error code for this |
| 300 | return RESULT_UNKNOWN; | 300 | return ResultUnknown; |
| 301 | } | 301 | } |
| 302 | 302 | ||
| 303 | return romfs_factory->OpenCurrentProcess(system.CurrentProcess()->GetTitleID()); | 303 | return romfs_factory->OpenCurrentProcess(system.CurrentProcess()->GetTitleID()); |
| @@ -309,7 +309,7 @@ ResultVal<FileSys::VirtualFile> FileSystemController::OpenPatchedRomFS( | |||
| 309 | 309 | ||
| 310 | if (romfs_factory == nullptr) { | 310 | if (romfs_factory == nullptr) { |
| 311 | // TODO: Find a better error code for this | 311 | // TODO: Find a better error code for this |
| 312 | return RESULT_UNKNOWN; | 312 | return ResultUnknown; |
| 313 | } | 313 | } |
| 314 | 314 | ||
| 315 | return romfs_factory->OpenPatchedRomFS(title_id, type); | 315 | return romfs_factory->OpenPatchedRomFS(title_id, type); |
| @@ -322,7 +322,7 @@ ResultVal<FileSys::VirtualFile> FileSystemController::OpenPatchedRomFSWithProgra | |||
| 322 | 322 | ||
| 323 | if (romfs_factory == nullptr) { | 323 | if (romfs_factory == nullptr) { |
| 324 | // TODO: Find a better error code for this | 324 | // TODO: Find a better error code for this |
| 325 | return RESULT_UNKNOWN; | 325 | return ResultUnknown; |
| 326 | } | 326 | } |
| 327 | 327 | ||
| 328 | return romfs_factory->OpenPatchedRomFSWithProgramIndex(title_id, program_index, type); | 328 | return romfs_factory->OpenPatchedRomFSWithProgramIndex(title_id, program_index, type); |
| @@ -335,7 +335,7 @@ ResultVal<FileSys::VirtualFile> FileSystemController::OpenRomFS( | |||
| 335 | 335 | ||
| 336 | if (romfs_factory == nullptr) { | 336 | if (romfs_factory == nullptr) { |
| 337 | // TODO(bunnei): Find a better error code for this | 337 | // TODO(bunnei): Find a better error code for this |
| 338 | return RESULT_UNKNOWN; | 338 | return ResultUnknown; |
| 339 | } | 339 | } |
| 340 | 340 | ||
| 341 | return romfs_factory->Open(title_id, storage_id, type); | 341 | return romfs_factory->Open(title_id, storage_id, type); |
diff --git a/src/core/hle/service/filesystem/fsp_srv.cpp b/src/core/hle/service/filesystem/fsp_srv.cpp index 92ea27074..d9e8020b4 100644 --- a/src/core/hle/service/filesystem/fsp_srv.cpp +++ b/src/core/hle/service/filesystem/fsp_srv.cpp | |||
| @@ -100,7 +100,7 @@ private: | |||
| 100 | ctx.WriteBuffer(output); | 100 | ctx.WriteBuffer(output); |
| 101 | 101 | ||
| 102 | IPC::ResponseBuilder rb{ctx, 2}; | 102 | IPC::ResponseBuilder rb{ctx, 2}; |
| 103 | rb.Push(RESULT_SUCCESS); | 103 | rb.Push(ResultSuccess); |
| 104 | } | 104 | } |
| 105 | 105 | ||
| 106 | void GetSize(Kernel::HLERequestContext& ctx) { | 106 | void GetSize(Kernel::HLERequestContext& ctx) { |
| @@ -108,7 +108,7 @@ private: | |||
| 108 | LOG_DEBUG(Service_FS, "called, size={}", size); | 108 | LOG_DEBUG(Service_FS, "called, size={}", size); |
| 109 | 109 | ||
| 110 | IPC::ResponseBuilder rb{ctx, 4}; | 110 | IPC::ResponseBuilder rb{ctx, 4}; |
| 111 | rb.Push(RESULT_SUCCESS); | 111 | rb.Push(ResultSuccess); |
| 112 | rb.Push<u64>(size); | 112 | rb.Push<u64>(size); |
| 113 | } | 113 | } |
| 114 | }; | 114 | }; |
| @@ -162,7 +162,7 @@ private: | |||
| 162 | ctx.WriteBuffer(output); | 162 | ctx.WriteBuffer(output); |
| 163 | 163 | ||
| 164 | IPC::ResponseBuilder rb{ctx, 4}; | 164 | IPC::ResponseBuilder rb{ctx, 4}; |
| 165 | rb.Push(RESULT_SUCCESS); | 165 | rb.Push(ResultSuccess); |
| 166 | rb.Push(static_cast<u64>(output.size())); | 166 | rb.Push(static_cast<u64>(output.size())); |
| 167 | } | 167 | } |
| 168 | 168 | ||
| @@ -206,7 +206,7 @@ private: | |||
| 206 | written); | 206 | written); |
| 207 | 207 | ||
| 208 | IPC::ResponseBuilder rb{ctx, 2}; | 208 | IPC::ResponseBuilder rb{ctx, 2}; |
| 209 | rb.Push(RESULT_SUCCESS); | 209 | rb.Push(ResultSuccess); |
| 210 | } | 210 | } |
| 211 | 211 | ||
| 212 | void Flush(Kernel::HLERequestContext& ctx) { | 212 | void Flush(Kernel::HLERequestContext& ctx) { |
| @@ -215,7 +215,7 @@ private: | |||
| 215 | // Exists for SDK compatibiltity -- No need to flush file. | 215 | // Exists for SDK compatibiltity -- No need to flush file. |
| 216 | 216 | ||
| 217 | IPC::ResponseBuilder rb{ctx, 2}; | 217 | IPC::ResponseBuilder rb{ctx, 2}; |
| 218 | rb.Push(RESULT_SUCCESS); | 218 | rb.Push(ResultSuccess); |
| 219 | } | 219 | } |
| 220 | 220 | ||
| 221 | void SetSize(Kernel::HLERequestContext& ctx) { | 221 | void SetSize(Kernel::HLERequestContext& ctx) { |
| @@ -226,7 +226,7 @@ private: | |||
| 226 | backend->Resize(size); | 226 | backend->Resize(size); |
| 227 | 227 | ||
| 228 | IPC::ResponseBuilder rb{ctx, 2}; | 228 | IPC::ResponseBuilder rb{ctx, 2}; |
| 229 | rb.Push(RESULT_SUCCESS); | 229 | rb.Push(ResultSuccess); |
| 230 | } | 230 | } |
| 231 | 231 | ||
| 232 | void GetSize(Kernel::HLERequestContext& ctx) { | 232 | void GetSize(Kernel::HLERequestContext& ctx) { |
| @@ -234,7 +234,7 @@ private: | |||
| 234 | LOG_DEBUG(Service_FS, "called, size={}", size); | 234 | LOG_DEBUG(Service_FS, "called, size={}", size); |
| 235 | 235 | ||
| 236 | IPC::ResponseBuilder rb{ctx, 4}; | 236 | IPC::ResponseBuilder rb{ctx, 4}; |
| 237 | rb.Push(RESULT_SUCCESS); | 237 | rb.Push(ResultSuccess); |
| 238 | rb.Push<u64>(size); | 238 | rb.Push<u64>(size); |
| 239 | } | 239 | } |
| 240 | }; | 240 | }; |
| @@ -290,7 +290,7 @@ private: | |||
| 290 | ctx.WriteBuffer(begin, range_size); | 290 | ctx.WriteBuffer(begin, range_size); |
| 291 | 291 | ||
| 292 | IPC::ResponseBuilder rb{ctx, 4}; | 292 | IPC::ResponseBuilder rb{ctx, 4}; |
| 293 | rb.Push(RESULT_SUCCESS); | 293 | rb.Push(ResultSuccess); |
| 294 | rb.Push(actual_entries); | 294 | rb.Push(actual_entries); |
| 295 | } | 295 | } |
| 296 | 296 | ||
| @@ -300,7 +300,7 @@ private: | |||
| 300 | u64 count = entries.size() - next_entry_index; | 300 | u64 count = entries.size() - next_entry_index; |
| 301 | 301 | ||
| 302 | IPC::ResponseBuilder rb{ctx, 4}; | 302 | IPC::ResponseBuilder rb{ctx, 4}; |
| 303 | rb.Push(RESULT_SUCCESS); | 303 | rb.Push(ResultSuccess); |
| 304 | rb.Push(count); | 304 | rb.Push(count); |
| 305 | } | 305 | } |
| 306 | }; | 306 | }; |
| @@ -430,7 +430,7 @@ public: | |||
| 430 | auto file = std::make_shared<IFile>(system, result.Unwrap()); | 430 | auto file = std::make_shared<IFile>(system, result.Unwrap()); |
| 431 | 431 | ||
| 432 | IPC::ResponseBuilder rb{ctx, 2, 0, 1}; | 432 | IPC::ResponseBuilder rb{ctx, 2, 0, 1}; |
| 433 | rb.Push(RESULT_SUCCESS); | 433 | rb.Push(ResultSuccess); |
| 434 | rb.PushIpcInterface<IFile>(std::move(file)); | 434 | rb.PushIpcInterface<IFile>(std::move(file)); |
| 435 | } | 435 | } |
| 436 | 436 | ||
| @@ -455,7 +455,7 @@ public: | |||
| 455 | auto directory = std::make_shared<IDirectory>(system, result.Unwrap()); | 455 | auto directory = std::make_shared<IDirectory>(system, result.Unwrap()); |
| 456 | 456 | ||
| 457 | IPC::ResponseBuilder rb{ctx, 2, 0, 1}; | 457 | IPC::ResponseBuilder rb{ctx, 2, 0, 1}; |
| 458 | rb.Push(RESULT_SUCCESS); | 458 | rb.Push(ResultSuccess); |
| 459 | rb.PushIpcInterface<IDirectory>(std::move(directory)); | 459 | rb.PushIpcInterface<IDirectory>(std::move(directory)); |
| 460 | } | 460 | } |
| 461 | 461 | ||
| @@ -473,7 +473,7 @@ public: | |||
| 473 | } | 473 | } |
| 474 | 474 | ||
| 475 | IPC::ResponseBuilder rb{ctx, 3}; | 475 | IPC::ResponseBuilder rb{ctx, 3}; |
| 476 | rb.Push(RESULT_SUCCESS); | 476 | rb.Push(ResultSuccess); |
| 477 | rb.Push<u32>(static_cast<u32>(*result)); | 477 | rb.Push<u32>(static_cast<u32>(*result)); |
| 478 | } | 478 | } |
| 479 | 479 | ||
| @@ -481,14 +481,14 @@ public: | |||
| 481 | LOG_WARNING(Service_FS, "(STUBBED) called"); | 481 | LOG_WARNING(Service_FS, "(STUBBED) called"); |
| 482 | 482 | ||
| 483 | IPC::ResponseBuilder rb{ctx, 2}; | 483 | IPC::ResponseBuilder rb{ctx, 2}; |
| 484 | rb.Push(RESULT_SUCCESS); | 484 | rb.Push(ResultSuccess); |
| 485 | } | 485 | } |
| 486 | 486 | ||
| 487 | void GetFreeSpaceSize(Kernel::HLERequestContext& ctx) { | 487 | void GetFreeSpaceSize(Kernel::HLERequestContext& ctx) { |
| 488 | LOG_DEBUG(Service_FS, "called"); | 488 | LOG_DEBUG(Service_FS, "called"); |
| 489 | 489 | ||
| 490 | IPC::ResponseBuilder rb{ctx, 4}; | 490 | IPC::ResponseBuilder rb{ctx, 4}; |
| 491 | rb.Push(RESULT_SUCCESS); | 491 | rb.Push(ResultSuccess); |
| 492 | rb.Push(size.get_free_size()); | 492 | rb.Push(size.get_free_size()); |
| 493 | } | 493 | } |
| 494 | 494 | ||
| @@ -496,7 +496,7 @@ public: | |||
| 496 | LOG_DEBUG(Service_FS, "called"); | 496 | LOG_DEBUG(Service_FS, "called"); |
| 497 | 497 | ||
| 498 | IPC::ResponseBuilder rb{ctx, 4}; | 498 | IPC::ResponseBuilder rb{ctx, 4}; |
| 499 | rb.Push(RESULT_SUCCESS); | 499 | rb.Push(ResultSuccess); |
| 500 | rb.Push(size.get_total_size()); | 500 | rb.Push(size.get_total_size()); |
| 501 | } | 501 | } |
| 502 | 502 | ||
| @@ -538,7 +538,7 @@ public: | |||
| 538 | ctx.WriteBuffer(begin, range_size); | 538 | ctx.WriteBuffer(begin, range_size); |
| 539 | 539 | ||
| 540 | IPC::ResponseBuilder rb{ctx, 3}; | 540 | IPC::ResponseBuilder rb{ctx, 3}; |
| 541 | rb.Push(RESULT_SUCCESS); | 541 | rb.Push(ResultSuccess); |
| 542 | rb.Push<u32>(static_cast<u32>(actual_entries)); | 542 | rb.Push<u32>(static_cast<u32>(actual_entries)); |
| 543 | } | 543 | } |
| 544 | 544 | ||
| @@ -796,7 +796,7 @@ void FSP_SRV::SetCurrentProcess(Kernel::HLERequestContext& ctx) { | |||
| 796 | LOG_DEBUG(Service_FS, "called. current_process_id=0x{:016X}", current_process_id); | 796 | LOG_DEBUG(Service_FS, "called. current_process_id=0x{:016X}", current_process_id); |
| 797 | 797 | ||
| 798 | IPC::ResponseBuilder rb{ctx, 2}; | 798 | IPC::ResponseBuilder rb{ctx, 2}; |
| 799 | rb.Push(RESULT_SUCCESS); | 799 | rb.Push(ResultSuccess); |
| 800 | } | 800 | } |
| 801 | 801 | ||
| 802 | void FSP_SRV::OpenFileSystemWithPatch(Kernel::HLERequestContext& ctx) { | 802 | void FSP_SRV::OpenFileSystemWithPatch(Kernel::HLERequestContext& ctx) { |
| @@ -807,7 +807,7 @@ void FSP_SRV::OpenFileSystemWithPatch(Kernel::HLERequestContext& ctx) { | |||
| 807 | LOG_WARNING(Service_FS, "(STUBBED) called with type={}, title_id={:016X}", type, title_id); | 807 | LOG_WARNING(Service_FS, "(STUBBED) called with type={}, title_id={:016X}", type, title_id); |
| 808 | 808 | ||
| 809 | IPC::ResponseBuilder rb{ctx, 2, 0, 0}; | 809 | IPC::ResponseBuilder rb{ctx, 2, 0, 0}; |
| 810 | rb.Push(RESULT_UNKNOWN); | 810 | rb.Push(ResultUnknown); |
| 811 | } | 811 | } |
| 812 | 812 | ||
| 813 | void FSP_SRV::OpenSdCardFileSystem(Kernel::HLERequestContext& ctx) { | 813 | void FSP_SRV::OpenSdCardFileSystem(Kernel::HLERequestContext& ctx) { |
| @@ -818,7 +818,7 @@ void FSP_SRV::OpenSdCardFileSystem(Kernel::HLERequestContext& ctx) { | |||
| 818 | SizeGetter::FromStorageId(fsc, FileSys::StorageId::SdCard)); | 818 | SizeGetter::FromStorageId(fsc, FileSys::StorageId::SdCard)); |
| 819 | 819 | ||
| 820 | IPC::ResponseBuilder rb{ctx, 2, 0, 1}; | 820 | IPC::ResponseBuilder rb{ctx, 2, 0, 1}; |
| 821 | rb.Push(RESULT_SUCCESS); | 821 | rb.Push(ResultSuccess); |
| 822 | rb.PushIpcInterface<IFileSystem>(std::move(filesystem)); | 822 | rb.PushIpcInterface<IFileSystem>(std::move(filesystem)); |
| 823 | } | 823 | } |
| 824 | 824 | ||
| @@ -835,7 +835,7 @@ void FSP_SRV::CreateSaveDataFileSystem(Kernel::HLERequestContext& ctx) { | |||
| 835 | fsc.CreateSaveData(FileSys::SaveDataSpaceId::NandUser, save_struct); | 835 | fsc.CreateSaveData(FileSys::SaveDataSpaceId::NandUser, save_struct); |
| 836 | 836 | ||
| 837 | IPC::ResponseBuilder rb{ctx, 2}; | 837 | IPC::ResponseBuilder rb{ctx, 2}; |
| 838 | rb.Push(RESULT_SUCCESS); | 838 | rb.Push(ResultSuccess); |
| 839 | } | 839 | } |
| 840 | 840 | ||
| 841 | void FSP_SRV::OpenSaveDataFileSystem(Kernel::HLERequestContext& ctx) { | 841 | void FSP_SRV::OpenSaveDataFileSystem(Kernel::HLERequestContext& ctx) { |
| @@ -879,7 +879,7 @@ void FSP_SRV::OpenSaveDataFileSystem(Kernel::HLERequestContext& ctx) { | |||
| 879 | SizeGetter::FromStorageId(fsc, id)); | 879 | SizeGetter::FromStorageId(fsc, id)); |
| 880 | 880 | ||
| 881 | IPC::ResponseBuilder rb{ctx, 2, 0, 1}; | 881 | IPC::ResponseBuilder rb{ctx, 2, 0, 1}; |
| 882 | rb.Push(RESULT_SUCCESS); | 882 | rb.Push(ResultSuccess); |
| 883 | rb.PushIpcInterface<IFileSystem>(std::move(filesystem)); | 883 | rb.PushIpcInterface<IFileSystem>(std::move(filesystem)); |
| 884 | } | 884 | } |
| 885 | 885 | ||
| @@ -894,7 +894,7 @@ void FSP_SRV::OpenSaveDataInfoReaderBySaveDataSpaceId(Kernel::HLERequestContext& | |||
| 894 | LOG_INFO(Service_FS, "called, space={}", space); | 894 | LOG_INFO(Service_FS, "called, space={}", space); |
| 895 | 895 | ||
| 896 | IPC::ResponseBuilder rb{ctx, 2, 0, 1}; | 896 | IPC::ResponseBuilder rb{ctx, 2, 0, 1}; |
| 897 | rb.Push(RESULT_SUCCESS); | 897 | rb.Push(ResultSuccess); |
| 898 | rb.PushIpcInterface<ISaveDataInfoReader>( | 898 | rb.PushIpcInterface<ISaveDataInfoReader>( |
| 899 | std::make_shared<ISaveDataInfoReader>(system, space, fsc)); | 899 | std::make_shared<ISaveDataInfoReader>(system, space, fsc)); |
| 900 | } | 900 | } |
| @@ -903,7 +903,7 @@ void FSP_SRV::WriteSaveDataFileSystemExtraDataBySaveDataAttribute(Kernel::HLEReq | |||
| 903 | LOG_WARNING(Service_FS, "(STUBBED) called."); | 903 | LOG_WARNING(Service_FS, "(STUBBED) called."); |
| 904 | 904 | ||
| 905 | IPC::ResponseBuilder rb{ctx, 2}; | 905 | IPC::ResponseBuilder rb{ctx, 2}; |
| 906 | rb.Push(RESULT_SUCCESS); | 906 | rb.Push(ResultSuccess); |
| 907 | } | 907 | } |
| 908 | 908 | ||
| 909 | void FSP_SRV::ReadSaveDataFileSystemExtraDataWithMaskBySaveDataAttribute( | 909 | void FSP_SRV::ReadSaveDataFileSystemExtraDataWithMaskBySaveDataAttribute( |
| @@ -929,7 +929,7 @@ void FSP_SRV::ReadSaveDataFileSystemExtraDataWithMaskBySaveDataAttribute( | |||
| 929 | parameters.attribute.index); | 929 | parameters.attribute.index); |
| 930 | 930 | ||
| 931 | IPC::ResponseBuilder rb{ctx, 3}; | 931 | IPC::ResponseBuilder rb{ctx, 3}; |
| 932 | rb.Push(RESULT_SUCCESS); | 932 | rb.Push(ResultSuccess); |
| 933 | rb.Push(flags); | 933 | rb.Push(flags); |
| 934 | } | 934 | } |
| 935 | 935 | ||
| @@ -941,14 +941,14 @@ void FSP_SRV::OpenDataStorageByCurrentProcess(Kernel::HLERequestContext& ctx) { | |||
| 941 | // TODO (bunnei): Find the right error code to use here | 941 | // TODO (bunnei): Find the right error code to use here |
| 942 | LOG_CRITICAL(Service_FS, "no file system interface available!"); | 942 | LOG_CRITICAL(Service_FS, "no file system interface available!"); |
| 943 | IPC::ResponseBuilder rb{ctx, 2}; | 943 | IPC::ResponseBuilder rb{ctx, 2}; |
| 944 | rb.Push(RESULT_UNKNOWN); | 944 | rb.Push(ResultUnknown); |
| 945 | return; | 945 | return; |
| 946 | } | 946 | } |
| 947 | 947 | ||
| 948 | auto storage = std::make_shared<IStorage>(system, std::move(current_romfs.Unwrap())); | 948 | auto storage = std::make_shared<IStorage>(system, std::move(current_romfs.Unwrap())); |
| 949 | 949 | ||
| 950 | IPC::ResponseBuilder rb{ctx, 2, 0, 1}; | 950 | IPC::ResponseBuilder rb{ctx, 2, 0, 1}; |
| 951 | rb.Push(RESULT_SUCCESS); | 951 | rb.Push(ResultSuccess); |
| 952 | rb.PushIpcInterface<IStorage>(std::move(storage)); | 952 | rb.PushIpcInterface<IStorage>(std::move(storage)); |
| 953 | } | 953 | } |
| 954 | 954 | ||
| @@ -968,7 +968,7 @@ void FSP_SRV::OpenDataStorageByDataId(Kernel::HLERequestContext& ctx) { | |||
| 968 | 968 | ||
| 969 | if (archive != nullptr) { | 969 | if (archive != nullptr) { |
| 970 | IPC::ResponseBuilder rb{ctx, 2, 0, 1}; | 970 | IPC::ResponseBuilder rb{ctx, 2, 0, 1}; |
| 971 | rb.Push(RESULT_SUCCESS); | 971 | rb.Push(ResultSuccess); |
| 972 | rb.PushIpcInterface(std::make_shared<IStorage>(system, archive)); | 972 | rb.PushIpcInterface(std::make_shared<IStorage>(system, archive)); |
| 973 | return; | 973 | return; |
| 974 | } | 974 | } |
| @@ -978,7 +978,7 @@ void FSP_SRV::OpenDataStorageByDataId(Kernel::HLERequestContext& ctx) { | |||
| 978 | "could not open data storage with title_id={:016X}, storage_id={:02X}", title_id, | 978 | "could not open data storage with title_id={:016X}, storage_id={:02X}", title_id, |
| 979 | storage_id); | 979 | storage_id); |
| 980 | IPC::ResponseBuilder rb{ctx, 2}; | 980 | IPC::ResponseBuilder rb{ctx, 2}; |
| 981 | rb.Push(RESULT_UNKNOWN); | 981 | rb.Push(ResultUnknown); |
| 982 | return; | 982 | return; |
| 983 | } | 983 | } |
| 984 | 984 | ||
| @@ -988,7 +988,7 @@ void FSP_SRV::OpenDataStorageByDataId(Kernel::HLERequestContext& ctx) { | |||
| 988 | system, pm.PatchRomFS(std::move(data.Unwrap()), 0, FileSys::ContentRecordType::Data)); | 988 | system, pm.PatchRomFS(std::move(data.Unwrap()), 0, FileSys::ContentRecordType::Data)); |
| 989 | 989 | ||
| 990 | IPC::ResponseBuilder rb{ctx, 2, 0, 1}; | 990 | IPC::ResponseBuilder rb{ctx, 2, 0, 1}; |
| 991 | rb.Push(RESULT_SUCCESS); | 991 | rb.Push(ResultSuccess); |
| 992 | rb.PushIpcInterface<IStorage>(std::move(storage)); | 992 | rb.PushIpcInterface<IStorage>(std::move(storage)); |
| 993 | } | 993 | } |
| 994 | 994 | ||
| @@ -1019,14 +1019,14 @@ void FSP_SRV::OpenDataStorageWithProgramIndex(Kernel::HLERequestContext& ctx) { | |||
| 1019 | LOG_ERROR(Service_FS, "could not open storage with program_index={}", program_index); | 1019 | LOG_ERROR(Service_FS, "could not open storage with program_index={}", program_index); |
| 1020 | 1020 | ||
| 1021 | IPC::ResponseBuilder rb{ctx, 2}; | 1021 | IPC::ResponseBuilder rb{ctx, 2}; |
| 1022 | rb.Push(RESULT_UNKNOWN); | 1022 | rb.Push(ResultUnknown); |
| 1023 | return; | 1023 | return; |
| 1024 | } | 1024 | } |
| 1025 | 1025 | ||
| 1026 | auto storage = std::make_shared<IStorage>(system, std::move(patched_romfs.Unwrap())); | 1026 | auto storage = std::make_shared<IStorage>(system, std::move(patched_romfs.Unwrap())); |
| 1027 | 1027 | ||
| 1028 | IPC::ResponseBuilder rb{ctx, 2, 0, 1}; | 1028 | IPC::ResponseBuilder rb{ctx, 2, 0, 1}; |
| 1029 | rb.Push(RESULT_SUCCESS); | 1029 | rb.Push(ResultSuccess); |
| 1030 | rb.PushIpcInterface<IStorage>(std::move(storage)); | 1030 | rb.PushIpcInterface<IStorage>(std::move(storage)); |
| 1031 | } | 1031 | } |
| 1032 | 1032 | ||
| @@ -1037,14 +1037,14 @@ void FSP_SRV::SetGlobalAccessLogMode(Kernel::HLERequestContext& ctx) { | |||
| 1037 | LOG_DEBUG(Service_FS, "called, log_mode={:08X}", log_mode); | 1037 | LOG_DEBUG(Service_FS, "called, log_mode={:08X}", log_mode); |
| 1038 | 1038 | ||
| 1039 | IPC::ResponseBuilder rb{ctx, 2}; | 1039 | IPC::ResponseBuilder rb{ctx, 2}; |
| 1040 | rb.Push(RESULT_SUCCESS); | 1040 | rb.Push(ResultSuccess); |
| 1041 | } | 1041 | } |
| 1042 | 1042 | ||
| 1043 | void FSP_SRV::GetGlobalAccessLogMode(Kernel::HLERequestContext& ctx) { | 1043 | void FSP_SRV::GetGlobalAccessLogMode(Kernel::HLERequestContext& ctx) { |
| 1044 | LOG_DEBUG(Service_FS, "called"); | 1044 | LOG_DEBUG(Service_FS, "called"); |
| 1045 | 1045 | ||
| 1046 | IPC::ResponseBuilder rb{ctx, 3}; | 1046 | IPC::ResponseBuilder rb{ctx, 3}; |
| 1047 | rb.Push(RESULT_SUCCESS); | 1047 | rb.Push(ResultSuccess); |
| 1048 | rb.PushEnum(log_mode); | 1048 | rb.PushEnum(log_mode); |
| 1049 | } | 1049 | } |
| 1050 | 1050 | ||
| @@ -1058,14 +1058,14 @@ void FSP_SRV::OutputAccessLogToSdCard(Kernel::HLERequestContext& ctx) { | |||
| 1058 | reporter.SaveFilesystemAccessReport(log_mode, std::move(log)); | 1058 | reporter.SaveFilesystemAccessReport(log_mode, std::move(log)); |
| 1059 | 1059 | ||
| 1060 | IPC::ResponseBuilder rb{ctx, 2}; | 1060 | IPC::ResponseBuilder rb{ctx, 2}; |
| 1061 | rb.Push(RESULT_SUCCESS); | 1061 | rb.Push(ResultSuccess); |
| 1062 | } | 1062 | } |
| 1063 | 1063 | ||
| 1064 | void FSP_SRV::GetProgramIndexForAccessLog(Kernel::HLERequestContext& ctx) { | 1064 | void FSP_SRV::GetProgramIndexForAccessLog(Kernel::HLERequestContext& ctx) { |
| 1065 | LOG_DEBUG(Service_FS, "called"); | 1065 | LOG_DEBUG(Service_FS, "called"); |
| 1066 | 1066 | ||
| 1067 | IPC::ResponseBuilder rb{ctx, 4}; | 1067 | IPC::ResponseBuilder rb{ctx, 4}; |
| 1068 | rb.Push(RESULT_SUCCESS); | 1068 | rb.Push(ResultSuccess); |
| 1069 | rb.PushEnum(AccessLogVersion::Latest); | 1069 | rb.PushEnum(AccessLogVersion::Latest); |
| 1070 | rb.Push(access_log_program_index); | 1070 | rb.Push(access_log_program_index); |
| 1071 | } | 1071 | } |
| @@ -1088,14 +1088,14 @@ private: | |||
| 1088 | LOG_WARNING(Service_FS, "(STUBBED) called"); | 1088 | LOG_WARNING(Service_FS, "(STUBBED) called"); |
| 1089 | 1089 | ||
| 1090 | IPC::ResponseBuilder rb{ctx, 2}; | 1090 | IPC::ResponseBuilder rb{ctx, 2}; |
| 1091 | rb.Push(RESULT_SUCCESS); | 1091 | rb.Push(ResultSuccess); |
| 1092 | } | 1092 | } |
| 1093 | 1093 | ||
| 1094 | void Commit(Kernel::HLERequestContext& ctx) { | 1094 | void Commit(Kernel::HLERequestContext& ctx) { |
| 1095 | LOG_WARNING(Service_FS, "(STUBBED) called"); | 1095 | LOG_WARNING(Service_FS, "(STUBBED) called"); |
| 1096 | 1096 | ||
| 1097 | IPC::ResponseBuilder rb{ctx, 2}; | 1097 | IPC::ResponseBuilder rb{ctx, 2}; |
| 1098 | rb.Push(RESULT_SUCCESS); | 1098 | rb.Push(ResultSuccess); |
| 1099 | } | 1099 | } |
| 1100 | }; | 1100 | }; |
| 1101 | 1101 | ||
| @@ -1103,7 +1103,7 @@ void FSP_SRV::OpenMultiCommitManager(Kernel::HLERequestContext& ctx) { | |||
| 1103 | LOG_DEBUG(Service_FS, "called"); | 1103 | LOG_DEBUG(Service_FS, "called"); |
| 1104 | 1104 | ||
| 1105 | IPC::ResponseBuilder rb{ctx, 2, 0, 1}; | 1105 | IPC::ResponseBuilder rb{ctx, 2, 0, 1}; |
| 1106 | rb.Push(RESULT_SUCCESS); | 1106 | rb.Push(ResultSuccess); |
| 1107 | rb.PushIpcInterface<IMultiCommitManager>(std::make_shared<IMultiCommitManager>(system)); | 1107 | rb.PushIpcInterface<IMultiCommitManager>(std::make_shared<IMultiCommitManager>(system)); |
| 1108 | } | 1108 | } |
| 1109 | 1109 | ||