From 5e7ba8fc9cd296c0869f37f48453a3bb7cd00263 Mon Sep 17 00:00:00 2001 From: lizzie Date: Fri, 25 Sep 2026 19:19:49 +0000 Subject: [PATCH] 2026-09-25 19:19:49 Signed-off-by: lizzie --- src/core/hle/service/service.cpp | 6 ++++++ src/core/hle/service/service.h | 6 ++---- 2 files changed, 8 insertions(+), 4 deletions(-) diff --git a/src/core/hle/service/service.cpp b/src/core/hle/service/service.cpp index 4e9d961b6a..5b9c9960e9 100644 --- a/src/core/hle/service/service.cpp +++ b/src/core/hle/service/service.cpp @@ -69,6 +69,9 @@ void ServiceFrameworkBase::ReportUnimplementedFunction(HLERequestContext& ctx, c void ServiceFrameworkBase::InvokeRequest(HLERequestContext& ctx) { const bool is_cmd_read = ctx.GetCommand() == 0; auto const info = FindRequest(ctx.GetCommand()); + if (info == nullptr || info->handler_callback == nullptr) + return ReportUnimplementedFunction(ctx, info); + LOG_TRACE(Service, "{}", MakeFunctionString(info->name, GetServiceName(), ctx.CommandBuffer())); handler_invoker(this, info->handler_callback, ctx); if (is_i_storage && is_cmd_read) { @@ -81,6 +84,9 @@ void ServiceFrameworkBase::InvokeRequest(HLERequestContext& ctx) { void ServiceFrameworkBase::InvokeRequestTipc(HLERequestContext& ctx) { auto const info = FindRequestTipc(ctx.GetCommand()); + if (info == nullptr || info->handler_callback == nullptr) + return ReportUnimplementedFunction(ctx, info); + LOG_TRACE(Service, "{}", MakeFunctionString(info->name, GetServiceName(), ctx.CommandBuffer())); handler_invoker(this, info->handler_callback, ctx); } diff --git a/src/core/hle/service/service.h b/src/core/hle/service/service.h index 3bd39ac25f..14d1de1a1f 100644 --- a/src/core/hle/service/service.h +++ b/src/core/hle/service/service.h @@ -180,14 +180,12 @@ protected: FunctionInfoBase const* FindRequest(u32 key) override { auto it = handlers.find(key); - FunctionInfoBase const* info = it == handlers.end() ? nullptr : &it->second; - return !(info == nullptr || info->handler_callback == nullptr) ? info : nullptr; + return it != handlers.end() ? std::addressof(it->second) : nullptr; } FunctionInfoBase const* FindRequestTipc(u32 key) override { auto it = handlers_tipc.find(key); - FunctionInfoBase const* info = it == handlers_tipc.end() ? nullptr : &it->second; - return !(info == nullptr || info->handler_callback == nullptr) ? info : nullptr; + return it != handlers_tipc.end() ? std::addressof(it->second) : nullptr; } constexpr void RegisterHandlersBase(const FunctionInfoBase* functions, std::size_t n) {