feat(ldn): Implement missing Account and LDN services from SwitchBrew documentation

Implements 150+ missing functions across Account (acc:*) and LDN (ldn:*, lp2p:*)
services based on official SwitchBrew documentation.

Account Services (acc:su, acc:e, acc:u0, acc:u1, acc:e:u1, acc:e:u2, dauth:0):
- Add 70+ missing functions including notifiers, async operations, and OAuth procedures
- Implement GetUserRegistrationNotifier, GetUserStateChangeNotifier, GetProfileUpdateNotifier
- Add thumbnail management (LoadSaveDataThumbnail, GetSaveDataThumbnailExistence)
- Implement user management (DeleteUser, SetUserPosition, CancelUserRegistration)
- Add Nintendo Account procedures (CreateFloatingRegistrationRequest, etc.)
- Implement device migration functions (19.0.0+, 20.0.0+)
- Add debug functions for user qualification and token cache management

IManagerForApplication/SystemService (19.0.0+ compatibility):
- Rename LoadIdTokenCache (cmd 3) to LoadIdTokenCacheDeprecated
- Add new LoadIdTokenCache (cmd 4) with updated signature
- Add GetNintendoAccountUserResourceCache (cmd 136)

LDN Services (ldn:m, ldn:s, ldn:u):
- Add 80+ missing functions across all LDN interfaces
- Implement CreateClientProcessMonitor (cmd 1) for ldn:s and ldn:u (18.0.0+)
- Create IClientProcessMonitor service with RegisterClient function
- Implement IMonitorService functions (GetNetworkInfoForMonitor, GetIpv4AddressForMonitor, etc.)
- Implement ISystemLocalCommunicationService (GetState, Scan, Connect, Initialize, etc.)

LP2P Services (lp2p:app, lp2p:sys, lp2p:m):
- Implement ISfService functions (Initialize, Scan, CreateGroup, etc.)
- Implement ISfServiceMonitor (GetGroupInfo, GetMembers, AttachJoinEvent, etc.)
- Implement ISfMonitorService (GetLinkLevel)

Technical Changes:
- Change non-domain (C<>) to domain (D<>) functions in LDN to fix crashes
- Add enhanced error messaging to cmif_serialization.h for debugging
- Create client_process_monitor.cpp/.h for IClientProcessMonitor
- Add concrete async context implementations (EnsureSignedDeviceIdentifierCacheAsyncInterface, etc.)
- Add Kernel::KReadableEvent forward declarations

All functions properly stubbed with appropriate logging for future implementation.

References:
- https://switchbrew.org/wiki/Account_services
- https://switchbrew.org/wiki/LDN_services

Fixes 'Pokemon: Legends Z-A' LDN initialization crashes and improves compatibility
with games using Account and Local Network services.

Signed-off-by: Zephyron <zephyron@citron-emu.org>
This commit is contained in:
Zephyron
2025-10-30 19:28:35 +10:00
parent 57783503d1
commit 68a8b07f78
23 changed files with 1284 additions and 231 deletions

View File

@@ -5079,7 +5079,7 @@ static void stbi__de_iphone(stbi__png *z)
static int stbi__parse_png_file(stbi__png *z, int scan, int req_comp) static int stbi__parse_png_file(stbi__png *z, int scan, int req_comp)
{ {
stbi_uc palette[1024], pal_img_n=0; stbi_uc palette[1024], pal_img_n=0;
stbi_uc has_trans=0, tc[3]={0}; stbi_uc has_trans=0, tc[4]={0};
stbi__uint16 tc16[3]; stbi__uint16 tc16[3];
stbi__uint32 ioff=0, idata_limit=0, i, pal_len=0; stbi__uint32 ioff=0, idata_limit=0, i, pal_len=0;
int first=1,k,interlace=0, color=0, is_iphone=0; int first=1,k,interlace=0, color=0, is_iphone=0;
@@ -5163,7 +5163,7 @@ static int stbi__parse_png_file(stbi__png *z, int scan, int req_comp)
if (z->depth == 16) { if (z->depth == 16) {
for (k = 0; k < s->img_n; ++k) tc16[k] = (stbi__uint16)stbi__get16be(s); // copy the values as-is for (k = 0; k < s->img_n; ++k) tc16[k] = (stbi__uint16)stbi__get16be(s); // copy the values as-is
} else { } else {
for (k = 0; k < s->img_n; ++k) tc[k] = (stbi_uc)(stbi__get16be(s) & 255) * stbi__depth_scale_table[z->depth]; // non 8-bit images will be larger for (k = 0; k < s->img_n && k < 4; ++k) tc[k] = (stbi_uc)(stbi__get16be(s) & 255) * stbi__depth_scale_table[z->depth]; // non 8-bit images will be larger
} }
} }
break; break;

View File

@@ -748,6 +748,8 @@ add_library(core STATIC
hle/service/kernel_helpers.h hle/service/kernel_helpers.h
hle/service/lbl/lbl.cpp hle/service/lbl/lbl.cpp
hle/service/lbl/lbl.h 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.cpp
hle/service/ldn/lan_discovery.h hle/service/ldn/lan_discovery.h
hle/service/ldn/ldn.cpp hle/service/ldn/ldn.cpp

View File

@@ -86,7 +86,8 @@ public:
{0, D<&IManagerForSystemService::CheckAvailability>, "CheckAvailability"}, {0, D<&IManagerForSystemService::CheckAvailability>, "CheckAvailability"},
{1, D<&IManagerForSystemService::GetAccountId>, "GetAccountId"}, {1, D<&IManagerForSystemService::GetAccountId>, "GetAccountId"},
{2, nullptr, "EnsureIdTokenCacheAsync"}, {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"}, {100, nullptr, "SetSystemProgramIdentification"},
{101, nullptr, "RefreshNotificationTokenAsync"}, // 7.0.0+ {101, nullptr, "RefreshNotificationTokenAsync"}, // 7.0.0+
{110, nullptr, "GetServiceEntryRequirementCache"}, // 4.0.0+ {110, nullptr, "GetServiceEntryRequirementCache"}, // 4.0.0+
@@ -125,6 +126,16 @@ private:
R_SUCCEED(); R_SUCCEED();
} }
Result LoadIdTokenCacheDeprecated() {
LOG_WARNING(Service_ACC, "(STUBBED) called");
R_SUCCEED();
}
Result LoadIdTokenCache() {
LOG_WARNING(Service_ACC, "(STUBBED) called");
R_SUCCEED();
}
Common::UUID account_id; Common::UUID account_id;
}; };
@@ -608,6 +619,63 @@ protected:
} }
}; };
class EnsureSignedDeviceIdentifierCacheAsyncInterface final : public IAsyncContext {
public:
explicit EnsureSignedDeviceIdentifierCacheAsyncInterface(Core::System& system_) : IAsyncContext{system_} {
MarkComplete();
}
~EnsureSignedDeviceIdentifierCacheAsyncInterface() = default;
protected:
bool IsComplete() const override {
return true;
}
void Cancel() override {}
Result GetResult() const override {
return ResultSuccess;
}
};
class AuthenticateServiceAsyncInterface final : public IAsyncContext {
public:
explicit AuthenticateServiceAsyncInterface(Core::System& system_) : IAsyncContext{system_} {
MarkComplete();
}
~AuthenticateServiceAsyncInterface() = default;
protected:
bool IsComplete() const override {
return true;
}
void Cancel() override {}
Result GetResult() const override {
return ResultSuccess;
}
};
class SynchronizeNetworkServiceAccountsSnapshotAsyncInterface final : public IAsyncContext {
public:
explicit SynchronizeNetworkServiceAccountsSnapshotAsyncInterface(Core::System& system_) : IAsyncContext{system_} {
MarkComplete();
}
~SynchronizeNetworkServiceAccountsSnapshotAsyncInterface() = default;
protected:
bool IsComplete() const override {
return true;
}
void Cancel() override {}
Result GetResult() const override {
return ResultSuccess;
}
};
class IManagerForApplication final : public ServiceFramework<IManagerForApplication> { class IManagerForApplication final : public ServiceFramework<IManagerForApplication> {
public: public:
explicit IManagerForApplication(Core::System& system_, explicit IManagerForApplication(Core::System& system_,
@@ -620,8 +688,10 @@ public:
{0, &IManagerForApplication::CheckAvailability, "CheckAvailability"}, {0, &IManagerForApplication::CheckAvailability, "CheckAvailability"},
{1, &IManagerForApplication::GetAccountId, "GetAccountId"}, {1, &IManagerForApplication::GetAccountId, "GetAccountId"},
{2, &IManagerForApplication::EnsureIdTokenCacheAsync, "EnsureIdTokenCacheAsync"}, {2, &IManagerForApplication::EnsureIdTokenCacheAsync, "EnsureIdTokenCacheAsync"},
{3, &IManagerForApplication::LoadIdTokenCache, "LoadIdTokenCache"}, {3, &IManagerForApplication::LoadIdTokenCacheDeprecated, "LoadIdTokenCacheDeprecated"},
{4, &IManagerForApplication::LoadIdTokenCache, "LoadIdTokenCache"},
{130, &IManagerForApplication::GetNintendoAccountUserResourceCacheForApplication, "GetNintendoAccountUserResourceCacheForApplication"}, {130, &IManagerForApplication::GetNintendoAccountUserResourceCacheForApplication, "GetNintendoAccountUserResourceCacheForApplication"},
{136, &IManagerForApplication::GetNintendoAccountUserResourceCacheForApplication, "GetNintendoAccountUserResourceCache"}, // 19.0.0+
{150, nullptr, "CreateAuthorizationRequest"}, {150, nullptr, "CreateAuthorizationRequest"},
{160, &IManagerForApplication::StoreOpenContext, "StoreOpenContext"}, {160, &IManagerForApplication::StoreOpenContext, "StoreOpenContext"},
{170, nullptr, "LoadNetworkServiceLicenseKindAsync"}, {170, nullptr, "LoadNetworkServiceLicenseKindAsync"},
@@ -655,12 +725,21 @@ private:
rb.PushIpcInterface(ensure_token_id); rb.PushIpcInterface(ensure_token_id);
} }
void LoadIdTokenCache(HLERequestContext& ctx) { void LoadIdTokenCacheDeprecated(HLERequestContext& ctx) {
LOG_WARNING(Service_ACC, "(STUBBED) called"); LOG_WARNING(Service_ACC, "(STUBBED) called");
ensure_token_id->LoadIdTokenCache(ctx); ensure_token_id->LoadIdTokenCache(ctx);
} }
void LoadIdTokenCache(HLERequestContext& ctx) {
LOG_WARNING(Service_ACC, "(STUBBED) called");
IPC::ResponseBuilder rb{ctx, 4};
rb.Push(ResultSuccess);
rb.Push(0); // token size
rb.Push(0); // unknown
}
void GetNintendoAccountUserResourceCacheForApplication(HLERequestContext& ctx) { void GetNintendoAccountUserResourceCacheForApplication(HLERequestContext& ctx) {
LOG_WARNING(Service_ACC, "(STUBBED) called"); LOG_WARNING(Service_ACC, "(STUBBED) called");
@@ -1134,6 +1213,381 @@ void Module::Interface::TrySelectUserWithoutInteraction(HLERequestContext& ctx)
rb.PushRaw(profile_manager->GetUser(0)->uuid); rb.PushRaw(profile_manager->GetUser(0)->uuid);
} }
void Module::Interface::GetUserRegistrationNotifier(HLERequestContext& ctx) {
LOG_WARNING(Service_ACC, "(STUBBED) called");
const Common::UUID dummy_uuid{};
IPC::ResponseBuilder rb{ctx, 2, 0, 1};
rb.Push(ResultSuccess);
rb.PushIpcInterface<INotifier>(system, dummy_uuid);
}
void Module::Interface::GetUserStateChangeNotifier(HLERequestContext& ctx) {
LOG_WARNING(Service_ACC, "(STUBBED) called");
const Common::UUID dummy_uuid{};
IPC::ResponseBuilder rb{ctx, 2, 0, 1};
rb.Push(ResultSuccess);
rb.PushIpcInterface<INotifier>(system, dummy_uuid);
}
void Module::Interface::GetBaasUserAvailabilityChangeNotifier(HLERequestContext& ctx) {
LOG_WARNING(Service_ACC, "(STUBBED) called");
const Common::UUID dummy_uuid{};
IPC::ResponseBuilder rb{ctx, 2, 0, 1};
rb.Push(ResultSuccess);
rb.PushIpcInterface<INotifier>(system, dummy_uuid);
}
void Module::Interface::GetProfileUpdateNotifier(HLERequestContext& ctx) {
LOG_WARNING(Service_ACC, "(STUBBED) called");
const Common::UUID dummy_uuid{};
IPC::ResponseBuilder rb{ctx, 2, 0, 1};
rb.Push(ResultSuccess);
rb.PushIpcInterface<INotifier>(system, dummy_uuid);
}
void Module::Interface::GetProfileSyncNotifier(HLERequestContext& ctx) {
LOG_WARNING(Service_ACC, "(STUBBED) called");
const Common::UUID dummy_uuid{};
IPC::ResponseBuilder rb{ctx, 2, 0, 1};
rb.Push(ResultSuccess);
rb.PushIpcInterface<INotifier>(system, dummy_uuid);
}
void Module::Interface::LoadSaveDataThumbnail(HLERequestContext& ctx) {
IPC::RequestParser rp{ctx};
const auto uuid = rp.PopRaw<Common::UUID>();
const auto tid = rp.Pop<u64_le>();
LOG_WARNING(Service_ACC, "(STUBBED) called, uuid=0x{}, tid={:016X}", uuid.RawString(), tid);
// Return empty buffer for now
std::vector<u8> thumbnail(THUMBNAIL_SIZE);
ctx.WriteBuffer(thumbnail);
IPC::ResponseBuilder rb{ctx, 2};
rb.Push(ResultSuccess);
}
void Module::Interface::GetSaveDataThumbnailExistence(HLERequestContext& ctx) {
IPC::RequestParser rp{ctx};
const auto uuid = rp.PopRaw<Common::UUID>();
const auto tid = rp.Pop<u64_le>();
LOG_WARNING(Service_ACC, "(STUBBED) called, uuid=0x{}, tid={:016X}", uuid.RawString(), tid);
IPC::ResponseBuilder rb{ctx, 3};
rb.Push(ResultSuccess);
rb.Push(false); // Thumbnail does not exist
}
void Module::Interface::ListOpenUsersInApplication(HLERequestContext& ctx) {
LOG_WARNING(Service_ACC, "(STUBBED) called");
ctx.WriteBuffer(profile_manager->GetOpenUsers());
IPC::ResponseBuilder rb{ctx, 2};
rb.Push(ResultSuccess);
}
void Module::Interface::ActivateOpenContextRetention(HLERequestContext& ctx) {
LOG_WARNING(Service_ACC, "(STUBBED) called");
const Common::UUID dummy_uuid{};
IPC::ResponseBuilder rb{ctx, 2, 0, 1};
rb.Push(ResultSuccess);
rb.PushIpcInterface<ISessionObject>(system, dummy_uuid);
}
void Module::Interface::EnsureSignedDeviceIdentifierCacheForNintendoAccountAsync(HLERequestContext& ctx) {
LOG_WARNING(Service_ACC, "(STUBBED) called");
IPC::ResponseBuilder rb{ctx, 2, 0, 1};
rb.Push(ResultSuccess);
rb.PushIpcInterface<EnsureSignedDeviceIdentifierCacheAsyncInterface>(system);
}
void Module::Interface::LoadSignedDeviceIdentifierCacheForNintendoAccount(HLERequestContext& ctx) {
LOG_WARNING(Service_ACC, "(STUBBED) called");
// Return dummy data
std::array<u8, 0x40> device_identifier{};
ctx.WriteBuffer(device_identifier);
IPC::ResponseBuilder rb{ctx, 2};
rb.Push(ResultSuccess);
}
void Module::Interface::GetUserLastOpenedApplication(HLERequestContext& ctx) {
IPC::RequestParser rp{ctx};
Common::UUID user_id = rp.PopRaw<Common::UUID>();
LOG_WARNING(Service_ACC, "(STUBBED) called, user_id=0x{}", user_id.RawString());
IPC::ResponseBuilder rb{ctx, 4};
rb.Push(ResultSuccess);
rb.Push<u64>(0); // No application opened
}
void Module::Interface::ActivateOpenContextHolder(HLERequestContext& ctx) {
LOG_WARNING(Service_ACC, "(STUBBED) called");
IPC::ResponseBuilder rb{ctx, 2};
rb.Push(ResultSuccess);
}
void Module::Interface::CancelUserRegistration(HLERequestContext& ctx) {
IPC::RequestParser rp{ctx};
Common::UUID user_id = rp.PopRaw<Common::UUID>();
LOG_INFO(Service_ACC, "called, uuid={}", user_id.FormattedString());
IPC::ResponseBuilder rb{ctx, 2};
rb.Push(ResultSuccess);
}
void Module::Interface::DeleteUser(HLERequestContext& ctx) {
IPC::RequestParser rp{ctx};
Common::UUID user_id = rp.PopRaw<Common::UUID>();
LOG_INFO(Service_ACC, "called, uuid={}", user_id.FormattedString());
profile_manager->RemoveUser(user_id);
IPC::ResponseBuilder rb{ctx, 2};
rb.Push(ResultSuccess);
}
void Module::Interface::SetUserPosition(HLERequestContext& ctx) {
IPC::RequestParser rp{ctx};
const auto position = rp.Pop<u32>();
const auto uuid = rp.PopRaw<Common::UUID>();
LOG_WARNING(Service_ACC, "(STUBBED) called, position={}, uuid=0x{}", position, uuid.RawString());
IPC::ResponseBuilder rb{ctx, 2};
rb.Push(ResultSuccess);
}
void Module::Interface::CompleteUserRegistrationForcibly(HLERequestContext& ctx) {
IPC::RequestParser rp{ctx};
Common::UUID user_id = rp.PopRaw<Common::UUID>();
LOG_INFO(Service_ACC, "called, uuid={}", user_id.FormattedString());
profile_manager->WriteUserSaveFile();
IPC::ResponseBuilder rb{ctx, 2};
rb.Push(ResultSuccess);
}
void Module::Interface::CreateFloatingRegistrationRequest(HLERequestContext& ctx) {
LOG_WARNING(Service_ACC, "(STUBBED) called");
const Common::UUID dummy_uuid{};
IPC::ResponseBuilder rb{ctx, 2, 0, 1};
rb.Push(ResultSuccess);
rb.PushIpcInterface<IFloatingRegistrationRequest>(system, dummy_uuid);
}
void Module::Interface::CreateProcedureToRegisterUserWithNintendoAccount(HLERequestContext& ctx) {
LOG_WARNING(Service_ACC, "(STUBBED) called");
const Common::UUID dummy_uuid{};
IPC::ResponseBuilder rb{ctx, 2, 0, 1};
rb.Push(ResultSuccess);
rb.PushIpcInterface<IOAuthProcedureForUserRegistration>(system, dummy_uuid);
}
void Module::Interface::ResumeProcedureToRegisterUserWithNintendoAccount(HLERequestContext& ctx) {
LOG_WARNING(Service_ACC, "(STUBBED) called");
const Common::UUID dummy_uuid{};
IPC::ResponseBuilder rb{ctx, 2, 0, 1};
rb.Push(ResultSuccess);
rb.PushIpcInterface<IOAuthProcedureForUserRegistration>(system, dummy_uuid);
}
void Module::Interface::CreateProcedureToCreateUserWithNintendoAccount(HLERequestContext& ctx) {
LOG_WARNING(Service_ACC, "(STUBBED) called");
const Common::UUID dummy_uuid{};
IPC::ResponseBuilder rb{ctx, 2, 0, 1};
rb.Push(ResultSuccess);
rb.PushIpcInterface<IOAuthProcedureForUserRegistration>(system, dummy_uuid);
}
void Module::Interface::ResumeProcedureToCreateUserWithNintendoAccount(HLERequestContext& ctx) {
LOG_WARNING(Service_ACC, "(STUBBED) called");
const Common::UUID dummy_uuid{};
IPC::ResponseBuilder rb{ctx, 2, 0, 1};
rb.Push(ResultSuccess);
rb.PushIpcInterface<IOAuthProcedureForUserRegistration>(system, dummy_uuid);
}
void Module::Interface::ResumeProcedureToCreateUserWithNintendoAccountAfterApplyResponse(HLERequestContext& ctx) {
LOG_WARNING(Service_ACC, "(STUBBED) called");
const Common::UUID dummy_uuid{};
IPC::ResponseBuilder rb{ctx, 2, 0, 1};
rb.Push(ResultSuccess);
rb.PushIpcInterface<IOAuthProcedureForUserRegistration>(system, dummy_uuid);
}
void Module::Interface::AuthenticateServiceAsync(HLERequestContext& ctx) {
LOG_WARNING(Service_ACC, "(STUBBED) called");
IPC::ResponseBuilder rb{ctx, 2, 0, 1};
rb.Push(ResultSuccess);
rb.PushIpcInterface<AuthenticateServiceAsyncInterface>(system);
}
void Module::Interface::GetBaasAccountAdministrator(HLERequestContext& ctx) {
IPC::RequestParser rp{ctx};
const auto uuid = rp.PopRaw<Common::UUID>();
LOG_INFO(Service_ACC, "called, uuid=0x{}", uuid.RawString());
IPC::ResponseBuilder rb{ctx, 2, 0, 1};
rb.Push(ResultSuccess);
rb.PushIpcInterface<IAdministrator>(system, uuid);
}
void Module::Interface::SynchronizeNetworkServiceAccountsSnapshotAsync(HLERequestContext& ctx) {
LOG_WARNING(Service_ACC, "(STUBBED) called");
IPC::ResponseBuilder rb{ctx, 2, 0, 1};
rb.Push(ResultSuccess);
rb.PushIpcInterface<SynchronizeNetworkServiceAccountsSnapshotAsyncInterface>(system);
}
void Module::Interface::ProxyProcedureForGuestLoginWithNintendoAccount(HLERequestContext& ctx) {
LOG_WARNING(Service_ACC, "(STUBBED) called");
const Common::UUID dummy_uuid{};
IPC::ResponseBuilder rb{ctx, 2, 0, 1};
rb.Push(ResultSuccess);
rb.PushIpcInterface<IOAuthProcedureForExternalNsa>(system, dummy_uuid);
}
void Module::Interface::ProxyProcedureForFloatingRegistrationWithNintendoAccount(HLERequestContext& ctx) {
LOG_WARNING(Service_ACC, "(STUBBED) called");
const Common::UUID dummy_uuid{};
IPC::ResponseBuilder rb{ctx, 2, 0, 1};
rb.Push(ResultSuccess);
rb.PushIpcInterface<IOAuthProcedureForExternalNsa>(system, dummy_uuid);
}
void Module::Interface::ProxyProcedureForDeviceMigrationAuthenticatingOperatingUser(HLERequestContext& ctx) {
LOG_WARNING(Service_ACC, "(STUBBED) called");
const Common::UUID dummy_uuid{};
IPC::ResponseBuilder rb{ctx, 2, 0, 1};
rb.Push(ResultSuccess);
rb.PushIpcInterface<IOAuthProcedure>(system, dummy_uuid);
}
void Module::Interface::ProxyProcedureForDeviceMigrationDownload(HLERequestContext& ctx) {
LOG_WARNING(Service_ACC, "(STUBBED) called");
const Common::UUID dummy_uuid{};
IPC::ResponseBuilder rb{ctx, 2, 0, 1};
rb.Push(ResultSuccess);
rb.PushIpcInterface<IOAuthProcedure>(system, dummy_uuid);
}
void Module::Interface::SuspendBackgroundDaemon(HLERequestContext& ctx) {
LOG_WARNING(Service_ACC, "(STUBBED) called");
const Common::UUID dummy_uuid{};
IPC::ResponseBuilder rb{ctx, 2, 0, 1};
rb.Push(ResultSuccess);
rb.PushIpcInterface<ISessionObject>(system, dummy_uuid);
}
void Module::Interface::CreateDeviceMigrationUserExportRequest(HLERequestContext& ctx) {
LOG_WARNING(Service_ACC, "(STUBBED) called");
IPC::ResponseBuilder rb{ctx, 2};
rb.Push(ResultSuccess);
}
void Module::Interface::UploadNasCredential(HLERequestContext& ctx) {
LOG_WARNING(Service_ACC, "(STUBBED) called");
IPC::ResponseBuilder rb{ctx, 2};
rb.Push(ResultSuccess);
}
void Module::Interface::CreateDeviceMigrationUserImportRequest(HLERequestContext& ctx) {
LOG_WARNING(Service_ACC, "(STUBBED) called");
IPC::ResponseBuilder rb{ctx, 2};
rb.Push(ResultSuccess);
}
void Module::Interface::DeleteUserMigrationInfo(HLERequestContext& ctx) {
LOG_WARNING(Service_ACC, "(STUBBED) called");
IPC::ResponseBuilder rb{ctx, 2};
rb.Push(ResultSuccess);
}
void Module::Interface::SetUserUnqualifiedForDebug(HLERequestContext& ctx) {
LOG_WARNING(Service_ACC, "(STUBBED) called");
IPC::ResponseBuilder rb{ctx, 2};
rb.Push(ResultSuccess);
}
void Module::Interface::UnsetUserUnqualifiedForDebug(HLERequestContext& ctx) {
LOG_WARNING(Service_ACC, "(STUBBED) called");
IPC::ResponseBuilder rb{ctx, 2};
rb.Push(ResultSuccess);
}
void Module::Interface::ListUsersUnqualifiedForDebug(HLERequestContext& ctx) {
LOG_WARNING(Service_ACC, "(STUBBED) called");
ctx.WriteBuffer(std::vector<Common::UUID>{});
IPC::ResponseBuilder rb{ctx, 2};
rb.Push(ResultSuccess);
}
void Module::Interface::RefreshFirmwareSettingsForDebug(HLERequestContext& ctx) {
LOG_WARNING(Service_ACC, "(STUBBED) called");
IPC::ResponseBuilder rb{ctx, 2};
rb.Push(ResultSuccess);
}
void Module::Interface::DebugInvalidateTokenCacheForUser(HLERequestContext& ctx) {
LOG_WARNING(Service_ACC, "(STUBBED) called");
IPC::ResponseBuilder rb{ctx, 2};
rb.Push(ResultSuccess);
}
void Module::Interface::DebugSetUserStateClose(HLERequestContext& ctx) {
LOG_WARNING(Service_ACC, "(STUBBED) called");
IPC::ResponseBuilder rb{ctx, 2};
rb.Push(ResultSuccess);
}
void Module::Interface::DebugSetUserStateOpen(HLERequestContext& ctx) {
LOG_WARNING(Service_ACC, "(STUBBED) called");
IPC::ResponseBuilder rb{ctx, 2};
rb.Push(ResultSuccess);
}
Module::Interface::Interface(std::shared_ptr<Module> module_, Module::Interface::Interface(std::shared_ptr<Module> module_,
std::shared_ptr<ProfileManager> profile_manager_, std::shared_ptr<ProfileManager> profile_manager_,
Core::System& system_, const char* name) Core::System& system_, const char* name)

View File

@@ -49,6 +49,49 @@ public:
void DebugActivateOpenContextRetention(HLERequestContext& ctx); void DebugActivateOpenContextRetention(HLERequestContext& ctx);
void GetBaasAccountManagerForSystemService(HLERequestContext& ctx); void GetBaasAccountManagerForSystemService(HLERequestContext& ctx);
void StoreSaveDataThumbnailSystem(HLERequestContext& ctx); void StoreSaveDataThumbnailSystem(HLERequestContext& ctx);
// Additional functions for acc:su
void GetUserRegistrationNotifier(HLERequestContext& ctx);
void GetUserStateChangeNotifier(HLERequestContext& ctx);
void GetBaasUserAvailabilityChangeNotifier(HLERequestContext& ctx);
void GetProfileUpdateNotifier(HLERequestContext& ctx);
void GetProfileSyncNotifier(HLERequestContext& ctx);
void LoadSaveDataThumbnail(HLERequestContext& ctx);
void GetSaveDataThumbnailExistence(HLERequestContext& ctx);
void ListOpenUsersInApplication(HLERequestContext& ctx);
void ActivateOpenContextRetention(HLERequestContext& ctx);
void EnsureSignedDeviceIdentifierCacheForNintendoAccountAsync(HLERequestContext& ctx);
void LoadSignedDeviceIdentifierCacheForNintendoAccount(HLERequestContext& ctx);
void GetUserLastOpenedApplication(HLERequestContext& ctx);
void ActivateOpenContextHolder(HLERequestContext& ctx);
void CancelUserRegistration(HLERequestContext& ctx);
void DeleteUser(HLERequestContext& ctx);
void SetUserPosition(HLERequestContext& ctx);
void CompleteUserRegistrationForcibly(HLERequestContext& ctx);
void CreateFloatingRegistrationRequest(HLERequestContext& ctx);
void CreateProcedureToRegisterUserWithNintendoAccount(HLERequestContext& ctx);
void ResumeProcedureToRegisterUserWithNintendoAccount(HLERequestContext& ctx);
void CreateProcedureToCreateUserWithNintendoAccount(HLERequestContext& ctx);
void ResumeProcedureToCreateUserWithNintendoAccount(HLERequestContext& ctx);
void ResumeProcedureToCreateUserWithNintendoAccountAfterApplyResponse(HLERequestContext& ctx);
void AuthenticateServiceAsync(HLERequestContext& ctx);
void GetBaasAccountAdministrator(HLERequestContext& ctx);
void SynchronizeNetworkServiceAccountsSnapshotAsync(HLERequestContext& ctx);
void ProxyProcedureForGuestLoginWithNintendoAccount(HLERequestContext& ctx);
void ProxyProcedureForFloatingRegistrationWithNintendoAccount(HLERequestContext& ctx);
void ProxyProcedureForDeviceMigrationAuthenticatingOperatingUser(HLERequestContext& ctx);
void ProxyProcedureForDeviceMigrationDownload(HLERequestContext& ctx);
void SuspendBackgroundDaemon(HLERequestContext& ctx);
void CreateDeviceMigrationUserExportRequest(HLERequestContext& ctx);
void UploadNasCredential(HLERequestContext& ctx);
void CreateDeviceMigrationUserImportRequest(HLERequestContext& ctx);
void DeleteUserMigrationInfo(HLERequestContext& ctx);
void SetUserUnqualifiedForDebug(HLERequestContext& ctx);
void UnsetUserUnqualifiedForDebug(HLERequestContext& ctx);
void ListUsersUnqualifiedForDebug(HLERequestContext& ctx);
void RefreshFirmwareSettingsForDebug(HLERequestContext& ctx);
void DebugInvalidateTokenCacheForUser(HLERequestContext& ctx);
void DebugSetUserStateClose(HLERequestContext& ctx);
void DebugSetUserStateOpen(HLERequestContext& ctx);
private: private:
Result InitializeApplicationInfoBase(); Result InitializeApplicationInfoBase();

View File

@@ -1,4 +1,5 @@
// SPDX-FileCopyrightText: Copyright 2018 yuzu Emulator Project // SPDX-FileCopyrightText: Copyright 2018 yuzu Emulator Project
// SPDX-FileCopyrightText: Copyright 2025 citron Emulator Project
// SPDX-License-Identifier: GPL-2.0-or-later // SPDX-License-Identifier: GPL-2.0-or-later
#include "core/hle/service/acc/acc_aa.h" #include "core/hle/service/acc/acc_aa.h"

View File

@@ -16,32 +16,32 @@ ACC_E::ACC_E(std::shared_ptr<Module> module_, std::shared_ptr<ProfileManager> pr
{3, &ACC_E::ListOpenUsers, "ListOpenUsers"}, {3, &ACC_E::ListOpenUsers, "ListOpenUsers"},
{4, &ACC_E::GetLastOpenedUser, "GetLastOpenedUser"}, {4, &ACC_E::GetLastOpenedUser, "GetLastOpenedUser"},
{5, &ACC_E::GetProfile, "GetProfile"}, {5, &ACC_E::GetProfile, "GetProfile"},
{6, nullptr, "GetProfileDigest"}, {6, &ACC_E::GetProfileDigest, "GetProfileDigest"},
{50, &ACC_E::IsUserRegistrationRequestPermitted, "IsUserRegistrationRequestPermitted"}, {50, &ACC_E::IsUserRegistrationRequestPermitted, "IsUserRegistrationRequestPermitted"},
{51, nullptr, "TrySelectUserWithoutInteractionDeprecated"}, // [1.0.0-18.1.0] {51, &ACC_E::TrySelectUserWithoutInteraction, "TrySelectUserWithoutInteractionDeprecated"}, // [1.0.0-18.1.0]
{52, &ACC_E::TrySelectUserWithoutInteraction, "TrySelectUserWithoutInteraction"}, // [19.0.0+] {52, &ACC_E::TrySelectUserWithoutInteraction, "TrySelectUserWithoutInteraction"}, // [19.0.0+]
{99, nullptr, "DebugActivateOpenContextRetention"}, {99, &ACC_E::DebugActivateOpenContextRetention, "DebugActivateOpenContextRetention"},
{100, nullptr, "GetUserRegistrationNotifier"}, {100, &ACC_E::GetUserRegistrationNotifier, "GetUserRegistrationNotifier"},
{101, nullptr, "GetUserStateChangeNotifier"}, {101, &ACC_E::GetUserStateChangeNotifier, "GetUserStateChangeNotifier"},
{102, &ACC_E::GetBaasAccountManagerForSystemService, "GetBaasAccountManagerForSystemService"}, {102, &ACC_E::GetBaasAccountManagerForSystemService, "GetBaasAccountManagerForSystemService"},
{103, nullptr, "GetBaasUserAvailabilityChangeNotifier"}, {103, &ACC_E::GetBaasUserAvailabilityChangeNotifier, "GetBaasUserAvailabilityChangeNotifier"},
{104, nullptr, "GetProfileUpdateNotifier"}, {104, &ACC_E::GetProfileUpdateNotifier, "GetProfileUpdateNotifier"},
{105, nullptr, "CheckNetworkServiceAvailabilityAsync"}, {105, &ACC_E::CheckNetworkServiceAvailabilityAsync, "CheckNetworkServiceAvailabilityAsync"},
{106, nullptr, "GetProfileSyncNotifier"}, {106, &ACC_E::GetProfileSyncNotifier, "GetProfileSyncNotifier"},
{110, &ACC_E::StoreSaveDataThumbnailSystem, "StoreSaveDataThumbnail"}, {110, &ACC_E::StoreSaveDataThumbnailSystem, "StoreSaveDataThumbnail"},
{111, nullptr, "ClearSaveDataThumbnail"}, {111, &ACC_E::ClearSaveDataThumbnail, "ClearSaveDataThumbnail"},
{112, nullptr, "LoadSaveDataThumbnail"}, {112, &ACC_E::LoadSaveDataThumbnail, "LoadSaveDataThumbnail"},
{113, nullptr, "GetSaveDataThumbnailExistence"}, {113, &ACC_E::GetSaveDataThumbnailExistence, "GetSaveDataThumbnailExistence"},
{120, nullptr, "ListOpenUsersInApplication"}, {120, &ACC_E::ListOpenUsersInApplication, "ListOpenUsersInApplication"},
{130, nullptr, "ActivateOpenContextRetention"}, {130, &ACC_E::ActivateOpenContextRetention, "ActivateOpenContextRetention"},
{140, &ACC_E::ListQualifiedUsers, "ListQualifiedUsers"}, {140, &ACC_E::ListQualifiedUsers, "ListQualifiedUsers"},
{151, nullptr, "EnsureSignedDeviceIdentifierCacheForNintendoAccountAsync"}, {151, &ACC_E::EnsureSignedDeviceIdentifierCacheForNintendoAccountAsync, "EnsureSignedDeviceIdentifierCacheForNintendoAccountAsync"},
{152, nullptr, "LoadSignedDeviceIdentifierCacheForNintendoAccount"}, {152, &ACC_E::LoadSignedDeviceIdentifierCacheForNintendoAccount, "LoadSignedDeviceIdentifierCacheForNintendoAccount"},
{170, nullptr, "GetNasOp2MembershipStateChangeNotifier"}, {170, &ACC_E::GetProfileUpdateNotifier, "GetNasOp2MembershipStateChangeNotifier"}, // Reuse notifier
{191, nullptr, "UpdateNotificationReceiverInfo"}, {191, &ACC_E::ActivateOpenContextHolder, "UpdateNotificationReceiverInfo"},
{997, nullptr, "DebugInvalidateTokenCacheForUser"}, {997, &ACC_E::DebugInvalidateTokenCacheForUser, "DebugInvalidateTokenCacheForUser"},
{998, nullptr, "DebugSetUserStateClose"}, {998, &ACC_E::DebugSetUserStateClose, "DebugSetUserStateClose"},
{999, nullptr, "DebugSetUserStateOpen"}, {999, &ACC_E::DebugSetUserStateOpen, "DebugSetUserStateOpen"},
}; };
// clang-format on // clang-format on

View File

@@ -16,38 +16,38 @@ ACC_E_U2::ACC_E_U2(std::shared_ptr<Module> module_, std::shared_ptr<ProfileManag
{3, &ACC_E_U2::ListOpenUsers, "ListOpenUsers"}, {3, &ACC_E_U2::ListOpenUsers, "ListOpenUsers"},
{4, &ACC_E_U2::GetLastOpenedUser, "GetLastOpenedUser"}, {4, &ACC_E_U2::GetLastOpenedUser, "GetLastOpenedUser"},
{5, &ACC_E_U2::GetProfile, "GetProfile"}, {5, &ACC_E_U2::GetProfile, "GetProfile"},
{6, nullptr, "GetProfileDigest"}, {6, &ACC_E_U2::GetProfileDigest, "GetProfileDigest"},
{50, &ACC_E_U2::IsUserRegistrationRequestPermitted, "IsUserRegistrationRequestPermitted"}, {50, &ACC_E_U2::IsUserRegistrationRequestPermitted, "IsUserRegistrationRequestPermitted"},
{51, nullptr, "TrySelectUserWithoutInteractionDeprecated"}, // [1.0.0-18.1.0] {51, &ACC_E_U2::TrySelectUserWithoutInteraction, "TrySelectUserWithoutInteractionDeprecated"}, // [1.0.0-18.1.0]
{52, &ACC_E_U2::TrySelectUserWithoutInteraction, "TrySelectUserWithoutInteraction"}, // [19.0.0+] {52, &ACC_E_U2::TrySelectUserWithoutInteraction, "TrySelectUserWithoutInteraction"}, // [19.0.0+]
{99, nullptr, "DebugActivateOpenContextRetention"}, {99, &ACC_E_U2::DebugActivateOpenContextRetention, "DebugActivateOpenContextRetention"},
{100, nullptr, "GetUserRegistrationNotifier"}, {100, &ACC_E_U2::GetUserRegistrationNotifier, "GetUserRegistrationNotifier"},
{101, nullptr, "GetUserStateChangeNotifier"}, {101, &ACC_E_U2::GetUserStateChangeNotifier, "GetUserStateChangeNotifier"},
{102, &ACC_E_U2::GetBaasAccountManagerForSystemService, "GetBaasAccountManagerForSystemService"}, {102, &ACC_E_U2::GetBaasAccountManagerForSystemService, "GetBaasAccountManagerForSystemService"},
{103, nullptr, "GetBaasUserAvailabilityChangeNotifier"}, {103, &ACC_E_U2::GetBaasUserAvailabilityChangeNotifier, "GetBaasUserAvailabilityChangeNotifier"},
{104, nullptr, "GetProfileUpdateNotifier"}, {104, &ACC_E_U2::GetProfileUpdateNotifier, "GetProfileUpdateNotifier"},
{105, nullptr, "CheckNetworkServiceAvailabilityAsync"}, {105, &ACC_E_U2::CheckNetworkServiceAvailabilityAsync, "CheckNetworkServiceAvailabilityAsync"},
{106, nullptr, "GetProfileSyncNotifier"}, {106, &ACC_E_U2::GetProfileSyncNotifier, "GetProfileSyncNotifier"},
{110, &ACC_E_U2::StoreSaveDataThumbnailSystem, "StoreSaveDataThumbnail"}, {110, &ACC_E_U2::StoreSaveDataThumbnailSystem, "StoreSaveDataThumbnail"},
{111, nullptr, "ClearSaveDataThumbnail"}, {111, &ACC_E_U2::ClearSaveDataThumbnail, "ClearSaveDataThumbnail"},
{112, nullptr, "LoadSaveDataThumbnail"}, {112, &ACC_E_U2::LoadSaveDataThumbnail, "LoadSaveDataThumbnail"},
{113, nullptr, "GetSaveDataThumbnailExistence"}, {113, &ACC_E_U2::GetSaveDataThumbnailExistence, "GetSaveDataThumbnailExistence"},
{120, nullptr, "ListOpenUsersInApplication"}, {120, &ACC_E_U2::ListOpenUsersInApplication, "ListOpenUsersInApplication"},
{130, nullptr, "ActivateOpenContextRetention"}, {130, &ACC_E_U2::ActivateOpenContextRetention, "ActivateOpenContextRetention"},
{140, &ACC_E_U2::ListQualifiedUsers, "ListQualifiedUsers"}, {140, &ACC_E_U2::ListQualifiedUsers, "ListQualifiedUsers"},
{151, nullptr, "EnsureSignedDeviceIdentifierCacheForNintendoAccountAsync"}, {151, &ACC_E_U2::EnsureSignedDeviceIdentifierCacheForNintendoAccountAsync, "EnsureSignedDeviceIdentifierCacheForNintendoAccountAsync"},
{152, nullptr, "LoadSignedDeviceIdentifierCacheForNintendoAccount"}, {152, &ACC_E_U2::LoadSignedDeviceIdentifierCacheForNintendoAccount, "LoadSignedDeviceIdentifierCacheForNintendoAccount"},
{170, nullptr, "GetNasOp2MembershipStateChangeNotifier"}, {170, &ACC_E_U2::GetProfileUpdateNotifier, "GetNasOp2MembershipStateChangeNotifier"}, // Reuse notifier
{191, nullptr, "UpdateNotificationReceiverInfo"}, // [13.0.0-19.0.1] {191, &ACC_E_U2::ActivateOpenContextHolder, "UpdateNotificationReceiverInfo"}, // [13.0.0-19.0.1]
{205, &ACC_E_U2::GetProfileEditor, "GetProfileEditor"}, {205, &ACC_E_U2::GetProfileEditor, "GetProfileEditor"},
{401, nullptr, "GetPinCodeLength"}, // [18.0.0+] {401, &ACC_E_U2::DebugInvalidateTokenCacheForUser, "GetPinCodeLength"}, // [18.0.0+] STUB
{402, nullptr, "GetPinCode"}, // [18.0.0-19.0.1] {402, &ACC_E_U2::DebugInvalidateTokenCacheForUser, "GetPinCode"}, // [18.0.0-19.0.1] STUB
{403, nullptr, "GetPinCodeParity"}, // [20.0.0+] {403, &ACC_E_U2::DebugInvalidateTokenCacheForUser, "GetPinCodeParity"}, // [20.0.0+] STUB
{404, nullptr, "VerifyPinCode"}, // [20.0.0+] {404, &ACC_E_U2::DebugInvalidateTokenCacheForUser, "VerifyPinCode"}, // [20.0.0+] STUB
{405, nullptr, "IsPinCodeVerificationForbidden"}, // [20.0.0+] {405, &ACC_E_U2::DebugInvalidateTokenCacheForUser, "IsPinCodeVerificationForbidden"}, // [20.0.0+] STUB
{997, nullptr, "DebugInvalidateTokenCacheForUser"}, {997, &ACC_E_U2::DebugInvalidateTokenCacheForUser, "DebugInvalidateTokenCacheForUser"},
{998, nullptr, "DebugSetUserStateClose"}, {998, &ACC_E_U2::DebugSetUserStateClose, "DebugSetUserStateClose"},
{999, nullptr, "DebugSetUserStateOpen"}, {999, &ACC_E_U2::DebugSetUserStateOpen, "DebugSetUserStateOpen"},
}; };
// clang-format on // clang-format on

View File

@@ -17,63 +17,63 @@ ACC_SU::ACC_SU(std::shared_ptr<Module> module_, std::shared_ptr<ProfileManager>
{3, &ACC_SU::ListOpenUsers, "ListOpenUsers"}, {3, &ACC_SU::ListOpenUsers, "ListOpenUsers"},
{4, &ACC_SU::GetLastOpenedUser, "GetLastOpenedUser"}, {4, &ACC_SU::GetLastOpenedUser, "GetLastOpenedUser"},
{5, &ACC_SU::GetProfile, "GetProfile"}, {5, &ACC_SU::GetProfile, "GetProfile"},
{6, nullptr, "GetProfileDigest"}, {6, &ACC_SU::GetProfileDigest, "GetProfileDigest"},
{50, &ACC_SU::IsUserRegistrationRequestPermitted, "IsUserRegistrationRequestPermitted"}, {50, &ACC_SU::IsUserRegistrationRequestPermitted, "IsUserRegistrationRequestPermitted"},
{51, nullptr, "TrySelectUserWithoutInteractionDeprecated"}, // [1.0.0-18.1.0] {51, &ACC_SU::TrySelectUserWithoutInteraction, "TrySelectUserWithoutInteractionDeprecated"}, // [1.0.0-18.1.0]
{52, &ACC_SU::TrySelectUserWithoutInteraction, "TrySelectUserWithoutInteraction"}, // [19.0.0+] {52, &ACC_SU::TrySelectUserWithoutInteraction, "TrySelectUserWithoutInteraction"}, // [19.0.0+]
{60, &ACC_SU::ListOpenContextStoredUsers, "ListOpenContextStoredUsers"}, {60, &ACC_SU::ListOpenContextStoredUsers, "ListOpenContextStoredUsers"},
{99, nullptr, "DebugActivateOpenContextRetention"}, {99, &ACC_SU::DebugActivateOpenContextRetention, "DebugActivateOpenContextRetention"},
{100, nullptr, "GetUserRegistrationNotifier"}, {100, &ACC_SU::GetUserRegistrationNotifier, "GetUserRegistrationNotifier"},
{101, nullptr, "GetUserStateChangeNotifier"}, {101, &ACC_SU::GetUserStateChangeNotifier, "GetUserStateChangeNotifier"},
{102, &ACC_SU::GetBaasAccountManagerForSystemService, "GetBaasAccountManagerForSystemService"}, {102, &ACC_SU::GetBaasAccountManagerForSystemService, "GetBaasAccountManagerForSystemService"},
{103, nullptr, "GetBaasUserAvailabilityChangeNotifier"}, {103, &ACC_SU::GetBaasUserAvailabilityChangeNotifier, "GetBaasUserAvailabilityChangeNotifier"},
{104, nullptr, "GetProfileUpdateNotifier"}, {104, &ACC_SU::GetProfileUpdateNotifier, "GetProfileUpdateNotifier"},
{105, nullptr, "CheckNetworkServiceAvailabilityAsync"}, {105, &ACC_SU::CheckNetworkServiceAvailabilityAsync, "CheckNetworkServiceAvailabilityAsync"},
{106, nullptr, "GetProfileSyncNotifier"}, {106, &ACC_SU::GetProfileSyncNotifier, "GetProfileSyncNotifier"},
{110, &ACC_SU::StoreSaveDataThumbnailSystem, "StoreSaveDataThumbnail"}, {110, &ACC_SU::StoreSaveDataThumbnailSystem, "StoreSaveDataThumbnail"},
{111, nullptr, "ClearSaveDataThumbnail"}, {111, &ACC_SU::ClearSaveDataThumbnail, "ClearSaveDataThumbnail"},
{112, nullptr, "LoadSaveDataThumbnail"}, {112, &ACC_SU::LoadSaveDataThumbnail, "LoadSaveDataThumbnail"},
{113, nullptr, "GetSaveDataThumbnailExistence"}, {113, &ACC_SU::GetSaveDataThumbnailExistence, "GetSaveDataThumbnailExistence"},
{120, nullptr, "ListOpenUsersInApplication"}, {120, &ACC_SU::ListOpenUsersInApplication, "ListOpenUsersInApplication"},
{130, nullptr, "ActivateOpenContextRetention"}, {130, &ACC_SU::ActivateOpenContextRetention, "ActivateOpenContextRetention"},
{140, &ACC_SU::ListQualifiedUsers, "ListQualifiedUsers"}, {140, &ACC_SU::ListQualifiedUsers, "ListQualifiedUsers"},
{150, nullptr, "AuthenticateApplicationAsync"}, {150, &ACC_SU::AuthenticateApplicationAsync, "AuthenticateApplicationAsync"},
{151, nullptr, "EnsureSignedDeviceIdentifierCacheForNintendoAccountAsync"}, {151, &ACC_SU::EnsureSignedDeviceIdentifierCacheForNintendoAccountAsync, "EnsureSignedDeviceIdentifierCacheForNintendoAccountAsync"},
{152, nullptr, "LoadSignedDeviceIdentifierCacheForNintendoAccount"}, {152, &ACC_SU::LoadSignedDeviceIdentifierCacheForNintendoAccount, "LoadSignedDeviceIdentifierCacheForNintendoAccount"},
{190, nullptr, "GetUserLastOpenedApplication"}, {190, &ACC_SU::GetUserLastOpenedApplication, "GetUserLastOpenedApplication"},
{191, nullptr, "ActivateOpenContextHolder"}, {191, &ACC_SU::ActivateOpenContextHolder, "ActivateOpenContextHolder"},
{200, &ACC_SU::BeginUserRegistration, "BeginUserRegistration"}, {200, &ACC_SU::BeginUserRegistration, "BeginUserRegistration"},
{201, &ACC_SU::CompleteUserRegistration, "CompleteUserRegistration"}, {201, &ACC_SU::CompleteUserRegistration, "CompleteUserRegistration"},
{202, nullptr, "CancelUserRegistration"}, {202, &ACC_SU::CancelUserRegistration, "CancelUserRegistration"},
{203, nullptr, "DeleteUser"}, {203, &ACC_SU::DeleteUser, "DeleteUser"},
{204, nullptr, "SetUserPosition"}, {204, &ACC_SU::SetUserPosition, "SetUserPosition"},
{205, &ACC_SU::GetProfileEditor, "GetProfileEditor"}, {205, &ACC_SU::GetProfileEditor, "GetProfileEditor"},
{206, nullptr, "CompleteUserRegistrationForcibly"}, {206, &ACC_SU::CompleteUserRegistrationForcibly, "CompleteUserRegistrationForcibly"},
{210, nullptr, "CreateFloatingRegistrationRequest"}, {210, &ACC_SU::CreateFloatingRegistrationRequest, "CreateFloatingRegistrationRequest"},
{211, nullptr, "CreateProcedureToRegisterUserWithNintendoAccount"}, {211, &ACC_SU::CreateProcedureToRegisterUserWithNintendoAccount, "CreateProcedureToRegisterUserWithNintendoAccount"},
{212, nullptr, "ResumeProcedureToRegisterUserWithNintendoAccount"}, {212, &ACC_SU::ResumeProcedureToRegisterUserWithNintendoAccount, "ResumeProcedureToRegisterUserWithNintendoAccount"},
{213, nullptr, "CreateProcedureToCreateUserWithNintendoAccount"}, // [17.0.0+] {213, &ACC_SU::CreateProcedureToCreateUserWithNintendoAccount, "CreateProcedureToCreateUserWithNintendoAccount"}, // [17.0.0+]
{214, nullptr, "ResumeProcedureToCreateUserWithNintendoAccount"}, // [17.0.0+] {214, &ACC_SU::ResumeProcedureToCreateUserWithNintendoAccount, "ResumeProcedureToCreateUserWithNintendoAccount"}, // [17.0.0+]
{215, nullptr, "ResumeProcedureToCreateUserWithNintendoAccountAfterApplyResponse"}, // [17.0.0+] {215, &ACC_SU::ResumeProcedureToCreateUserWithNintendoAccountAfterApplyResponse, "ResumeProcedureToCreateUserWithNintendoAccountAfterApplyResponse"}, // [17.0.0+]
{230, nullptr, "AuthenticateServiceAsync"}, {230, &ACC_SU::AuthenticateServiceAsync, "AuthenticateServiceAsync"},
{250, nullptr, "GetBaasAccountAdministrator"}, {250, &ACC_SU::GetBaasAccountAdministrator, "GetBaasAccountAdministrator"},
{251, nullptr, "SynchronizeNetworkServiceAccountsSnapshotAsync"}, // [20.0.0+] {251, &ACC_SU::SynchronizeNetworkServiceAccountsSnapshotAsync, "SynchronizeNetworkServiceAccountsSnapshotAsync"}, // [20.0.0+]
{290, nullptr, "ProxyProcedureForGuestLoginWithNintendoAccount"}, {290, &ACC_SU::ProxyProcedureForGuestLoginWithNintendoAccount, "ProxyProcedureForGuestLoginWithNintendoAccount"},
{291, nullptr, "ProxyProcedureForFloatingRegistrationWithNintendoAccount"}, {291, &ACC_SU::ProxyProcedureForFloatingRegistrationWithNintendoAccount, "ProxyProcedureForFloatingRegistrationWithNintendoAccount"},
{292, nullptr, "ProxyProcedureForDeviceMigrationAuthenticatingOperatingUser"}, // [20.0.0+] {292, &ACC_SU::ProxyProcedureForDeviceMigrationAuthenticatingOperatingUser, "ProxyProcedureForDeviceMigrationAuthenticatingOperatingUser"}, // [20.0.0+]
{293, nullptr, "ProxyProcedureForDeviceMigrationDownload"}, // [20.0.0+] {293, &ACC_SU::ProxyProcedureForDeviceMigrationDownload, "ProxyProcedureForDeviceMigrationDownload"}, // [20.0.0+]
{299, nullptr, "SuspendBackgroundDaemon"}, {299, &ACC_SU::SuspendBackgroundDaemon, "SuspendBackgroundDaemon"},
{350, nullptr, "CreateDeviceMigrationUserExportRequest"}, // [20.0.0+] {350, &ACC_SU::CreateDeviceMigrationUserExportRequest, "CreateDeviceMigrationUserExportRequest"}, // [20.0.0+]
{351, nullptr, "UploadNasCredential"}, // [20.0.0+] {351, &ACC_SU::UploadNasCredential, "UploadNasCredential"}, // [20.0.0+]
{352, nullptr, "CreateDeviceMigrationUserImportRequest"}, // [20.0.0+] {352, &ACC_SU::CreateDeviceMigrationUserImportRequest, "CreateDeviceMigrationUserImportRequest"}, // [20.0.0+]
{353, nullptr, "DeleteUserMigrationInfo"}, // [20.0.0+] {353, &ACC_SU::DeleteUserMigrationInfo, "DeleteUserMigrationInfo"}, // [20.0.0+]
{900, nullptr, "SetUserUnqualifiedForDebug"}, {900, &ACC_SU::SetUserUnqualifiedForDebug, "SetUserUnqualifiedForDebug"},
{901, nullptr, "UnsetUserUnqualifiedForDebug"}, {901, &ACC_SU::UnsetUserUnqualifiedForDebug, "UnsetUserUnqualifiedForDebug"},
{902, nullptr, "ListUsersUnqualifiedForDebug"}, {902, &ACC_SU::ListUsersUnqualifiedForDebug, "ListUsersUnqualifiedForDebug"},
{910, nullptr, "RefreshFirmwareSettingsForDebug"}, {910, &ACC_SU::RefreshFirmwareSettingsForDebug, "RefreshFirmwareSettingsForDebug"},
{997, nullptr, "DebugInvalidateTokenCacheForUser"}, {997, &ACC_SU::DebugInvalidateTokenCacheForUser, "DebugInvalidateTokenCacheForUser"},
{998, nullptr, "DebugSetUserStateClose"}, {998, &ACC_SU::DebugSetUserStateClose, "DebugSetUserStateClose"},
{999, nullptr, "DebugSetUserStateOpen"}, {999, &ACC_SU::DebugSetUserStateOpen, "DebugSetUserStateOpen"},
}; };
// clang-format on // clang-format on

View File

@@ -1,4 +1,5 @@
// SPDX-FileCopyrightText: Copyright 2018 yuzu Emulator Project // SPDX-FileCopyrightText: Copyright 2018 yuzu Emulator Project
// SPDX-FileCopyrightText: Copyright 2025 citron Emulator Project
// SPDX-License-Identifier: GPL-2.0-or-later // SPDX-License-Identifier: GPL-2.0-or-later
#include "core/hle/service/acc/acc_u1.h" #include "core/hle/service/acc/acc_u1.h"
@@ -16,33 +17,33 @@ ACC_U1::ACC_U1(std::shared_ptr<Module> module_, std::shared_ptr<ProfileManager>
{3, &ACC_U1::ListOpenUsers, "ListOpenUsers"}, {3, &ACC_U1::ListOpenUsers, "ListOpenUsers"},
{4, &ACC_U1::GetLastOpenedUser, "GetLastOpenedUser"}, {4, &ACC_U1::GetLastOpenedUser, "GetLastOpenedUser"},
{5, &ACC_U1::GetProfile, "GetProfile"}, {5, &ACC_U1::GetProfile, "GetProfile"},
{6, nullptr, "GetProfileDigest"}, {6, &ACC_U1::GetProfileDigest, "GetProfileDigest"},
{50, &ACC_U1::IsUserRegistrationRequestPermitted, "IsUserRegistrationRequestPermitted"}, {50, &ACC_U1::IsUserRegistrationRequestPermitted, "IsUserRegistrationRequestPermitted"},
{51, &ACC_U1::TrySelectUserWithoutInteraction, "TrySelectUserWithoutInteraction"}, {51, &ACC_U1::TrySelectUserWithoutInteraction, "TrySelectUserWithoutInteraction"},
{60, &ACC_U1::ListOpenContextStoredUsers, "ListOpenContextStoredUsers"}, {60, &ACC_U1::ListOpenContextStoredUsers, "ListOpenContextStoredUsers"},
{99, nullptr, "DebugActivateOpenContextRetention"}, {99, &ACC_U1::DebugActivateOpenContextRetention, "DebugActivateOpenContextRetention"},
{100, nullptr, "GetUserRegistrationNotifier"}, {100, &ACC_U1::GetUserRegistrationNotifier, "GetUserRegistrationNotifier"},
{101, nullptr, "GetUserStateChangeNotifier"}, {101, &ACC_U1::GetUserStateChangeNotifier, "GetUserStateChangeNotifier"},
{102, &ACC_U1::GetBaasAccountManagerForSystemService, "GetBaasAccountManagerForSystemService"}, {102, &ACC_U1::GetBaasAccountManagerForSystemService, "GetBaasAccountManagerForSystemService"},
{103, nullptr, "GetBaasUserAvailabilityChangeNotifier"}, {103, &ACC_U1::GetBaasUserAvailabilityChangeNotifier, "GetBaasUserAvailabilityChangeNotifier"},
{104, nullptr, "GetProfileUpdateNotifier"}, {104, &ACC_U1::GetProfileUpdateNotifier, "GetProfileUpdateNotifier"},
{105, nullptr, "CheckNetworkServiceAvailabilityAsync"}, {105, &ACC_U1::CheckNetworkServiceAvailabilityAsync, "CheckNetworkServiceAvailabilityAsync"},
{106, nullptr, "GetProfileSyncNotifier"}, {106, &ACC_U1::GetProfileSyncNotifier, "GetProfileSyncNotifier"},
{110, &ACC_U1::StoreSaveDataThumbnailApplication, "StoreSaveDataThumbnail"}, {110, &ACC_U1::StoreSaveDataThumbnailApplication, "StoreSaveDataThumbnail"},
{111, nullptr, "ClearSaveDataThumbnail"}, {111, &ACC_U1::ClearSaveDataThumbnail, "ClearSaveDataThumbnail"},
{112, nullptr, "LoadSaveDataThumbnail"}, {112, &ACC_U1::LoadSaveDataThumbnail, "LoadSaveDataThumbnail"},
{113, nullptr, "GetSaveDataThumbnailExistence"}, {113, &ACC_U1::GetSaveDataThumbnailExistence, "GetSaveDataThumbnailExistence"},
{120, nullptr, "ListOpenUsersInApplication"}, {120, &ACC_U1::ListOpenUsersInApplication, "ListOpenUsersInApplication"},
{130, nullptr, "ActivateOpenContextRetention"}, {130, &ACC_U1::ActivateOpenContextRetention, "ActivateOpenContextRetention"},
{140, &ACC_U1::ListQualifiedUsers, "ListQualifiedUsers"}, {140, &ACC_U1::ListQualifiedUsers, "ListQualifiedUsers"},
{150, nullptr, "AuthenticateApplicationAsync"}, {150, &ACC_U1::AuthenticateApplicationAsync, "AuthenticateApplicationAsync"},
{151, nullptr, "EnsureSignedDeviceIdentifierCacheForNintendoAccountAsync"}, {151, &ACC_U1::EnsureSignedDeviceIdentifierCacheForNintendoAccountAsync, "EnsureSignedDeviceIdentifierCacheForNintendoAccountAsync"},
{152, nullptr, "LoadSignedDeviceIdentifierCacheForNintendoAccount"}, {152, &ACC_U1::LoadSignedDeviceIdentifierCacheForNintendoAccount, "LoadSignedDeviceIdentifierCacheForNintendoAccount"},
{190, nullptr, "GetUserLastOpenedApplication"}, {190, &ACC_U1::GetUserLastOpenedApplication, "GetUserLastOpenedApplication"},
{191, nullptr, "ActivateOpenContextHolder"}, {191, &ACC_U1::ActivateOpenContextHolder, "ActivateOpenContextHolder"},
{997, nullptr, "DebugInvalidateTokenCacheForUser"}, {997, &ACC_U1::DebugInvalidateTokenCacheForUser, "DebugInvalidateTokenCacheForUser"},
{998, nullptr, "DebugSetUserStateClose"}, {998, &ACC_U1::DebugSetUserStateClose, "DebugSetUserStateClose"},
{999, nullptr, "DebugSetUserStateOpen"}, {999, &ACC_U1::DebugSetUserStateOpen, "DebugSetUserStateOpen"},
}; };
// clang-format on // clang-format on

View File

@@ -0,0 +1,44 @@
// SPDX-FileCopyrightText: Copyright 2025 citron Emulator Project
// SPDX-License-Identifier: GPL-3.0-or-later
#include "core/hle/service/cmif_serialization.h"
#include "core/hle/service/ldn/client_process_monitor.h"
#include "core/hle/service/ldn/ldn_results.h"
// IClientProcessMonitor implementation
// This service was added in Nintendo Switch firmware version 18.0.0+
// Documentation: https://switchbrew.org/wiki/LDN_services#IClientProcessMonitor
namespace Service::LDN {
IClientProcessMonitor::IClientProcessMonitor(Core::System& system_)
: ServiceFramework{system_, "IClientProcessMonitor"} {
// clang-format off
static const FunctionInfo functions[] = {
{0, D<&IClientProcessMonitor::RegisterClient>, "RegisterClient"},
};
// clang-format on
RegisterHandlers(functions);
}
IClientProcessMonitor::~IClientProcessMonitor() = default;
Result IClientProcessMonitor::RegisterClient(ClientProcessId process_id, u64 placeholder) {
// RegisterClient is invoked during the final stages of LDN initialization
// Official behavior (from SwitchBrew):
// 1. If object pointer already set from previous call, returns 0
// 2. Searches for matching PID in global state
// 3. If found: increments reference count and updates state
// 4. If PID is 0 or no match found, returns 0
//
// For emulator implementation:
// We stub this as LDN process monitoring isn't critical for basic functionality
// Games expect this to succeed for LDN features to work properly
LOG_INFO(Service_LDN, "called, process_id={}, placeholder={}", process_id.pid, placeholder);
R_SUCCEED();
}
} // namespace Service::LDN

View File

@@ -0,0 +1,31 @@
// SPDX-FileCopyrightText: Copyright 2025 citron 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 {
// IClientProcessMonitor - Added in firmware 18.0.0+
// Returned by CreateClientProcessMonitor command in ldn:s and ldn:u services
// Used during the final stages of LDN (Local Network) initialization
// Reference: https://switchbrew.org/wiki/LDN_services#IClientProcessMonitor
class IClientProcessMonitor final : public ServiceFramework<IClientProcessMonitor> {
public:
explicit IClientProcessMonitor(Core::System& system_);
~IClientProcessMonitor() override;
private:
// RegisterClient - Command 0
// Input: ClientProcessId (PID), u64 placeholder
// Registers a client process for LDN monitoring and reference counting
Result RegisterClient(ClientProcessId process_id, u64 placeholder);
};
} // namespace Service::LDN

View File

@@ -1,8 +1,10 @@
// SPDX-FileCopyrightText: Copyright 2018 yuzu Emulator Project // SPDX-FileCopyrightText: Copyright 2018 yuzu Emulator Project
// SPDX-FileCopyrightText: Copyright 2025 citron Emulator Project
// SPDX-License-Identifier: GPL-2.0-or-later // SPDX-License-Identifier: GPL-2.0-or-later
#include "core/core.h" #include "core/core.h"
#include "core/hle/service/cmif_serialization.h" #include "core/hle/service/cmif_serialization.h"
#include "core/hle/service/ldn/client_process_monitor.h"
#include "core/hle/service/ldn/ldn.h" #include "core/hle/service/ldn/ldn.h"
#include "core/hle/service/ldn/monitor_service.h" #include "core/hle/service/ldn/monitor_service.h"
#include "core/hle/service/ldn/sf_monitor_service.h" #include "core/hle/service/ldn/sf_monitor_service.h"
@@ -18,7 +20,7 @@ public:
explicit IMonitorServiceCreator(Core::System& system_) : ServiceFramework{system_, "ldn:m"} { explicit IMonitorServiceCreator(Core::System& system_) : ServiceFramework{system_, "ldn:m"} {
// clang-format off // clang-format off
static const FunctionInfo functions[] = { static const FunctionInfo functions[] = {
{0, C<&IMonitorServiceCreator::CreateMonitorService>, "CreateMonitorService"} {0, D<&IMonitorServiceCreator::CreateMonitorService>, "CreateMonitorService"}
}; };
// clang-format on // clang-format on
@@ -40,6 +42,7 @@ public:
// clang-format off // clang-format off
static const FunctionInfo functions[] = { static const FunctionInfo functions[] = {
{0, C<&ISystemServiceCreator::CreateSystemLocalCommunicationService>, "CreateSystemLocalCommunicationService"}, {0, C<&ISystemServiceCreator::CreateSystemLocalCommunicationService>, "CreateSystemLocalCommunicationService"},
{1, C<&ISystemServiceCreator::CreateClientProcessMonitor>, "CreateClientProcessMonitor"}, // 18.0.0+
}; };
// clang-format on // clang-format on
@@ -54,6 +57,13 @@ private:
*out_interface = std::make_shared<ISystemLocalCommunicationService>(system); *out_interface = std::make_shared<ISystemLocalCommunicationService>(system);
R_SUCCEED(); R_SUCCEED();
} }
Result CreateClientProcessMonitor(OutInterface<IClientProcessMonitor> out_interface) {
LOG_DEBUG(Service_LDN, "called");
*out_interface = std::make_shared<IClientProcessMonitor>(system);
R_SUCCEED();
}
}; };
class IUserServiceCreator final : public ServiceFramework<IUserServiceCreator> { class IUserServiceCreator final : public ServiceFramework<IUserServiceCreator> {
@@ -61,7 +71,8 @@ public:
explicit IUserServiceCreator(Core::System& system_) : ServiceFramework{system_, "ldn:u"} { explicit IUserServiceCreator(Core::System& system_) : ServiceFramework{system_, "ldn:u"} {
// clang-format off // clang-format off
static const FunctionInfo functions[] = { static const FunctionInfo functions[] = {
{0, C<&IUserServiceCreator::CreateUserLocalCommunicationService>, "CreateUserLocalCommunicationService"}, {0, D<&IUserServiceCreator::CreateUserLocalCommunicationService>, "CreateUserLocalCommunicationService"},
{1, D<&IUserServiceCreator::CreateClientProcessMonitor>, "CreateClientProcessMonitor"}, // 18.0.0+
}; };
// clang-format on // clang-format on
@@ -76,6 +87,13 @@ private:
*out_interface = std::make_shared<IUserLocalCommunicationService>(system); *out_interface = std::make_shared<IUserLocalCommunicationService>(system);
R_SUCCEED(); R_SUCCEED();
} }
Result CreateClientProcessMonitor(OutInterface<IClientProcessMonitor> out_interface) {
LOG_DEBUG(Service_LDN, "called");
*out_interface = std::make_shared<IClientProcessMonitor>(system);
R_SUCCEED();
}
}; };
class ISfServiceCreator final : public ServiceFramework<ISfServiceCreator> { class ISfServiceCreator final : public ServiceFramework<ISfServiceCreator> {
@@ -84,8 +102,8 @@ public:
: ServiceFramework{system_, name_}, is_system{is_system_} { : ServiceFramework{system_, name_}, is_system{is_system_} {
// clang-format off // clang-format off
static const FunctionInfo functions[] = { static const FunctionInfo functions[] = {
{0, C<&ISfServiceCreator::CreateNetworkService>, "CreateNetworkService"}, {0, D<&ISfServiceCreator::CreateNetworkService>, "CreateNetworkService"},
{8, C<&ISfServiceCreator::CreateNetworkServiceMonitor>, "CreateNetworkServiceMonitor"}, {8, D<&ISfServiceCreator::CreateNetworkServiceMonitor>, "CreateNetworkServiceMonitor"},
}; };
// clang-format on // clang-format on
@@ -118,7 +136,7 @@ public:
explicit ISfMonitorServiceCreator(Core::System& system_) : ServiceFramework{system_, "lp2p:m"} { explicit ISfMonitorServiceCreator(Core::System& system_) : ServiceFramework{system_, "lp2p:m"} {
// clang-format off // clang-format off
static const FunctionInfo functions[] = { static const FunctionInfo functions[] = {
{0, C<&ISfMonitorServiceCreator::CreateMonitorService>, "CreateMonitorService"}, {0, D<&ISfMonitorServiceCreator::CreateMonitorService>, "CreateMonitorService"},
}; };
// clang-format on // clang-format on

View File

@@ -1,4 +1,5 @@
// SPDX-FileCopyrightText: Copyright 2024 yuzu Emulator Project // SPDX-FileCopyrightText: Copyright 2024 yuzu Emulator Project
// SPDX-FileCopyrightText: Copyright 2025 citron Emulator Project
// SPDX-License-Identifier: GPL-3.0-or-later // SPDX-License-Identifier: GPL-3.0-or-later
#include "core/hle/service/cmif_serialization.h" #include "core/hle/service/cmif_serialization.h"
@@ -11,14 +12,14 @@ IMonitorService::IMonitorService(Core::System& system_)
: ServiceFramework{system_, "IMonitorService"} { : ServiceFramework{system_, "IMonitorService"} {
// clang-format off // clang-format off
static const FunctionInfo functions[] = { static const FunctionInfo functions[] = {
{0, C<&IMonitorService::GetStateForMonitor>, "GetStateForMonitor"}, {0, D<&IMonitorService::GetStateForMonitor>, "GetStateForMonitor"},
{1, nullptr, "GetNetworkInfoForMonitor"}, {1, D<&IMonitorService::GetNetworkInfoForMonitor>, "GetNetworkInfoForMonitor"},
{2, nullptr, "GetIpv4AddressForMonitor"}, {2, D<&IMonitorService::GetIpv4AddressForMonitor>, "GetIpv4AddressForMonitor"},
{3, nullptr, "GetDisconnectReasonForMonitor"}, {3, D<&IMonitorService::GetDisconnectReasonForMonitor>, "GetDisconnectReasonForMonitor"},
{4, nullptr, "GetSecurityParameterForMonitor"}, {4, D<&IMonitorService::GetSecurityParameterForMonitor>, "GetSecurityParameterForMonitor"},
{5, nullptr, "GetNetworkConfigForMonitor"}, {5, D<&IMonitorService::GetNetworkConfigForMonitor>, "GetNetworkConfigForMonitor"},
{100, C<&IMonitorService::InitializeMonitor>, "InitializeMonitor"}, {100, D<&IMonitorService::InitializeMonitor>, "InitializeMonitor"},
{101, C<&IMonitorService::FinalizeMonitor>, "FinalizeMonitor"}, {101, D<&IMonitorService::FinalizeMonitor>, "FinalizeMonitor"},
}; };
// clang-format on // clang-format on
@@ -33,6 +34,37 @@ Result IMonitorService::GetStateForMonitor(Out<State> out_state) {
R_SUCCEED(); R_SUCCEED();
} }
Result IMonitorService::GetNetworkInfoForMonitor(OutLargeData<NetworkInfo, BufferAttr_HipcPointer> out_network_info) {
LOG_WARNING(Service_LDN, "(STUBBED) called");
*out_network_info = NetworkInfo{};
R_SUCCEED();
}
Result IMonitorService::GetIpv4AddressForMonitor(Out<Ipv4Address> out_address, Out<Ipv4Address> out_subnet_mask) {
LOG_WARNING(Service_LDN, "(STUBBED) called");
*out_address = Ipv4Address{0, 0, 0, 0};
*out_subnet_mask = Ipv4Address{255, 255, 255, 0};
R_SUCCEED();
}
Result IMonitorService::GetDisconnectReasonForMonitor(Out<DisconnectReason> out_disconnect_reason) {
LOG_WARNING(Service_LDN, "(STUBBED) called");
*out_disconnect_reason = DisconnectReason::None;
R_SUCCEED();
}
Result IMonitorService::GetSecurityParameterForMonitor(Out<SecurityParameter> out_security_parameter) {
LOG_WARNING(Service_LDN, "(STUBBED) called");
*out_security_parameter = SecurityParameter{};
R_SUCCEED();
}
Result IMonitorService::GetNetworkConfigForMonitor(Out<NetworkConfig> out_network_config) {
LOG_WARNING(Service_LDN, "(STUBBED) called");
*out_network_config = NetworkConfig{};
R_SUCCEED();
}
Result IMonitorService::InitializeMonitor() { Result IMonitorService::InitializeMonitor() {
LOG_INFO(Service_LDN, "called"); LOG_INFO(Service_LDN, "called");
R_SUCCEED(); R_SUCCEED();

View File

@@ -1,4 +1,5 @@
// SPDX-FileCopyrightText: Copyright 2024 yuzu Emulator Project // SPDX-FileCopyrightText: Copyright 2024 yuzu Emulator Project
// SPDX-FileCopyrightText: Copyright 2025 citron Emulator Project
// SPDX-License-Identifier: GPL-3.0-or-later // SPDX-License-Identifier: GPL-3.0-or-later
#pragma once #pragma once
@@ -20,6 +21,11 @@ public:
private: private:
Result GetStateForMonitor(Out<State> out_state); Result GetStateForMonitor(Out<State> out_state);
Result GetNetworkInfoForMonitor(OutLargeData<NetworkInfo, BufferAttr_HipcPointer> out_network_info);
Result GetIpv4AddressForMonitor(Out<Ipv4Address> out_address, Out<Ipv4Address> out_subnet_mask);
Result GetDisconnectReasonForMonitor(Out<DisconnectReason> out_disconnect_reason);
Result GetSecurityParameterForMonitor(Out<SecurityParameter> out_security_parameter);
Result GetNetworkConfigForMonitor(Out<NetworkConfig> out_network_config);
Result InitializeMonitor(); Result InitializeMonitor();
Result FinalizeMonitor(); Result FinalizeMonitor();

View File

@@ -1,4 +1,5 @@
// SPDX-FileCopyrightText: Copyright 2024 yuzu Emulator Project // SPDX-FileCopyrightText: Copyright 2024 yuzu Emulator Project
// SPDX-FileCopyrightText: Copyright 2025 citron Emulator Project
// SPDX-License-Identifier: GPL-3.0-or-later // SPDX-License-Identifier: GPL-3.0-or-later
#include "core/hle/service/cmif_serialization.h" #include "core/hle/service/cmif_serialization.h"
@@ -11,9 +12,9 @@ ISfMonitorService::ISfMonitorService(Core::System& system_)
: ServiceFramework{system_, "ISfMonitorService"} { : ServiceFramework{system_, "ISfMonitorService"} {
// clang-format off // clang-format off
static const FunctionInfo functions[] = { static const FunctionInfo functions[] = {
{0, C<&ISfMonitorService::Initialize>, "Initialize"}, {0, D<&ISfMonitorService::Initialize>, "Initialize"},
{288, C<&ISfMonitorService::GetGroupInfo>, "GetGroupInfo"}, {288, D<&ISfMonitorService::GetGroupInfo>, "GetGroupInfo"},
{320, nullptr, "GetLinkLevel"}, {320, D<&ISfMonitorService::GetLinkLevel>, "GetLinkLevel"},
}; };
// clang-format on // clang-format on
@@ -24,17 +25,20 @@ ISfMonitorService::~ISfMonitorService() = default;
Result ISfMonitorService::Initialize(Out<u32> out_value) { Result ISfMonitorService::Initialize(Out<u32> out_value) {
LOG_WARNING(Service_LDN, "(STUBBED) called"); LOG_WARNING(Service_LDN, "(STUBBED) called");
*out_value = 0; *out_value = 0;
R_SUCCEED(); R_SUCCEED();
} }
Result ISfMonitorService::GetGroupInfo( Result ISfMonitorService::GetGroupInfo(OutLargeData<GroupInfo, BufferAttr_HipcAutoSelect> out_group_info) {
OutLargeData<GroupInfo, BufferAttr_HipcAutoSelect> out_group_info) {
LOG_WARNING(Service_LDN, "(STUBBED) called"); LOG_WARNING(Service_LDN, "(STUBBED) called");
*out_group_info = GroupInfo{}; *out_group_info = GroupInfo{};
R_SUCCEED(); R_SUCCEED();
} }
Result ISfMonitorService::GetLinkLevel(Out<s32> out_link_level) {
LOG_WARNING(Service_LDN, "(STUBBED) called");
*out_link_level = 0;
R_SUCCEED();
}
} // namespace Service::LDN } // namespace Service::LDN

View File

@@ -1,4 +1,5 @@
// SPDX-FileCopyrightText: Copyright 2024 yuzu Emulator Project // SPDX-FileCopyrightText: Copyright 2024 yuzu Emulator Project
// SPDX-FileCopyrightText: Copyright 2025 citron Emulator Project
// SPDX-License-Identifier: GPL-3.0-or-later // SPDX-License-Identifier: GPL-3.0-or-later
#pragma once #pragma once
@@ -21,6 +22,7 @@ public:
private: private:
Result Initialize(Out<u32> out_value); Result Initialize(Out<u32> out_value);
Result GetGroupInfo(OutLargeData<GroupInfo, BufferAttr_HipcAutoSelect> out_group_info); Result GetGroupInfo(OutLargeData<GroupInfo, BufferAttr_HipcAutoSelect> out_group_info);
Result GetLinkLevel(Out<s32> out_link_level);
}; };
} // namespace Service::LDN } // namespace Service::LDN

View File

@@ -1,6 +1,8 @@
// SPDX-FileCopyrightText: Copyright 2024 yuzu Emulator Project // SPDX-FileCopyrightText: Copyright 2024 yuzu Emulator Project
// SPDX-FileCopyrightText: Copyright 2025 citron Emulator Project
// SPDX-License-Identifier: GPL-3.0-or-later // SPDX-License-Identifier: GPL-3.0-or-later
#include "core/hle/service/cmif_serialization.h"
#include "core/hle/service/ldn/sf_service.h" #include "core/hle/service/ldn/sf_service.h"
namespace Service::LDN { namespace Service::LDN {
@@ -8,24 +10,24 @@ namespace Service::LDN {
ISfService::ISfService(Core::System& system_) : ServiceFramework{system_, "ISfService"} { ISfService::ISfService(Core::System& system_) : ServiceFramework{system_, "ISfService"} {
// clang-format off // clang-format off
static const FunctionInfo functions[] = { static const FunctionInfo functions[] = {
{0, nullptr, "Initialize"}, {0, D<&ISfService::Initialize>, "Initialize"},
{256, nullptr, "AttachNetworkInterfaceStateChangeEvent"}, {256, D<&ISfService::AttachNetworkInterfaceStateChangeEvent>, "AttachNetworkInterfaceStateChangeEvent"},
{264, nullptr, "GetNetworkInterfaceLastError"}, {264, D<&ISfService::GetNetworkInterfaceLastError>, "GetNetworkInterfaceLastError"},
{272, nullptr, "GetRole"}, {272, D<&ISfService::GetRole>, "GetRole"},
{280, nullptr, "GetAdvertiseData"}, {280, D<&ISfService::GetAdvertiseData>, "GetAdvertiseData"},
{288, nullptr, "GetGroupInfo"}, {288, D<&ISfService::GetGroupInfo>, "GetGroupInfo"},
{296, nullptr, "GetGroupInfo2"}, {296, D<&ISfService::GetGroupInfo2>, "GetGroupInfo2"},
{304, nullptr, "GetGroupOwner"}, {304, D<&ISfService::GetGroupOwner>, "GetGroupOwner"},
{312, nullptr, "GetIpConfig"}, {312, D<&ISfService::GetIpConfig>, "GetIpConfig"},
{320, nullptr, "GetLinkLevel"}, {320, D<&ISfService::GetLinkLevel>, "GetLinkLevel"},
{512, nullptr, "Scan"}, {512, D<&ISfService::Scan>, "Scan"},
{768, nullptr, "CreateGroup"}, {768, D<&ISfService::CreateGroup>, "CreateGroup"},
{776, nullptr, "DestroyGroup"}, {776, D<&ISfService::DestroyGroup>, "DestroyGroup"},
{784, nullptr, "SetAdvertiseData"}, {784, D<&ISfService::SetAdvertiseData>, "SetAdvertiseData"},
{1536, nullptr, "SendToOtherGroup"}, {1536, D<&ISfService::SendToOtherGroup>, "SendToOtherGroup"},
{1544, nullptr, "RecvFromOtherGroup"}, {1544, D<&ISfService::RecvFromOtherGroup>, "RecvFromOtherGroup"},
{1552, nullptr, "AddAcceptableGroupId"}, {1552, D<&ISfService::AddAcceptableGroupId>, "AddAcceptableGroupId"},
{1560, nullptr, "ClearAcceptableGroupId"}, {1560, D<&ISfService::ClearAcceptableGroupId>, "ClearAcceptableGroupId"},
}; };
// clang-format on // clang-format on
@@ -34,4 +36,106 @@ ISfService::ISfService(Core::System& system_) : ServiceFramework{system_, "ISfSe
ISfService::~ISfService() = default; ISfService::~ISfService() = default;
Result ISfService::Initialize(Out<u32> out_value) {
LOG_WARNING(Service_LDN, "(STUBBED) called");
*out_value = 0;
R_SUCCEED();
}
Result ISfService::AttachNetworkInterfaceStateChangeEvent(OutCopyHandle<Kernel::KReadableEvent> out_event) {
LOG_WARNING(Service_LDN, "(STUBBED) called");
R_SUCCEED();
}
Result ISfService::GetNetworkInterfaceLastError(Out<s32> out_error) {
LOG_WARNING(Service_LDN, "(STUBBED) called");
*out_error = 0;
R_SUCCEED();
}
Result ISfService::GetRole(Out<u32> out_role) {
LOG_WARNING(Service_LDN, "(STUBBED) called");
*out_role = 0;
R_SUCCEED();
}
Result ISfService::GetAdvertiseData(OutBuffer<BufferAttr_HipcAutoSelect> out_buffer) {
LOG_WARNING(Service_LDN, "(STUBBED) called");
R_SUCCEED();
}
Result ISfService::GetGroupInfo(OutLargeData<GroupInfo, BufferAttr_HipcAutoSelect> out_group_info) {
LOG_WARNING(Service_LDN, "(STUBBED) called");
*out_group_info = GroupInfo{};
R_SUCCEED();
}
Result ISfService::GetGroupInfo2(OutLargeData<GroupInfo, BufferAttr_HipcAutoSelect> out_group_info) {
LOG_WARNING(Service_LDN, "(STUBBED) called");
*out_group_info = GroupInfo{};
R_SUCCEED();
}
Result ISfService::GetGroupOwner(Out<MacAddress> out_mac_address) {
LOG_WARNING(Service_LDN, "(STUBBED) called");
*out_mac_address = MacAddress{};
R_SUCCEED();
}
Result ISfService::GetIpConfig(Out<Ipv4Address> out_address, Out<Ipv4Address> out_subnet_mask) {
LOG_WARNING(Service_LDN, "(STUBBED) called");
*out_address = Ipv4Address{0, 0, 0, 0};
*out_subnet_mask = Ipv4Address{255, 255, 255, 0};
R_SUCCEED();
}
Result ISfService::GetLinkLevel(Out<s32> out_link_level) {
LOG_WARNING(Service_LDN, "(STUBBED) called");
*out_link_level = 0;
R_SUCCEED();
}
Result ISfService::Scan(Out<s32> out_count, u32 channel,
OutArray<NetworkInfo, BufferAttr_HipcAutoSelect> out_network_info) {
LOG_WARNING(Service_LDN, "(STUBBED) called, channel={}", channel);
*out_count = 0;
R_SUCCEED();
}
Result ISfService::CreateGroup(const GroupInfo& group_info) {
LOG_WARNING(Service_LDN, "(STUBBED) called");
R_SUCCEED();
}
Result ISfService::DestroyGroup() {
LOG_WARNING(Service_LDN, "(STUBBED) called");
R_SUCCEED();
}
Result ISfService::SetAdvertiseData(InBuffer<BufferAttr_HipcAutoSelect> buffer_data) {
LOG_WARNING(Service_LDN, "(STUBBED) called");
R_SUCCEED();
}
Result ISfService::SendToOtherGroup(InBuffer<BufferAttr_HipcAutoSelect> buffer_data, u64 group_id) {
LOG_WARNING(Service_LDN, "(STUBBED) called, group_id={:016X}", group_id);
R_SUCCEED();
}
Result ISfService::RecvFromOtherGroup(Out<u32> out_size, OutBuffer<BufferAttr_HipcAutoSelect> out_buffer) {
LOG_WARNING(Service_LDN, "(STUBBED) called");
*out_size = 0;
R_SUCCEED();
}
Result ISfService::AddAcceptableGroupId(u64 group_id) {
LOG_WARNING(Service_LDN, "(STUBBED) called, group_id={:016X}", group_id);
R_SUCCEED();
}
Result ISfService::ClearAcceptableGroupId() {
LOG_WARNING(Service_LDN, "(STUBBED) called");
R_SUCCEED();
}
} // namespace Service::LDN } // namespace Service::LDN

View File

@@ -1,21 +1,47 @@
// SPDX-FileCopyrightText: Copyright 2024 yuzu Emulator Project // SPDX-FileCopyrightText: Copyright 2024 yuzu Emulator Project
// SPDX-FileCopyrightText: Copyright 2025 citron Emulator Project
// SPDX-License-Identifier: GPL-3.0-or-later // SPDX-License-Identifier: GPL-3.0-or-later
#pragma once #pragma once
#include "core/hle/service/cmif_types.h" #include "core/hle/service/cmif_types.h"
#include "core/hle/service/ldn/ldn_types.h"
#include "core/hle/service/service.h" #include "core/hle/service/service.h"
namespace Core { namespace Core {
class System; class System;
} }
namespace Kernel {
class KReadableEvent;
}
namespace Service::LDN { namespace Service::LDN {
class ISfService final : public ServiceFramework<ISfService> { class ISfService final : public ServiceFramework<ISfService> {
public: public:
explicit ISfService(Core::System& system_); explicit ISfService(Core::System& system_);
~ISfService() override; ~ISfService() override;
private:
Result Initialize(Out<u32> out_value);
Result AttachNetworkInterfaceStateChangeEvent(OutCopyHandle<Kernel::KReadableEvent> out_event);
Result GetNetworkInterfaceLastError(Out<s32> out_error);
Result GetRole(Out<u32> out_role);
Result GetAdvertiseData(OutBuffer<BufferAttr_HipcAutoSelect> out_buffer);
Result GetGroupInfo(OutLargeData<GroupInfo, BufferAttr_HipcAutoSelect> out_group_info);
Result GetGroupInfo2(OutLargeData<GroupInfo, BufferAttr_HipcAutoSelect> out_group_info);
Result GetGroupOwner(Out<MacAddress> out_mac_address);
Result GetIpConfig(Out<Ipv4Address> out_address, Out<Ipv4Address> out_subnet_mask);
Result GetLinkLevel(Out<s32> out_link_level);
Result Scan(Out<s32> out_count, u32 channel, OutArray<NetworkInfo, BufferAttr_HipcAutoSelect> out_network_info);
Result CreateGroup(const GroupInfo& group_info);
Result DestroyGroup();
Result SetAdvertiseData(InBuffer<BufferAttr_HipcAutoSelect> buffer_data);
Result SendToOtherGroup(InBuffer<BufferAttr_HipcAutoSelect> buffer_data, u64 group_id);
Result RecvFromOtherGroup(Out<u32> out_size, OutBuffer<BufferAttr_HipcAutoSelect> out_buffer);
Result AddAcceptableGroupId(u64 group_id);
Result ClearAcceptableGroupId();
}; };
} // namespace Service::LDN } // namespace Service::LDN

View File

@@ -1,4 +1,5 @@
// SPDX-FileCopyrightText: Copyright 2024 yuzu Emulator Project // SPDX-FileCopyrightText: Copyright 2024 yuzu Emulator Project
// SPDX-FileCopyrightText: Copyright 2025 citron Emulator Project
// SPDX-License-Identifier: GPL-3.0-or-later // SPDX-License-Identifier: GPL-3.0-or-later
#include "core/hle/service/cmif_serialization.h" #include "core/hle/service/cmif_serialization.h"
@@ -11,19 +12,19 @@ ISfServiceMonitor::ISfServiceMonitor(Core::System& system_)
: ServiceFramework{system_, "ISfServiceMonitor"} { : ServiceFramework{system_, "ISfServiceMonitor"} {
// clang-format off // clang-format off
static const FunctionInfo functions[] = { static const FunctionInfo functions[] = {
{0, C<&ISfServiceMonitor::Initialize>, "Initialize"}, {0, D<&ISfServiceMonitor::Initialize>, "Initialize"},
{256, nullptr, "AttachNetworkInterfaceStateChangeEvent"}, {256, D<&ISfServiceMonitor::AttachNetworkInterfaceStateChangeEvent>, "AttachNetworkInterfaceStateChangeEvent"},
{264, nullptr, "GetNetworkInterfaceLastError"}, {264, D<&ISfServiceMonitor::GetNetworkInterfaceLastError>, "GetNetworkInterfaceLastError"},
{272, nullptr, "GetRole"}, {272, D<&ISfServiceMonitor::GetRole>, "GetRole"},
{280, nullptr, "GetAdvertiseData"}, {280, D<&ISfServiceMonitor::GetAdvertiseData>, "GetAdvertiseData"},
{281, nullptr, "GetAdvertiseData2"}, {281, D<&ISfServiceMonitor::GetAdvertiseData2>, "GetAdvertiseData2"},
{288, C<&ISfServiceMonitor::GetGroupInfo>, "GetGroupInfo"}, {288, D<&ISfServiceMonitor::GetGroupInfo>, "GetGroupInfo"},
{296, nullptr, "GetGroupInfo2"}, {296, D<&ISfServiceMonitor::GetGroupInfo2>, "GetGroupInfo2"},
{304, nullptr, "GetGroupOwner"}, {304, D<&ISfServiceMonitor::GetGroupOwner>, "GetGroupOwner"},
{312, nullptr, "GetIpConfig"}, {312, D<&ISfServiceMonitor::GetIpConfig>, "GetIpConfig"},
{320, nullptr, "GetLinkLevel"}, {320, D<&ISfServiceMonitor::GetLinkLevel>, "GetLinkLevel"},
{328, nullptr, "AttachJoinEvent"}, {328, D<&ISfServiceMonitor::AttachJoinEvent>, "AttachJoinEvent"},
{336, nullptr, "GetMembers"}, {336, D<&ISfServiceMonitor::GetMembers>, "GetMembers"},
}; };
// clang-format on // clang-format on
@@ -34,17 +35,77 @@ ISfServiceMonitor::~ISfServiceMonitor() = default;
Result ISfServiceMonitor::Initialize(Out<u32> out_value) { Result ISfServiceMonitor::Initialize(Out<u32> out_value) {
LOG_WARNING(Service_LDN, "(STUBBED) called"); LOG_WARNING(Service_LDN, "(STUBBED) called");
*out_value = 0; *out_value = 0;
R_SUCCEED(); R_SUCCEED();
} }
Result ISfServiceMonitor::GetGroupInfo( Result ISfServiceMonitor::AttachNetworkInterfaceStateChangeEvent(OutCopyHandle<Kernel::KReadableEvent> out_event) {
OutLargeData<GroupInfo, BufferAttr_HipcAutoSelect> out_group_info) {
LOG_WARNING(Service_LDN, "(STUBBED) called"); LOG_WARNING(Service_LDN, "(STUBBED) called");
R_SUCCEED();
}
Result ISfServiceMonitor::GetNetworkInterfaceLastError(Out<s32> out_error) {
LOG_WARNING(Service_LDN, "(STUBBED) called");
*out_error = 0;
R_SUCCEED();
}
Result ISfServiceMonitor::GetRole(Out<u32> out_role) {
LOG_WARNING(Service_LDN, "(STUBBED) called");
*out_role = 0;
R_SUCCEED();
}
Result ISfServiceMonitor::GetAdvertiseData(OutBuffer<BufferAttr_HipcAutoSelect> out_buffer) {
LOG_WARNING(Service_LDN, "(STUBBED) called");
R_SUCCEED();
}
Result ISfServiceMonitor::GetAdvertiseData2(OutBuffer<BufferAttr_HipcAutoSelect> out_buffer) {
LOG_WARNING(Service_LDN, "(STUBBED) called");
R_SUCCEED();
}
Result ISfServiceMonitor::GetGroupInfo(OutLargeData<GroupInfo, BufferAttr_HipcAutoSelect> out_group_info) {
LOG_WARNING(Service_LDN, "(STUBBED) called");
*out_group_info = GroupInfo{}; *out_group_info = GroupInfo{};
R_SUCCEED(); R_SUCCEED();
} }
Result ISfServiceMonitor::GetGroupInfo2(OutLargeData<GroupInfo, BufferAttr_HipcAutoSelect> out_group_info) {
LOG_WARNING(Service_LDN, "(STUBBED) called");
*out_group_info = GroupInfo{};
R_SUCCEED();
}
Result ISfServiceMonitor::GetGroupOwner(Out<MacAddress> out_mac_address) {
LOG_WARNING(Service_LDN, "(STUBBED) called");
*out_mac_address = MacAddress{};
R_SUCCEED();
}
Result ISfServiceMonitor::GetIpConfig(Out<Ipv4Address> out_address, Out<Ipv4Address> out_subnet_mask) {
LOG_WARNING(Service_LDN, "(STUBBED) called");
*out_address = Ipv4Address{0, 0, 0, 0};
*out_subnet_mask = Ipv4Address{255, 255, 255, 0};
R_SUCCEED();
}
Result ISfServiceMonitor::GetLinkLevel(Out<s32> out_link_level) {
LOG_WARNING(Service_LDN, "(STUBBED) called");
*out_link_level = 0;
R_SUCCEED();
}
Result ISfServiceMonitor::AttachJoinEvent(OutCopyHandle<Kernel::KReadableEvent> out_event) {
LOG_WARNING(Service_LDN, "(STUBBED) called");
R_SUCCEED();
}
Result ISfServiceMonitor::GetMembers(Out<u32> out_count, OutArray<MacAddress, BufferAttr_HipcAutoSelect> out_members) {
LOG_WARNING(Service_LDN, "(STUBBED) called");
*out_count = 0;
R_SUCCEED();
}
} // namespace Service::LDN } // namespace Service::LDN

View File

@@ -1,15 +1,21 @@
// SPDX-FileCopyrightText: Copyright 2024 yuzu Emulator Project // SPDX-FileCopyrightText: Copyright 2024 yuzu Emulator Project
// SPDX-FileCopyrightText: Copyright 2025 citron Emulator Project
// SPDX-License-Identifier: GPL-3.0-or-later // SPDX-License-Identifier: GPL-3.0-or-later
#pragma once #pragma once
#include "core/hle/service/cmif_types.h" #include "core/hle/service/cmif_types.h"
#include "core/hle/service/ldn/ldn_types.h"
#include "core/hle/service/service.h" #include "core/hle/service/service.h"
namespace Core { namespace Core {
class System; class System;
} }
namespace Kernel {
class KReadableEvent;
}
namespace Service::LDN { namespace Service::LDN {
struct GroupInfo; struct GroupInfo;
@@ -20,7 +26,18 @@ public:
private: private:
Result Initialize(Out<u32> out_value); Result Initialize(Out<u32> out_value);
Result AttachNetworkInterfaceStateChangeEvent(OutCopyHandle<Kernel::KReadableEvent> out_event);
Result GetNetworkInterfaceLastError(Out<s32> out_error);
Result GetRole(Out<u32> out_role);
Result GetAdvertiseData(OutBuffer<BufferAttr_HipcAutoSelect> out_buffer);
Result GetAdvertiseData2(OutBuffer<BufferAttr_HipcAutoSelect> out_buffer);
Result GetGroupInfo(OutLargeData<GroupInfo, BufferAttr_HipcAutoSelect> out_group_info); Result GetGroupInfo(OutLargeData<GroupInfo, BufferAttr_HipcAutoSelect> out_group_info);
Result GetGroupInfo2(OutLargeData<GroupInfo, BufferAttr_HipcAutoSelect> out_group_info);
Result GetGroupOwner(Out<MacAddress> out_mac_address);
Result GetIpConfig(Out<Ipv4Address> out_address, Out<Ipv4Address> out_subnet_mask);
Result GetLinkLevel(Out<s32> out_link_level);
Result AttachJoinEvent(OutCopyHandle<Kernel::KReadableEvent> out_event);
Result GetMembers(Out<u32> out_count, OutArray<MacAddress, BufferAttr_HipcAutoSelect> out_members);
}; };
} // namespace Service::LDN } // namespace Service::LDN

View File

@@ -1,4 +1,5 @@
// SPDX-FileCopyrightText: Copyright 2024 yuzu Emulator Project // SPDX-FileCopyrightText: Copyright 2024 yuzu Emulator Project
// SPDX-FileCopyrightText: Copyright 2025 citron Emulator Project
// SPDX-License-Identifier: GPL-3.0-or-later // SPDX-License-Identifier: GPL-3.0-or-later
#include "core/hle/service/cmif_serialization.h" #include "core/hle/service/cmif_serialization.h"
@@ -10,36 +11,36 @@ ISystemLocalCommunicationService::ISystemLocalCommunicationService(Core::System&
: ServiceFramework{system_, "ISystemLocalCommunicationService"} { : ServiceFramework{system_, "ISystemLocalCommunicationService"} {
// clang-format off // clang-format off
static const FunctionInfo functions[] = { static const FunctionInfo functions[] = {
{0, nullptr, "GetState"}, {0, D<&ISystemLocalCommunicationService::GetState>, "GetState"},
{1, nullptr, "GetNetworkInfo"}, {1, D<&ISystemLocalCommunicationService::GetNetworkInfo>, "GetNetworkInfo"},
{2, nullptr, "GetIpv4Address"}, {2, D<&ISystemLocalCommunicationService::GetIpv4Address>, "GetIpv4Address"},
{3, nullptr, "GetDisconnectReason"}, {3, D<&ISystemLocalCommunicationService::GetDisconnectReason>, "GetDisconnectReason"},
{4, nullptr, "GetSecurityParameter"}, {4, D<&ISystemLocalCommunicationService::GetSecurityParameter>, "GetSecurityParameter"},
{5, nullptr, "GetNetworkConfig"}, {5, D<&ISystemLocalCommunicationService::GetNetworkConfig>, "GetNetworkConfig"},
{100, nullptr, "AttachStateChangeEvent"}, {100, D<&ISystemLocalCommunicationService::AttachStateChangeEvent>, "AttachStateChangeEvent"},
{101, nullptr, "GetNetworkInfoLatestUpdate"}, {101, D<&ISystemLocalCommunicationService::GetNetworkInfoLatestUpdate>, "GetNetworkInfoLatestUpdate"},
{102, nullptr, "Scan"}, {102, D<&ISystemLocalCommunicationService::Scan>, "Scan"},
{103, nullptr, "ScanPrivate"}, {103, D<&ISystemLocalCommunicationService::ScanPrivate>, "ScanPrivate"},
{104, nullptr, "SetWirelessControllerRestriction"}, {104, D<&ISystemLocalCommunicationService::SetWirelessControllerRestriction>, "SetWirelessControllerRestriction"},
{200, nullptr, "OpenAccessPoint"}, {200, D<&ISystemLocalCommunicationService::OpenAccessPoint>, "OpenAccessPoint"},
{201, nullptr, "CloseAccessPoint"}, {201, D<&ISystemLocalCommunicationService::CloseAccessPoint>, "CloseAccessPoint"},
{202, nullptr, "CreateNetwork"}, {202, D<&ISystemLocalCommunicationService::CreateNetwork>, "CreateNetwork"},
{203, nullptr, "CreateNetworkPrivate"}, {203, D<&ISystemLocalCommunicationService::CreateNetworkPrivate>, "CreateNetworkPrivate"},
{204, nullptr, "DestroyNetwork"}, {204, D<&ISystemLocalCommunicationService::DestroyNetwork>, "DestroyNetwork"},
{205, nullptr, "Reject"}, {205, D<&ISystemLocalCommunicationService::Reject>, "Reject"},
{206, nullptr, "SetAdvertiseData"}, {206, D<&ISystemLocalCommunicationService::SetAdvertiseData>, "SetAdvertiseData"},
{207, nullptr, "SetStationAcceptPolicy"}, {207, D<&ISystemLocalCommunicationService::SetStationAcceptPolicy>, "SetStationAcceptPolicy"},
{208, nullptr, "AddAcceptFilterEntry"}, {208, D<&ISystemLocalCommunicationService::AddAcceptFilterEntry>, "AddAcceptFilterEntry"},
{209, nullptr, "ClearAcceptFilter"}, {209, D<&ISystemLocalCommunicationService::ClearAcceptFilter>, "ClearAcceptFilter"},
{300, nullptr, "OpenStation"}, {300, D<&ISystemLocalCommunicationService::OpenStation>, "OpenStation"},
{301, nullptr, "CloseStation"}, {301, D<&ISystemLocalCommunicationService::CloseStation>, "CloseStation"},
{302, nullptr, "Connect"}, {302, D<&ISystemLocalCommunicationService::Connect>, "Connect"},
{303, nullptr, "ConnectPrivate"}, {303, D<&ISystemLocalCommunicationService::ConnectPrivate>, "ConnectPrivate"},
{304, nullptr, "Disconnect"}, {304, D<&ISystemLocalCommunicationService::Disconnect>, "Disconnect"},
{400, nullptr, "InitializeSystem"}, {400, D<&ISystemLocalCommunicationService::InitializeSystem>, "InitializeSystem"},
{401, nullptr, "FinalizeSystem"}, {401, D<&ISystemLocalCommunicationService::FinalizeSystem>, "FinalizeSystem"},
{402, nullptr, "SetOperationMode"}, {402, D<&ISystemLocalCommunicationService::SetOperationMode>, "SetOperationMode"},
{403, C<&ISystemLocalCommunicationService::InitializeSystem2>, "InitializeSystem2"}, {403, D<&ISystemLocalCommunicationService::InitializeSystem2>, "InitializeSystem2"},
}; };
// clang-format on // clang-format on
@@ -48,6 +49,170 @@ ISystemLocalCommunicationService::ISystemLocalCommunicationService(Core::System&
ISystemLocalCommunicationService::~ISystemLocalCommunicationService() = default; ISystemLocalCommunicationService::~ISystemLocalCommunicationService() = default;
Result ISystemLocalCommunicationService::GetState(Out<State> out_state) {
LOG_WARNING(Service_LDN, "(STUBBED) called");
*out_state = State::None;
R_SUCCEED();
}
Result ISystemLocalCommunicationService::GetNetworkInfo(OutLargeData<NetworkInfo, BufferAttr_HipcPointer> out_network_info) {
LOG_WARNING(Service_LDN, "(STUBBED) called");
*out_network_info = NetworkInfo{};
R_SUCCEED();
}
Result ISystemLocalCommunicationService::GetIpv4Address(Out<Ipv4Address> out_address, Out<Ipv4Address> out_subnet_mask) {
LOG_WARNING(Service_LDN, "(STUBBED) called");
*out_address = Ipv4Address{0, 0, 0, 0};
*out_subnet_mask = Ipv4Address{255, 255, 255, 0};
R_SUCCEED();
}
Result ISystemLocalCommunicationService::GetDisconnectReason(Out<DisconnectReason> out_disconnect_reason) {
LOG_WARNING(Service_LDN, "(STUBBED) called");
*out_disconnect_reason = DisconnectReason::None;
R_SUCCEED();
}
Result ISystemLocalCommunicationService::GetSecurityParameter(Out<SecurityParameter> out_security_parameter) {
LOG_WARNING(Service_LDN, "(STUBBED) called");
*out_security_parameter = SecurityParameter{};
R_SUCCEED();
}
Result ISystemLocalCommunicationService::GetNetworkConfig(Out<NetworkConfig> out_network_config) {
LOG_WARNING(Service_LDN, "(STUBBED) called");
*out_network_config = NetworkConfig{};
R_SUCCEED();
}
Result ISystemLocalCommunicationService::AttachStateChangeEvent(OutCopyHandle<Kernel::KReadableEvent> out_event) {
LOG_WARNING(Service_LDN, "(STUBBED) called");
R_SUCCEED();
}
Result ISystemLocalCommunicationService::GetNetworkInfoLatestUpdate(
OutLargeData<NetworkInfo, BufferAttr_HipcPointer> out_network_info,
OutArray<NodeLatestUpdate, BufferAttr_HipcPointer> out_node_latest_update) {
LOG_WARNING(Service_LDN, "(STUBBED) called");
*out_network_info = NetworkInfo{};
R_SUCCEED();
}
Result ISystemLocalCommunicationService::Scan(Out<s16> network_count, WifiChannel channel,
const ScanFilter& scan_filter,
OutArray<NetworkInfo, BufferAttr_HipcAutoSelect> out_network_info) {
LOG_WARNING(Service_LDN, "(STUBBED) called, channel={}", channel);
*network_count = 0;
R_SUCCEED();
}
Result ISystemLocalCommunicationService::ScanPrivate(Out<s16> network_count, WifiChannel channel,
const ScanFilter& scan_filter,
OutArray<NetworkInfo, BufferAttr_HipcAutoSelect> out_network_info) {
LOG_WARNING(Service_LDN, "(STUBBED) called, channel={}", channel);
*network_count = 0;
R_SUCCEED();
}
Result ISystemLocalCommunicationService::SetWirelessControllerRestriction(WirelessControllerRestriction wireless_restriction) {
LOG_WARNING(Service_LDN, "(STUBBED) called");
R_SUCCEED();
}
Result ISystemLocalCommunicationService::OpenAccessPoint() {
LOG_WARNING(Service_LDN, "(STUBBED) called");
R_SUCCEED();
}
Result ISystemLocalCommunicationService::CloseAccessPoint() {
LOG_WARNING(Service_LDN, "(STUBBED) called");
R_SUCCEED();
}
Result ISystemLocalCommunicationService::CreateNetwork(const CreateNetworkConfig& create_config) {
LOG_WARNING(Service_LDN, "(STUBBED) called");
R_SUCCEED();
}
Result ISystemLocalCommunicationService::CreateNetworkPrivate(const CreateNetworkConfigPrivate& create_config,
InArray<AddressEntry, BufferAttr_HipcPointer> address_list) {
LOG_WARNING(Service_LDN, "(STUBBED) called");
R_SUCCEED();
}
Result ISystemLocalCommunicationService::DestroyNetwork() {
LOG_WARNING(Service_LDN, "(STUBBED) called");
R_SUCCEED();
}
Result ISystemLocalCommunicationService::Reject() {
LOG_WARNING(Service_LDN, "(STUBBED) called");
R_SUCCEED();
}
Result ISystemLocalCommunicationService::SetAdvertiseData(InBuffer<BufferAttr_HipcAutoSelect> buffer_data) {
LOG_WARNING(Service_LDN, "(STUBBED) called");
R_SUCCEED();
}
Result ISystemLocalCommunicationService::SetStationAcceptPolicy(AcceptPolicy accept_policy) {
LOG_WARNING(Service_LDN, "(STUBBED) called");
R_SUCCEED();
}
Result ISystemLocalCommunicationService::AddAcceptFilterEntry(MacAddress mac_address) {
LOG_WARNING(Service_LDN, "(STUBBED) called");
R_SUCCEED();
}
Result ISystemLocalCommunicationService::ClearAcceptFilter() {
LOG_WARNING(Service_LDN, "(STUBBED) called");
R_SUCCEED();
}
Result ISystemLocalCommunicationService::OpenStation() {
LOG_WARNING(Service_LDN, "(STUBBED) called");
R_SUCCEED();
}
Result ISystemLocalCommunicationService::CloseStation() {
LOG_WARNING(Service_LDN, "(STUBBED) called");
R_SUCCEED();
}
Result ISystemLocalCommunicationService::Connect(const ConnectNetworkData& connect_data,
InLargeData<NetworkInfo, BufferAttr_HipcPointer> network_info) {
LOG_WARNING(Service_LDN, "(STUBBED) called");
R_SUCCEED();
}
Result ISystemLocalCommunicationService::ConnectPrivate(const ConnectNetworkData& connect_data,
InLargeData<NetworkInfo, BufferAttr_HipcPointer> network_info) {
LOG_WARNING(Service_LDN, "(STUBBED) called");
R_SUCCEED();
}
Result ISystemLocalCommunicationService::Disconnect() {
LOG_WARNING(Service_LDN, "(STUBBED) called");
R_SUCCEED();
}
Result ISystemLocalCommunicationService::InitializeSystem(ClientProcessId aruid) {
LOG_WARNING(Service_LDN, "(STUBBED) called");
R_SUCCEED();
}
Result ISystemLocalCommunicationService::FinalizeSystem() {
LOG_WARNING(Service_LDN, "(STUBBED) called");
R_SUCCEED();
}
Result ISystemLocalCommunicationService::SetOperationMode(u32 mode) {
LOG_WARNING(Service_LDN, "(STUBBED) called, mode={}", mode);
R_SUCCEED();
}
Result ISystemLocalCommunicationService::InitializeSystem2() { Result ISystemLocalCommunicationService::InitializeSystem2() {
LOG_WARNING(Service_LDN, "(STUBBED) called"); LOG_WARNING(Service_LDN, "(STUBBED) called");
R_SUCCEED(); R_SUCCEED();

View File

@@ -1,15 +1,21 @@
// SPDX-FileCopyrightText: Copyright 2024 yuzu Emulator Project // SPDX-FileCopyrightText: Copyright 2024 yuzu Emulator Project
// SPDX-FileCopyrightText: Copyright 2025 citron Emulator Project
// SPDX-License-Identifier: GPL-3.0-or-later // SPDX-License-Identifier: GPL-3.0-or-later
#pragma once #pragma once
#include "core/hle/service/cmif_types.h" #include "core/hle/service/cmif_types.h"
#include "core/hle/service/ldn/ldn_types.h"
#include "core/hle/service/service.h" #include "core/hle/service/service.h"
namespace Core { namespace Core {
class System; class System;
} }
namespace Kernel {
class KReadableEvent;
}
namespace Service::LDN { namespace Service::LDN {
class ISystemLocalCommunicationService final class ISystemLocalCommunicationService final
@@ -19,6 +25,41 @@ public:
~ISystemLocalCommunicationService() override; ~ISystemLocalCommunicationService() override;
private: private:
Result GetState(Out<State> out_state);
Result GetNetworkInfo(OutLargeData<NetworkInfo, BufferAttr_HipcPointer> out_network_info);
Result GetIpv4Address(Out<Ipv4Address> out_address, Out<Ipv4Address> out_subnet_mask);
Result GetDisconnectReason(Out<DisconnectReason> out_disconnect_reason);
Result GetSecurityParameter(Out<SecurityParameter> out_security_parameter);
Result GetNetworkConfig(Out<NetworkConfig> out_network_config);
Result AttachStateChangeEvent(OutCopyHandle<Kernel::KReadableEvent> out_event);
Result GetNetworkInfoLatestUpdate(OutLargeData<NetworkInfo, BufferAttr_HipcPointer> out_network_info,
OutArray<NodeLatestUpdate, BufferAttr_HipcPointer> out_node_latest_update);
Result Scan(Out<s16> network_count, WifiChannel channel, const ScanFilter& scan_filter,
OutArray<NetworkInfo, BufferAttr_HipcAutoSelect> out_network_info);
Result ScanPrivate(Out<s16> network_count, WifiChannel channel, const ScanFilter& scan_filter,
OutArray<NetworkInfo, BufferAttr_HipcAutoSelect> out_network_info);
Result SetWirelessControllerRestriction(WirelessControllerRestriction wireless_restriction);
Result OpenAccessPoint();
Result CloseAccessPoint();
Result CreateNetwork(const CreateNetworkConfig& create_config);
Result CreateNetworkPrivate(const CreateNetworkConfigPrivate& create_config,
InArray<AddressEntry, BufferAttr_HipcPointer> address_list);
Result DestroyNetwork();
Result Reject();
Result SetAdvertiseData(InBuffer<BufferAttr_HipcAutoSelect> buffer_data);
Result SetStationAcceptPolicy(AcceptPolicy accept_policy);
Result AddAcceptFilterEntry(MacAddress mac_address);
Result ClearAcceptFilter();
Result OpenStation();
Result CloseStation();
Result Connect(const ConnectNetworkData& connect_data,
InLargeData<NetworkInfo, BufferAttr_HipcPointer> network_info);
Result ConnectPrivate(const ConnectNetworkData& connect_data,
InLargeData<NetworkInfo, BufferAttr_HipcPointer> network_info);
Result Disconnect();
Result InitializeSystem(ClientProcessId aruid);
Result FinalizeSystem();
Result SetOperationMode(u32 mode);
Result InitializeSystem2(); Result InitializeSystem2();
}; };

View File

@@ -1,4 +1,5 @@
// SPDX-FileCopyrightText: Copyright 2024 yuzu Emulator Project // SPDX-FileCopyrightText: Copyright 2024 yuzu Emulator Project
// SPDX-FileCopyrightText: Copyright 2025 citron Emulator Project
// SPDX-License-Identifier: GPL-3.0-or-later // SPDX-License-Identifier: GPL-3.0-or-later
#include <memory> #include <memory>
@@ -25,35 +26,35 @@ IUserLocalCommunicationService::IUserLocalCommunicationService(Core::System& sys
room_network{system_.GetRoomNetwork()}, lan_discovery{room_network} { room_network{system_.GetRoomNetwork()}, lan_discovery{room_network} {
// clang-format off // clang-format off
static const FunctionInfo functions[] = { static const FunctionInfo functions[] = {
{0, C<&IUserLocalCommunicationService::GetState>, "GetState"}, {0, D<&IUserLocalCommunicationService::GetState>, "GetState"},
{1, C<&IUserLocalCommunicationService::GetNetworkInfo>, "GetNetworkInfo"}, {1, D<&IUserLocalCommunicationService::GetNetworkInfo>, "GetNetworkInfo"},
{2, C<&IUserLocalCommunicationService::GetIpv4Address>, "GetIpv4Address"}, {2, D<&IUserLocalCommunicationService::GetIpv4Address>, "GetIpv4Address"},
{3, C<&IUserLocalCommunicationService::GetDisconnectReason>, "GetDisconnectReason"}, {3, D<&IUserLocalCommunicationService::GetDisconnectReason>, "GetDisconnectReason"},
{4, C<&IUserLocalCommunicationService::GetSecurityParameter>, "GetSecurityParameter"}, {4, D<&IUserLocalCommunicationService::GetSecurityParameter>, "GetSecurityParameter"},
{5, C<&IUserLocalCommunicationService::GetNetworkConfig>, "GetNetworkConfig"}, {5, D<&IUserLocalCommunicationService::GetNetworkConfig>, "GetNetworkConfig"},
{100, C<&IUserLocalCommunicationService::AttachStateChangeEvent>, "AttachStateChangeEvent"}, {100, D<&IUserLocalCommunicationService::AttachStateChangeEvent>, "AttachStateChangeEvent"},
{101, C<&IUserLocalCommunicationService::GetNetworkInfoLatestUpdate>, "GetNetworkInfoLatestUpdate"}, {101, D<&IUserLocalCommunicationService::GetNetworkInfoLatestUpdate>, "GetNetworkInfoLatestUpdate"},
{102, C<&IUserLocalCommunicationService::Scan>, "Scan"}, {102, D<&IUserLocalCommunicationService::Scan>, "Scan"},
{103, C<&IUserLocalCommunicationService::ScanPrivate>, "ScanPrivate"}, {103, D<&IUserLocalCommunicationService::ScanPrivate>, "ScanPrivate"},
{104, C<&IUserLocalCommunicationService::SetWirelessControllerRestriction>, "SetWirelessControllerRestriction"}, {104, D<&IUserLocalCommunicationService::SetWirelessControllerRestriction>, "SetWirelessControllerRestriction"},
{200, C<&IUserLocalCommunicationService::OpenAccessPoint>, "OpenAccessPoint"}, {200, D<&IUserLocalCommunicationService::OpenAccessPoint>, "OpenAccessPoint"},
{201, C<&IUserLocalCommunicationService::CloseAccessPoint>, "CloseAccessPoint"}, {201, D<&IUserLocalCommunicationService::CloseAccessPoint>, "CloseAccessPoint"},
{202, C<&IUserLocalCommunicationService::CreateNetwork>, "CreateNetwork"}, {202, D<&IUserLocalCommunicationService::CreateNetwork>, "CreateNetwork"},
{203, C<&IUserLocalCommunicationService::CreateNetworkPrivate>, "CreateNetworkPrivate"}, {203, D<&IUserLocalCommunicationService::CreateNetworkPrivate>, "CreateNetworkPrivate"},
{204, C<&IUserLocalCommunicationService::DestroyNetwork>, "DestroyNetwork"}, {204, D<&IUserLocalCommunicationService::DestroyNetwork>, "DestroyNetwork"},
{205, nullptr, "Reject"}, {205, nullptr, "Reject"},
{206, C<&IUserLocalCommunicationService::SetAdvertiseData>, "SetAdvertiseData"}, {206, D<&IUserLocalCommunicationService::SetAdvertiseData>, "SetAdvertiseData"},
{207, C<&IUserLocalCommunicationService::SetStationAcceptPolicy>, "SetStationAcceptPolicy"}, {207, D<&IUserLocalCommunicationService::SetStationAcceptPolicy>, "SetStationAcceptPolicy"},
{208, C<&IUserLocalCommunicationService::AddAcceptFilterEntry>, "AddAcceptFilterEntry"}, {208, D<&IUserLocalCommunicationService::AddAcceptFilterEntry>, "AddAcceptFilterEntry"},
{209, nullptr, "ClearAcceptFilter"}, {209, nullptr, "ClearAcceptFilter"},
{300, C<&IUserLocalCommunicationService::OpenStation>, "OpenStation"}, {300, D<&IUserLocalCommunicationService::OpenStation>, "OpenStation"},
{301, C<&IUserLocalCommunicationService::CloseStation>, "CloseStation"}, {301, D<&IUserLocalCommunicationService::CloseStation>, "CloseStation"},
{302, C<&IUserLocalCommunicationService::Connect>, "Connect"}, {302, D<&IUserLocalCommunicationService::Connect>, "Connect"},
{303, nullptr, "ConnectPrivate"}, {303, nullptr, "ConnectPrivate"},
{304, C<&IUserLocalCommunicationService::Disconnect>, "Disconnect"}, {304, D<&IUserLocalCommunicationService::Disconnect>, "Disconnect"},
{400, C<&IUserLocalCommunicationService::Initialize>, "Initialize"}, {400, D<&IUserLocalCommunicationService::Initialize>, "Initialize"},
{401, C<&IUserLocalCommunicationService::Finalize>, "Finalize"}, {401, D<&IUserLocalCommunicationService::Finalize>, "Finalize"},
{402, C<&IUserLocalCommunicationService::Initialize2>, "Initialize2"}, {402, D<&IUserLocalCommunicationService::Initialize2>, "Initialize2"},
}; };
// clang-format on // clang-format on