Addressed issues
This commit is contained in:
parent
0b03e8a98f
commit
fd6549be73
|
@ -237,45 +237,37 @@ void Module::Interface::InitializeApplicationInfoRestricted(Kernel::HLERequestCo
|
||||||
|
|
||||||
LOG_WARNING(Service_ACC, "(Partial implementation) called, process_id={}", pid);
|
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
|
// 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};
|
IPC::ResponseBuilder rb{ctx, 2};
|
||||||
rb.Push(res);
|
rb.Push(InitializeApplicationInfoBase(pid));
|
||||||
}
|
}
|
||||||
|
|
||||||
ResultCode Module::Interface::InitializeApplicationInfoBase(u64 process_id) {
|
ResultCode Module::Interface::InitializeApplicationInfoBase(u64 process_id) {
|
||||||
if (application_info) {
|
if (application_info) {
|
||||||
|
LOG_ERROR(Service_ACC, "Application already initialized");
|
||||||
return ERR_ACCOUNTINFO_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& list = system.Kernel().GetProcessList();
|
||||||
const auto iter = std::find_if(list.begin(), list.end(), [&process_id](const auto& process) {
|
const auto iter = std::find_if(list.begin(), list.end(), [&process_id](const auto& process) {
|
||||||
return process->GetProcessID() == process_id;
|
return process->GetProcessID() == process_id;
|
||||||
});
|
});
|
||||||
|
|
||||||
if (iter == list.end()) {
|
if (iter == list.end()) {
|
||||||
// Failed to find process ID
|
LOG_ERROR(Service_ACC, "Failed to find process ID");
|
||||||
application_info.application_type = ApplicationType::Unknown;
|
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());
|
const auto launch_property = system.GetARPManager().GetLaunchProperty((*iter)->GetTitleID());
|
||||||
|
|
||||||
if (launch_property.Failed()) {
|
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) {
|
switch (launch_property->base_game_storage_id) {
|
||||||
|
@ -288,7 +280,8 @@ ResultCode Module::Interface::InitializeApplicationInfoBase(u64 process_id) {
|
||||||
application_info.application_type = ApplicationType::Digital;
|
application_info.application_type = ApplicationType::Digital;
|
||||||
break;
|
break;
|
||||||
default:
|
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");
|
LOG_WARNING(Service_ACC, "ApplicationInfo init required");
|
||||||
|
|
|
@ -7,6 +7,8 @@
|
||||||
#include "core/hle/result.h"
|
#include "core/hle/result.h"
|
||||||
|
|
||||||
namespace Service::Account {
|
namespace Service::Account {
|
||||||
|
|
||||||
constexpr ResultCode ERR_ACCOUNTINFO_BAD_APPLICATION{ErrorModule::Account, 22};
|
constexpr ResultCode ERR_ACCOUNTINFO_BAD_APPLICATION{ErrorModule::Account, 22};
|
||||||
constexpr ResultCode ERR_ACCOUNTINFO_ALREADY_INITIALIZED{ErrorModule::Account, 41};
|
constexpr ResultCode ERR_ACCOUNTINFO_ALREADY_INITIALIZED{ErrorModule::Account, 41};
|
||||||
|
|
||||||
} // namespace Service::Account
|
} // namespace Service::Account
|
||||||
|
|
Reference in New Issue