From a944f93f265dbbe3fa0ee8b245b2897ea3fee694 Mon Sep 17 00:00:00 2001 From: lizzie Date: Mon, 7 Sep 2026 20:03:46 +0000 Subject: [PATCH] 2026-09-07 20:03:46 Signed-off-by: lizzie --- ...rchical_integrity_verification_storage.cpp | 1 + src/core/hle/service/am/service/storage.cpp | 10 ++--- .../service/ldn/client_process_monitor.cpp | 27 ------------ .../hle/service/ldn/client_process_monitor.h | 25 ----------- src/core/hle/service/ldn/ldn.cpp | 24 +++++++++-- src/core/hle/service/ns/ns.cpp | 41 ++++++++++++++++++- .../ns/vulnerability_manager_interface.cpp | 31 -------------- .../ns/vulnerability_manager_interface.h | 21 ---------- src/core/hle/service/spl/csrng.cpp | 18 -------- src/core/hle/service/spl/csrng.h | 20 --------- src/core/hle/service/spl/spl_module.cpp | 13 +++++- 11 files changed, 79 insertions(+), 152 deletions(-) delete mode 100644 src/core/hle/service/ldn/client_process_monitor.cpp delete mode 100644 src/core/hle/service/ldn/client_process_monitor.h delete mode 100644 src/core/hle/service/ns/vulnerability_manager_interface.cpp delete mode 100644 src/core/hle/service/ns/vulnerability_manager_interface.h delete mode 100644 src/core/hle/service/spl/csrng.cpp delete mode 100644 src/core/hle/service/spl/csrng.h diff --git a/src/core/file_sys/fssystem/fssystem_hierarchical_integrity_verification_storage.cpp b/src/core/file_sys/fssystem/fssystem_hierarchical_integrity_verification_storage.cpp index 39bb7b8086..af647bd160 100644 --- a/src/core/file_sys/fssystem/fssystem_hierarchical_integrity_verification_storage.cpp +++ b/src/core/file_sys/fssystem/fssystem_hierarchical_integrity_verification_storage.cpp @@ -121,6 +121,7 @@ size_t HierarchicalIntegrityVerificationStorage::Read(u8* buffer, size_t size, } size_t HierarchicalIntegrityVerificationStorage::GetSize() const { + ASSERT(m_data_size >= 0); return m_data_size; } diff --git a/src/core/hle/service/am/service/storage.cpp b/src/core/hle/service/am/service/storage.cpp index 25ee0afbdb..5fe191bf2f 100644 --- a/src/core/hle/service/am/service/storage.cpp +++ b/src/core/hle/service/am/service/storage.cpp @@ -1,3 +1,6 @@ +// SPDX-FileCopyrightText: Copyright 2026 Eden Emulator Project +// SPDX-License-Identifier: GPL-3.0-or-later + // SPDX-FileCopyrightText: Copyright 2024 yuzu Emulator Project // SPDX-License-Identifier: GPL-2.0-or-later @@ -26,17 +29,14 @@ IStorage::~IStorage() = default; Result IStorage::Open(Out> out_storage_accessor) { LOG_DEBUG(Service_AM, "called"); - R_UNLESS(m_impl->GetHandle() == nullptr, AM::ResultInvalidStorageType); - *out_storage_accessor = std::make_shared(system, m_impl); R_SUCCEED(); } -Result IStorage::OpenTransferStorage( - Out> out_transfer_storage_accessor) { +Result IStorage::OpenTransferStorage(Out> out_transfer_storage_accessor) { + LOG_DEBUG(Service_AM, "called"); R_UNLESS(m_impl->GetHandle() != nullptr, AM::ResultInvalidStorageType); - *out_transfer_storage_accessor = std::make_shared(system, m_impl); R_SUCCEED(); } diff --git a/src/core/hle/service/ldn/client_process_monitor.cpp b/src/core/hle/service/ldn/client_process_monitor.cpp deleted file mode 100644 index 0c1963a4ca..0000000000 --- a/src/core/hle/service/ldn/client_process_monitor.cpp +++ /dev/null @@ -1,27 +0,0 @@ -// SPDX-FileCopyrightText: Copyright 2025 Eden Emulator Project -// SPDX-License-Identifier: GPL-3.0-or-later - -#include "core/hle/service/cmif_serialization.h" -#include "core/hle/service/ldn/ldn_results.h" -#include "core/hle/service/ldn/client_process_monitor.h" -#include "core/hle/service/ipc_helpers.h" - -namespace Service::LDN { - -IClientProcessMonitor::IClientProcessMonitor(Core::System& system_) - : ServiceFramework{system_, "IClientProcessMonitor"} { - static const FunctionInfo functions[] = { - {0, D<&IClientProcessMonitor::RegisterClient>, "RegisterClient"}, - }; - RegisterHandlers(functions); -} - -IClientProcessMonitor::~IClientProcessMonitor() = default; - -Result IClientProcessMonitor::RegisterClient() { - LOG_WARNING(Service_LDN, "(STUBBED) called"); - - R_SUCCEED(); -} - -} // namespace Service::LDN diff --git a/src/core/hle/service/ldn/client_process_monitor.h b/src/core/hle/service/ldn/client_process_monitor.h deleted file mode 100644 index 9caa337795..0000000000 --- a/src/core/hle/service/ldn/client_process_monitor.h +++ /dev/null @@ -1,25 +0,0 @@ -// SPDX-FileCopyrightText: Copyright 2025 Eden Emulator Project -// SPDX-License-Identifier: GPL-3.0-or-later - -#pragma once - -#include "core/hle/service/cmif_types.h" -#include "core/hle/service/service.h" - -namespace Core { -class System; -} - -namespace Service::LDN { - -class IClientProcessMonitor final - : public ServiceFramework { -public: - explicit IClientProcessMonitor(Core::System& system_); - ~IClientProcessMonitor() override; - -private: - Result RegisterClient(); -}; - -} // namespace Service::LDN diff --git a/src/core/hle/service/ldn/ldn.cpp b/src/core/hle/service/ldn/ldn.cpp index c77ae2911e..1a0165fd2e 100644 --- a/src/core/hle/service/ldn/ldn.cpp +++ b/src/core/hle/service/ldn/ldn.cpp @@ -1,4 +1,4 @@ -// SPDX-FileCopyrightText: Copyright 2025 Eden Emulator Project +// SPDX-FileCopyrightText: Copyright 2026 Eden Emulator Project // SPDX-License-Identifier: GPL-3.0-or-later // SPDX-FileCopyrightText: Copyright 2018 yuzu Emulator Project @@ -7,7 +7,6 @@ #include "core/core.h" #include "core/hle/service/cmif_serialization.h" #include "core/hle/service/ldn/ldn.h" -#include "core/hle/service/ldn/client_process_monitor.h" #include "core/hle/service/ldn/monitor_service.h" #include "core/hle/service/ldn/sf_monitor_service.h" #include "core/hle/service/ldn/sf_service.h" @@ -17,6 +16,26 @@ namespace Service::LDN { +class IClientProcessMonitor final + : public ServiceFramework { +public: + explicit 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() override = default; +private: + Result RegisterClient(ClientProcessId pid) { + LOG_WARNING(Service_LDN, "(STUBBED) called"); + R_SUCCEED(); + } +}; + class IMonitorServiceCreator final : public ServiceFramework { public: explicit IMonitorServiceCreator(Core::System& system_) : ServiceFramework{system_, "ldn:m"} { @@ -25,7 +44,6 @@ public: {0, C<&IMonitorServiceCreator::CreateMonitorService>, "CreateMonitorService"} }; // clang-format on - RegisterHandlers(functions); } diff --git a/src/core/hle/service/ns/ns.cpp b/src/core/hle/service/ns/ns.cpp index 4d6154404e..4e3915f684 100644 --- a/src/core/hle/service/ns/ns.cpp +++ b/src/core/hle/service/ns/ns.cpp @@ -10,7 +10,9 @@ #include "core/hle/service/ns/query_service.h" #include "core/hle/service/ns/service_getter_interface.h" #include "core/hle/service/ns/system_update_interface.h" -#include "core/hle/service/ns/vulnerability_manager_interface.h" +#include "core/hle/service/ipc_helpers.h" +#include "core/hle/service/cmif_serialization.h" +#include "core/hle/service/cmif_types.h" #include "core/hle/service/server_manager.h" namespace Service::NS { @@ -39,6 +41,43 @@ public: } }; +class IVulnerabilityManagerInterface final + : public ServiceFramework { +public: + explicit IVulnerabilityManagerInterface(Core::System& system_) + : ServiceFramework{system_, "ns:vm"} { + // clang-format off + static const FunctionInfo functions[] = { + {1200, D<&IVulnerabilityManagerInterface::NeedsUpdateVulnerability>, "NeedsUpdateVulnerability"}, + {1201, nullptr, "UpdateSafeSystemVersionForDebug"}, + {1202, nullptr, "GetSafeSystemVersion"}, + {3100, D<&IVulnerabilityManagerInterface::GetSafeSystemVersionCheckInfo>, "GetSafeSystemVersionCheckInfo"}, + {3101, nullptr, "RequestUpdateSafeSystemVersionCheckInfo"}, + {3102, D<&IVulnerabilityManagerInterface::ResetSafeSystemVersionCheckInfo>, "ResetSafeSystemVersionCheckInfo"}, + }; + // clang-format on + RegisterHandlers(functions); + } + ~IVulnerabilityManagerInterface() override = default; + + Result NeedsUpdateVulnerability(Out out_needs_update_vulnerability) { + LOG_WARNING(Service_NS, "(STUBBED)"); + *out_needs_update_vulnerability = false; + R_SUCCEED(); + } + + Result GetSafeSystemVersionCheckInfo(Out> out_system_version_check_info) { + LOG_WARNING(Service_NS, "(STUBBED)"); + *out_system_version_check_info = {}; + R_SUCCEED(); + } + + Result ResetSafeSystemVersionCheckInfo() { + LOG_WARNING(Service_NS, "(STUBBED)"); + R_SUCCEED(); + } +}; + void LoopProcess(Core::System& system) { auto server_manager = std::make_unique(system); diff --git a/src/core/hle/service/ns/vulnerability_manager_interface.cpp b/src/core/hle/service/ns/vulnerability_manager_interface.cpp deleted file mode 100644 index 69c21fb894..0000000000 --- a/src/core/hle/service/ns/vulnerability_manager_interface.cpp +++ /dev/null @@ -1,31 +0,0 @@ -// SPDX-FileCopyrightText: Copyright 2024 yuzu Emulator Project -// SPDX-License-Identifier: GPL-2.0-or-later - -#include "core/hle/service/cmif_serialization.h" -#include "core/hle/service/ns/vulnerability_manager_interface.h" - -namespace Service::NS { - -IVulnerabilityManagerInterface::IVulnerabilityManagerInterface(Core::System& system_) - : ServiceFramework{system_, "ns:vm"} { - // clang-format off - static const FunctionInfo functions[] = { - {1200, D<&IVulnerabilityManagerInterface::NeedsUpdateVulnerability>, "NeedsUpdateVulnerability"}, - {1201, nullptr, "UpdateSafeSystemVersionForDebug"}, - {1202, nullptr, "GetSafeSystemVersion"}, - }; - // clang-format on - - RegisterHandlers(functions); -} - -IVulnerabilityManagerInterface::~IVulnerabilityManagerInterface() = default; - -Result IVulnerabilityManagerInterface::NeedsUpdateVulnerability( - Out out_needs_update_vulnerability) { - LOG_WARNING(Service_NS, "(STUBBED) called"); - *out_needs_update_vulnerability = false; - R_SUCCEED(); -} - -} // namespace Service::NS diff --git a/src/core/hle/service/ns/vulnerability_manager_interface.h b/src/core/hle/service/ns/vulnerability_manager_interface.h deleted file mode 100644 index c689cf7ece..0000000000 --- a/src/core/hle/service/ns/vulnerability_manager_interface.h +++ /dev/null @@ -1,21 +0,0 @@ -// SPDX-FileCopyrightText: Copyright 2024 yuzu Emulator Project -// SPDX-License-Identifier: GPL-2.0-or-later - -#pragma once - -#include "core/hle/service/cmif_types.h" -#include "core/hle/service/service.h" - -namespace Service::NS { - -class IVulnerabilityManagerInterface final - : public ServiceFramework { -public: - explicit IVulnerabilityManagerInterface(Core::System& system_); - ~IVulnerabilityManagerInterface() override; - -private: - Result NeedsUpdateVulnerability(Out out_needs_update_vulnerability); -}; - -} // namespace Service::NS diff --git a/src/core/hle/service/spl/csrng.cpp b/src/core/hle/service/spl/csrng.cpp deleted file mode 100644 index ca121fb054..0000000000 --- a/src/core/hle/service/spl/csrng.cpp +++ /dev/null @@ -1,18 +0,0 @@ -// SPDX-FileCopyrightText: Copyright 2018 yuzu Emulator Project -// SPDX-License-Identifier: GPL-2.0-or-later - -#include "core/hle/service/spl/csrng.h" - -namespace Service::SPL { - -CSRNG::CSRNG(Core::System& system_, std::shared_ptr module_) - : Interface(system_, std::move(module_), "csrng") { - static const FunctionInfo functions[] = { - {0, &CSRNG::GenerateRandomBytes, "GenerateRandomBytes"}, - }; - RegisterHandlers(functions); -} - -CSRNG::~CSRNG() = default; - -} // namespace Service::SPL diff --git a/src/core/hle/service/spl/csrng.h b/src/core/hle/service/spl/csrng.h deleted file mode 100644 index b337a82816..0000000000 --- a/src/core/hle/service/spl/csrng.h +++ /dev/null @@ -1,20 +0,0 @@ -// SPDX-FileCopyrightText: Copyright 2018 yuzu Emulator Project -// SPDX-License-Identifier: GPL-2.0-or-later - -#pragma once - -#include "core/hle/service/spl/spl_module.h" - -namespace Core { -class System; -} - -namespace Service::SPL { - -class CSRNG final : public Module::Interface { -public: - explicit CSRNG(Core::System& system_, std::shared_ptr module_); - ~CSRNG() override; -}; - -} // namespace Service::SPL diff --git a/src/core/hle/service/spl/spl_module.cpp b/src/core/hle/service/spl/spl_module.cpp index d62cecf9a2..520cb1860b 100644 --- a/src/core/hle/service/spl/spl_module.cpp +++ b/src/core/hle/service/spl/spl_module.cpp @@ -13,7 +13,6 @@ #include "core/hle/api_version.h" #include "core/hle/service/ipc_helpers.h" #include "core/hle/service/server_manager.h" -#include "core/hle/service/spl/csrng.h" #include "core/hle/service/spl/spl.h" #include "core/hle/service/spl/spl_module.h" @@ -203,6 +202,18 @@ Result Module::Interface::GetConfigImpl(u64* out_config, ConfigItem config_item) } } +class CSRNG final : public Module::Interface { +public: + explicit CSRNG(Core::System& system_, std::shared_ptr module_) + : Interface(system_, std::move(module_), "csrng") { + static const FunctionInfo functions[] = { + {0, &CSRNG::GenerateRandomBytes, "GenerateRandomBytes"}, + }; + RegisterHandlers(functions); + } + ~CSRNG() override = default; +}; + void LoopProcess(Core::System& system) { auto server_manager = std::make_unique(system); auto module = std::make_shared();