diff --git a/src/core/CMakeLists.txt b/src/core/CMakeLists.txt index ea330fad3..3cd896226 100644 --- a/src/core/CMakeLists.txt +++ b/src/core/CMakeLists.txt @@ -694,6 +694,8 @@ add_library(core STATIC hle/service/kernel_helpers.h hle/service/lbl/lbl.cpp hle/service/lbl/lbl.h + hle/service/ldn/client_process_monitor.cpp + hle/service/ldn/client_process_monitor.h hle/service/ldn/lan_discovery.cpp hle/service/ldn/lan_discovery.h hle/service/ldn/ldn.cpp diff --git a/src/core/hle/service/acc/acc.cpp b/src/core/hle/service/acc/acc.cpp index 671b33b4b..181d27a9c 100644 --- a/src/core/hle/service/acc/acc.cpp +++ b/src/core/hle/service/acc/acc.cpp @@ -81,7 +81,8 @@ public: {0, D<&IManagerForSystemService::CheckAvailability>, "CheckAvailability"}, {1, D<&IManagerForSystemService::GetAccountId>, "GetAccountId"}, {2, nullptr, "EnsureIdTokenCacheAsync"}, - {3, nullptr, "LoadIdTokenCache"}, + {3, D<&IManagerForSystemService::LoadIdTokenCacheDeprecated>, "LoadIdTokenCacheDeprecated"}, // 19.0.0+ + {4, D<&IManagerForSystemService::LoadIdTokenCache>, "LoadIdTokenCache"}, // 19.0.0+ {100, nullptr, "SetSystemProgramIdentification"}, {101, nullptr, "RefreshNotificationTokenAsync"}, // 7.0.0+ {110, nullptr, "GetServiceEntryRequirementCache"}, // 4.0.0+ @@ -99,6 +100,7 @@ public: {140, nullptr, "GetNetworkServiceLicenseCache"}, // 5.0.0+ {141, nullptr, "RefreshNetworkServiceLicenseCacheAsync"}, // 5.0.0+ {142, nullptr, "RefreshNetworkServiceLicenseCacheAsyncIfSecondsElapsed"}, // 5.0.0+ + {143, D<&IManagerForSystemService::GetNetworkServiceLicenseCacheEx>, "GetNetworkServiceLicenseCacheEx"}, // 15.0.0+ {150, nullptr, "CreateAuthorizationRequest"}, {160, nullptr, "RequiresUpdateNetworkServiceAccountIdTokenCache"}, {161, nullptr, "RequireReauthenticationOfNetworkServiceAccount"}, @@ -122,6 +124,24 @@ private: R_SUCCEED(); } + Result LoadIdTokenCacheDeprecated() { + LOG_WARNING(Service_ACC, "(STUBBED) called"); + R_SUCCEED(); + } + + Result LoadIdTokenCache() { + LOG_WARNING(Service_ACC, "(STUBBED) called"); + R_SUCCEED(); + } + + Result GetNetworkServiceLicenseCacheEx() { + LOG_DEBUG(Service_ACC, "(STUBBED) called."); + + // TODO (jarrodnorwell) + + R_RETURN(ResultUnknown); + } + Common::UUID account_id; }; @@ -292,6 +312,10 @@ public: {101, nullptr, "IsNetworkServiceAccountReplaced"}, {199, nullptr, "GetUrlForIntroductionOfExtraMembership"}, // 2.0.0 - 5.1.0 {200, nullptr, "ApplyAsyncWithAuthorizedToken"}, + {210, nullptr, "IsProfileAvailable"}, // 17.0.0+ + {220, nullptr, "RegisterUserAsyncWithoutProfile"}, // 17.0.0+ + {221, nullptr, "RegisterUserWithProfileAsync"}, // 17.0.0+ + {230, nullptr, "RegisterUserWithLargeImageProfileAsync"}, // 18.0.0+ }; // clang-format on @@ -603,8 +627,10 @@ public: {0, &IManagerForApplication::CheckAvailability, "CheckAvailability"}, {1, &IManagerForApplication::GetAccountId, "GetAccountId"}, {2, &IManagerForApplication::EnsureIdTokenCacheAsync, "EnsureIdTokenCacheAsync"}, - {3, &IManagerForApplication::LoadIdTokenCache, "LoadIdTokenCache"}, + {3, &IManagerForApplication::LoadIdTokenCacheDeprecated, "LoadIdTokenCacheDeprecated"}, + {4, &IManagerForApplication::LoadIdTokenCache, "LoadIdTokenCache"}, {130, &IManagerForApplication::GetNintendoAccountUserResourceCacheForApplication, "GetNintendoAccountUserResourceCacheForApplication"}, + {136, &IManagerForApplication::GetNintendoAccountUserResourceCacheForApplication, "GetNintendoAccountUserResourceCache"}, // 19.0.0+ {150, nullptr, "CreateAuthorizationRequest"}, {160, &IManagerForApplication::StoreOpenContext, "StoreOpenContext"}, {170, nullptr, "LoadNetworkServiceLicenseKindAsync"}, @@ -638,12 +664,25 @@ private: rb.PushIpcInterface(ensure_token_id); } - void LoadIdTokenCache(HLERequestContext& ctx) { + void LoadIdTokenCacheDeprecated(HLERequestContext& ctx) { LOG_WARNING(Service_ACC, "(STUBBED) called"); ensure_token_id->LoadIdTokenCache(ctx); } + void LoadIdTokenCache(HLERequestContext& ctx) { + LOG_WARNING(Service_ACC, "(STUBBED) called"); + + std::vector token_data(0x100); + std::fill(token_data.begin(), token_data.end(), u8(0)); + + ctx.WriteBuffer(token_data, 0); + + IPC::ResponseBuilder rb{ctx, 3}; + rb.Push(ResultSuccess); + rb.Push(static_cast(token_data.size())); + } + void GetNintendoAccountUserResourceCacheForApplication(HLERequestContext& ctx) { LOG_WARNING(Service_ACC, "(STUBBED) called"); diff --git a/src/core/hle/service/cmif_serialization.h b/src/core/hle/service/cmif_serialization.h index 5a5f610f3..0ca9dc28e 100644 --- a/src/core/hle/service/cmif_serialization.h +++ b/src/core/hle/service/cmif_serialization.h @@ -8,6 +8,7 @@ #include "core/hle/service/cmif_types.h" #include "core/hle/service/ipc_helpers.h" #include "core/hle/service/service.h" +#include namespace Service { @@ -436,7 +437,16 @@ template void CmifReplyWrapImpl(HLERequestContext& ctx, T& t, Result (T::*f)(A...)) { // Verify domain state. if constexpr (!Domain) { - ASSERT_MSG(!ctx.GetManager()->IsDomain(), "Non-domain reply used on domain session"); + const auto _mgr = ctx.GetManager(); + const bool _is_domain = _mgr ? _mgr->IsDomain() : false; + ASSERT_MSG(!_is_domain, + "Non-domain reply used on domain session\n" + "Service={} (type={})\nTIPC={} CmdType={} Cmd=0x{:08X}\n" + "HasDomainHeader={} DomainHandlers={}\nDesc={}", + t.GetServiceName(), typeid(T).name(), ctx.IsTipc(), + static_cast(ctx.GetCommandType()), static_cast(ctx.GetCommand()), + ctx.HasDomainMessageHeader(), _mgr ? static_cast(_mgr->DomainHandlerCount()) : 0u, + ctx.Description()); } const bool is_domain = Domain ? ctx.GetManager()->IsDomain() : false; diff --git a/src/core/hle/service/ldn/client_process_monitor.cpp b/src/core/hle/service/ldn/client_process_monitor.cpp new file mode 100644 index 000000000..0c1963a4c --- /dev/null +++ b/src/core/hle/service/ldn/client_process_monitor.cpp @@ -0,0 +1,27 @@ +// SPDX-FileCopyrightText: Copyright 2025 Eden Emulator Project +// SPDX-License-Identifier: GPL-3.0-or-later + +#include "core/hle/service/cmif_serialization.h" +#include "core/hle/service/ldn/ldn_results.h" +#include "core/hle/service/ldn/client_process_monitor.h" +#include "core/hle/service/ipc_helpers.h" + +namespace Service::LDN { + +IClientProcessMonitor::IClientProcessMonitor(Core::System& system_) + : ServiceFramework{system_, "IClientProcessMonitor"} { + static const FunctionInfo functions[] = { + {0, D<&IClientProcessMonitor::RegisterClient>, "RegisterClient"}, + }; + RegisterHandlers(functions); +} + +IClientProcessMonitor::~IClientProcessMonitor() = default; + +Result IClientProcessMonitor::RegisterClient() { + LOG_WARNING(Service_LDN, "(STUBBED) called"); + + R_SUCCEED(); +} + +} // namespace Service::LDN diff --git a/src/core/hle/service/ldn/client_process_monitor.h b/src/core/hle/service/ldn/client_process_monitor.h new file mode 100644 index 000000000..9caa33779 --- /dev/null +++ b/src/core/hle/service/ldn/client_process_monitor.h @@ -0,0 +1,25 @@ +// SPDX-FileCopyrightText: Copyright 2025 Eden Emulator Project +// SPDX-License-Identifier: GPL-3.0-or-later + +#pragma once + +#include "core/hle/service/cmif_types.h" +#include "core/hle/service/service.h" + +namespace Core { +class System; +} + +namespace Service::LDN { + +class IClientProcessMonitor final + : public ServiceFramework { +public: + explicit IClientProcessMonitor(Core::System& system_); + ~IClientProcessMonitor() override; + +private: + Result RegisterClient(); +}; + +} // namespace Service::LDN diff --git a/src/core/hle/service/ldn/ldn.cpp b/src/core/hle/service/ldn/ldn.cpp index 46e10e21c..eaaef2b59 100644 --- a/src/core/hle/service/ldn/ldn.cpp +++ b/src/core/hle/service/ldn/ldn.cpp @@ -4,6 +4,7 @@ #include "core/core.h" #include "core/hle/service/cmif_serialization.h" #include "core/hle/service/ldn/ldn.h" +#include "core/hle/service/ldn/client_process_monitor.h" #include "core/hle/service/ldn/monitor_service.h" #include "core/hle/service/ldn/sf_monitor_service.h" #include "core/hle/service/ldn/sf_service.h" @@ -40,7 +41,7 @@ public: // clang-format off static const FunctionInfo functions[] = { {0, C<&ISystemServiceCreator::CreateSystemLocalCommunicationService>, "CreateSystemLocalCommunicationService"}, - {1, nullptr, "CreateClientProcessMonitor"} // 18.0.0+ + {1, C<&ISystemServiceCreator::CreateClientProcessMonitor>, "CreateClientProcessMonitor"} // 18.0.0+ }; // clang-format on @@ -55,6 +56,14 @@ private: *out_interface = std::make_shared(system); R_SUCCEED(); } + + Result CreateClientProcessMonitor( + OutInterface out_interface) { + LOG_DEBUG(Service_LDN, "called"); + + *out_interface = std::make_shared(system); + R_SUCCEED(); + } }; class IUserServiceCreator final : public ServiceFramework { @@ -62,8 +71,8 @@ public: explicit IUserServiceCreator(Core::System& system_) : ServiceFramework{system_, "ldn:u"} { // clang-format off static const FunctionInfo functions[] = { - {0, C<&IUserServiceCreator::CreateUserLocalCommunicationService>, "CreateUserLocalCommunicationService"}, - {1, nullptr, "CreateClientProcessMonitor"} // 18.0.0+ + {0, D<&IUserServiceCreator::CreateUserLocalCommunicationService>, "CreateUserLocalCommunicationService"}, + {1, D<&IUserServiceCreator::CreateClientProcessMonitor>, "CreateClientProcessMonitor"} // 18.0.0+ }; // clang-format on @@ -78,6 +87,14 @@ private: *out_interface = std::make_shared(system); R_SUCCEED(); } + + Result CreateClientProcessMonitor( + OutInterface out_interface) { + LOG_DEBUG(Service_LDN, "called"); + + *out_interface = std::make_shared(system); + R_SUCCEED(); + } }; class ISfServiceCreator final : public ServiceFramework { diff --git a/src/core/hle/service/ldn/user_local_communication_service.cpp b/src/core/hle/service/ldn/user_local_communication_service.cpp index 8e559f440..e982a04b0 100644 --- a/src/core/hle/service/ldn/user_local_communication_service.cpp +++ b/src/core/hle/service/ldn/user_local_communication_service.cpp @@ -25,35 +25,35 @@ IUserLocalCommunicationService::IUserLocalCommunicationService(Core::System& sys room_network{system_.GetRoomNetwork()}, lan_discovery{room_network} { // clang-format off static const FunctionInfo functions[] = { - {0, C<&IUserLocalCommunicationService::GetState>, "GetState"}, - {1, C<&IUserLocalCommunicationService::GetNetworkInfo>, "GetNetworkInfo"}, - {2, C<&IUserLocalCommunicationService::GetIpv4Address>, "GetIpv4Address"}, - {3, C<&IUserLocalCommunicationService::GetDisconnectReason>, "GetDisconnectReason"}, - {4, C<&IUserLocalCommunicationService::GetSecurityParameter>, "GetSecurityParameter"}, - {5, C<&IUserLocalCommunicationService::GetNetworkConfig>, "GetNetworkConfig"}, - {100, C<&IUserLocalCommunicationService::AttachStateChangeEvent>, "AttachStateChangeEvent"}, - {101, C<&IUserLocalCommunicationService::GetNetworkInfoLatestUpdate>, "GetNetworkInfoLatestUpdate"}, - {102, C<&IUserLocalCommunicationService::Scan>, "Scan"}, - {103, C<&IUserLocalCommunicationService::ScanPrivate>, "ScanPrivate"}, - {104, C<&IUserLocalCommunicationService::SetWirelessControllerRestriction>, "SetWirelessControllerRestriction"}, - {200, C<&IUserLocalCommunicationService::OpenAccessPoint>, "OpenAccessPoint"}, - {201, C<&IUserLocalCommunicationService::CloseAccessPoint>, "CloseAccessPoint"}, - {202, C<&IUserLocalCommunicationService::CreateNetwork>, "CreateNetwork"}, - {203, C<&IUserLocalCommunicationService::CreateNetworkPrivate>, "CreateNetworkPrivate"}, - {204, C<&IUserLocalCommunicationService::DestroyNetwork>, "DestroyNetwork"}, + {0, D<&IUserLocalCommunicationService::GetState>, "GetState"}, + {1, D<&IUserLocalCommunicationService::GetNetworkInfo>, "GetNetworkInfo"}, + {2, D<&IUserLocalCommunicationService::GetIpv4Address>, "GetIpv4Address"}, + {3, D<&IUserLocalCommunicationService::GetDisconnectReason>, "GetDisconnectReason"}, + {4, D<&IUserLocalCommunicationService::GetSecurityParameter>, "GetSecurityParameter"}, + {5, D<&IUserLocalCommunicationService::GetNetworkConfig>, "GetNetworkConfig"}, + {100, D<&IUserLocalCommunicationService::AttachStateChangeEvent>, "AttachStateChangeEvent"}, + {101, D<&IUserLocalCommunicationService::GetNetworkInfoLatestUpdate>, "GetNetworkInfoLatestUpdate"}, + {102, D<&IUserLocalCommunicationService::Scan>, "Scan"}, + {103, D<&IUserLocalCommunicationService::ScanPrivate>, "ScanPrivate"}, + {104, D<&IUserLocalCommunicationService::SetWirelessControllerRestriction>, "SetWirelessControllerRestriction"}, + {200, D<&IUserLocalCommunicationService::OpenAccessPoint>, "OpenAccessPoint"}, + {201, D<&IUserLocalCommunicationService::CloseAccessPoint>, "CloseAccessPoint"}, + {202, D<&IUserLocalCommunicationService::CreateNetwork>, "CreateNetwork"}, + {203, D<&IUserLocalCommunicationService::CreateNetworkPrivate>, "CreateNetworkPrivate"}, + {204, D<&IUserLocalCommunicationService::DestroyNetwork>, "DestroyNetwork"}, {205, nullptr, "Reject"}, - {206, C<&IUserLocalCommunicationService::SetAdvertiseData>, "SetAdvertiseData"}, - {207, C<&IUserLocalCommunicationService::SetStationAcceptPolicy>, "SetStationAcceptPolicy"}, - {208, C<&IUserLocalCommunicationService::AddAcceptFilterEntry>, "AddAcceptFilterEntry"}, + {206, D<&IUserLocalCommunicationService::SetAdvertiseData>, "SetAdvertiseData"}, + {207, D<&IUserLocalCommunicationService::SetStationAcceptPolicy>, "SetStationAcceptPolicy"}, + {208, D<&IUserLocalCommunicationService::AddAcceptFilterEntry>, "AddAcceptFilterEntry"}, {209, nullptr, "ClearAcceptFilter"}, - {300, C<&IUserLocalCommunicationService::OpenStation>, "OpenStation"}, - {301, C<&IUserLocalCommunicationService::CloseStation>, "CloseStation"}, - {302, C<&IUserLocalCommunicationService::Connect>, "Connect"}, + {300, D<&IUserLocalCommunicationService::OpenStation>, "OpenStation"}, + {301, D<&IUserLocalCommunicationService::CloseStation>, "CloseStation"}, + {302, D<&IUserLocalCommunicationService::Connect>, "Connect"}, {303, nullptr, "ConnectPrivate"}, - {304, C<&IUserLocalCommunicationService::Disconnect>, "Disconnect"}, - {400, C<&IUserLocalCommunicationService::Initialize>, "Initialize"}, - {401, C<&IUserLocalCommunicationService::Finalize>, "Finalize"}, - {402, C<&IUserLocalCommunicationService::Initialize2>, "Initialize2"}, // 7.0.0+ + {304, D<&IUserLocalCommunicationService::Disconnect>, "Disconnect"}, + {400, D<&IUserLocalCommunicationService::Initialize>, "Initialize"}, + {401, D<&IUserLocalCommunicationService::Finalize>, "Finalize"}, + {402, D<&IUserLocalCommunicationService::Initialize2>, "Initialize2"}, // 7.0.0+ {500, nullptr, "EnableActionFrame"}, // 18.0.0+ {501, nullptr, "DisableActionFrame"}, // 18.0.0+ {502, nullptr, "SendActionFrame"}, // 18.0.0+