mirror of
https://github.com/skyline-emu/skyline.git
synced 2024-11-22 20:39:20 +01:00
Fix ListOpenContextStoredUsers stub
The problem is in StoreOpenContext wasn't storing any user, but ListOpenContextStoredUsers was writing default user (when it's not stored by StoreOpenContext)
This commit is contained in:
parent
3c5f8dd876
commit
3a94bcf692
@ -88,7 +88,7 @@ namespace skyline::service::account {
|
|||||||
if (id == UserId{})
|
if (id == UserId{})
|
||||||
return result::NullArgument;
|
return result::NullArgument;
|
||||||
|
|
||||||
manager.RegisterService(SRVREG(IManagerForApplication), session, response);
|
manager.RegisterService(std::make_shared<IManagerForApplication>(state, manager, openedUsers), session, response);
|
||||||
return {};
|
return {};
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -116,7 +116,7 @@ namespace skyline::service::account {
|
|||||||
|
|
||||||
Result IAccountServiceForApplication::ListOpenContextStoredUsers(type::KSession &session, ipc::IpcRequest &request, ipc::IpcResponse &response) {
|
Result IAccountServiceForApplication::ListOpenContextStoredUsers(type::KSession &session, ipc::IpcRequest &request, ipc::IpcResponse &response) {
|
||||||
try {
|
try {
|
||||||
return WriteUserList(request.outputBuf.at(0), {constant::DefaultUserId});
|
return WriteUserList(request.outputBuf.at(0), openedUsers);
|
||||||
} catch (const std::out_of_range &) {
|
} catch (const std::out_of_range &) {
|
||||||
return result::InvalidInputBuffer;
|
return result::InvalidInputBuffer;
|
||||||
}
|
}
|
||||||
|
@ -32,6 +32,8 @@ namespace skyline {
|
|||||||
*/
|
*/
|
||||||
class IAccountServiceForApplication : public BaseService {
|
class IAccountServiceForApplication : public BaseService {
|
||||||
private:
|
private:
|
||||||
|
std::vector<account::UserId> openedUsers;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @brief Writes a vector of 128-bit user IDs to an output buffer
|
* @brief Writes a vector of 128-bit user IDs to an output buffer
|
||||||
*/
|
*/
|
||||||
|
@ -5,7 +5,9 @@
|
|||||||
#include "IAccountServiceForApplication.h"
|
#include "IAccountServiceForApplication.h"
|
||||||
|
|
||||||
namespace skyline::service::account {
|
namespace skyline::service::account {
|
||||||
IManagerForApplication::IManagerForApplication(const DeviceState &state, ServiceManager &manager) : BaseService(state, manager) {}
|
IManagerForApplication::IManagerForApplication(const DeviceState &state, ServiceManager &manager, std::vector<UserId> &openedUsers) : BaseService(state, manager) {
|
||||||
|
this->openedUsers = std::make_shared<std::vector<UserId>>(openedUsers);
|
||||||
|
}
|
||||||
|
|
||||||
Result IManagerForApplication::CheckAvailability(type::KSession &session, ipc::IpcRequest &request, ipc::IpcResponse &response) {
|
Result IManagerForApplication::CheckAvailability(type::KSession &session, ipc::IpcRequest &request, ipc::IpcResponse &response) {
|
||||||
response.Push(false);
|
response.Push(false);
|
||||||
@ -18,6 +20,8 @@ namespace skyline::service::account {
|
|||||||
}
|
}
|
||||||
|
|
||||||
Result IManagerForApplication::StoreOpenContext(type::KSession &session, ipc::IpcRequest &request, ipc::IpcResponse &response) {
|
Result IManagerForApplication::StoreOpenContext(type::KSession &session, ipc::IpcRequest &request, ipc::IpcResponse &response) {
|
||||||
|
openedUsers->clear();
|
||||||
|
openedUsers->push_back(constant::DefaultUserId);
|
||||||
return {};
|
return {};
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -4,6 +4,7 @@
|
|||||||
#pragma once
|
#pragma once
|
||||||
|
|
||||||
#include <services/serviceman.h>
|
#include <services/serviceman.h>
|
||||||
|
#include "IAccountServiceForApplication.h"
|
||||||
|
|
||||||
namespace skyline::service::account {
|
namespace skyline::service::account {
|
||||||
/**
|
/**
|
||||||
@ -11,8 +12,11 @@ namespace skyline::service::account {
|
|||||||
* @url https://switchbrew.org/wiki/Account_services#IManagerForApplication
|
* @url https://switchbrew.org/wiki/Account_services#IManagerForApplication
|
||||||
*/
|
*/
|
||||||
class IManagerForApplication : public BaseService {
|
class IManagerForApplication : public BaseService {
|
||||||
|
private:
|
||||||
|
std::shared_ptr<std::vector<UserId>> openedUsers;
|
||||||
|
|
||||||
public:
|
public:
|
||||||
IManagerForApplication(const DeviceState &state, ServiceManager &manager);
|
IManagerForApplication(const DeviceState &state, ServiceManager &manager, std::vector<UserId> &openedUsers);
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @brief This checks if the given user has access to online services
|
* @brief This checks if the given user has access to online services
|
||||||
|
Loading…
Reference in New Issue
Block a user