summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--src/core/hle/kernel/k_client_port.cpp4
-rw-r--r--src/core/hle/service/ipc_helpers.h4
-rw-r--r--src/core/hle/service/sm/sm_controller.cpp7
3 files changed, 7 insertions, 8 deletions
diff --git a/src/core/hle/kernel/k_client_port.cpp b/src/core/hle/kernel/k_client_port.cpp
index 9b20c4d75..68cea978a 100644
--- a/src/core/hle/kernel/k_client_port.cpp
+++ b/src/core/hle/kernel/k_client_port.cpp
@@ -58,8 +58,8 @@ Result KClientPort::CreateSession(KClientSession** out) {
58 KSession* session{}; 58 KSession* session{};
59 59
60 // Reserve a new session from the resource limit. 60 // Reserve a new session from the resource limit.
61 KScopedResourceReservation session_reservation( 61 KScopedResourceReservation session_reservation(GetCurrentProcessPointer(m_kernel),
62 GetCurrentProcessPointer(m_kernel)->GetResourceLimit(), LimitableResource::SessionCountMax); 62 LimitableResource::SessionCountMax);
63 R_UNLESS(session_reservation.Succeeded(), ResultLimitReached); 63 R_UNLESS(session_reservation.Succeeded(), ResultLimitReached);
64 64
65 // Allocate a session normally. 65 // Allocate a session normally.
diff --git a/src/core/hle/service/ipc_helpers.h b/src/core/hle/service/ipc_helpers.h
index 0e222362e..4b02872fb 100644
--- a/src/core/hle/service/ipc_helpers.h
+++ b/src/core/hle/service/ipc_helpers.h
@@ -151,8 +151,8 @@ public:
151 if (manager->IsDomain()) { 151 if (manager->IsDomain()) {
152 context->AddDomainObject(std::move(iface)); 152 context->AddDomainObject(std::move(iface));
153 } else { 153 } else {
154 kernel.ApplicationProcess()->GetResourceLimit()->Reserve( 154 ASSERT(Kernel::GetCurrentProcess(kernel).GetResourceLimit()->Reserve(
155 Kernel::LimitableResource::SessionCountMax, 1); 155 Kernel::LimitableResource::SessionCountMax, 1));
156 156
157 auto* session = Kernel::KSession::Create(kernel); 157 auto* session = Kernel::KSession::Create(kernel);
158 session->Initialize(nullptr, 0); 158 session->Initialize(nullptr, 0);
diff --git a/src/core/hle/service/sm/sm_controller.cpp b/src/core/hle/service/sm/sm_controller.cpp
index 7dce28fe0..7f0fb91d0 100644
--- a/src/core/hle/service/sm/sm_controller.cpp
+++ b/src/core/hle/service/sm/sm_controller.cpp
@@ -28,7 +28,6 @@ void Controller::ConvertCurrentObjectToDomain(HLERequestContext& ctx) {
28void Controller::CloneCurrentObject(HLERequestContext& ctx) { 28void Controller::CloneCurrentObject(HLERequestContext& ctx) {
29 LOG_DEBUG(Service, "called"); 29 LOG_DEBUG(Service, "called");
30 30
31 auto& process = *ctx.GetThread().GetOwnerProcess();
32 auto session_manager = ctx.GetManager(); 31 auto session_manager = ctx.GetManager();
33 32
34 // FIXME: this is duplicated from the SVC, it should just call it instead 33 // FIXME: this is duplicated from the SVC, it should just call it instead
@@ -36,11 +35,11 @@ void Controller::CloneCurrentObject(HLERequestContext& ctx) {
36 35
37 // Reserve a new session from the process resource limit. 36 // Reserve a new session from the process resource limit.
38 Kernel::KScopedResourceReservation session_reservation( 37 Kernel::KScopedResourceReservation session_reservation(
39 &process, Kernel::LimitableResource::SessionCountMax); 38 Kernel::GetCurrentProcessPointer(kernel), Kernel::LimitableResource::SessionCountMax);
40 ASSERT(session_reservation.Succeeded()); 39 ASSERT(session_reservation.Succeeded());
41 40
42 // Create the session. 41 // Create the session.
43 Kernel::KSession* session = Kernel::KSession::Create(system.Kernel()); 42 Kernel::KSession* session = Kernel::KSession::Create(kernel);
44 ASSERT(session != nullptr); 43 ASSERT(session != nullptr);
45 44
46 // Initialize the session. 45 // Initialize the session.
@@ -50,7 +49,7 @@ void Controller::CloneCurrentObject(HLERequestContext& ctx) {
50 session_reservation.Commit(); 49 session_reservation.Commit();
51 50
52 // Register the session. 51 // Register the session.
53 Kernel::KSession::Register(system.Kernel(), session); 52 Kernel::KSession::Register(kernel, session);
54 53
55 // Register with server manager. 54 // Register with server manager.
56 session_manager->GetServerManager().RegisterSession(&session->GetServerSession(), 55 session_manager->GetServerManager().RegisterSession(&session->GetServerSession(),