From db625441a14dfd64be9ccb77e19835fad634985d Mon Sep 17 00:00:00 2001 From: lizzie Date: Sat, 26 Sep 2026 07:29:31 +0000 Subject: [PATCH] 2026-09-26 07:29:31 Signed-off-by: lizzie --- .../am/service/application_proxy_service.cpp | 4 ---- .../am/service/application_proxy_service.h | 6 +++++ .../am/service/library_applet_creator.cpp | 10 --------- .../am/service/library_applet_creator.h | 14 +++++++++++- src/core/hle/service/apm/apm_interface.cpp | 6 ----- src/core/hle/service/apm/apm_interface.h | 8 +++++++ .../audio/final_output_recorder_manager.cpp | 4 ---- .../audio/final_output_recorder_manager.h | 7 ++++++ .../service/bcat/news/news_data_service.cpp | 8 ------- .../hle/service/bcat/news/news_data_service.h | 10 +++++++++ .../bcat/news/news_database_service.cpp | 10 --------- .../service/bcat/news/news_database_service.h | 13 +++++++++++ src/core/hle/service/fatal/fatal_p.cpp | 5 ----- src/core/hle/service/fatal/fatal_p.h | 8 +++++++ .../service/filesystem/fsp/fs_i_directory.cpp | 5 ----- .../service/filesystem/fsp/fs_i_directory.h | 8 +++++++ .../filesystem/fsp/fs_i_filesystem.cpp | 20 ----------------- .../service/filesystem/fsp/fs_i_filesystem.h | 22 +++++++++++++++++++ .../fsp/fs_i_multi_commit_manager.cpp | 5 ----- .../fsp/fs_i_multi_commit_manager.h | 7 ++++++ .../fsp/fs_i_save_data_info_reader.cpp | 5 ----- .../fsp/fs_i_save_data_info_reader.h | 6 +++++ .../service/filesystem/fsp/fs_i_storage.cpp | 9 -------- .../hle/service/filesystem/fsp/fs_i_storage.h | 15 +++++++++++-- .../hle/service/friend/friend_interface.cpp | 6 ----- .../hle/service/friend/friend_interface.h | 9 ++++++++ src/core/hle/service/hid/applet_resource.cpp | 4 ---- src/core/hle/service/hid/applet_resource.h | 6 +++++ .../hle/service/nvdrv/nvdrv_interface.cpp | 18 --------------- src/core/hle/service/nvdrv/nvdrv_interface.h | 21 +++++++++++++++++- src/core/hle/service/nvdrv/nvmemp.cpp | 5 ----- src/core/hle/service/nvdrv/nvmemp.h | 8 +++++++ .../service/nvnflinger/hos_binder_driver.cpp | 7 ------ .../service/nvnflinger/hos_binder_driver.h | 9 ++++++++ .../pctl/parental_control_service_factory.cpp | 6 ----- .../pctl/parental_control_service_factory.h | 7 ++++++ src/core/hle/service/sockets/sfdnsres.cpp | 19 ---------------- src/core/hle/service/sockets/sfdnsres.h | 22 +++++++++++++++++++ .../service/vi/application_root_service.cpp | 5 ----- .../hle/service/vi/application_root_service.h | 7 ++++++ .../hle/service/vi/manager_root_service.cpp | 9 -------- .../hle/service/vi/manager_root_service.h | 11 ++++++++++ 42 files changed, 220 insertions(+), 174 deletions(-) diff --git a/src/core/hle/service/am/service/application_proxy_service.cpp b/src/core/hle/service/am/service/application_proxy_service.cpp index b7d7b3c2d9..bc6703be7d 100644 --- a/src/core/hle/service/am/service/application_proxy_service.cpp +++ b/src/core/hle/service/am/service/application_proxy_service.cpp @@ -14,10 +14,6 @@ namespace Service::AM { IApplicationProxyService::IApplicationProxyService(Core::System& system_, WindowSystem& window_system) : ServiceFramework{system_, "appletOE"}, m_window_system{window_system} { - static const FunctionInfo functions[] = { - {0, D<&IApplicationProxyService::OpenApplicationProxy>, "OpenApplicationProxy"}, - }; - RegisterHandlers(functions); } IApplicationProxyService::~IApplicationProxyService() = default; diff --git a/src/core/hle/service/am/service/application_proxy_service.h b/src/core/hle/service/am/service/application_proxy_service.h index e5f4ea345b..5962e97afa 100644 --- a/src/core/hle/service/am/service/application_proxy_service.h +++ b/src/core/hle/service/am/service/application_proxy_service.h @@ -26,6 +26,12 @@ private: private: std::shared_ptr GetAppletFromProcessId(ProcessId pid); + FunctionInfoBase const* FindRequest(u32 key) override { + return HandlerTableGenerateWithFind(key, functions); + } + static constexpr auto functions = CreateStaticMap( + {0, D<&IApplicationProxyService::OpenApplicationProxy>, "OpenApplicationProxy"} + ); WindowSystem& m_window_system; }; diff --git a/src/core/hle/service/am/service/library_applet_creator.cpp b/src/core/hle/service/am/service/library_applet_creator.cpp index 4ee92908b5..f9a317e09e 100644 --- a/src/core/hle/service/am/service/library_applet_creator.cpp +++ b/src/core/hle/service/am/service/library_applet_creator.cpp @@ -164,16 +164,6 @@ ILibraryAppletCreator::ILibraryAppletCreator(Core::System& system_, std::shared_ WindowSystem& window_system) : ServiceFramework{system_, "ILibraryAppletCreator"}, m_window_system{window_system}, m_applet{std::move(applet)} { - static const FunctionInfo functions[] = { - {0, D<&ILibraryAppletCreator::CreateLibraryApplet>, "CreateLibraryApplet"}, - {1, nullptr, "TerminateAllLibraryApplets"}, - {2, nullptr, "AreAnyLibraryAppletsLeft"}, - {3, D<&ILibraryAppletCreator::CreateLibraryAppletEx>, "CreateLibraryAppletEx"}, - {10, D<&ILibraryAppletCreator::CreateStorage>, "CreateStorage"}, - {11, D<&ILibraryAppletCreator::CreateTransferMemoryStorage>, "CreateTransferMemoryStorage"}, - {12, D<&ILibraryAppletCreator::CreateHandleStorage>, "CreateHandleStorage"}, - }; - RegisterHandlers(functions); } ILibraryAppletCreator::~ILibraryAppletCreator() = default; diff --git a/src/core/hle/service/am/service/library_applet_creator.h b/src/core/hle/service/am/service/library_applet_creator.h index 34e7586e8f..3e0cf0bc93 100644 --- a/src/core/hle/service/am/service/library_applet_creator.h +++ b/src/core/hle/service/am/service/library_applet_creator.h @@ -35,8 +35,20 @@ private: Out> out_storage, bool is_writable, s64 size, InCopyHandle transfer_memory_handle); Result CreateHandleStorage(Out> out_storage, s64 size, - InCopyHandle transfer_memory_handle); + InCopyHandle transfer_memory_handle); + FunctionInfoBase const* FindRequest(u32 key) override { + return HandlerTableGenerateWithFind(key, functions); + } + static constexpr auto functions = CreateStaticMap( + {0, D<&ILibraryAppletCreator::CreateLibraryApplet>, "CreateLibraryApplet"}, + {1, nullptr, "TerminateAllLibraryApplets"}, + {2, nullptr, "AreAnyLibraryAppletsLeft"}, + {3, D<&ILibraryAppletCreator::CreateLibraryAppletEx>, "CreateLibraryAppletEx"}, + {10, D<&ILibraryAppletCreator::CreateStorage>, "CreateStorage"}, + {11, D<&ILibraryAppletCreator::CreateTransferMemoryStorage>, "CreateTransferMemoryStorage"}, + {12, D<&ILibraryAppletCreator::CreateHandleStorage>, "CreateHandleStorage"} + ); WindowSystem& m_window_system; const std::shared_ptr m_applet; }; diff --git a/src/core/hle/service/apm/apm_interface.cpp b/src/core/hle/service/apm/apm_interface.cpp index 480ac3e229..2ed65c55d1 100644 --- a/src/core/hle/service/apm/apm_interface.cpp +++ b/src/core/hle/service/apm/apm_interface.cpp @@ -67,12 +67,6 @@ private: APM::APM(Core::System& system_, std::shared_ptr apm_, Controller& controller_, const char* name) : ServiceFramework{system_, name}, apm(std::move(apm_)), controller{controller_} { - static const FunctionInfo functions[] = { - {0, &APM::OpenSession, "OpenSession"}, - {1, &APM::GetPerformanceMode, "GetPerformanceMode"}, - {6, &APM::IsCpuOverclockEnabled, "IsCpuOverclockEnabled"}, - }; - RegisterHandlers(functions); } APM::~APM() = default; diff --git a/src/core/hle/service/apm/apm_interface.h b/src/core/hle/service/apm/apm_interface.h index 58718453b6..1303e4fc5b 100644 --- a/src/core/hle/service/apm/apm_interface.h +++ b/src/core/hle/service/apm/apm_interface.h @@ -21,6 +21,14 @@ private: void GetPerformanceMode(HLERequestContext& ctx); void IsCpuOverclockEnabled(HLERequestContext& ctx); + FunctionInfoBase const* FindRequest(u32 key) override { + return HandlerTableGenerateWithFind(key, functions); + } + static constexpr auto functions = CreateStaticMap( + {0, &APM::OpenSession, "OpenSession"}, + {1, &APM::GetPerformanceMode, "GetPerformanceMode"}, + {6, &APM::IsCpuOverclockEnabled, "IsCpuOverclockEnabled"} + ); std::shared_ptr apm; Controller& controller; }; diff --git a/src/core/hle/service/audio/final_output_recorder_manager.cpp b/src/core/hle/service/audio/final_output_recorder_manager.cpp index fea2daad2a..32951eecdb 100644 --- a/src/core/hle/service/audio/final_output_recorder_manager.cpp +++ b/src/core/hle/service/audio/final_output_recorder_manager.cpp @@ -34,10 +34,6 @@ public: IFinalOutputRecorderManager::IFinalOutputRecorderManager(Core::System& system_) : ServiceFramework{system_, "audrec:u"} { - static const FunctionInfo functions[] = { - {0, nullptr, "OpenFinalOutputRecorder"}, - }; - RegisterHandlers(functions); } IFinalOutputRecorderManager::~IFinalOutputRecorderManager() = default; diff --git a/src/core/hle/service/audio/final_output_recorder_manager.h b/src/core/hle/service/audio/final_output_recorder_manager.h index 0663b894e7..43ff834fba 100644 --- a/src/core/hle/service/audio/final_output_recorder_manager.h +++ b/src/core/hle/service/audio/final_output_recorder_manager.h @@ -15,6 +15,13 @@ class IFinalOutputRecorderManager final : public ServiceFramework buf) { INewsDataService::INewsDataService(Core::System& system_) : ServiceFramework{system_, "INewsDataService"} { - static const FunctionInfo functions[] = { - {0, D<&INewsDataService::Open>, "Open"}, - {1, D<&INewsDataService::OpenWithNewsRecordV1>, "OpenWithNewsRecordV1"}, - {2, D<&INewsDataService::Read>, "Read"}, - {3, D<&INewsDataService::GetSize>, "GetSize"}, - {1001, D<&INewsDataService::OpenWithNewsRecord>, "OpenWithNewsRecord"}, - }; - RegisterHandlers(functions); } INewsDataService::~INewsDataService() = default; diff --git a/src/core/hle/service/bcat/news/news_data_service.h b/src/core/hle/service/bcat/news/news_data_service.h index 8f5e031701..52ea221d5f 100644 --- a/src/core/hle/service/bcat/news/news_data_service.h +++ b/src/core/hle/service/bcat/news/news_data_service.h @@ -31,6 +31,16 @@ private: Result Read(Out out_size, s64 offset, OutBuffer out_buffer); Result GetSize(Out out_size); + FunctionInfoBase const* FindRequest(u32 key) override { + return HandlerTableGenerateWithFind(key, functions); + } + static constexpr auto functions = CreateStaticMap( + {0, D<&INewsDataService::Open>, "Open"}, + {1, D<&INewsDataService::OpenWithNewsRecordV1>, "OpenWithNewsRecordV1"}, + {2, D<&INewsDataService::Read>, "Read"}, + {3, D<&INewsDataService::GetSize>, "GetSize"}, + {1001, D<&INewsDataService::OpenWithNewsRecord>, "OpenWithNewsRecord"} + ); std::vector opened_payload; }; diff --git a/src/core/hle/service/bcat/news/news_database_service.cpp b/src/core/hle/service/bcat/news/news_database_service.cpp index 3580ceb0f7..27201f251b 100644 --- a/src/core/hle/service/bcat/news/news_database_service.cpp +++ b/src/core/hle/service/bcat/news/news_database_service.cpp @@ -47,16 +47,6 @@ bool UpdateField(NewsRecord& rec, std::string_view column, s32 value, bool addit INewsDatabaseService::INewsDatabaseService(Core::System& system_) : ServiceFramework{system_, "INewsDatabaseService"} { - static const FunctionInfo functions[] = { - {0, D<&INewsDatabaseService::GetListV1>, "GetListV1"}, - {1, D<&INewsDatabaseService::Count>, "Count"}, - {2, D<&INewsDatabaseService::CountWithKey>, "CountWithKey"}, - {3, D<&INewsDatabaseService::UpdateIntegerValue>, "UpdateIntegerValue"}, - {4, D<&INewsDatabaseService::UpdateIntegerValueWithAddition>, "UpdateIntegerValueWithAddition"}, - {5, D<&INewsDatabaseService::UpdateStringValue>, "UpdateStringValue"}, - {1000, D<&INewsDatabaseService::GetList>, "GetList"}, - }; - RegisterHandlers(functions); } INewsDatabaseService::~INewsDatabaseService() = default; diff --git a/src/core/hle/service/bcat/news/news_database_service.h b/src/core/hle/service/bcat/news/news_database_service.h index 143864e80e..15f079cc43 100644 --- a/src/core/hle/service/bcat/news/news_database_service.h +++ b/src/core/hle/service/bcat/news/news_database_service.h @@ -49,6 +49,19 @@ private: InBuffer where_phrase, InBuffer order_by_phrase, s32 offset); + + FunctionInfoBase const* FindRequest(u32 key) override { + return HandlerTableGenerateWithFind(key, functions); + } + static constexpr auto functions = CreateStaticMap( + {0, D<&INewsDatabaseService::GetListV1>, "GetListV1"}, + {1, D<&INewsDatabaseService::Count>, "Count"}, + {2, D<&INewsDatabaseService::CountWithKey>, "CountWithKey"}, + {3, D<&INewsDatabaseService::UpdateIntegerValue>, "UpdateIntegerValue"}, + {4, D<&INewsDatabaseService::UpdateIntegerValueWithAddition>, "UpdateIntegerValueWithAddition"}, + {5, D<&INewsDatabaseService::UpdateStringValue>, "UpdateStringValue"}, + {1000, D<&INewsDatabaseService::GetList>, "GetList"} + ); }; } // namespace Service::News diff --git a/src/core/hle/service/fatal/fatal_p.cpp b/src/core/hle/service/fatal/fatal_p.cpp index 4a81bb5e2f..77e451c4e1 100644 --- a/src/core/hle/service/fatal/fatal_p.cpp +++ b/src/core/hle/service/fatal/fatal_p.cpp @@ -7,11 +7,6 @@ namespace Service::Fatal { Fatal_P::Fatal_P(std::shared_ptr module_, Core::System& system_) : Interface(std::move(module_), system_, "fatal:p") { - static const FunctionInfo functions[] = { - {0, nullptr, "GetFatalEvent"}, - {10, nullptr, "GetFatalContext"}, - }; - RegisterHandlers(functions); } Fatal_P::~Fatal_P() = default; diff --git a/src/core/hle/service/fatal/fatal_p.h b/src/core/hle/service/fatal/fatal_p.h index f743368350..3b5485a0da 100644 --- a/src/core/hle/service/fatal/fatal_p.h +++ b/src/core/hle/service/fatal/fatal_p.h @@ -11,6 +11,14 @@ class Fatal_P final : public Module::Interface { public: explicit Fatal_P(std::shared_ptr module_, Core::System& system_); ~Fatal_P() override; + + FunctionInfoBase const* FindRequest(u32 key) override { + return HandlerTableGenerateWithFind(key, functions); + } + static constexpr auto functions = CreateStaticMap( + {0, nullptr, "GetFatalEvent"}, + {10, nullptr, "GetFatalContext"} + ); }; } // namespace Service::Fatal diff --git a/src/core/hle/service/filesystem/fsp/fs_i_directory.cpp b/src/core/hle/service/filesystem/fsp/fs_i_directory.cpp index 8483394d0c..7f8a4375ef 100644 --- a/src/core/hle/service/filesystem/fsp/fs_i_directory.cpp +++ b/src/core/hle/service/filesystem/fsp/fs_i_directory.cpp @@ -12,11 +12,6 @@ IDirectory::IDirectory(Core::System& system_, FileSys::VirtualDir directory_, FileSys::OpenDirectoryMode mode) : ServiceFramework{system_, "IDirectory"}, backend(std::make_unique(directory_, mode)) { - static const FunctionInfo functions[] = { - {0, D<&IDirectory::Read>, "Read"}, - {1, D<&IDirectory::GetEntryCount>, "GetEntryCount"}, - }; - RegisterHandlers(functions); } Result IDirectory::Read( diff --git a/src/core/hle/service/filesystem/fsp/fs_i_directory.h b/src/core/hle/service/filesystem/fsp/fs_i_directory.h index b6251f7fdb..af6a2e86e3 100644 --- a/src/core/hle/service/filesystem/fsp/fs_i_directory.h +++ b/src/core/hle/service/filesystem/fsp/fs_i_directory.h @@ -26,6 +26,14 @@ private: Result Read(Out out_count, const OutArray out_entries); Result GetEntryCount(Out out_count); + + FunctionInfoBase const* FindRequest(u32 key) override { + return HandlerTableGenerateWithFind(key, functions); + } + static constexpr auto functions = CreateStaticMap( + {0, D<&IDirectory::Read>, "Read"}, + {1, D<&IDirectory::GetEntryCount>, "GetEntryCount"} + ); }; } // namespace Service::FileSystem diff --git a/src/core/hle/service/filesystem/fsp/fs_i_filesystem.cpp b/src/core/hle/service/filesystem/fsp/fs_i_filesystem.cpp index edd381f57c..16eb817be7 100644 --- a/src/core/hle/service/filesystem/fsp/fs_i_filesystem.cpp +++ b/src/core/hle/service/filesystem/fsp/fs_i_filesystem.cpp @@ -17,26 +17,6 @@ IFileSystem::IFileSystem(Core::System& system_, FileSys::VirtualDir dir_, SizeGe : ServiceFramework{system_, "IFileSystem"}, backend{std::make_unique( dir_)}, size_getter{std::move(size_getter_)} { - static const FunctionInfo functions[] = { - {0, D<&IFileSystem::CreateFile>, "CreateFile"}, - {1, D<&IFileSystem::DeleteFile>, "DeleteFile"}, - {2, D<&IFileSystem::CreateDirectory>, "CreateDirectory"}, - {3, D<&IFileSystem::DeleteDirectory>, "DeleteDirectory"}, - {4, D<&IFileSystem::DeleteDirectoryRecursively>, "DeleteDirectoryRecursively"}, - {5, D<&IFileSystem::RenameFile>, "RenameFile"}, - {6, D<&IFileSystem::RenameDirectory>, "RenameDirectory"}, - {7, D<&IFileSystem::GetEntryType>, "GetEntryType"}, - {8, D<&IFileSystem::OpenFile>, "OpenFile"}, - {9, D<&IFileSystem::OpenDirectory>, "OpenDirectory"}, - {10, D<&IFileSystem::Commit>, "Commit"}, - {11, D<&IFileSystem::GetFreeSpaceSize>, "GetFreeSpaceSize"}, - {12, D<&IFileSystem::GetTotalSpaceSize>, "GetTotalSpaceSize"}, - {13, D<&IFileSystem::CleanDirectoryRecursively>, "CleanDirectoryRecursively"}, - {14, D<&IFileSystem::GetFileTimeStampRaw>, "GetFileTimeStampRaw"}, - {15, nullptr, "QueryEntry"}, - {16, D<&IFileSystem::GetFileSystemAttribute>, "GetFileSystemAttribute"}, - }; - RegisterHandlers(functions); } Result IFileSystem::CreateFile(const InLargeData path, diff --git a/src/core/hle/service/filesystem/fsp/fs_i_filesystem.h b/src/core/hle/service/filesystem/fsp/fs_i_filesystem.h index ed03c3ef83..31c1eed7f2 100644 --- a/src/core/hle/service/filesystem/fsp/fs_i_filesystem.h +++ b/src/core/hle/service/filesystem/fsp/fs_i_filesystem.h @@ -58,6 +58,28 @@ public: Result GetFileSystemAttribute(Out out_attribute); private: + FunctionInfoBase const* FindRequest(u32 key) override { + return HandlerTableGenerateWithFind(key, functions); + } + static constexpr auto functions = CreateStaticMap( + {0, D<&IFileSystem::CreateFile>, "CreateFile"}, + {1, D<&IFileSystem::DeleteFile>, "DeleteFile"}, + {2, D<&IFileSystem::CreateDirectory>, "CreateDirectory"}, + {3, D<&IFileSystem::DeleteDirectory>, "DeleteDirectory"}, + {4, D<&IFileSystem::DeleteDirectoryRecursively>, "DeleteDirectoryRecursively"}, + {5, D<&IFileSystem::RenameFile>, "RenameFile"}, + {6, D<&IFileSystem::RenameDirectory>, "RenameDirectory"}, + {7, D<&IFileSystem::GetEntryType>, "GetEntryType"}, + {8, D<&IFileSystem::OpenFile>, "OpenFile"}, + {9, D<&IFileSystem::OpenDirectory>, "OpenDirectory"}, + {10, D<&IFileSystem::Commit>, "Commit"}, + {11, D<&IFileSystem::GetFreeSpaceSize>, "GetFreeSpaceSize"}, + {12, D<&IFileSystem::GetTotalSpaceSize>, "GetTotalSpaceSize"}, + {13, D<&IFileSystem::CleanDirectoryRecursively>, "CleanDirectoryRecursively"}, + {14, D<&IFileSystem::GetFileTimeStampRaw>, "GetFileTimeStampRaw"}, + {15, nullptr, "QueryEntry"}, + {16, D<&IFileSystem::GetFileSystemAttribute>, "GetFileSystemAttribute"} + ); std::unique_ptr backend; SizeGetter size_getter; }; diff --git a/src/core/hle/service/filesystem/fsp/fs_i_multi_commit_manager.cpp b/src/core/hle/service/filesystem/fsp/fs_i_multi_commit_manager.cpp index 6263282344..a1cd2ed2ac 100644 --- a/src/core/hle/service/filesystem/fsp/fs_i_multi_commit_manager.cpp +++ b/src/core/hle/service/filesystem/fsp/fs_i_multi_commit_manager.cpp @@ -9,11 +9,6 @@ namespace Service::FileSystem { IMultiCommitManager::IMultiCommitManager(Core::System& system_) : ServiceFramework{system_, "IMultiCommitManager"} { - static const FunctionInfo functions[] = { - {1, D<&IMultiCommitManager::Add>, "Add"}, - {2, D<&IMultiCommitManager::Commit>, "Commit"}, - }; - RegisterHandlers(functions); } IMultiCommitManager::~IMultiCommitManager() = default; diff --git a/src/core/hle/service/filesystem/fsp/fs_i_multi_commit_manager.h b/src/core/hle/service/filesystem/fsp/fs_i_multi_commit_manager.h index 8ebf7c7d96..a8b8753d27 100644 --- a/src/core/hle/service/filesystem/fsp/fs_i_multi_commit_manager.h +++ b/src/core/hle/service/filesystem/fsp/fs_i_multi_commit_manager.h @@ -17,6 +17,13 @@ private: Result Add(std::shared_ptr filesystem); Result Commit(); + FunctionInfoBase const* FindRequest(u32 key) override { + return HandlerTableGenerateWithFind(key, functions); + } + static constexpr auto functions = CreateStaticMap( + {1, D<&IMultiCommitManager::Add>, "Add"}, + {2, D<&IMultiCommitManager::Commit>, "Commit"} + ); FileSys::VirtualFile backend; }; diff --git a/src/core/hle/service/filesystem/fsp/fs_i_save_data_info_reader.cpp b/src/core/hle/service/filesystem/fsp/fs_i_save_data_info_reader.cpp index 495b131df4..f7fba50ae7 100644 --- a/src/core/hle/service/filesystem/fsp/fs_i_save_data_info_reader.cpp +++ b/src/core/hle/service/filesystem/fsp/fs_i_save_data_info_reader.cpp @@ -17,11 +17,6 @@ ISaveDataInfoReader::ISaveDataInfoReader(Core::System& system_, FileSys::SaveDataSpaceId space) : ServiceFramework{system_, "ISaveDataInfoReader"}, save_data_controller{ save_data_controller_} { - static const FunctionInfo functions[] = { - {0, D<&ISaveDataInfoReader::ReadSaveDataInfo>, "ReadSaveDataInfo"}, - }; - RegisterHandlers(functions); - FindAllSaves(space); } diff --git a/src/core/hle/service/filesystem/fsp/fs_i_save_data_info_reader.h b/src/core/hle/service/filesystem/fsp/fs_i_save_data_info_reader.h index e45ad852ba..26f1d15045 100644 --- a/src/core/hle/service/filesystem/fsp/fs_i_save_data_info_reader.h +++ b/src/core/hle/service/filesystem/fsp/fs_i_save_data_info_reader.h @@ -42,6 +42,12 @@ private: void FindNormalSaves(FileSys::SaveDataSpaceId space, const FileSys::VirtualDir& type); void FindTemporaryStorageSaves(FileSys::SaveDataSpaceId space, const FileSys::VirtualDir& type); + FunctionInfoBase const* FindRequest(u32 key) override { + return HandlerTableGenerateWithFind(key, functions); + } + static constexpr auto functions = CreateStaticMap( + {0, D<&ISaveDataInfoReader::ReadSaveDataInfo>, "ReadSaveDataInfo"} + ); std::shared_ptr save_data_controller; std::vector info; u64 next_entry_index = 0; diff --git a/src/core/hle/service/filesystem/fsp/fs_i_storage.cpp b/src/core/hle/service/filesystem/fsp/fs_i_storage.cpp index 50b7d1e765..ac884b3b28 100644 --- a/src/core/hle/service/filesystem/fsp/fs_i_storage.cpp +++ b/src/core/hle/service/filesystem/fsp/fs_i_storage.cpp @@ -12,15 +12,6 @@ namespace Service::FileSystem { IStorage::IStorage(Core::System& system_, FileSys::VirtualFile backend_) : ServiceFramework{system_, "IStorage"}, backend(std::move(backend_)) { - static const FunctionInfo functions[] = { - {0, D<&IStorage::Read>, "Read"}, - {1, nullptr, "Write"}, - {2, nullptr, "Flush"}, - {3, nullptr, "SetSize"}, - {4, D<&IStorage::GetSize>, "GetSize"}, - {5, nullptr, "OperateRange"}, - }; - RegisterHandlers(functions); } Result IStorage::Read( diff --git a/src/core/hle/service/filesystem/fsp/fs_i_storage.h b/src/core/hle/service/filesystem/fsp/fs_i_storage.h index 74d879386f..fbe8e9a4cb 100644 --- a/src/core/hle/service/filesystem/fsp/fs_i_storage.h +++ b/src/core/hle/service/filesystem/fsp/fs_i_storage.h @@ -15,12 +15,23 @@ public: explicit IStorage(Core::System& system_, FileSys::VirtualFile backend_); private: - FileSys::VirtualFile backend; - Result Read( OutBuffer out_bytes, s64 offset, s64 length); Result GetSize(Out out_size); + + FunctionInfoBase const* FindRequest(u32 key) override { + return HandlerTableGenerateWithFind(key, functions); + } + static constexpr auto functions = CreateStaticMap( + {0, D<&IStorage::Read>, "Read"}, + {1, nullptr, "Write"}, + {2, nullptr, "Flush"}, + {3, nullptr, "SetSize"}, + {4, D<&IStorage::GetSize>, "GetSize"}, + {5, nullptr, "OperateRange"} + ); + FileSys::VirtualFile backend; }; } // namespace Service::FileSystem diff --git a/src/core/hle/service/friend/friend_interface.cpp b/src/core/hle/service/friend/friend_interface.cpp index c8b98b1f0c..6a5159b396 100644 --- a/src/core/hle/service/friend/friend_interface.cpp +++ b/src/core/hle/service/friend/friend_interface.cpp @@ -7,12 +7,6 @@ namespace Service::Friend { Friend::Friend(std::shared_ptr module_, Core::System& system_, const char* name) : Interface(std::move(module_), system_, name) { - static const FunctionInfo functions[] = { - {0, &Friend::CreateFriendService, "CreateFriendService"}, - {1, &Friend::CreateNotificationService, "CreateNotificationService"}, - {2, nullptr, "CreateDaemonSuspendSessionService"}, - }; - RegisterHandlers(functions); } Friend::~Friend() = default; diff --git a/src/core/hle/service/friend/friend_interface.h b/src/core/hle/service/friend/friend_interface.h index 3a2184c347..8e601e3720 100644 --- a/src/core/hle/service/friend/friend_interface.h +++ b/src/core/hle/service/friend/friend_interface.h @@ -11,6 +11,15 @@ class Friend final : public Module::Interface { public: explicit Friend(std::shared_ptr module_, Core::System& system_, const char* name); ~Friend() override; + + FunctionInfoBase const* FindRequest(u32 key) override { + return HandlerTableGenerateWithFind(key, functions); + } + static constexpr auto functions = CreateStaticMap( + {0, &Friend::CreateFriendService, "CreateFriendService"}, + {1, &Friend::CreateNotificationService, "CreateNotificationService"}, + {2, nullptr, "CreateDaemonSuspendSessionService"} + ); }; } // namespace Service::Friend diff --git a/src/core/hle/service/hid/applet_resource.cpp b/src/core/hle/service/hid/applet_resource.cpp index 44ae767841..148049c10f 100644 --- a/src/core/hle/service/hid/applet_resource.cpp +++ b/src/core/hle/service/hid/applet_resource.cpp @@ -16,10 +16,6 @@ IAppletResource::IAppletResource(Core::System& system_, std::shared_ptr, "GetSharedMemoryHandle"}, - }; - RegisterHandlers(functions); } IAppletResource::~IAppletResource() { diff --git a/src/core/hle/service/hid/applet_resource.h b/src/core/hle/service/hid/applet_resource.h index d1e7db9b1e..33092cd751 100644 --- a/src/core/hle/service/hid/applet_resource.h +++ b/src/core/hle/service/hid/applet_resource.h @@ -29,6 +29,12 @@ public: private: Result GetSharedMemoryHandle(OutCopyHandle out_shared_memory_handle); + FunctionInfoBase const* FindRequest(u32 key) override { + return HandlerTableGenerateWithFind(key, functions); + } + static constexpr auto functions = CreateStaticMap( + {0, C<&IAppletResource::GetSharedMemoryHandle>, "GetSharedMemoryHandle"} + ); u64 aruid{}; std::shared_ptr resource_manager; }; diff --git a/src/core/hle/service/nvdrv/nvdrv_interface.cpp b/src/core/hle/service/nvdrv/nvdrv_interface.cpp index 5fae68adbb..db3dbd9f8e 100644 --- a/src/core/hle/service/nvdrv/nvdrv_interface.cpp +++ b/src/core/hle/service/nvdrv/nvdrv_interface.cpp @@ -245,24 +245,6 @@ void NVDRV::DumpGraphicsMemoryInfo(HLERequestContext& ctx) { NVDRV::NVDRV(Core::System& system_, std::shared_ptr nvdrv_, const char* name) : ServiceFramework{system_, name}, nvdrv{std::move(nvdrv_)} { - static const FunctionInfo functions[] = { - {0, &NVDRV::Open, "Open"}, - {1, &NVDRV::Ioctl1, "Ioctl"}, - {2, &NVDRV::Close, "Close"}, - {3, &NVDRV::Initialize, "Initialize"}, - {4, &NVDRV::QueryEvent, "QueryEvent"}, - {5, nullptr, "MapSharedMem"}, - {6, &NVDRV::GetStatus, "GetStatus"}, - {7, nullptr, "SetAruidForTest"}, - {8, &NVDRV::SetAruid, "SetAruid"}, - {9, &NVDRV::DumpGraphicsMemoryInfo, "DumpGraphicsMemoryInfo"}, - {10, nullptr, "InitializeDevtools"}, - {11, &NVDRV::Ioctl2, "Ioctl2"}, - {12, &NVDRV::Ioctl3, "Ioctl3"}, - {13, &NVDRV::SetGraphicsFirmwareMemoryMarginEnabled, - "SetGraphicsFirmwareMemoryMarginEnabled"}, - }; - RegisterHandlers(functions); } NVDRV::~NVDRV() { diff --git a/src/core/hle/service/nvdrv/nvdrv_interface.h b/src/core/hle/service/nvdrv/nvdrv_interface.h index c72f925979..69f4ed7854 100644 --- a/src/core/hle/service/nvdrv/nvdrv_interface.h +++ b/src/core/hle/service/nvdrv/nvdrv_interface.h @@ -35,8 +35,27 @@ private: void ServiceError(HLERequestContext& ctx, NvResult result); + FunctionInfoBase const* FindRequest(u32 key) override { + return HandlerTableGenerateWithFind(key, functions); + } + static constexpr auto functions = CreateStaticMap( + {0, &NVDRV::Open, "Open"}, + {1, &NVDRV::Ioctl1, "Ioctl"}, + {2, &NVDRV::Close, "Close"}, + {3, &NVDRV::Initialize, "Initialize"}, + {4, &NVDRV::QueryEvent, "QueryEvent"}, + {5, nullptr, "MapSharedMem"}, + {6, &NVDRV::GetStatus, "GetStatus"}, + {7, nullptr, "SetAruidForTest"}, + {8, &NVDRV::SetAruid, "SetAruid"}, + {9, &NVDRV::DumpGraphicsMemoryInfo, "DumpGraphicsMemoryInfo"}, + {10, nullptr, "InitializeDevtools"}, + {11, &NVDRV::Ioctl2, "Ioctl2"}, + {12, &NVDRV::Ioctl3, "Ioctl3"}, + {13, &NVDRV::SetGraphicsFirmwareMemoryMarginEnabled, + "SetGraphicsFirmwareMemoryMarginEnabled"} + ); std::shared_ptr nvdrv; - u64 pid{}; bool is_initialized{}; NvCore::SessionId session_id{}; diff --git a/src/core/hle/service/nvdrv/nvmemp.cpp b/src/core/hle/service/nvdrv/nvmemp.cpp index a5477faf1a..8e2e4dfacb 100644 --- a/src/core/hle/service/nvdrv/nvmemp.cpp +++ b/src/core/hle/service/nvdrv/nvmemp.cpp @@ -11,11 +11,6 @@ namespace Service::Nvidia { NVMEMP::NVMEMP(Core::System& system_) : ServiceFramework{system_, "nvmemp"} { - static const FunctionInfo functions[] = { - {0, &NVMEMP::Open, "Open"}, - {1, &NVMEMP::GetAruid, "GetAruid"}, - }; - RegisterHandlers(functions); } NVMEMP::~NVMEMP() = default; diff --git a/src/core/hle/service/nvdrv/nvmemp.h b/src/core/hle/service/nvdrv/nvmemp.h index 85e3053a8d..f5a866e181 100644 --- a/src/core/hle/service/nvdrv/nvmemp.h +++ b/src/core/hle/service/nvdrv/nvmemp.h @@ -19,6 +19,14 @@ public: private: void Open(HLERequestContext& ctx); void GetAruid(HLERequestContext& ctx); + + FunctionInfoBase const* FindRequest(u32 key) override { + return HandlerTableGenerateWithFind(key, functions); + } + static constexpr auto functions = CreateStaticMap( + {0, &NVMEMP::Open, "Open"}, + {1, &NVMEMP::GetAruid, "GetAruid"} + ); }; } // namespace Service::Nvidia diff --git a/src/core/hle/service/nvnflinger/hos_binder_driver.cpp b/src/core/hle/service/nvnflinger/hos_binder_driver.cpp index d30aa3717d..98ce6e8a81 100644 --- a/src/core/hle/service/nvnflinger/hos_binder_driver.cpp +++ b/src/core/hle/service/nvnflinger/hos_binder_driver.cpp @@ -13,13 +13,6 @@ IHOSBinderDriver::IHOSBinderDriver(Core::System& system_, std::shared_ptr surface_flinger) : ServiceFramework{system_, "IHOSBinderDriver"}, m_server(server), m_surface_flinger(surface_flinger) { - static const FunctionInfo functions[] = { - {0, C<&IHOSBinderDriver::TransactParcel>, "TransactParcel"}, - {1, C<&IHOSBinderDriver::AdjustRefcount>, "AdjustRefcount"}, - {2, C<&IHOSBinderDriver::GetNativeHandle>, "GetNativeHandle"}, - {3, C<&IHOSBinderDriver::TransactParcelAuto>, "TransactParcelAuto"}, - }; - RegisterHandlers(functions); } IHOSBinderDriver::~IHOSBinderDriver() = default; diff --git a/src/core/hle/service/nvnflinger/hos_binder_driver.h b/src/core/hle/service/nvnflinger/hos_binder_driver.h index 6b551c91d2..2b0d6735fc 100644 --- a/src/core/hle/service/nvnflinger/hos_binder_driver.h +++ b/src/core/hle/service/nvnflinger/hos_binder_driver.h @@ -44,6 +44,15 @@ private: OutBuffer parcel_reply, u32 flags); private: + FunctionInfoBase const* FindRequest(u32 key) override { + return HandlerTableGenerateWithFind(key, functions); + } + static constexpr auto functions = CreateStaticMap( + {0, C<&IHOSBinderDriver::TransactParcel>, "TransactParcel"}, + {1, C<&IHOSBinderDriver::AdjustRefcount>, "AdjustRefcount"}, + {2, C<&IHOSBinderDriver::GetNativeHandle>, "GetNativeHandle"}, + {3, C<&IHOSBinderDriver::TransactParcelAuto>, "TransactParcelAuto"} + ); const std::shared_ptr m_server; const std::shared_ptr m_surface_flinger; }; diff --git a/src/core/hle/service/pctl/parental_control_service_factory.cpp b/src/core/hle/service/pctl/parental_control_service_factory.cpp index ae278a9bbc..c89a73cb9b 100644 --- a/src/core/hle/service/pctl/parental_control_service_factory.cpp +++ b/src/core/hle/service/pctl/parental_control_service_factory.cpp @@ -15,12 +15,6 @@ IParentalControlServiceFactory::IParentalControlServiceFactory(Core::System& sys const char* name_, Capability capability_) : ServiceFramework{system_, name_}, capability{capability_} { - static const FunctionInfo functions[] = { - {0, D<&IParentalControlServiceFactory::CreateService>, "CreateService"}, - {1, D<&IParentalControlServiceFactory::CreateServiceWithoutInitialize>, - "CreateServiceWithoutInitialize"}, - }; - RegisterHandlers(functions); } IParentalControlServiceFactory::~IParentalControlServiceFactory() = default; diff --git a/src/core/hle/service/pctl/parental_control_service_factory.h b/src/core/hle/service/pctl/parental_control_service_factory.h index 362988add1..6613edcc27 100644 --- a/src/core/hle/service/pctl/parental_control_service_factory.h +++ b/src/core/hle/service/pctl/parental_control_service_factory.h @@ -23,6 +23,13 @@ public: ClientProcessId process_id); private: + FunctionInfoBase const* FindRequest(u32 key) override { + return HandlerTableGenerateWithFind(key, functions); + } + static constexpr auto functions = CreateStaticMap( + {0, D<&IParentalControlServiceFactory::CreateService>, "CreateService"}, + {1, D<&IParentalControlServiceFactory::CreateServiceWithoutInitialize>, "CreateServiceWithoutInitialize"} + ); Capability capability{}; }; diff --git a/src/core/hle/service/sockets/sfdnsres.cpp b/src/core/hle/service/sockets/sfdnsres.cpp index 93c01bf786..ab5cfb4e19 100644 --- a/src/core/hle/service/sockets/sfdnsres.cpp +++ b/src/core/hle/service/sockets/sfdnsres.cpp @@ -21,25 +21,6 @@ namespace Service::Sockets { SFDNSRES::SFDNSRES(Core::System& system_) : ServiceFramework{system_, "sfdnsres"} { - static const FunctionInfo functions[] = { - {0, nullptr, "SetDnsAddressesPrivateRequest"}, - {1, nullptr, "GetDnsAddressPrivateRequest"}, - {2, &SFDNSRES::GetHostByNameRequest, "GetHostByNameRequest"}, - {3, nullptr, "GetHostByAddrRequest"}, - {4, nullptr, "GetHostStringErrorRequest"}, - {5, &SFDNSRES::GetGaiStringErrorRequest, "GetGaiStringErrorRequest"}, - {6, &SFDNSRES::GetAddrInfoRequest, "GetAddrInfoRequest"}, - {7, nullptr, "GetNameInfoRequest"}, - {8, nullptr, "RequestCancelHandleRequest"}, - {9, nullptr, "CancelRequest"}, - {10, &SFDNSRES::GetHostByNameRequestWithOptions, "GetHostByNameRequestWithOptions"}, - {11, nullptr, "GetHostByAddrRequestWithOptions"}, - {12, &SFDNSRES::GetAddrInfoRequestWithOptions, "GetAddrInfoRequestWithOptions"}, - {13, nullptr, "GetNameInfoRequestWithOptions"}, - {14, &SFDNSRES::ResolverSetOptionRequest, "ResolverSetOptionRequest"}, - {15, nullptr, "ResolverGetOptionRequest"}, - }; - RegisterHandlers(functions); } SFDNSRES::~SFDNSRES() = default; diff --git a/src/core/hle/service/sockets/sfdnsres.h b/src/core/hle/service/sockets/sfdnsres.h index 4302edc43e..9c77adb348 100644 --- a/src/core/hle/service/sockets/sfdnsres.h +++ b/src/core/hle/service/sockets/sfdnsres.h @@ -26,6 +26,28 @@ private: void GetAddrInfoRequest(HLERequestContext& ctx); void GetAddrInfoRequestWithOptions(HLERequestContext& ctx); void ResolverSetOptionRequest(HLERequestContext& ctx); + + FunctionInfoBase const* FindRequest(u32 key) override { + return HandlerTableGenerateWithFind(key, functions); + } + static constexpr auto functions = CreateStaticMap( + {0, nullptr, "SetDnsAddressesPrivateRequest"}, + {1, nullptr, "GetDnsAddressPrivateRequest"}, + {2, &SFDNSRES::GetHostByNameRequest, "GetHostByNameRequest"}, + {3, nullptr, "GetHostByAddrRequest"}, + {4, nullptr, "GetHostStringErrorRequest"}, + {5, &SFDNSRES::GetGaiStringErrorRequest, "GetGaiStringErrorRequest"}, + {6, &SFDNSRES::GetAddrInfoRequest, "GetAddrInfoRequest"}, + {7, nullptr, "GetNameInfoRequest"}, + {8, nullptr, "RequestCancelHandleRequest"}, + {9, nullptr, "CancelRequest"}, + {10, &SFDNSRES::GetHostByNameRequestWithOptions, "GetHostByNameRequestWithOptions"}, + {11, nullptr, "GetHostByAddrRequestWithOptions"}, + {12, &SFDNSRES::GetAddrInfoRequestWithOptions, "GetAddrInfoRequestWithOptions"}, + {13, nullptr, "GetNameInfoRequestWithOptions"}, + {14, &SFDNSRES::ResolverSetOptionRequest, "ResolverSetOptionRequest"}, + {15, nullptr, "ResolverGetOptionRequest"} + ); }; class DNS_PRIV final : public ServiceFramework { diff --git a/src/core/hle/service/vi/application_root_service.cpp b/src/core/hle/service/vi/application_root_service.cpp index 7f35a048da..f8e68cb6e6 100644 --- a/src/core/hle/service/vi/application_root_service.cpp +++ b/src/core/hle/service/vi/application_root_service.cpp @@ -14,11 +14,6 @@ namespace Service::VI { IApplicationRootService::IApplicationRootService(Core::System& system_, std::shared_ptr container) : ServiceFramework{system_, "vi:u"}, m_container{std::move(container)} { - static const FunctionInfo functions[] = { - {0, C<&IApplicationRootService::GetDisplayService>, "GetDisplayService"}, - {1, nullptr, "GetDisplayServiceWithProxyNameExchange"}, - }; - RegisterHandlers(functions); } IApplicationRootService::~IApplicationRootService() = default; diff --git a/src/core/hle/service/vi/application_root_service.h b/src/core/hle/service/vi/application_root_service.h index 15aa4483d6..0947ac48f0 100644 --- a/src/core/hle/service/vi/application_root_service.h +++ b/src/core/hle/service/vi/application_root_service.h @@ -27,6 +27,13 @@ private: Policy policy); private: + FunctionInfoBase const* FindRequest(u32 key) override { + return HandlerTableGenerateWithFind(key, functions); + } + static constexpr auto functions = CreateStaticMap( + {0, C<&IApplicationRootService::GetDisplayService>, "GetDisplayService"}, + {1, nullptr, "GetDisplayServiceWithProxyNameExchange"} + ); const std::shared_ptr m_container; }; diff --git a/src/core/hle/service/vi/manager_root_service.cpp b/src/core/hle/service/vi/manager_root_service.cpp index 0f16a15b4a..3c5110ca09 100644 --- a/src/core/hle/service/vi/manager_root_service.cpp +++ b/src/core/hle/service/vi/manager_root_service.cpp @@ -15,15 +15,6 @@ namespace Service::VI { IManagerRootService::IManagerRootService(Core::System& system_, std::shared_ptr container) : ServiceFramework{system_, "vi:m"}, m_container{std::move(container)} { - static const FunctionInfo functions[] = { - {2, C<&IManagerRootService::GetDisplayService>, "GetDisplayService"}, - {3, nullptr, "GetDisplayServiceWithProxyNameExchange"}, - {100, nullptr, "PrepareFatal"}, - {101, nullptr, "ShowFatal"}, - {102, nullptr, "DrawFatalRectangle"}, - {103, nullptr, "DrawFatalText32"}, - }; - RegisterHandlers(functions); } IManagerRootService::~IManagerRootService() = default; diff --git a/src/core/hle/service/vi/manager_root_service.h b/src/core/hle/service/vi/manager_root_service.h index 77cd328699..aaec917328 100644 --- a/src/core/hle/service/vi/manager_root_service.h +++ b/src/core/hle/service/vi/manager_root_service.h @@ -26,6 +26,17 @@ public: Policy policy); private: + FunctionInfoBase const* FindRequest(u32 key) override { + return HandlerTableGenerateWithFind(key, functions); + } + static constexpr auto functions = CreateStaticMap( + {2, C<&IManagerRootService::GetDisplayService>, "GetDisplayService"}, + {3, nullptr, "GetDisplayServiceWithProxyNameExchange"}, + {100, nullptr, "PrepareFatal"}, + {101, nullptr, "ShowFatal"}, + {102, nullptr, "DrawFatalRectangle"}, + {103, nullptr, "DrawFatalText32"} + ); const std::shared_ptr m_container; };