From 905356ccfc657aaf4da94a916c9ed942cb31c0ce Mon Sep 17 00:00:00 2001 From: german77 Date: Sun, 28 Jan 2024 00:32:50 -0600 Subject: [PATCH] launch --- .../hle/service/am/application_creator.cpp | 51 ++++++++++++++++++- src/core/hle/service/am/application_creator.h | 11 ++++ src/core/hle/service/nifm/nifm.cpp | 2 +- src/core/hle/service/ns/ns.cpp | 32 +++++++++++- src/core/hle/service/ns/ns.h | 1 + src/core/hle/service/olsc/olsc.cpp | 38 +++++++++++++- .../touch_screen/gesture_handler.cpp | 2 +- 7 files changed, 132 insertions(+), 5 deletions(-) diff --git a/src/core/hle/service/am/application_creator.cpp b/src/core/hle/service/am/application_creator.cpp index 79ea045a3..26382caa4 100644 --- a/src/core/hle/service/am/application_creator.cpp +++ b/src/core/hle/service/am/application_creator.cpp @@ -6,11 +6,49 @@ namespace Service::AM { +IApplicationAccessor::IApplicationAccessor(Core::System& system_, u64 application_id) + : ServiceFramework{system_, "IApplicationAccessor"} { + // clang-format off + static const FunctionInfo functions[] = { + {0, nullptr, "GetAppletStateChangedEvent"}, + {1, nullptr, "IsCompleted"}, + {10, nullptr, "Start"}, + {20, nullptr, "RequestExit"}, + {25, nullptr, "Terminate"}, + {30, nullptr, "GetResult"}, + {101, nullptr, "RequestForApplicationToGetForeground"}, + {110, nullptr, "TerminateAllLibraryApplets"}, + {111, nullptr, "AreAnyLibraryAppletsLeft"}, + {112, nullptr, "GetCurrentLibraryApplet"}, + {120, nullptr, "GetApplicationId"}, + {121, nullptr, "PushLaunchParameter"}, + {122, nullptr, "GetApplicationControlProperty"}, + {123, nullptr, "GetApplicationLaunchProperty"}, + {124, nullptr, "GetApplicationLaunchRequestInfo"}, + {130, nullptr, "SetUsers"}, + {131, nullptr, "CheckRightsEnvironmentAvailable"}, + {132, nullptr, "GetNsRightsEnvironmentHandle"}, + {140, nullptr, "GetDesirableUids"}, + {150, nullptr, "ReportApplicationExitTimeout"}, + {160, nullptr, "SetApplicationAttribute"}, + {170, nullptr, "HasSaveDataAccessPermission"}, + {180, nullptr, "PushToFriendInvitationStorageChannel"}, + {190, nullptr, "PushToNotificationStorageChannel"}, + {200, nullptr, "RequestApplicationSoftReset"}, + {201, nullptr, "RestartApplicationTimer"}, + }; + // clang-format on + + RegisterHandlers(functions); +} + +IApplicationAccessor::~IApplicationAccessor() = default; + IApplicationCreator::IApplicationCreator(Core::System& system_) : ServiceFramework{system_, "IApplicationCreator"} { // clang-format off static const FunctionInfo functions[] = { - {0, nullptr, "CreateApplication"}, + {0, &IApplicationCreator::CreateApplication, "CreateApplication"}, {1, nullptr, "PopLaunchRequestedApplication"}, {10, nullptr, "CreateSystemApplication"}, {100, nullptr, "PopFloatingApplicationForDevelopment"}, @@ -22,4 +60,15 @@ IApplicationCreator::IApplicationCreator(Core::System& system_) IApplicationCreator::~IApplicationCreator() = default; +void IApplicationCreator::CreateApplication(HLERequestContext& ctx) { + IPC::RequestParser rp{ctx}; + const auto application_id = rp.Pop(); + + LOG_ERROR(Service_NS, "called, application_id={:x}",application_id); + + IPC::ResponseBuilder rb{ctx, 2, 0, 1}; + rb.Push(ResultSuccess); + rb.PushIpcInterface(system, application_id); +} + } // namespace Service::AM diff --git a/src/core/hle/service/am/application_creator.h b/src/core/hle/service/am/application_creator.h index 375a3c476..9916bf5ca 100644 --- a/src/core/hle/service/am/application_creator.h +++ b/src/core/hle/service/am/application_creator.h @@ -7,10 +7,21 @@ namespace Service::AM { +class IApplicationAccessor final : public ServiceFramework { +public: + explicit IApplicationAccessor(Core::System& system_, u64 application_id); + ~IApplicationAccessor() override; + + private: +}; + class IApplicationCreator final : public ServiceFramework { public: explicit IApplicationCreator(Core::System& system_); ~IApplicationCreator() override; + + private: + void CreateApplication(HLERequestContext& ctx); }; } // namespace Service::AM diff --git a/src/core/hle/service/nifm/nifm.cpp b/src/core/hle/service/nifm/nifm.cpp index 3940638f8..0428bf77b 100644 --- a/src/core/hle/service/nifm/nifm.cpp +++ b/src/core/hle/service/nifm/nifm.cpp @@ -598,7 +598,7 @@ void IGeneralService::ConfirmSystemAvailability(HLERequestContext& ctx) { IPC::ResponseBuilder rb{ctx, 3}; rb.Push(ResultSuccess); - rb.Push(true); + rb.Push(false); } void IGeneralService::GetCurrentAccessPoint(HLERequestContext& ctx) { diff --git a/src/core/hle/service/ns/ns.cpp b/src/core/hle/service/ns/ns.cpp index 9413d334d..4730cc9bc 100644 --- a/src/core/hle/service/ns/ns.cpp +++ b/src/core/hle/service/ns/ns.cpp @@ -260,7 +260,7 @@ IApplicationManagerInterface::IApplicationManagerInterface(Core::System& system_ {2016, nullptr, "ListNotCommittedContentMeta"}, {2017, nullptr, "CreateDownloadTask"}, {2018, nullptr, "GetApplicationDeliveryInfoHash"}, - {2050, nullptr, "GetApplicationRightsOnClient"}, + {2050, &IApplicationManagerInterface::GetApplicationRightsOnClient, "GetApplicationRightsOnClient"}, {2051, nullptr, "InvalidateRightsIdCache"}, {2100, nullptr, "GetApplicationTerminateResult"}, {2101, nullptr, "GetRawApplicationTerminateResult"}, @@ -524,6 +524,36 @@ void IApplicationManagerInterface::GetApplicationViewWithPromotionInfo(HLEReques rb.Push(ResultSuccess); } +void IApplicationManagerInterface::GetApplicationRightsOnClient(HLERequestContext& ctx) { + struct ApplicationRightsOnClient { + u64 application_id; + Common::UUID uid; + u8 flags; + u8 flags2; + INSERT_PADDING_BYTES(0x6); + }; + + IPC::RequestParser rp{ctx}; + const auto flags = rp.Pop(); + const auto application_id = rp.Pop(); + const auto uid = rp.PopRaw(); + + LOG_ERROR(Service_NS, "(STUBBED) called, flags={}, application_id={:x}, uid={}",flags,application_id,uid.FormattedString()); + + ApplicationRightsOnClient rights{ + .application_id = application_id, + .uid = uid, + .flags = 0, + .flags2 = 0, + }; + + ctx.WriteBuffer(rights); + + IPC::ResponseBuilder rb{ctx, 3}; + rb.Push(ResultSuccess); + rb.Push(1); +} + void IApplicationManagerInterface::CheckSdCardMountStatus(HLERequestContext& ctx) { LOG_ERROR(Service_NS, "(STUBBED) called"); diff --git a/src/core/hle/service/ns/ns.h b/src/core/hle/service/ns/ns.h index 8be31968f..ad496f9c7 100644 --- a/src/core/hle/service/ns/ns.h +++ b/src/core/hle/service/ns/ns.h @@ -93,6 +93,7 @@ private: void IsAnyApplicationEntityInstalled(HLERequestContext& ctx); void GetApplicationView(HLERequestContext& ctx); void GetApplicationViewWithPromotionInfo(HLERequestContext& ctx); + void GetApplicationRightsOnClient(HLERequestContext& ctx); void CheckSdCardMountStatus(HLERequestContext& ctx); void GetSdCardMountStatusChangedEvent(HLERequestContext& ctx); void GetFreeSpaceSize(HLERequestContext& ctx); diff --git a/src/core/hle/service/olsc/olsc.cpp b/src/core/hle/service/olsc/olsc.cpp index 9226c0c26..d6da61c35 100644 --- a/src/core/hle/service/olsc/olsc.cpp +++ b/src/core/hle/service/olsc/olsc.cpp @@ -143,6 +143,34 @@ private: } }; +class IDaemonController final : public ServiceFramework { +public: + explicit IDaemonController(Core::System& system_) + : ServiceFramework{system_, "IDaemonController"} { + // clang-format off + static const FunctionInfo functions[] = { + {0, nullptr, "Unknown0"}, + {1, nullptr, "Unknown1"}, + {2, nullptr, "Unknown2"}, + {3, nullptr, "Unknown3"}, + {4, nullptr, "Unknown4"}, + {5, nullptr, "Unknown5"}, + {6, nullptr, "Unknown6"}, + {7, nullptr, "Unknown7"}, + {8, nullptr, "Unknown8"}, + {9, nullptr, "Unknown9"}, + {10, nullptr, "Unknown10"}, + {11, nullptr, "Unknown11"}, + {12, nullptr, "Unknown12"}, + }; + // clang-format on + + RegisterHandlers(functions); + } + +private: +}; + class IOlscServiceForSystemService final : public ServiceFramework { public: explicit IOlscServiceForSystemService(Core::System& system_) @@ -151,7 +179,7 @@ public: static const FunctionInfo functions[] = { {0, &IOlscServiceForSystemService::OpenTransferTaskListController, "OpenTransferTaskListController"}, {1, nullptr, "OpenRemoteStorageController"}, - {2, nullptr, "OpenDaemonController"}, + {2, &IOlscServiceForSystemService::OpenDaemonController, "OpenDaemonController"}, {10, nullptr, "Unknown10"}, {11, nullptr, "Unknown11"}, {12, nullptr, "Unknown12"}, @@ -222,6 +250,14 @@ private: rb.PushIpcInterface(system); } + void OpenDaemonController(HLERequestContext& ctx) { + LOG_INFO(Service_OLSC, "called"); + + IPC::ResponseBuilder rb{ctx, 2, 0, 1}; + rb.Push(ResultSuccess); + rb.PushIpcInterface(system); + } + void Unknown10000(HLERequestContext& ctx) { LOG_INFO(Service_OLSC, "called"); diff --git a/src/hid_core/resources/touch_screen/gesture_handler.cpp b/src/hid_core/resources/touch_screen/gesture_handler.cpp index 4fcaf6ecf..93c26c769 100644 --- a/src/hid_core/resources/touch_screen/gesture_handler.cpp +++ b/src/hid_core/resources/touch_screen/gesture_handler.cpp @@ -57,7 +57,7 @@ bool GestureHandler::NeedsUpdate() { for (size_t id = 0; id < MaxPoints; id++) { if (gesture.points[id] != last_gesture.points[id]) { return true; - } +} } // Update on press and hold event after 0.5 seconds