diff options
author | David Marcec <dmarcecguzman@gmail.com> | 2019-06-28 07:19:51 +0200 |
---|---|---|
committer | David Marcec <dmarcecguzman@gmail.com> | 2019-06-28 07:19:51 +0200 |
commit | fd6549be73ed45c04eb7bd97036ed668edd1a49c (patch) | |
tree | f5258d7dd062776f0382a5ae3e3e9132037fcdb8 | |
parent | Implemented InitializeApplicationInfo & InitializeApplicationInfoRestricted (diff) | |
download | yuzu-fd6549be73ed45c04eb7bd97036ed668edd1a49c.tar yuzu-fd6549be73ed45c04eb7bd97036ed668edd1a49c.tar.gz yuzu-fd6549be73ed45c04eb7bd97036ed668edd1a49c.tar.bz2 yuzu-fd6549be73ed45c04eb7bd97036ed668edd1a49c.tar.lz yuzu-fd6549be73ed45c04eb7bd97036ed668edd1a49c.tar.xz yuzu-fd6549be73ed45c04eb7bd97036ed668edd1a49c.tar.zst yuzu-fd6549be73ed45c04eb7bd97036ed668edd1a49c.zip |
-rw-r--r-- | src/core/hle/service/acc/acc.cpp | 27 | ||||
-rw-r--r-- | src/core/hle/service/acc/errors.h | 2 |
2 files changed, 12 insertions, 17 deletions
diff --git a/src/core/hle/service/acc/acc.cpp b/src/core/hle/service/acc/acc.cpp index 6aabe7409..c01ee3eda 100644 --- a/src/core/hle/service/acc/acc.cpp +++ b/src/core/hle/service/acc/acc.cpp @@ -237,45 +237,37 @@ void Module::Interface::InitializeApplicationInfoRestricted(Kernel::HLERequestCo LOG_WARNING(Service_ACC, "(Partial implementation) called, process_id={}", pid); - const auto res = InitializeApplicationInfoBase(pid); - // TODO(ogniK): We require checking if the user actually owns the title and what not. As of - // currently, we assume the user owns the title. + // currently, we assume the user owns the title. InitializeApplicationInfoBase SHOULD be called + // first then we do extra checks if the game is a digital copy. IPC::ResponseBuilder rb{ctx, 2}; - rb.Push(res); + rb.Push(InitializeApplicationInfoBase(pid)); } ResultCode Module::Interface::InitializeApplicationInfoBase(u64 process_id) { if (application_info) { + LOG_ERROR(Service_ACC, "Application already initialized"); return ERR_ACCOUNTINFO_ALREADY_INITIALIZED; } - Service::SM::ServiceManager& sm = system.ServiceManager(); - std::shared_ptr<Service::Glue::ARP_R> arp_r = sm.GetService<Service::Glue::ARP_R>("arp:r"); - if (arp_r == nullptr) { - LOG_ERROR(Service_ACC, "Failed to get arp:r service"); - application_info.application_type = ApplicationType::Unknown; - - return ResultCode(ERR_ACCOUNTINFO_BAD_APPLICATION); - } - const auto& list = system.Kernel().GetProcessList(); const auto iter = std::find_if(list.begin(), list.end(), [&process_id](const auto& process) { return process->GetProcessID() == process_id; }); if (iter == list.end()) { - // Failed to find process ID + LOG_ERROR(Service_ACC, "Failed to find process ID"); application_info.application_type = ApplicationType::Unknown; - return ResultCode(ERR_ACCOUNTINFO_BAD_APPLICATION); + return ERR_ACCOUNTINFO_BAD_APPLICATION; } const auto launch_property = system.GetARPManager().GetLaunchProperty((*iter)->GetTitleID()); if (launch_property.Failed()) { - return ResultCode(ERR_ACCOUNTINFO_BAD_APPLICATION); + LOG_ERROR(Service_ACC, "Failed to get launch property"); + return ERR_ACCOUNTINFO_BAD_APPLICATION; } switch (launch_property->base_game_storage_id) { @@ -288,7 +280,8 @@ ResultCode Module::Interface::InitializeApplicationInfoBase(u64 process_id) { application_info.application_type = ApplicationType::Digital; break; default: - return ResultCode(ERR_ACCOUNTINFO_BAD_APPLICATION); + LOG_ERROR(Service_ACC, "Invalid game storage ID"); + return ERR_ACCOUNTINFO_BAD_APPLICATION; } LOG_WARNING(Service_ACC, "ApplicationInfo init required"); diff --git a/src/core/hle/service/acc/errors.h b/src/core/hle/service/acc/errors.h index 86876dfd6..1f0577239 100644 --- a/src/core/hle/service/acc/errors.h +++ b/src/core/hle/service/acc/errors.h @@ -7,6 +7,8 @@ #include "core/hle/result.h" namespace Service::Account { + constexpr ResultCode ERR_ACCOUNTINFO_BAD_APPLICATION{ErrorModule::Account, 22}; constexpr ResultCode ERR_ACCOUNTINFO_ALREADY_INITIALIZED{ErrorModule::Account, 41}; + } // namespace Service::Account |