diff options
Diffstat (limited to 'src/core/loader/xci.cpp')
| -rw-r--r-- | src/core/loader/xci.cpp | 28 |
1 files changed, 16 insertions, 12 deletions
diff --git a/src/core/loader/xci.cpp b/src/core/loader/xci.cpp index 89f7bbf77..1e285a053 100644 --- a/src/core/loader/xci.cpp +++ b/src/core/loader/xci.cpp | |||
| @@ -48,31 +48,35 @@ FileType AppLoader_XCI::IdentifyType(const FileSys::VirtualFile& file) { | |||
| 48 | return FileType::Error; | 48 | return FileType::Error; |
| 49 | } | 49 | } |
| 50 | 50 | ||
| 51 | ResultStatus AppLoader_XCI::Load(Kernel::Process& process) { | 51 | AppLoader_XCI::LoadResult AppLoader_XCI::Load(Kernel::Process& process) { |
| 52 | if (is_loaded) { | 52 | if (is_loaded) { |
| 53 | return ResultStatus::ErrorAlreadyLoaded; | 53 | return {ResultStatus::ErrorAlreadyLoaded, {}}; |
| 54 | } | 54 | } |
| 55 | 55 | ||
| 56 | if (xci->GetStatus() != ResultStatus::Success) | 56 | if (xci->GetStatus() != ResultStatus::Success) { |
| 57 | return xci->GetStatus(); | 57 | return {xci->GetStatus(), {}}; |
| 58 | } | ||
| 58 | 59 | ||
| 59 | if (xci->GetProgramNCAStatus() != ResultStatus::Success) | 60 | if (xci->GetProgramNCAStatus() != ResultStatus::Success) { |
| 60 | return xci->GetProgramNCAStatus(); | 61 | return {xci->GetProgramNCAStatus(), {}}; |
| 62 | } | ||
| 61 | 63 | ||
| 62 | if (!xci->HasProgramNCA() && !Core::Crypto::KeyManager::KeyFileExists(false)) | 64 | if (!xci->HasProgramNCA() && !Core::Crypto::KeyManager::KeyFileExists(false)) { |
| 63 | return ResultStatus::ErrorMissingProductionKeyFile; | 65 | return {ResultStatus::ErrorMissingProductionKeyFile, {}}; |
| 66 | } | ||
| 64 | 67 | ||
| 65 | const auto result = nca_loader->Load(process); | 68 | const auto result = nca_loader->Load(process); |
| 66 | if (result != ResultStatus::Success) | 69 | if (result.first != ResultStatus::Success) { |
| 67 | return result; | 70 | return result; |
| 71 | } | ||
| 68 | 72 | ||
| 69 | FileSys::VirtualFile update_raw; | 73 | FileSys::VirtualFile update_raw; |
| 70 | if (ReadUpdateRaw(update_raw) == ResultStatus::Success && update_raw != nullptr) | 74 | if (ReadUpdateRaw(update_raw) == ResultStatus::Success && update_raw != nullptr) { |
| 71 | Service::FileSystem::SetPackedUpdate(std::move(update_raw)); | 75 | Service::FileSystem::SetPackedUpdate(std::move(update_raw)); |
| 76 | } | ||
| 72 | 77 | ||
| 73 | is_loaded = true; | 78 | is_loaded = true; |
| 74 | 79 | return result; | |
| 75 | return ResultStatus::Success; | ||
| 76 | } | 80 | } |
| 77 | 81 | ||
| 78 | ResultStatus AppLoader_XCI::ReadRomFS(FileSys::VirtualFile& file) { | 82 | ResultStatus AppLoader_XCI::ReadRomFS(FileSys::VirtualFile& file) { |