diff options
| author | Zach Hilman <zachhilman@gmail.com> | 2019-06-06 19:46:36 -0400 |
|---|---|---|
| committer | Zach Hilman <zachhilman@gmail.com> | 2019-06-24 20:07:10 -0400 |
| commit | 3c4238657d326a7d85cbc9152ca16483383c20e7 (patch) | |
| tree | 2b71e5603db308fbe6ec27b55fa64153602c2675 /src/core/hle/service/am/am.cpp | |
| parent | 01ff38cca80c5cf7e64494b129dde8d7c8ebbee5 (diff) | |
applets: Pass current process title ID to applets
Avoids using system accessor to get current process in applet code.
Diffstat (limited to 'src/core/hle/service/am/am.cpp')
| -rw-r--r-- | src/core/hle/service/am/am.cpp | 12 |
1 files changed, 7 insertions, 5 deletions
diff --git a/src/core/hle/service/am/am.cpp b/src/core/hle/service/am/am.cpp index 4a7bf4acb..33cebb48b 100644 --- a/src/core/hle/service/am/am.cpp +++ b/src/core/hle/service/am/am.cpp @@ -887,7 +887,9 @@ void IStorageAccessor::Read(Kernel::HLERequestContext& ctx) { rb.Push(RESULT_SUCCESS); } -ILibraryAppletCreator::ILibraryAppletCreator() : ServiceFramework("ILibraryAppletCreator") { +ILibraryAppletCreator::ILibraryAppletCreator(u64 current_process_title_id) + : ServiceFramework("ILibraryAppletCreator"), + current_process_title_id(current_process_title_id) { static const FunctionInfo functions[] = { {0, &ILibraryAppletCreator::CreateLibraryApplet, "CreateLibraryApplet"}, {1, nullptr, "TerminateAllLibraryApplets"}, @@ -910,7 +912,7 @@ void ILibraryAppletCreator::CreateLibraryApplet(Kernel::HLERequestContext& ctx) static_cast<u32>(applet_id), applet_mode); const auto& applet_manager{Core::System::GetInstance().GetAppletManager()}; - const auto applet = applet_manager.GetApplet(applet_id); + const auto applet = applet_manager.GetApplet(applet_id, current_process_title_id); if (applet == nullptr) { LOG_ERROR(Service_AM, "Applet doesn't exist! applet_id={}", static_cast<u32>(applet_id)); @@ -1234,13 +1236,13 @@ void IApplicationFunctions::GetSaveDataSize(Kernel::HLERequestContext& ctx) { } void InstallInterfaces(SM::ServiceManager& service_manager, - std::shared_ptr<NVFlinger::NVFlinger> nvflinger) { + std::shared_ptr<NVFlinger::NVFlinger> nvflinger, Core::System& system) { auto message_queue = std::make_shared<AppletMessageQueue>(); message_queue->PushMessage(AppletMessageQueue::AppletMessage::FocusStateChanged); // Needed on // game boot - std::make_shared<AppletAE>(nvflinger, message_queue)->InstallAsService(service_manager); - std::make_shared<AppletOE>(nvflinger, message_queue)->InstallAsService(service_manager); + 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); |
