diff options
author | bunnei <bunneidev@gmail.com> | 2021-05-11 01:12:01 +0200 |
---|---|---|
committer | bunnei <bunneidev@gmail.com> | 2021-05-11 05:34:38 +0200 |
commit | 49c4c329f6c873bcf8da22c8da08a704a563ba4e (patch) | |
tree | e4c059dc20317e42b96554c6cffa42a57ac9cca9 /src/core | |
parent | hle: service: Add support for dispatching TIPC requests. (diff) | |
download | yuzu-49c4c329f6c873bcf8da22c8da08a704a563ba4e.tar yuzu-49c4c329f6c873bcf8da22c8da08a704a563ba4e.tar.gz yuzu-49c4c329f6c873bcf8da22c8da08a704a563ba4e.tar.bz2 yuzu-49c4c329f6c873bcf8da22c8da08a704a563ba4e.tar.lz yuzu-49c4c329f6c873bcf8da22c8da08a704a563ba4e.tar.xz yuzu-49c4c329f6c873bcf8da22c8da08a704a563ba4e.tar.zst yuzu-49c4c329f6c873bcf8da22c8da08a704a563ba4e.zip |
Diffstat (limited to 'src/core')
-rw-r--r-- | src/core/hle/service/sm/sm.cpp | 7 |
1 files changed, 7 insertions, 0 deletions
diff --git a/src/core/hle/service/sm/sm.cpp b/src/core/hle/service/sm/sm.cpp index 7bd571880..726bef4c3 100644 --- a/src/core/hle/service/sm/sm.cpp +++ b/src/core/hle/service/sm/sm.cpp @@ -133,9 +133,16 @@ void SM::GetService(Kernel::HLERequestContext& ctx) { auto* port = result.Unwrap(); + Kernel::KScopedResourceReservation session_reservation( + kernel.CurrentProcess()->GetResourceLimit(), Kernel::LimitableResource::Sessions); + R_UNLESS(session_reservation.Succeeded(), Kernel::ResultLimitReached); + auto* session = Kernel::KSession::Create(kernel); session->Initialize(&port->GetClientPort(), std::move(name)); + // Commit the session reservation. + session_reservation.Commit(); + if (port->GetServerPort().GetHLEHandler()) { port->GetServerPort().GetHLEHandler()->ClientConnected(&session->GetServerSession()); } else { |