service: Eliminate usages of the global system instance
Completely removes all usages of the global system instance within the services code by passing in the using system instance to the services.
This commit is contained in:
parent
322349e8cc
commit
1a954b2a59
222 changed files with 1221 additions and 907 deletions
|
|
@ -47,8 +47,8 @@ static constexpr u32 SanitizeJPEGSize(std::size_t size) {
|
|||
|
||||
class IManagerForSystemService final : public ServiceFramework<IManagerForSystemService> {
|
||||
public:
|
||||
explicit IManagerForSystemService(Common::UUID user_id)
|
||||
: ServiceFramework("IManagerForSystemService") {
|
||||
explicit IManagerForSystemService(Core::System& system_, Common::UUID)
|
||||
: ServiceFramework{system_, "IManagerForSystemService"} {
|
||||
// clang-format off
|
||||
static const FunctionInfo functions[] = {
|
||||
{0, nullptr, "CheckAvailability"},
|
||||
|
|
@ -83,8 +83,8 @@ public:
|
|||
// 3.0.0+
|
||||
class IFloatingRegistrationRequest final : public ServiceFramework<IFloatingRegistrationRequest> {
|
||||
public:
|
||||
explicit IFloatingRegistrationRequest(Common::UUID user_id)
|
||||
: ServiceFramework("IFloatingRegistrationRequest") {
|
||||
explicit IFloatingRegistrationRequest(Core::System& system_, Common::UUID)
|
||||
: ServiceFramework{system_, "IFloatingRegistrationRequest"} {
|
||||
// clang-format off
|
||||
static const FunctionInfo functions[] = {
|
||||
{0, nullptr, "GetSessionId"},
|
||||
|
|
@ -108,7 +108,8 @@ public:
|
|||
|
||||
class IAdministrator final : public ServiceFramework<IAdministrator> {
|
||||
public:
|
||||
explicit IAdministrator(Common::UUID user_id) : ServiceFramework("IAdministrator") {
|
||||
explicit IAdministrator(Core::System& system_, Common::UUID)
|
||||
: ServiceFramework{system_, "IAdministrator"} {
|
||||
// clang-format off
|
||||
static const FunctionInfo functions[] = {
|
||||
{0, nullptr, "CheckAvailability"},
|
||||
|
|
@ -165,8 +166,8 @@ public:
|
|||
|
||||
class IAuthorizationRequest final : public ServiceFramework<IAuthorizationRequest> {
|
||||
public:
|
||||
explicit IAuthorizationRequest(Common::UUID user_id)
|
||||
: ServiceFramework("IAuthorizationRequest") {
|
||||
explicit IAuthorizationRequest(Core::System& system_, Common::UUID)
|
||||
: ServiceFramework{system_, "IAuthorizationRequest"} {
|
||||
// clang-format off
|
||||
static const FunctionInfo functions[] = {
|
||||
{0, nullptr, "GetSessionId"},
|
||||
|
|
@ -184,7 +185,8 @@ public:
|
|||
|
||||
class IOAuthProcedure final : public ServiceFramework<IOAuthProcedure> {
|
||||
public:
|
||||
explicit IOAuthProcedure(Common::UUID user_id) : ServiceFramework("IOAuthProcedure") {
|
||||
explicit IOAuthProcedure(Core::System& system_, Common::UUID)
|
||||
: ServiceFramework{system_, "IOAuthProcedure"} {
|
||||
// clang-format off
|
||||
static const FunctionInfo functions[] = {
|
||||
{0, nullptr, "PrepareAsync"},
|
||||
|
|
@ -202,8 +204,8 @@ public:
|
|||
// 3.0.0+
|
||||
class IOAuthProcedureForExternalNsa final : public ServiceFramework<IOAuthProcedureForExternalNsa> {
|
||||
public:
|
||||
explicit IOAuthProcedureForExternalNsa(Common::UUID user_id)
|
||||
: ServiceFramework("IOAuthProcedureForExternalNsa") {
|
||||
explicit IOAuthProcedureForExternalNsa(Core::System& system_, Common::UUID)
|
||||
: ServiceFramework{system_, "IOAuthProcedureForExternalNsa"} {
|
||||
// clang-format off
|
||||
static const FunctionInfo functions[] = {
|
||||
{0, nullptr, "PrepareAsync"},
|
||||
|
|
@ -225,8 +227,8 @@ public:
|
|||
class IOAuthProcedureForNintendoAccountLinkage final
|
||||
: public ServiceFramework<IOAuthProcedureForNintendoAccountLinkage> {
|
||||
public:
|
||||
explicit IOAuthProcedureForNintendoAccountLinkage(Common::UUID user_id)
|
||||
: ServiceFramework("IOAuthProcedureForNintendoAccountLinkage") {
|
||||
explicit IOAuthProcedureForNintendoAccountLinkage(Core::System& system_, Common::UUID)
|
||||
: ServiceFramework{system_, "IOAuthProcedureForNintendoAccountLinkage"} {
|
||||
// clang-format off
|
||||
static const FunctionInfo functions[] = {
|
||||
{0, nullptr, "PrepareAsync"},
|
||||
|
|
@ -246,7 +248,8 @@ public:
|
|||
|
||||
class INotifier final : public ServiceFramework<INotifier> {
|
||||
public:
|
||||
explicit INotifier(Common::UUID user_id) : ServiceFramework("INotifier") {
|
||||
explicit INotifier(Core::System& system_, Common::UUID)
|
||||
: ServiceFramework{system_, "INotifier"} {
|
||||
// clang-format off
|
||||
static const FunctionInfo functions[] = {
|
||||
{0, nullptr, "GetSystemEvent"},
|
||||
|
|
@ -259,9 +262,9 @@ public:
|
|||
|
||||
class IProfileCommon : public ServiceFramework<IProfileCommon> {
|
||||
public:
|
||||
explicit IProfileCommon(const char* name, bool editor_commands, Common::UUID user_id,
|
||||
ProfileManager& profile_manager)
|
||||
: ServiceFramework(name), profile_manager(profile_manager), user_id(user_id) {
|
||||
explicit IProfileCommon(Core::System& system_, const char* name, bool editor_commands,
|
||||
Common::UUID user_id_, ProfileManager& profile_manager_)
|
||||
: ServiceFramework{system_, name}, profile_manager{profile_manager_}, user_id{user_id_} {
|
||||
static const FunctionInfo functions[] = {
|
||||
{0, &IProfileCommon::Get, "Get"},
|
||||
{1, &IProfileCommon::GetBase, "GetBase"},
|
||||
|
|
@ -427,19 +430,21 @@ protected:
|
|||
|
||||
class IProfile final : public IProfileCommon {
|
||||
public:
|
||||
IProfile(Common::UUID user_id, ProfileManager& profile_manager)
|
||||
: IProfileCommon("IProfile", false, user_id, profile_manager) {}
|
||||
explicit IProfile(Core::System& system_, Common::UUID user_id_,
|
||||
ProfileManager& profile_manager_)
|
||||
: IProfileCommon{system_, "IProfile", false, user_id_, profile_manager_} {}
|
||||
};
|
||||
|
||||
class IProfileEditor final : public IProfileCommon {
|
||||
public:
|
||||
IProfileEditor(Common::UUID user_id, ProfileManager& profile_manager)
|
||||
: IProfileCommon("IProfileEditor", true, user_id, profile_manager) {}
|
||||
explicit IProfileEditor(Core::System& system_, Common::UUID user_id_,
|
||||
ProfileManager& profile_manager_)
|
||||
: IProfileCommon{system_, "IProfileEditor", true, user_id_, profile_manager_} {}
|
||||
};
|
||||
|
||||
class IAsyncContext final : public ServiceFramework<IAsyncContext> {
|
||||
public:
|
||||
explicit IAsyncContext(Common::UUID user_id) : ServiceFramework("IAsyncContext") {
|
||||
explicit IAsyncContext(Core::System& system_) : ServiceFramework{system_, "IAsyncContext"} {
|
||||
// clang-format off
|
||||
static const FunctionInfo functions[] = {
|
||||
{0, nullptr, "GetSystemEvent"},
|
||||
|
|
@ -455,7 +460,8 @@ public:
|
|||
|
||||
class ISessionObject final : public ServiceFramework<ISessionObject> {
|
||||
public:
|
||||
explicit ISessionObject(Common::UUID user_id) : ServiceFramework("ISessionObject") {
|
||||
explicit ISessionObject(Core::System& system_, Common::UUID)
|
||||
: ServiceFramework{system_, "ISessionObject"} {
|
||||
// clang-format off
|
||||
static const FunctionInfo functions[] = {
|
||||
{999, nullptr, "Dummy"},
|
||||
|
|
@ -468,7 +474,8 @@ public:
|
|||
|
||||
class IGuestLoginRequest final : public ServiceFramework<IGuestLoginRequest> {
|
||||
public:
|
||||
explicit IGuestLoginRequest(Common::UUID) : ServiceFramework("IGuestLoginRequest") {
|
||||
explicit IGuestLoginRequest(Core::System& system_, Common::UUID)
|
||||
: ServiceFramework{system_, "IGuestLoginRequest"} {
|
||||
// clang-format off
|
||||
static const FunctionInfo functions[] = {
|
||||
{0, nullptr, "GetSessionId"},
|
||||
|
|
@ -487,8 +494,8 @@ public:
|
|||
|
||||
class IManagerForApplication final : public ServiceFramework<IManagerForApplication> {
|
||||
public:
|
||||
explicit IManagerForApplication(Common::UUID user_id)
|
||||
: ServiceFramework("IManagerForApplication"), user_id(user_id) {
|
||||
explicit IManagerForApplication(Core::System& system_, Common::UUID user_id_)
|
||||
: ServiceFramework{system_, "IManagerForApplication"}, user_id{user_id_} {
|
||||
// clang-format off
|
||||
static const FunctionInfo functions[] = {
|
||||
{0, &IManagerForApplication::CheckAvailability, "CheckAvailability"},
|
||||
|
|
@ -534,8 +541,8 @@ private:
|
|||
class IAsyncNetworkServiceLicenseKindContext final
|
||||
: public ServiceFramework<IAsyncNetworkServiceLicenseKindContext> {
|
||||
public:
|
||||
explicit IAsyncNetworkServiceLicenseKindContext(Common::UUID user_id)
|
||||
: ServiceFramework("IAsyncNetworkServiceLicenseKindContext") {
|
||||
explicit IAsyncNetworkServiceLicenseKindContext(Core::System& system_, Common::UUID)
|
||||
: ServiceFramework{system_, "IAsyncNetworkServiceLicenseKindContext"} {
|
||||
// clang-format off
|
||||
static const FunctionInfo functions[] = {
|
||||
{0, nullptr, "GetSystemEvent"},
|
||||
|
|
@ -554,8 +561,8 @@ public:
|
|||
class IOAuthProcedureForUserRegistration final
|
||||
: public ServiceFramework<IOAuthProcedureForUserRegistration> {
|
||||
public:
|
||||
explicit IOAuthProcedureForUserRegistration(Common::UUID user_id)
|
||||
: ServiceFramework("IOAuthProcedureForUserRegistration") {
|
||||
explicit IOAuthProcedureForUserRegistration(Core::System& system_, Common::UUID)
|
||||
: ServiceFramework{system_, "IOAuthProcedureForUserRegistration"} {
|
||||
// clang-format off
|
||||
static const FunctionInfo functions[] = {
|
||||
{0, nullptr, "PrepareAsync"},
|
||||
|
|
@ -578,7 +585,7 @@ public:
|
|||
|
||||
class DAUTH_O final : public ServiceFramework<DAUTH_O> {
|
||||
public:
|
||||
explicit DAUTH_O(Common::UUID) : ServiceFramework("dauth:o") {
|
||||
explicit DAUTH_O(Core::System& system_, Common::UUID) : ServiceFramework{system_, "dauth:o"} {
|
||||
// clang-format off
|
||||
static const FunctionInfo functions[] = {
|
||||
{0, nullptr, "EnsureAuthenticationTokenCacheAsync"}, // [5.0.0-5.1.0] GeneratePostData
|
||||
|
|
@ -597,7 +604,8 @@ public:
|
|||
// 6.0.0+
|
||||
class IAsyncResult final : public ServiceFramework<IAsyncResult> {
|
||||
public:
|
||||
explicit IAsyncResult(Common::UUID user_id) : ServiceFramework("IAsyncResult") {
|
||||
explicit IAsyncResult(Core::System& system_, Common::UUID)
|
||||
: ServiceFramework{system_, "IAsyncResult"} {
|
||||
// clang-format off
|
||||
static const FunctionInfo functions[] = {
|
||||
{0, nullptr, "GetResult"},
|
||||
|
|
@ -656,7 +664,7 @@ void Module::Interface::GetProfile(Kernel::HLERequestContext& ctx) {
|
|||
|
||||
IPC::ResponseBuilder rb{ctx, 2, 0, 1};
|
||||
rb.Push(RESULT_SUCCESS);
|
||||
rb.PushIpcInterface<IProfile>(user_id, *profile_manager);
|
||||
rb.PushIpcInterface<IProfile>(system, user_id, *profile_manager);
|
||||
}
|
||||
|
||||
void Module::Interface::IsUserRegistrationRequestPermitted(Kernel::HLERequestContext& ctx) {
|
||||
|
|
@ -731,7 +739,7 @@ void Module::Interface::GetBaasAccountManagerForApplication(Kernel::HLERequestCo
|
|||
LOG_DEBUG(Service_ACC, "called");
|
||||
IPC::ResponseBuilder rb{ctx, 2, 0, 1};
|
||||
rb.Push(RESULT_SUCCESS);
|
||||
rb.PushIpcInterface<IManagerForApplication>(profile_manager->GetLastOpenedUser());
|
||||
rb.PushIpcInterface<IManagerForApplication>(system, profile_manager->GetLastOpenedUser());
|
||||
}
|
||||
|
||||
void Module::Interface::IsUserAccountSwitchLocked(Kernel::HLERequestContext& ctx) {
|
||||
|
|
@ -769,7 +777,7 @@ void Module::Interface::GetProfileEditor(Kernel::HLERequestContext& ctx) {
|
|||
|
||||
IPC::ResponseBuilder rb{ctx, 2, 0, 1};
|
||||
rb.Push(RESULT_SUCCESS);
|
||||
rb.PushIpcInterface<IProfileEditor>(user_id, *profile_manager);
|
||||
rb.PushIpcInterface<IProfileEditor>(system, user_id, *profile_manager);
|
||||
}
|
||||
|
||||
void Module::Interface::ListQualifiedUsers(Kernel::HLERequestContext& ctx) {
|
||||
|
|
@ -791,7 +799,7 @@ void Module::Interface::LoadOpenContext(Kernel::HLERequestContext& ctx) {
|
|||
// TODO: Find the differences between this and GetBaasAccountManagerForApplication
|
||||
IPC::ResponseBuilder rb{ctx, 2, 0, 1};
|
||||
rb.Push(RESULT_SUCCESS);
|
||||
rb.PushIpcInterface<IManagerForApplication>(profile_manager->GetLastOpenedUser());
|
||||
rb.PushIpcInterface<IManagerForApplication>(system, profile_manager->GetLastOpenedUser());
|
||||
}
|
||||
|
||||
void Module::Interface::ListOpenContextStoredUsers(Kernel::HLERequestContext& ctx) {
|
||||
|
|
@ -827,11 +835,11 @@ void Module::Interface::TrySelectUserWithoutInteraction(Kernel::HLERequestContex
|
|||
rb.PushRaw<u128>(profile_manager->GetUser(0)->uuid);
|
||||
}
|
||||
|
||||
Module::Interface::Interface(std::shared_ptr<Module> module,
|
||||
std::shared_ptr<ProfileManager> profile_manager, Core::System& system,
|
||||
const char* name)
|
||||
: ServiceFramework(name), module(std::move(module)),
|
||||
profile_manager(std::move(profile_manager)), system(system) {}
|
||||
Module::Interface::Interface(std::shared_ptr<Module> module_,
|
||||
std::shared_ptr<ProfileManager> profile_manager_,
|
||||
Core::System& system_, const char* name)
|
||||
: ServiceFramework{system_, name}, module{std::move(module_)}, profile_manager{std::move(
|
||||
profile_manager_)} {}
|
||||
|
||||
Module::Interface::~Interface() = default;
|
||||
|
||||
|
|
|
|||
|
|
@ -15,8 +15,8 @@ class Module final {
|
|||
public:
|
||||
class Interface : public ServiceFramework<Interface> {
|
||||
public:
|
||||
explicit Interface(std::shared_ptr<Module> module,
|
||||
std::shared_ptr<ProfileManager> profile_manager, Core::System& system,
|
||||
explicit Interface(std::shared_ptr<Module> module_,
|
||||
std::shared_ptr<ProfileManager> profile_manager_, Core::System& system_,
|
||||
const char* name);
|
||||
~Interface() override;
|
||||
|
||||
|
|
@ -60,7 +60,6 @@ public:
|
|||
protected:
|
||||
std::shared_ptr<Module> module;
|
||||
std::shared_ptr<ProfileManager> profile_manager;
|
||||
Core::System& system;
|
||||
};
|
||||
};
|
||||
|
||||
|
|
|
|||
|
|
@ -64,7 +64,7 @@ struct LaunchParameterAccountPreselectedUser {
|
|||
static_assert(sizeof(LaunchParameterAccountPreselectedUser) == 0x88);
|
||||
|
||||
IWindowController::IWindowController(Core::System& system_)
|
||||
: ServiceFramework("IWindowController"), system{system_} {
|
||||
: ServiceFramework{system_, "IWindowController"} {
|
||||
// clang-format off
|
||||
static const FunctionInfo functions[] = {
|
||||
{0, nullptr, "CreateWindow"},
|
||||
|
|
@ -99,7 +99,8 @@ void IWindowController::AcquireForegroundRights(Kernel::HLERequestContext& ctx)
|
|||
rb.Push(RESULT_SUCCESS);
|
||||
}
|
||||
|
||||
IAudioController::IAudioController() : ServiceFramework("IAudioController") {
|
||||
IAudioController::IAudioController(Core::System& system_)
|
||||
: ServiceFramework{system_, "IAudioController"} {
|
||||
// clang-format off
|
||||
static const FunctionInfo functions[] = {
|
||||
{0, &IAudioController::SetExpectedMasterVolume, "SetExpectedMasterVolume"},
|
||||
|
|
@ -180,7 +181,8 @@ void IAudioController::SetTransparentAudioRate(Kernel::HLERequestContext& ctx) {
|
|||
rb.Push(RESULT_SUCCESS);
|
||||
}
|
||||
|
||||
IDisplayController::IDisplayController() : ServiceFramework("IDisplayController") {
|
||||
IDisplayController::IDisplayController(Core::System& system_)
|
||||
: ServiceFramework{system_, "IDisplayController"} {
|
||||
// clang-format off
|
||||
static const FunctionInfo functions[] = {
|
||||
{0, nullptr, "GetLastForegroundCaptureImage"},
|
||||
|
|
@ -219,7 +221,8 @@ IDisplayController::IDisplayController() : ServiceFramework("IDisplayController"
|
|||
|
||||
IDisplayController::~IDisplayController() = default;
|
||||
|
||||
IDebugFunctions::IDebugFunctions() : ServiceFramework{"IDebugFunctions"} {
|
||||
IDebugFunctions::IDebugFunctions(Core::System& system_)
|
||||
: ServiceFramework{system_, "IDebugFunctions"} {
|
||||
// clang-format off
|
||||
static const FunctionInfo functions[] = {
|
||||
{0, nullptr, "NotifyMessageToHomeMenuForDebug"},
|
||||
|
|
@ -246,8 +249,8 @@ IDebugFunctions::IDebugFunctions() : ServiceFramework{"IDebugFunctions"} {
|
|||
|
||||
IDebugFunctions::~IDebugFunctions() = default;
|
||||
|
||||
ISelfController::ISelfController(Core::System& system, NVFlinger::NVFlinger& nvflinger)
|
||||
: ServiceFramework("ISelfController"), system(system), nvflinger(nvflinger) {
|
||||
ISelfController::ISelfController(Core::System& system_, NVFlinger::NVFlinger& nvflinger_)
|
||||
: ServiceFramework{system_, "ISelfController"}, nvflinger{nvflinger_} {
|
||||
// clang-format off
|
||||
static const FunctionInfo functions[] = {
|
||||
{0, &ISelfController::Exit, "Exit"},
|
||||
|
|
@ -605,9 +608,9 @@ void AppletMessageQueue::RequestExit() {
|
|||
PushMessage(AppletMessage::ExitRequested);
|
||||
}
|
||||
|
||||
ICommonStateGetter::ICommonStateGetter(Core::System& system,
|
||||
std::shared_ptr<AppletMessageQueue> msg_queue)
|
||||
: ServiceFramework("ICommonStateGetter"), system(system), msg_queue(std::move(msg_queue)) {
|
||||
ICommonStateGetter::ICommonStateGetter(Core::System& system_,
|
||||
std::shared_ptr<AppletMessageQueue> msg_queue_)
|
||||
: ServiceFramework{system_, "ICommonStateGetter"}, msg_queue{std::move(msg_queue_)} {
|
||||
// clang-format off
|
||||
static const FunctionInfo functions[] = {
|
||||
{0, &ICommonStateGetter::GetEventHandle, "GetEventHandle"},
|
||||
|
|
@ -795,8 +798,9 @@ private:
|
|||
std::vector<u8> buffer;
|
||||
};
|
||||
|
||||
IStorage::IStorage(std::vector<u8>&& buffer)
|
||||
: ServiceFramework("IStorage"), impl{std::make_shared<StorageDataImpl>(std::move(buffer))} {
|
||||
IStorage::IStorage(Core::System& system_, std::vector<u8>&& buffer)
|
||||
: ServiceFramework{system_, "IStorage"}, impl{std::make_shared<StorageDataImpl>(
|
||||
std::move(buffer))} {
|
||||
Register();
|
||||
}
|
||||
|
||||
|
|
@ -819,7 +823,7 @@ void IStorage::Open(Kernel::HLERequestContext& ctx) {
|
|||
IPC::ResponseBuilder rb{ctx, 2, 0, 1};
|
||||
|
||||
rb.Push(RESULT_SUCCESS);
|
||||
rb.PushIpcInterface<IStorageAccessor>(*this);
|
||||
rb.PushIpcInterface<IStorageAccessor>(system, *this);
|
||||
}
|
||||
|
||||
void ICommonStateGetter::GetOperationMode(Kernel::HLERequestContext& ctx) {
|
||||
|
|
@ -841,8 +845,8 @@ void ICommonStateGetter::GetPerformanceMode(Kernel::HLERequestContext& ctx) {
|
|||
|
||||
class ILibraryAppletAccessor final : public ServiceFramework<ILibraryAppletAccessor> {
|
||||
public:
|
||||
explicit ILibraryAppletAccessor(std::shared_ptr<Applets::Applet> applet)
|
||||
: ServiceFramework("ILibraryAppletAccessor"), applet(std::move(applet)) {
|
||||
explicit ILibraryAppletAccessor(Core::System& system_, std::shared_ptr<Applets::Applet> applet_)
|
||||
: ServiceFramework{system_, "ILibraryAppletAccessor"}, applet{std::move(applet_)} {
|
||||
// clang-format off
|
||||
static const FunctionInfo functions[] = {
|
||||
{0, &ILibraryAppletAccessor::GetAppletStateChangedEvent, "GetAppletStateChangedEvent"},
|
||||
|
|
@ -997,8 +1001,8 @@ private:
|
|||
std::shared_ptr<Applets::Applet> applet;
|
||||
};
|
||||
|
||||
IStorageAccessor::IStorageAccessor(IStorage& storage)
|
||||
: ServiceFramework("IStorageAccessor"), backing(storage) {
|
||||
IStorageAccessor::IStorageAccessor(Core::System& system_, IStorage& backing_)
|
||||
: ServiceFramework{system_, "IStorageAccessor"}, backing{backing_} {
|
||||
// clang-format off
|
||||
static const FunctionInfo functions[] = {
|
||||
{0, &IStorageAccessor::GetSize, "GetSize"},
|
||||
|
|
@ -1069,7 +1073,7 @@ void IStorageAccessor::Read(Kernel::HLERequestContext& ctx) {
|
|||
}
|
||||
|
||||
ILibraryAppletCreator::ILibraryAppletCreator(Core::System& system_)
|
||||
: ServiceFramework("ILibraryAppletCreator"), system{system_} {
|
||||
: ServiceFramework{system_, "ILibraryAppletCreator"} {
|
||||
static const FunctionInfo functions[] = {
|
||||
{0, &ILibraryAppletCreator::CreateLibraryApplet, "CreateLibraryApplet"},
|
||||
{1, nullptr, "TerminateAllLibraryApplets"},
|
||||
|
|
@ -1105,7 +1109,7 @@ void ILibraryAppletCreator::CreateLibraryApplet(Kernel::HLERequestContext& ctx)
|
|||
IPC::ResponseBuilder rb{ctx, 2, 0, 1};
|
||||
|
||||
rb.Push(RESULT_SUCCESS);
|
||||
rb.PushIpcInterface<AM::ILibraryAppletAccessor>(applet);
|
||||
rb.PushIpcInterface<ILibraryAppletAccessor>(system, applet);
|
||||
}
|
||||
|
||||
void ILibraryAppletCreator::CreateStorage(Kernel::HLERequestContext& ctx) {
|
||||
|
|
@ -1117,7 +1121,7 @@ void ILibraryAppletCreator::CreateStorage(Kernel::HLERequestContext& ctx) {
|
|||
|
||||
IPC::ResponseBuilder rb{ctx, 2, 0, 1};
|
||||
rb.Push(RESULT_SUCCESS);
|
||||
rb.PushIpcInterface<AM::IStorage>(std::move(buffer));
|
||||
rb.PushIpcInterface<IStorage>(system, std::move(buffer));
|
||||
}
|
||||
|
||||
void ILibraryAppletCreator::CreateTransferMemoryStorage(Kernel::HLERequestContext& ctx) {
|
||||
|
|
@ -1144,11 +1148,11 @@ void ILibraryAppletCreator::CreateTransferMemoryStorage(Kernel::HLERequestContex
|
|||
|
||||
IPC::ResponseBuilder rb{ctx, 2, 0, 1};
|
||||
rb.Push(RESULT_SUCCESS);
|
||||
rb.PushIpcInterface<IStorage>(std::move(memory));
|
||||
rb.PushIpcInterface<IStorage>(system, std::move(memory));
|
||||
}
|
||||
|
||||
IApplicationFunctions::IApplicationFunctions(Core::System& system_)
|
||||
: ServiceFramework("IApplicationFunctions"), system{system_} {
|
||||
: ServiceFramework{system_, "IApplicationFunctions"} {
|
||||
// clang-format off
|
||||
static const FunctionInfo functions[] = {
|
||||
{1, &IApplicationFunctions::PopLaunchParameter, "PopLaunchParameter"},
|
||||
|
|
@ -1300,7 +1304,7 @@ void IApplicationFunctions::PopLaunchParameter(Kernel::HLERequestContext& ctx) {
|
|||
if (data.has_value()) {
|
||||
IPC::ResponseBuilder rb{ctx, 2, 0, 1};
|
||||
rb.Push(RESULT_SUCCESS);
|
||||
rb.PushIpcInterface<IStorage>(std::move(*data));
|
||||
rb.PushIpcInterface<IStorage>(system, std::move(*data));
|
||||
launch_popped_application_specific = true;
|
||||
return;
|
||||
}
|
||||
|
|
@ -1323,7 +1327,7 @@ void IApplicationFunctions::PopLaunchParameter(Kernel::HLERequestContext& ctx) {
|
|||
std::vector<u8> buffer(sizeof(LaunchParameterAccountPreselectedUser));
|
||||
std::memcpy(buffer.data(), ¶ms, buffer.size());
|
||||
|
||||
rb.PushIpcInterface<IStorage>(std::move(buffer));
|
||||
rb.PushIpcInterface<IStorage>(system, std::move(buffer));
|
||||
launch_popped_account_preselect = true;
|
||||
return;
|
||||
}
|
||||
|
|
@ -1621,14 +1625,14 @@ void InstallInterfaces(SM::ServiceManager& service_manager, NVFlinger::NVFlinger
|
|||
|
||||
std::make_shared<AppletAE>(nvflinger, message_queue, system)->InstallAsService(service_manager);
|
||||
std::make_shared<AppletOE>(nvflinger, message_queue, system)->InstallAsService(service_manager);
|
||||
std::make_shared<IdleSys>()->InstallAsService(service_manager);
|
||||
std::make_shared<OMM>()->InstallAsService(service_manager);
|
||||
std::make_shared<SPSM>()->InstallAsService(service_manager);
|
||||
std::make_shared<TCAP>()->InstallAsService(service_manager);
|
||||
std::make_shared<IdleSys>(system)->InstallAsService(service_manager);
|
||||
std::make_shared<OMM>(system)->InstallAsService(service_manager);
|
||||
std::make_shared<SPSM>(system)->InstallAsService(service_manager);
|
||||
std::make_shared<TCAP>(system)->InstallAsService(service_manager);
|
||||
}
|
||||
|
||||
IHomeMenuFunctions::IHomeMenuFunctions(Kernel::KernelCore& kernel)
|
||||
: ServiceFramework("IHomeMenuFunctions"), kernel(kernel) {
|
||||
IHomeMenuFunctions::IHomeMenuFunctions(Core::System& system_)
|
||||
: ServiceFramework{system_, "IHomeMenuFunctions"} {
|
||||
// clang-format off
|
||||
static const FunctionInfo functions[] = {
|
||||
{10, &IHomeMenuFunctions::RequestToGetForeground, "RequestToGetForeground"},
|
||||
|
|
@ -1647,7 +1651,7 @@ IHomeMenuFunctions::IHomeMenuFunctions(Kernel::KernelCore& kernel)
|
|||
RegisterHandlers(functions);
|
||||
|
||||
pop_from_general_channel_event = Kernel::WritableEvent::CreateEventPair(
|
||||
kernel, "IHomeMenuFunctions:PopFromGeneralChannelEvent");
|
||||
system.Kernel(), "IHomeMenuFunctions:PopFromGeneralChannelEvent");
|
||||
}
|
||||
|
||||
IHomeMenuFunctions::~IHomeMenuFunctions() = default;
|
||||
|
|
@ -1667,7 +1671,8 @@ void IHomeMenuFunctions::GetPopFromGeneralChannelEvent(Kernel::HLERequestContext
|
|||
rb.PushCopyObjects(pop_from_general_channel_event.readable);
|
||||
}
|
||||
|
||||
IGlobalStateController::IGlobalStateController() : ServiceFramework("IGlobalStateController") {
|
||||
IGlobalStateController::IGlobalStateController(Core::System& system_)
|
||||
: ServiceFramework{system_, "IGlobalStateController"} {
|
||||
// clang-format off
|
||||
static const FunctionInfo functions[] = {
|
||||
{0, nullptr, "RequestToEnterSleep"},
|
||||
|
|
@ -1690,7 +1695,8 @@ IGlobalStateController::IGlobalStateController() : ServiceFramework("IGlobalStat
|
|||
|
||||
IGlobalStateController::~IGlobalStateController() = default;
|
||||
|
||||
IApplicationCreator::IApplicationCreator() : ServiceFramework("IApplicationCreator") {
|
||||
IApplicationCreator::IApplicationCreator(Core::System& system_)
|
||||
: ServiceFramework{system_, "IApplicationCreator"} {
|
||||
// clang-format off
|
||||
static const FunctionInfo functions[] = {
|
||||
{0, nullptr, "CreateApplication"},
|
||||
|
|
@ -1705,8 +1711,8 @@ IApplicationCreator::IApplicationCreator() : ServiceFramework("IApplicationCreat
|
|||
|
||||
IApplicationCreator::~IApplicationCreator() = default;
|
||||
|
||||
IProcessWindingController::IProcessWindingController()
|
||||
: ServiceFramework("IProcessWindingController") {
|
||||
IProcessWindingController::IProcessWindingController(Core::System& system_)
|
||||
: ServiceFramework{system_, "IProcessWindingController"} {
|
||||
// clang-format off
|
||||
static const FunctionInfo functions[] = {
|
||||
{0, nullptr, "GetLaunchReason"},
|
||||
|
|
|
|||
|
|
@ -77,13 +77,11 @@ public:
|
|||
private:
|
||||
void GetAppletResourceUserId(Kernel::HLERequestContext& ctx);
|
||||
void AcquireForegroundRights(Kernel::HLERequestContext& ctx);
|
||||
|
||||
Core::System& system;
|
||||
};
|
||||
|
||||
class IAudioController final : public ServiceFramework<IAudioController> {
|
||||
public:
|
||||
IAudioController();
|
||||
explicit IAudioController(Core::System& system_);
|
||||
~IAudioController() override;
|
||||
|
||||
private:
|
||||
|
|
@ -109,13 +107,13 @@ private:
|
|||
|
||||
class IDisplayController final : public ServiceFramework<IDisplayController> {
|
||||
public:
|
||||
IDisplayController();
|
||||
explicit IDisplayController(Core::System& system_);
|
||||
~IDisplayController() override;
|
||||
};
|
||||
|
||||
class IDebugFunctions final : public ServiceFramework<IDebugFunctions> {
|
||||
public:
|
||||
IDebugFunctions();
|
||||
explicit IDebugFunctions(Core::System& system_);
|
||||
~IDebugFunctions() override;
|
||||
};
|
||||
|
||||
|
|
@ -154,7 +152,6 @@ private:
|
|||
Disable = 2,
|
||||
};
|
||||
|
||||
Core::System& system;
|
||||
NVFlinger::NVFlinger& nvflinger;
|
||||
Kernel::EventPair launchable_event;
|
||||
Kernel::EventPair accumulated_suspended_tick_changed_event;
|
||||
|
|
@ -167,8 +164,8 @@ private:
|
|||
|
||||
class ICommonStateGetter final : public ServiceFramework<ICommonStateGetter> {
|
||||
public:
|
||||
explicit ICommonStateGetter(Core::System& system,
|
||||
std::shared_ptr<AppletMessageQueue> msg_queue);
|
||||
explicit ICommonStateGetter(Core::System& system_,
|
||||
std::shared_ptr<AppletMessageQueue> msg_queue_);
|
||||
~ICommonStateGetter() override;
|
||||
|
||||
private:
|
||||
|
|
@ -196,7 +193,6 @@ private:
|
|||
void GetDefaultDisplayResolution(Kernel::HLERequestContext& ctx);
|
||||
void SetCpuBoostMode(Kernel::HLERequestContext& ctx);
|
||||
|
||||
Core::System& system;
|
||||
std::shared_ptr<AppletMessageQueue> msg_queue;
|
||||
bool vr_mode_state{};
|
||||
};
|
||||
|
|
@ -211,7 +207,7 @@ public:
|
|||
|
||||
class IStorage final : public ServiceFramework<IStorage> {
|
||||
public:
|
||||
explicit IStorage(std::vector<u8>&& buffer);
|
||||
explicit IStorage(Core::System& system_, std::vector<u8>&& buffer);
|
||||
~IStorage() override;
|
||||
|
||||
std::vector<u8>& GetData() {
|
||||
|
|
@ -235,7 +231,7 @@ private:
|
|||
|
||||
class IStorageAccessor final : public ServiceFramework<IStorageAccessor> {
|
||||
public:
|
||||
explicit IStorageAccessor(IStorage& backing);
|
||||
explicit IStorageAccessor(Core::System& system_, IStorage& backing_);
|
||||
~IStorageAccessor() override;
|
||||
|
||||
private:
|
||||
|
|
@ -255,8 +251,6 @@ private:
|
|||
void CreateLibraryApplet(Kernel::HLERequestContext& ctx);
|
||||
void CreateStorage(Kernel::HLERequestContext& ctx);
|
||||
void CreateTransferMemoryStorage(Kernel::HLERequestContext& ctx);
|
||||
|
||||
Core::System& system;
|
||||
};
|
||||
|
||||
class IApplicationFunctions final : public ServiceFramework<IApplicationFunctions> {
|
||||
|
|
@ -299,12 +293,11 @@ private:
|
|||
s32 previous_program_index{-1};
|
||||
Kernel::EventPair gpu_error_detected_event;
|
||||
Kernel::EventPair friend_invitation_storage_channel_event;
|
||||
Core::System& system;
|
||||
};
|
||||
|
||||
class IHomeMenuFunctions final : public ServiceFramework<IHomeMenuFunctions> {
|
||||
public:
|
||||
explicit IHomeMenuFunctions(Kernel::KernelCore& kernel);
|
||||
explicit IHomeMenuFunctions(Core::System& system_);
|
||||
~IHomeMenuFunctions() override;
|
||||
|
||||
private:
|
||||
|
|
@ -312,24 +305,23 @@ private:
|
|||
void GetPopFromGeneralChannelEvent(Kernel::HLERequestContext& ctx);
|
||||
|
||||
Kernel::EventPair pop_from_general_channel_event;
|
||||
Kernel::KernelCore& kernel;
|
||||
};
|
||||
|
||||
class IGlobalStateController final : public ServiceFramework<IGlobalStateController> {
|
||||
public:
|
||||
IGlobalStateController();
|
||||
explicit IGlobalStateController(Core::System& system_);
|
||||
~IGlobalStateController() override;
|
||||
};
|
||||
|
||||
class IApplicationCreator final : public ServiceFramework<IApplicationCreator> {
|
||||
public:
|
||||
IApplicationCreator();
|
||||
explicit IApplicationCreator(Core::System& system_);
|
||||
~IApplicationCreator() override;
|
||||
};
|
||||
|
||||
class IProcessWindingController final : public ServiceFramework<IProcessWindingController> {
|
||||
public:
|
||||
IProcessWindingController();
|
||||
explicit IProcessWindingController(Core::System& system_);
|
||||
~IProcessWindingController() override;
|
||||
};
|
||||
|
||||
|
|
|
|||
|
|
@ -13,11 +13,11 @@ namespace Service::AM {
|
|||
|
||||
class ILibraryAppletProxy final : public ServiceFramework<ILibraryAppletProxy> {
|
||||
public:
|
||||
explicit ILibraryAppletProxy(NVFlinger::NVFlinger& nvflinger,
|
||||
std::shared_ptr<AppletMessageQueue> msg_queue,
|
||||
Core::System& system)
|
||||
: ServiceFramework("ILibraryAppletProxy"), nvflinger(nvflinger),
|
||||
msg_queue(std::move(msg_queue)), system(system) {
|
||||
explicit ILibraryAppletProxy(NVFlinger::NVFlinger& nvflinger_,
|
||||
std::shared_ptr<AppletMessageQueue> msg_queue_,
|
||||
Core::System& system_)
|
||||
: ServiceFramework{system_, "ILibraryAppletProxy"}, nvflinger{nvflinger_},
|
||||
msg_queue{std::move(msg_queue_)} {
|
||||
// clang-format off
|
||||
static const FunctionInfo functions[] = {
|
||||
{0, &ILibraryAppletProxy::GetCommonStateGetter, "GetCommonStateGetter"},
|
||||
|
|
@ -66,7 +66,7 @@ private:
|
|||
|
||||
IPC::ResponseBuilder rb{ctx, 2, 0, 1};
|
||||
rb.Push(RESULT_SUCCESS);
|
||||
rb.PushIpcInterface<IAudioController>();
|
||||
rb.PushIpcInterface<IAudioController>(system);
|
||||
}
|
||||
|
||||
void GetDisplayController(Kernel::HLERequestContext& ctx) {
|
||||
|
|
@ -74,7 +74,7 @@ private:
|
|||
|
||||
IPC::ResponseBuilder rb{ctx, 2, 0, 1};
|
||||
rb.Push(RESULT_SUCCESS);
|
||||
rb.PushIpcInterface<IDisplayController>();
|
||||
rb.PushIpcInterface<IDisplayController>(system);
|
||||
}
|
||||
|
||||
void GetProcessWindingController(Kernel::HLERequestContext& ctx) {
|
||||
|
|
@ -82,7 +82,7 @@ private:
|
|||
|
||||
IPC::ResponseBuilder rb{ctx, 2, 0, 1};
|
||||
rb.Push(RESULT_SUCCESS);
|
||||
rb.PushIpcInterface<IProcessWindingController>();
|
||||
rb.PushIpcInterface<IProcessWindingController>(system);
|
||||
}
|
||||
|
||||
void GetDebugFunctions(Kernel::HLERequestContext& ctx) {
|
||||
|
|
@ -90,7 +90,7 @@ private:
|
|||
|
||||
IPC::ResponseBuilder rb{ctx, 2, 0, 1};
|
||||
rb.Push(RESULT_SUCCESS);
|
||||
rb.PushIpcInterface<IDebugFunctions>();
|
||||
rb.PushIpcInterface<IDebugFunctions>(system);
|
||||
}
|
||||
|
||||
void GetLibraryAppletCreator(Kernel::HLERequestContext& ctx) {
|
||||
|
|
@ -111,15 +111,15 @@ private:
|
|||
|
||||
NVFlinger::NVFlinger& nvflinger;
|
||||
std::shared_ptr<AppletMessageQueue> msg_queue;
|
||||
Core::System& system;
|
||||
};
|
||||
|
||||
class ISystemAppletProxy final : public ServiceFramework<ISystemAppletProxy> {
|
||||
public:
|
||||
explicit ISystemAppletProxy(NVFlinger::NVFlinger& nvflinger,
|
||||
std::shared_ptr<AppletMessageQueue> msg_queue, Core::System& system)
|
||||
: ServiceFramework("ISystemAppletProxy"), nvflinger(nvflinger),
|
||||
msg_queue(std::move(msg_queue)), system(system) {
|
||||
explicit ISystemAppletProxy(NVFlinger::NVFlinger& nvflinger_,
|
||||
std::shared_ptr<AppletMessageQueue> msg_queue_,
|
||||
Core::System& system_)
|
||||
: ServiceFramework{system_, "ISystemAppletProxy"}, nvflinger{nvflinger_},
|
||||
msg_queue{std::move(msg_queue_)} {
|
||||
// clang-format off
|
||||
static const FunctionInfo functions[] = {
|
||||
{0, &ISystemAppletProxy::GetCommonStateGetter, "GetCommonStateGetter"},
|
||||
|
|
@ -170,7 +170,7 @@ private:
|
|||
|
||||
IPC::ResponseBuilder rb{ctx, 2, 0, 1};
|
||||
rb.Push(RESULT_SUCCESS);
|
||||
rb.PushIpcInterface<IAudioController>();
|
||||
rb.PushIpcInterface<IAudioController>(system);
|
||||
}
|
||||
|
||||
void GetDisplayController(Kernel::HLERequestContext& ctx) {
|
||||
|
|
@ -178,7 +178,7 @@ private:
|
|||
|
||||
IPC::ResponseBuilder rb{ctx, 2, 0, 1};
|
||||
rb.Push(RESULT_SUCCESS);
|
||||
rb.PushIpcInterface<IDisplayController>();
|
||||
rb.PushIpcInterface<IDisplayController>(system);
|
||||
}
|
||||
|
||||
void GetDebugFunctions(Kernel::HLERequestContext& ctx) {
|
||||
|
|
@ -186,7 +186,7 @@ private:
|
|||
|
||||
IPC::ResponseBuilder rb{ctx, 2, 0, 1};
|
||||
rb.Push(RESULT_SUCCESS);
|
||||
rb.PushIpcInterface<IDebugFunctions>();
|
||||
rb.PushIpcInterface<IDebugFunctions>(system);
|
||||
}
|
||||
|
||||
void GetLibraryAppletCreator(Kernel::HLERequestContext& ctx) {
|
||||
|
|
@ -202,7 +202,7 @@ private:
|
|||
|
||||
IPC::ResponseBuilder rb{ctx, 2, 0, 1};
|
||||
rb.Push(RESULT_SUCCESS);
|
||||
rb.PushIpcInterface<IHomeMenuFunctions>(system.Kernel());
|
||||
rb.PushIpcInterface<IHomeMenuFunctions>(system);
|
||||
}
|
||||
|
||||
void GetGlobalStateController(Kernel::HLERequestContext& ctx) {
|
||||
|
|
@ -210,7 +210,7 @@ private:
|
|||
|
||||
IPC::ResponseBuilder rb{ctx, 2, 0, 1};
|
||||
rb.Push(RESULT_SUCCESS);
|
||||
rb.PushIpcInterface<IGlobalStateController>();
|
||||
rb.PushIpcInterface<IGlobalStateController>(system);
|
||||
}
|
||||
|
||||
void GetApplicationCreator(Kernel::HLERequestContext& ctx) {
|
||||
|
|
@ -218,12 +218,11 @@ private:
|
|||
|
||||
IPC::ResponseBuilder rb{ctx, 2, 0, 1};
|
||||
rb.Push(RESULT_SUCCESS);
|
||||
rb.PushIpcInterface<IApplicationCreator>();
|
||||
rb.PushIpcInterface<IApplicationCreator>(system);
|
||||
}
|
||||
|
||||
NVFlinger::NVFlinger& nvflinger;
|
||||
std::shared_ptr<AppletMessageQueue> msg_queue;
|
||||
Core::System& system;
|
||||
};
|
||||
|
||||
void AppletAE::OpenSystemAppletProxy(Kernel::HLERequestContext& ctx) {
|
||||
|
|
@ -250,10 +249,10 @@ void AppletAE::OpenLibraryAppletProxyOld(Kernel::HLERequestContext& ctx) {
|
|||
rb.PushIpcInterface<ILibraryAppletProxy>(nvflinger, msg_queue, system);
|
||||
}
|
||||
|
||||
AppletAE::AppletAE(NVFlinger::NVFlinger& nvflinger, std::shared_ptr<AppletMessageQueue> msg_queue,
|
||||
Core::System& system)
|
||||
: ServiceFramework("appletAE"), nvflinger(nvflinger), msg_queue(std::move(msg_queue)),
|
||||
system(system) {
|
||||
AppletAE::AppletAE(NVFlinger::NVFlinger& nvflinger_, std::shared_ptr<AppletMessageQueue> msg_queue_,
|
||||
Core::System& system_)
|
||||
: ServiceFramework{system_, "appletAE"}, nvflinger{nvflinger_}, msg_queue{
|
||||
std::move(msg_queue_)} {
|
||||
// clang-format off
|
||||
static const FunctionInfo functions[] = {
|
||||
{100, &AppletAE::OpenSystemAppletProxy, "OpenSystemAppletProxy"},
|
||||
|
|
|
|||
|
|
@ -23,8 +23,8 @@ class AppletMessageQueue;
|
|||
|
||||
class AppletAE final : public ServiceFramework<AppletAE> {
|
||||
public:
|
||||
explicit AppletAE(NVFlinger::NVFlinger& nvflinger,
|
||||
std::shared_ptr<AppletMessageQueue> msg_queue, Core::System& system);
|
||||
explicit AppletAE(NVFlinger::NVFlinger& nvflinger_,
|
||||
std::shared_ptr<AppletMessageQueue> msg_queue_, Core::System& system_);
|
||||
~AppletAE() override;
|
||||
|
||||
const std::shared_ptr<AppletMessageQueue>& GetMessageQueue() const;
|
||||
|
|
@ -36,7 +36,6 @@ private:
|
|||
|
||||
NVFlinger::NVFlinger& nvflinger;
|
||||
std::shared_ptr<AppletMessageQueue> msg_queue;
|
||||
Core::System& system;
|
||||
};
|
||||
|
||||
} // namespace AM
|
||||
|
|
|
|||
|
|
@ -12,10 +12,11 @@ namespace Service::AM {
|
|||
|
||||
class IApplicationProxy final : public ServiceFramework<IApplicationProxy> {
|
||||
public:
|
||||
explicit IApplicationProxy(NVFlinger::NVFlinger& nvflinger,
|
||||
std::shared_ptr<AppletMessageQueue> msg_queue, Core::System& system)
|
||||
: ServiceFramework("IApplicationProxy"), nvflinger(nvflinger),
|
||||
msg_queue(std::move(msg_queue)), system(system) {
|
||||
explicit IApplicationProxy(NVFlinger::NVFlinger& nvflinger_,
|
||||
std::shared_ptr<AppletMessageQueue> msg_queue_,
|
||||
Core::System& system_)
|
||||
: ServiceFramework{system_, "IApplicationProxy"}, nvflinger{nvflinger_},
|
||||
msg_queue{std::move(msg_queue_)} {
|
||||
// clang-format off
|
||||
static const FunctionInfo functions[] = {
|
||||
{0, &IApplicationProxy::GetCommonStateGetter, "GetCommonStateGetter"},
|
||||
|
|
@ -39,7 +40,7 @@ private:
|
|||
|
||||
IPC::ResponseBuilder rb{ctx, 2, 0, 1};
|
||||
rb.Push(RESULT_SUCCESS);
|
||||
rb.PushIpcInterface<IAudioController>();
|
||||
rb.PushIpcInterface<IAudioController>(system);
|
||||
}
|
||||
|
||||
void GetDisplayController(Kernel::HLERequestContext& ctx) {
|
||||
|
|
@ -47,7 +48,7 @@ private:
|
|||
|
||||
IPC::ResponseBuilder rb{ctx, 2, 0, 1};
|
||||
rb.Push(RESULT_SUCCESS);
|
||||
rb.PushIpcInterface<IDisplayController>();
|
||||
rb.PushIpcInterface<IDisplayController>(system);
|
||||
}
|
||||
|
||||
void GetDebugFunctions(Kernel::HLERequestContext& ctx) {
|
||||
|
|
@ -55,7 +56,7 @@ private:
|
|||
|
||||
IPC::ResponseBuilder rb{ctx, 2, 0, 1};
|
||||
rb.Push(RESULT_SUCCESS);
|
||||
rb.PushIpcInterface<IDebugFunctions>();
|
||||
rb.PushIpcInterface<IDebugFunctions>(system);
|
||||
}
|
||||
|
||||
void GetWindowController(Kernel::HLERequestContext& ctx) {
|
||||
|
|
@ -100,7 +101,6 @@ private:
|
|||
|
||||
NVFlinger::NVFlinger& nvflinger;
|
||||
std::shared_ptr<AppletMessageQueue> msg_queue;
|
||||
Core::System& system;
|
||||
};
|
||||
|
||||
void AppletOE::OpenApplicationProxy(Kernel::HLERequestContext& ctx) {
|
||||
|
|
@ -111,10 +111,10 @@ void AppletOE::OpenApplicationProxy(Kernel::HLERequestContext& ctx) {
|
|||
rb.PushIpcInterface<IApplicationProxy>(nvflinger, msg_queue, system);
|
||||
}
|
||||
|
||||
AppletOE::AppletOE(NVFlinger::NVFlinger& nvflinger, std::shared_ptr<AppletMessageQueue> msg_queue,
|
||||
Core::System& system)
|
||||
: ServiceFramework("appletOE"), nvflinger(nvflinger), msg_queue(std::move(msg_queue)),
|
||||
system(system) {
|
||||
AppletOE::AppletOE(NVFlinger::NVFlinger& nvflinger_, std::shared_ptr<AppletMessageQueue> msg_queue_,
|
||||
Core::System& system_)
|
||||
: ServiceFramework{system_, "appletOE"}, nvflinger{nvflinger_}, msg_queue{
|
||||
std::move(msg_queue_)} {
|
||||
static const FunctionInfo functions[] = {
|
||||
{0, &AppletOE::OpenApplicationProxy, "OpenApplicationProxy"},
|
||||
};
|
||||
|
|
|
|||
|
|
@ -23,8 +23,8 @@ class AppletMessageQueue;
|
|||
|
||||
class AppletOE final : public ServiceFramework<AppletOE> {
|
||||
public:
|
||||
explicit AppletOE(NVFlinger::NVFlinger& nvflinger,
|
||||
std::shared_ptr<AppletMessageQueue> msg_queue, Core::System& system);
|
||||
explicit AppletOE(NVFlinger::NVFlinger& nvflinger_,
|
||||
std::shared_ptr<AppletMessageQueue> msg_queue_, Core::System& system_);
|
||||
~AppletOE() override;
|
||||
|
||||
const std::shared_ptr<AppletMessageQueue>& GetMessageQueue() const;
|
||||
|
|
@ -34,7 +34,6 @@ private:
|
|||
|
||||
NVFlinger::NVFlinger& nvflinger;
|
||||
std::shared_ptr<AppletMessageQueue> msg_queue;
|
||||
Core::System& system;
|
||||
};
|
||||
|
||||
} // namespace AM
|
||||
|
|
|
|||
|
|
@ -46,7 +46,7 @@ static Core::Frontend::ControllerParameters ConvertToFrontendParameters(
|
|||
}
|
||||
|
||||
Controller::Controller(Core::System& system_, const Core::Frontend::ControllerApplet& frontend_)
|
||||
: Applet{system_.Kernel()}, frontend(frontend_) {}
|
||||
: Applet{system_.Kernel()}, frontend{frontend_}, system{system_} {}
|
||||
|
||||
Controller::~Controller() = default;
|
||||
|
||||
|
|
@ -245,7 +245,7 @@ void Controller::ConfigurationComplete() {
|
|||
complete = true;
|
||||
out_data = std::vector<u8>(sizeof(ControllerSupportResultInfo));
|
||||
std::memcpy(out_data.data(), &result_info, out_data.size());
|
||||
broker.PushNormalDataFromApplet(std::make_shared<IStorage>(std::move(out_data)));
|
||||
broker.PushNormalDataFromApplet(std::make_shared<IStorage>(system, std::move(out_data)));
|
||||
broker.SignalStateChanged();
|
||||
}
|
||||
|
||||
|
|
|
|||
|
|
@ -120,6 +120,7 @@ public:
|
|||
|
||||
private:
|
||||
const Core::Frontend::ControllerApplet& frontend;
|
||||
Core::System& system;
|
||||
|
||||
ControllerAppletVersion controller_applet_version;
|
||||
ControllerSupportArgPrivate controller_private_arg;
|
||||
|
|
|
|||
|
|
@ -87,7 +87,7 @@ ResultCode Decode64BitError(u64 error) {
|
|||
} // Anonymous namespace
|
||||
|
||||
Error::Error(Core::System& system_, const Core::Frontend::ErrorApplet& frontend_)
|
||||
: Applet{system_.Kernel()}, frontend(frontend_), system{system_} {}
|
||||
: Applet{system_.Kernel()}, frontend{frontend_}, system{system_} {}
|
||||
|
||||
Error::~Error() = default;
|
||||
|
||||
|
|
@ -186,7 +186,7 @@ void Error::Execute() {
|
|||
|
||||
void Error::DisplayCompleted() {
|
||||
complete = true;
|
||||
broker.PushNormalDataFromApplet(std::make_shared<IStorage>(std::vector<u8>{}));
|
||||
broker.PushNormalDataFromApplet(std::make_shared<IStorage>(system, std::vector<u8>{}));
|
||||
broker.SignalStateChanged();
|
||||
}
|
||||
|
||||
|
|
|
|||
|
|
@ -38,7 +38,7 @@ static void LogCurrentStorage(AppletDataBroker& broker, std::string_view prefix)
|
|||
}
|
||||
|
||||
Auth::Auth(Core::System& system_, Core::Frontend::ParentalControlsApplet& frontend_)
|
||||
: Applet{system_.Kernel()}, frontend(frontend_) {}
|
||||
: Applet{system_.Kernel()}, frontend{frontend_}, system{system_} {}
|
||||
|
||||
Auth::~Auth() = default;
|
||||
|
||||
|
|
@ -135,8 +135,8 @@ void Auth::Execute() {
|
|||
}
|
||||
}
|
||||
|
||||
void Auth::AuthFinished(bool successful) {
|
||||
this->successful = successful;
|
||||
void Auth::AuthFinished(bool is_successful) {
|
||||
this->successful = is_successful;
|
||||
|
||||
struct Return {
|
||||
ResultCode result_code;
|
||||
|
|
@ -148,12 +148,12 @@ void Auth::AuthFinished(bool successful) {
|
|||
std::vector<u8> out(sizeof(Return));
|
||||
std::memcpy(out.data(), &return_, sizeof(Return));
|
||||
|
||||
broker.PushNormalDataFromApplet(std::make_shared<IStorage>(std::move(out)));
|
||||
broker.PushNormalDataFromApplet(std::make_shared<IStorage>(system, std::move(out)));
|
||||
broker.SignalStateChanged();
|
||||
}
|
||||
|
||||
PhotoViewer::PhotoViewer(Core::System& system_, const Core::Frontend::PhotoViewerApplet& frontend_)
|
||||
: Applet{system_.Kernel()}, frontend(frontend_), system{system_} {}
|
||||
: Applet{system_.Kernel()}, frontend{frontend_}, system{system_} {}
|
||||
|
||||
PhotoViewer::~PhotoViewer() = default;
|
||||
|
||||
|
|
@ -198,12 +198,12 @@ void PhotoViewer::Execute() {
|
|||
}
|
||||
|
||||
void PhotoViewer::ViewFinished() {
|
||||
broker.PushNormalDataFromApplet(std::make_shared<IStorage>(std::vector<u8>{}));
|
||||
broker.PushNormalDataFromApplet(std::make_shared<IStorage>(system, std::vector<u8>{}));
|
||||
broker.SignalStateChanged();
|
||||
}
|
||||
|
||||
StubApplet::StubApplet(Core::System& system_, AppletId id_)
|
||||
: Applet{system_.Kernel()}, id(id_), system{system_} {}
|
||||
: Applet{system_.Kernel()}, id{id_}, system{system_} {}
|
||||
|
||||
StubApplet::~StubApplet() = default;
|
||||
|
||||
|
|
@ -234,8 +234,9 @@ void StubApplet::ExecuteInteractive() {
|
|||
LOG_WARNING(Service_AM, "called (STUBBED)");
|
||||
LogCurrentStorage(broker, "ExecuteInteractive");
|
||||
|
||||
broker.PushNormalDataFromApplet(std::make_shared<IStorage>(std::vector<u8>(0x1000)));
|
||||
broker.PushInteractiveDataFromApplet(std::make_shared<IStorage>(std::vector<u8>(0x1000)));
|
||||
broker.PushNormalDataFromApplet(std::make_shared<IStorage>(system, std::vector<u8>(0x1000)));
|
||||
broker.PushInteractiveDataFromApplet(
|
||||
std::make_shared<IStorage>(system, std::vector<u8>(0x1000)));
|
||||
broker.SignalStateChanged();
|
||||
}
|
||||
|
||||
|
|
@ -243,8 +244,9 @@ void StubApplet::Execute() {
|
|||
LOG_WARNING(Service_AM, "called (STUBBED)");
|
||||
LogCurrentStorage(broker, "Execute");
|
||||
|
||||
broker.PushNormalDataFromApplet(std::make_shared<IStorage>(std::vector<u8>(0x1000)));
|
||||
broker.PushInteractiveDataFromApplet(std::make_shared<IStorage>(std::vector<u8>(0x1000)));
|
||||
broker.PushNormalDataFromApplet(std::make_shared<IStorage>(system, std::vector<u8>(0x1000)));
|
||||
broker.PushInteractiveDataFromApplet(
|
||||
std::make_shared<IStorage>(system, std::vector<u8>(0x1000)));
|
||||
broker.SignalStateChanged();
|
||||
}
|
||||
|
||||
|
|
|
|||
|
|
@ -29,10 +29,11 @@ public:
|
|||
void ExecuteInteractive() override;
|
||||
void Execute() override;
|
||||
|
||||
void AuthFinished(bool successful = true);
|
||||
void AuthFinished(bool is_successful = true);
|
||||
|
||||
private:
|
||||
Core::Frontend::ParentalControlsApplet& frontend;
|
||||
Core::System& system;
|
||||
bool complete = false;
|
||||
bool successful = false;
|
||||
|
||||
|
|
|
|||
|
|
@ -17,7 +17,7 @@ constexpr ResultCode ERR_USER_CANCELLED_SELECTION{ErrorModule::Account, 1};
|
|||
|
||||
ProfileSelect::ProfileSelect(Core::System& system_,
|
||||
const Core::Frontend::ProfileSelectApplet& frontend_)
|
||||
: Applet{system_.Kernel()}, frontend(frontend_) {}
|
||||
: Applet{system_.Kernel()}, frontend{frontend_}, system{system_} {}
|
||||
|
||||
ProfileSelect::~ProfileSelect() = default;
|
||||
|
||||
|
|
@ -50,7 +50,7 @@ void ProfileSelect::ExecuteInteractive() {
|
|||
|
||||
void ProfileSelect::Execute() {
|
||||
if (complete) {
|
||||
broker.PushNormalDataFromApplet(std::make_shared<IStorage>(std::move(final_data)));
|
||||
broker.PushNormalDataFromApplet(std::make_shared<IStorage>(system, std::move(final_data)));
|
||||
return;
|
||||
}
|
||||
|
||||
|
|
@ -71,7 +71,7 @@ void ProfileSelect::SelectionComplete(std::optional<Common::UUID> uuid) {
|
|||
|
||||
final_data = std::vector<u8>(sizeof(UserSelectionOutput));
|
||||
std::memcpy(final_data.data(), &output, final_data.size());
|
||||
broker.PushNormalDataFromApplet(std::make_shared<IStorage>(std::move(final_data)));
|
||||
broker.PushNormalDataFromApplet(std::make_shared<IStorage>(system, std::move(final_data)));
|
||||
broker.SignalStateChanged();
|
||||
}
|
||||
|
||||
|
|
|
|||
|
|
@ -53,6 +53,7 @@ private:
|
|||
bool complete = false;
|
||||
ResultCode status = RESULT_SUCCESS;
|
||||
std::vector<u8> final_data;
|
||||
Core::System& system;
|
||||
};
|
||||
|
||||
} // namespace Service::AM::Applets
|
||||
|
|
|
|||
|
|
@ -53,7 +53,7 @@ static Core::Frontend::SoftwareKeyboardParameters ConvertToFrontendParameters(
|
|||
|
||||
SoftwareKeyboard::SoftwareKeyboard(Core::System& system_,
|
||||
const Core::Frontend::SoftwareKeyboardApplet& frontend_)
|
||||
: Applet{system_.Kernel()}, frontend(frontend_) {}
|
||||
: Applet{system_.Kernel()}, frontend{frontend_}, system{system_} {}
|
||||
|
||||
SoftwareKeyboard::~SoftwareKeyboard() = default;
|
||||
|
||||
|
|
@ -122,7 +122,7 @@ void SoftwareKeyboard::ExecuteInteractive() {
|
|||
|
||||
switch (request) {
|
||||
case Request::Calc: {
|
||||
broker.PushNormalDataFromApplet(std::make_shared<IStorage>(std::vector<u8>{1}));
|
||||
broker.PushNormalDataFromApplet(std::make_shared<IStorage>(system, std::vector<u8>{1}));
|
||||
broker.SignalStateChanged();
|
||||
break;
|
||||
}
|
||||
|
|
@ -135,7 +135,7 @@ void SoftwareKeyboard::ExecuteInteractive() {
|
|||
|
||||
void SoftwareKeyboard::Execute() {
|
||||
if (complete) {
|
||||
broker.PushNormalDataFromApplet(std::make_shared<IStorage>(std::move(final_data)));
|
||||
broker.PushNormalDataFromApplet(std::make_shared<IStorage>(system, std::move(final_data)));
|
||||
broker.SignalStateChanged();
|
||||
return;
|
||||
}
|
||||
|
|
@ -179,15 +179,17 @@ void SoftwareKeyboard::WriteText(std::optional<std::u16string> text) {
|
|||
final_data = output_main;
|
||||
|
||||
if (complete) {
|
||||
broker.PushNormalDataFromApplet(std::make_shared<IStorage>(std::move(output_main)));
|
||||
broker.PushNormalDataFromApplet(
|
||||
std::make_shared<IStorage>(system, std::move(output_main)));
|
||||
broker.SignalStateChanged();
|
||||
} else {
|
||||
broker.PushInteractiveDataFromApplet(std::make_shared<IStorage>(std::move(output_sub)));
|
||||
broker.PushInteractiveDataFromApplet(
|
||||
std::make_shared<IStorage>(system, std::move(output_sub)));
|
||||
}
|
||||
} else {
|
||||
output_main[0] = 1;
|
||||
complete = true;
|
||||
broker.PushNormalDataFromApplet(std::make_shared<IStorage>(std::move(output_main)));
|
||||
broker.PushNormalDataFromApplet(std::make_shared<IStorage>(system, std::move(output_main)));
|
||||
broker.SignalStateChanged();
|
||||
}
|
||||
}
|
||||
|
|
|
|||
|
|
@ -80,6 +80,7 @@ private:
|
|||
bool complete = false;
|
||||
bool is_inline = false;
|
||||
std::vector<u8> final_data;
|
||||
Core::System& system;
|
||||
};
|
||||
|
||||
} // namespace Service::AM::Applets
|
||||
|
|
|
|||
|
|
@ -290,7 +290,7 @@ void WebBrowser::Finalize() {
|
|||
std::vector<u8> data(sizeof(WebCommonReturnValue));
|
||||
std::memcpy(data.data(), &out, sizeof(WebCommonReturnValue));
|
||||
|
||||
broker.PushNormalDataFromApplet(std::make_shared<IStorage>(std::move(data)));
|
||||
broker.PushNormalDataFromApplet(std::make_shared<IStorage>(system, std::move(data)));
|
||||
broker.SignalStateChanged();
|
||||
|
||||
if (!temporary_dir.empty() && Common::FS::IsDirectory(temporary_dir)) {
|
||||
|
|
|
|||
|
|
@ -6,7 +6,7 @@
|
|||
|
||||
namespace Service::AM {
|
||||
|
||||
IdleSys::IdleSys() : ServiceFramework{"idle:sys"} {
|
||||
IdleSys::IdleSys(Core::System& system_) : ServiceFramework{system_, "idle:sys"} {
|
||||
// clang-format off
|
||||
static const FunctionInfo functions[] = {
|
||||
{0, nullptr, "GetAutoPowerDownEvent"},
|
||||
|
|
|
|||
|
|
@ -6,11 +6,15 @@
|
|||
|
||||
#include "core/hle/service/service.h"
|
||||
|
||||
namespace Core {
|
||||
class System;
|
||||
}
|
||||
|
||||
namespace Service::AM {
|
||||
|
||||
class IdleSys final : public ServiceFramework<IdleSys> {
|
||||
public:
|
||||
explicit IdleSys();
|
||||
explicit IdleSys(Core::System& system_);
|
||||
~IdleSys() override;
|
||||
};
|
||||
|
||||
|
|
|
|||
Some files were not shown because too many files have changed in this diff Show more
Loading…
Reference in a new issue