From acd35e1b60b7e0420b7f385515bff8a2f4465874 Mon Sep 17 00:00:00 2001 From: David Marcec Date: Tue, 21 Jul 2020 14:06:52 +1000 Subject: nifm: GetAppletInfo stub Fixes crash for Catherine Full Body --- src/core/hle/service/nifm/nifm.cpp | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) (limited to 'src/core/hle/service/nifm/nifm.cpp') diff --git a/src/core/hle/service/nifm/nifm.cpp b/src/core/hle/service/nifm/nifm.cpp index 2e9d95195..7eef35e54 100644 --- a/src/core/hle/service/nifm/nifm.cpp +++ b/src/core/hle/service/nifm/nifm.cpp @@ -62,7 +62,7 @@ public: {18, nullptr, "SetRequirementByRevision"}, {19, nullptr, "GetRequirement"}, {20, nullptr, "GetRevision"}, - {21, nullptr, "GetAppletInfo"}, + {21, &IRequest::GetAppletInfo, "GetAppletInfo"}, {22, nullptr, "GetAdditionalInfo"}, {23, nullptr, "SetKeptInSleep"}, {24, nullptr, "RegisterSocketDescriptor"}, @@ -125,6 +125,13 @@ private: rb.Push(RESULT_SUCCESS); } + void GetAppletInfo(Kernel::HLERequestContext& ctx) { + LOG_WARNING(Service_NIFM, "(STUBBED) called"); + + IPC::ResponseBuilder rb{ctx, 2}; + rb.Push(RESULT_SUCCESS); + } + Kernel::EventPair event1, event2; }; -- cgit v1.2.3 From 298b50e22055a89979f7bc9fde332966e9dd4b00 Mon Sep 17 00:00:00 2001 From: David Marcec Date: Tue, 20 Oct 2020 16:45:01 +1100 Subject: Added remaining params --- src/core/hle/service/nifm/nifm.cpp | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) (limited to 'src/core/hle/service/nifm/nifm.cpp') diff --git a/src/core/hle/service/nifm/nifm.cpp b/src/core/hle/service/nifm/nifm.cpp index 7eef35e54..db7ec6d0e 100644 --- a/src/core/hle/service/nifm/nifm.cpp +++ b/src/core/hle/service/nifm/nifm.cpp @@ -128,8 +128,11 @@ private: void GetAppletInfo(Kernel::HLERequestContext& ctx) { LOG_WARNING(Service_NIFM, "(STUBBED) called"); - IPC::ResponseBuilder rb{ctx, 2}; + IPC::ResponseBuilder rb{ctx, 8}; rb.Push(RESULT_SUCCESS); + rb.Push(0); + rb.Push(0); + rb.Push(0); } Kernel::EventPair event1, event2; -- cgit v1.2.3 From 1a954b2a596fdfd4fc4b5feb9b43c8147de4cc7f Mon Sep 17 00:00:00 2001 From: Lioncash Date: Thu, 26 Nov 2020 15:19:08 -0500 Subject: 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. --- src/core/hle/service/nifm/nifm.cpp | 25 +++++++++++-------------- 1 file changed, 11 insertions(+), 14 deletions(-) (limited to 'src/core/hle/service/nifm/nifm.cpp') diff --git a/src/core/hle/service/nifm/nifm.cpp b/src/core/hle/service/nifm/nifm.cpp index db7ec6d0e..ef5176bea 100644 --- a/src/core/hle/service/nifm/nifm.cpp +++ b/src/core/hle/service/nifm/nifm.cpp @@ -23,7 +23,7 @@ enum class RequestState : u32 { class IScanRequest final : public ServiceFramework { public: - explicit IScanRequest() : ServiceFramework("IScanRequest") { + explicit IScanRequest(Core::System& system_) : ServiceFramework{system_, "IScanRequest"} { // clang-format off static const FunctionInfo functions[] = { {0, nullptr, "Submit"}, @@ -40,7 +40,7 @@ public: class IRequest final : public ServiceFramework { public: - explicit IRequest(Core::System& system) : ServiceFramework("IRequest") { + explicit IRequest(Core::System& system_) : ServiceFramework{system_, "IRequest"} { static const FunctionInfo functions[] = { {0, &IRequest::GetRequestState, "GetRequestState"}, {1, &IRequest::GetResult, "GetResult"}, @@ -140,7 +140,7 @@ private: class INetworkProfile final : public ServiceFramework { public: - explicit INetworkProfile() : ServiceFramework("INetworkProfile") { + explicit INetworkProfile(Core::System& system_) : ServiceFramework{system_, "INetworkProfile"} { static const FunctionInfo functions[] = { {0, nullptr, "Update"}, {1, nullptr, "PersistOld"}, @@ -152,7 +152,7 @@ public: class IGeneralService final : public ServiceFramework { public: - IGeneralService(Core::System& system); + explicit IGeneralService(Core::System& system_); private: void GetClientId(Kernel::HLERequestContext& ctx) { @@ -169,7 +169,7 @@ private: IPC::ResponseBuilder rb{ctx, 2, 0, 1}; rb.Push(RESULT_SUCCESS); - rb.PushIpcInterface(); + rb.PushIpcInterface(system); } void CreateRequest(Kernel::HLERequestContext& ctx) { LOG_DEBUG(Service_NIFM, "called"); @@ -207,7 +207,7 @@ private: IPC::ResponseBuilder rb{ctx, 6, 0, 1}; rb.Push(RESULT_SUCCESS); - rb.PushIpcInterface(); + rb.PushIpcInterface(system); rb.PushRaw(uuid); } void IsWirelessCommunicationEnabled(Kernel::HLERequestContext& ctx) { @@ -239,11 +239,10 @@ private: rb.Push(1); } } - Core::System& system; }; -IGeneralService::IGeneralService(Core::System& system) - : ServiceFramework("IGeneralService"), system(system) { +IGeneralService::IGeneralService(Core::System& system_) + : ServiceFramework{system_, "IGeneralService"} { // clang-format off static const FunctionInfo functions[] = { {1, &IGeneralService::GetClientId, "GetClientId"}, @@ -296,8 +295,8 @@ IGeneralService::IGeneralService(Core::System& system) class NetworkInterface final : public ServiceFramework { public: - explicit NetworkInterface(const char* name, Core::System& system) - : ServiceFramework{name}, system(system) { + explicit NetworkInterface(const char* name, Core::System& system_) + : ServiceFramework{system_, name} { static const FunctionInfo functions[] = { {4, &NetworkInterface::CreateGeneralServiceOld, "CreateGeneralServiceOld"}, {5, &NetworkInterface::CreateGeneralService, "CreateGeneralService"}, @@ -305,6 +304,7 @@ public: RegisterHandlers(functions); } +private: void CreateGeneralServiceOld(Kernel::HLERequestContext& ctx) { LOG_DEBUG(Service_NIFM, "called"); @@ -320,9 +320,6 @@ public: rb.Push(RESULT_SUCCESS); rb.PushIpcInterface(system); } - -private: - Core::System& system; }; void InstallInterfaces(SM::ServiceManager& service_manager, Core::System& system) { -- cgit v1.2.3