diff options
author | Liam <byteslice@airmail.cc> | 2023-02-21 18:19:12 +0100 |
---|---|---|
committer | Liam <byteslice@airmail.cc> | 2023-02-21 18:19:25 +0100 |
commit | 72e5552409305fe57781b83c3145fb2b66552be2 (patch) | |
tree | 7c88edce6084274a0c79a9284fc7290033e2e0bc /src/core/hle/service/sm/sm.cpp | |
parent | cheat_engine: add check for hid initialization (diff) | |
download | yuzu-72e5552409305fe57781b83c3145fb2b66552be2.tar yuzu-72e5552409305fe57781b83c3145fb2b66552be2.tar.gz yuzu-72e5552409305fe57781b83c3145fb2b66552be2.tar.bz2 yuzu-72e5552409305fe57781b83c3145fb2b66552be2.tar.lz yuzu-72e5552409305fe57781b83c3145fb2b66552be2.tar.xz yuzu-72e5552409305fe57781b83c3145fb2b66552be2.tar.zst yuzu-72e5552409305fe57781b83c3145fb2b66552be2.zip |
Diffstat (limited to 'src/core/hle/service/sm/sm.cpp')
-rw-r--r-- | src/core/hle/service/sm/sm.cpp | 9 |
1 files changed, 7 insertions, 2 deletions
diff --git a/src/core/hle/service/sm/sm.cpp b/src/core/hle/service/sm/sm.cpp index 6eba48f03..53c877836 100644 --- a/src/core/hle/service/sm/sm.cpp +++ b/src/core/hle/service/sm/sm.cpp @@ -112,7 +112,7 @@ ResultVal<Kernel::KPort*> ServiceManager::GetServicePort(const std::string& name void SM::Initialize(Kernel::HLERequestContext& ctx) { LOG_DEBUG(Service_SM, "called"); - is_initialized = true; + ctx.GetManager()->SetIsInitializedForSm(); IPC::ResponseBuilder rb{ctx, 2}; rb.Push(ResultSuccess); @@ -159,7 +159,7 @@ static std::string PopServiceName(IPC::RequestParser& rp) { } ResultVal<Kernel::KClientSession*> SM::GetServiceImpl(Kernel::HLERequestContext& ctx) { - if (!is_initialized) { + if (!ctx.GetManager()->GetIsInitializedForSm()) { return ERR_NOT_INITIALIZED; } @@ -168,6 +168,11 @@ ResultVal<Kernel::KClientSession*> SM::GetServiceImpl(Kernel::HLERequestContext& // Find the named port. auto port_result = service_manager.GetServicePort(name); + if (port_result.Code() == ERR_INVALID_NAME) { + LOG_ERROR(Service_SM, "Invalid service name '{}'", name); + return ERR_INVALID_NAME; + } + if (port_result.Failed()) { LOG_INFO(Service_SM, "Waiting for service {} to become available", name); ctx.SetIsDeferred(); |