From 2d43831d1f787fe96a30f668fe01bcb73061764c Mon Sep 17 00:00:00 2001 From: Liam Date: Sat, 17 Feb 2024 14:34:13 -0500 Subject: ns: rewrite IServiceGetterInterface --- src/core/hle/service/am/service/application_functions.cpp | 8 +++++--- src/core/hle/service/am/service/library_applet_self_accessor.cpp | 8 +++++--- 2 files changed, 10 insertions(+), 6 deletions(-) (limited to 'src/core/hle/service/am') diff --git a/src/core/hle/service/am/service/application_functions.cpp b/src/core/hle/service/am/service/application_functions.cpp index a40789c01..cb53b07e0 100644 --- a/src/core/hle/service/am/service/application_functions.cpp +++ b/src/core/hle/service/am/service/application_functions.cpp @@ -17,7 +17,7 @@ #include "core/hle/service/filesystem/save_data_controller.h" #include "core/hle/service/glue/glue_manager.h" #include "core/hle/service/ns/application_manager_interface.h" -#include "core/hle/service/ns/ns.h" +#include "core/hle/service/ns/service_getter_interface.h" #include "core/hle/service/sm/sm.h" namespace Service::AM { @@ -164,8 +164,10 @@ Result IApplicationFunctions::GetDesiredLanguage(Out out_language_code) { // Call IApplicationManagerInterface implementation. auto& service_manager = system.ServiceManager(); - auto ns_am2 = service_manager.GetService("ns:am2"); - auto app_man = ns_am2->GetApplicationManagerInterface(); + auto ns_am2 = service_manager.GetService("ns:am2"); + + std::shared_ptr app_man; + R_TRY(ns_am2->GetApplicationManagerInterface(&app_man)); // Get desired application language NS::ApplicationLanguage desired_language{}; diff --git a/src/core/hle/service/am/service/library_applet_self_accessor.cpp b/src/core/hle/service/am/service/library_applet_self_accessor.cpp index 932e354e0..963e67487 100644 --- a/src/core/hle/service/am/service/library_applet_self_accessor.cpp +++ b/src/core/hle/service/am/service/library_applet_self_accessor.cpp @@ -15,7 +15,7 @@ #include "core/hle/service/filesystem/filesystem.h" #include "core/hle/service/glue/glue_manager.h" #include "core/hle/service/ns/application_manager_interface.h" -#include "core/hle/service/ns/ns.h" +#include "core/hle/service/ns/service_getter_interface.h" #include "core/hle/service/sm/sm.h" namespace Service::AM { @@ -257,8 +257,10 @@ Result ILibraryAppletSelfAccessor::GetMainAppletApplicationDesiredLanguage( // Call IApplicationManagerInterface implementation. auto& service_manager = system.ServiceManager(); - auto ns_am2 = service_manager.GetService("ns:am2"); - auto app_man = ns_am2->GetApplicationManagerInterface(); + auto ns_am2 = service_manager.GetService("ns:am2"); + + std::shared_ptr app_man; + R_TRY(ns_am2->GetApplicationManagerInterface(&app_man)); // Get desired application language NS::ApplicationLanguage desired_language{}; -- cgit v1.2.3