mirror of
https://git.eden-emu.dev/eden-emu/eden.git
synced 2025-10-23 02:47:51 +00:00
glue: Correct missing bytes in ApplicationLaunchParameter
This commit is contained in:
parent
22bea84c51
commit
12105d8909
7 changed files with 71 additions and 37 deletions
|
@ -7,18 +7,23 @@
|
|||
|
||||
namespace Service::Glue {
|
||||
|
||||
struct ARPManager::MapEntry {
|
||||
ApplicationLaunchProperty launch;
|
||||
std::vector<u8> control;
|
||||
};
|
||||
|
||||
ARPManager::ARPManager() = default;
|
||||
|
||||
ARPManager::~ARPManager() = default;
|
||||
|
||||
ResultVal<ApplicationLaunchProperty> ARPManager::GetLaunchProperty(u64 title_id) const {
|
||||
if (title_id == 0) {
|
||||
return ERR_TITLE_ID_ZERO;
|
||||
return ERR_INVALID_PROCESS_ID;
|
||||
}
|
||||
|
||||
const auto iter = entries.find(title_id);
|
||||
if (iter == entries.end()) {
|
||||
return ERR_NONEXISTENT;
|
||||
return ERR_NOT_REGISTERED;
|
||||
}
|
||||
|
||||
return MakeResult<ApplicationLaunchProperty>(iter->second.launch);
|
||||
|
@ -26,12 +31,12 @@ ResultVal<ApplicationLaunchProperty> ARPManager::GetLaunchProperty(u64 title_id)
|
|||
|
||||
ResultVal<std::vector<u8>> ARPManager::GetControlProperty(u64 title_id) const {
|
||||
if (title_id == 0) {
|
||||
return ERR_TITLE_ID_ZERO;
|
||||
return ERR_INVALID_PROCESS_ID;
|
||||
}
|
||||
|
||||
const auto iter = entries.find(title_id);
|
||||
if (iter == entries.end()) {
|
||||
return ERR_NONEXISTENT;
|
||||
return ERR_NOT_REGISTERED;
|
||||
}
|
||||
|
||||
return MakeResult<std::vector<u8>>(iter->second.control);
|
||||
|
@ -40,12 +45,12 @@ ResultVal<std::vector<u8>> ARPManager::GetControlProperty(u64 title_id) const {
|
|||
ResultCode ARPManager::Register(u64 title_id, ApplicationLaunchProperty launch,
|
||||
std::vector<u8> control) {
|
||||
if (title_id == 0) {
|
||||
return ERR_TITLE_ID_ZERO;
|
||||
return ERR_INVALID_PROCESS_ID;
|
||||
}
|
||||
|
||||
const auto iter = entries.find(title_id);
|
||||
if (iter != entries.end()) {
|
||||
return ERR_ALREADY_ISSUED;
|
||||
return ERR_INVALID_ACCESS;
|
||||
}
|
||||
|
||||
entries.insert_or_assign(title_id, MapEntry{launch, std::move(control)});
|
||||
|
@ -54,12 +59,12 @@ ResultCode ARPManager::Register(u64 title_id, ApplicationLaunchProperty launch,
|
|||
|
||||
ResultCode ARPManager::Unregister(u64 title_id) {
|
||||
if (title_id == 0) {
|
||||
return ERR_TITLE_ID_ZERO;
|
||||
return ERR_INVALID_PROCESS_ID;
|
||||
}
|
||||
|
||||
const auto iter = entries.find(title_id);
|
||||
if (iter == entries.end()) {
|
||||
return ERR_NONEXISTENT;
|
||||
return ERR_NOT_REGISTERED;
|
||||
}
|
||||
|
||||
entries.erase(iter);
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue