diff options
| author | 2023-02-21 12:19:12 -0500 | |
|---|---|---|
| committer | 2023-02-21 12:19:25 -0500 | |
| commit | 72e5552409305fe57781b83c3145fb2b66552be2 (patch) | |
| tree | 7c88edce6084274a0c79a9284fc7290033e2e0bc /src/core/hle/service/sm | |
| parent | cheat_engine: add check for hid initialization (diff) | |
| download | yuzu-72e5552409305fe57781b83c3145fb2b66552be2.tar.gz yuzu-72e5552409305fe57781b83c3145fb2b66552be2.tar.xz yuzu-72e5552409305fe57781b83c3145fb2b66552be2.zip | |
sm:: fix lingering session initialization issues
Diffstat (limited to 'src/core/hle/service/sm')
| -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 | |||
| 112 | void SM::Initialize(Kernel::HLERequestContext& ctx) { | 112 | void SM::Initialize(Kernel::HLERequestContext& ctx) { |
| 113 | LOG_DEBUG(Service_SM, "called"); | 113 | LOG_DEBUG(Service_SM, "called"); |
| 114 | 114 | ||
| 115 | is_initialized = true; | 115 | ctx.GetManager()->SetIsInitializedForSm(); |
| 116 | 116 | ||
| 117 | IPC::ResponseBuilder rb{ctx, 2}; | 117 | IPC::ResponseBuilder rb{ctx, 2}; |
| 118 | rb.Push(ResultSuccess); | 118 | rb.Push(ResultSuccess); |
| @@ -159,7 +159,7 @@ static std::string PopServiceName(IPC::RequestParser& rp) { | |||
| 159 | } | 159 | } |
| 160 | 160 | ||
| 161 | ResultVal<Kernel::KClientSession*> SM::GetServiceImpl(Kernel::HLERequestContext& ctx) { | 161 | ResultVal<Kernel::KClientSession*> SM::GetServiceImpl(Kernel::HLERequestContext& ctx) { |
| 162 | if (!is_initialized) { | 162 | if (!ctx.GetManager()->GetIsInitializedForSm()) { |
| 163 | return ERR_NOT_INITIALIZED; | 163 | return ERR_NOT_INITIALIZED; |
| 164 | } | 164 | } |
| 165 | 165 | ||
| @@ -168,6 +168,11 @@ ResultVal<Kernel::KClientSession*> SM::GetServiceImpl(Kernel::HLERequestContext& | |||
| 168 | 168 | ||
| 169 | // Find the named port. | 169 | // Find the named port. |
| 170 | auto port_result = service_manager.GetServicePort(name); | 170 | auto port_result = service_manager.GetServicePort(name); |
| 171 | if (port_result.Code() == ERR_INVALID_NAME) { | ||
| 172 | LOG_ERROR(Service_SM, "Invalid service name '{}'", name); | ||
| 173 | return ERR_INVALID_NAME; | ||
| 174 | } | ||
| 175 | |||
| 171 | if (port_result.Failed()) { | 176 | if (port_result.Failed()) { |
| 172 | LOG_INFO(Service_SM, "Waiting for service {} to become available", name); | 177 | LOG_INFO(Service_SM, "Waiting for service {} to become available", name); |
| 173 | ctx.SetIsDeferred(); | 178 | ctx.SetIsDeferred(); |