summaryrefslogtreecommitdiff
path: root/src/core
diff options
context:
space:
mode:
Diffstat (limited to 'src/core')
-rw-r--r--src/core/hle/service/sm/controller.cpp13
1 files changed, 9 insertions, 4 deletions
diff --git a/src/core/hle/service/sm/controller.cpp b/src/core/hle/service/sm/controller.cpp
index a81ff9f49..e12c53442 100644
--- a/src/core/hle/service/sm/controller.cpp
+++ b/src/core/hle/service/sm/controller.cpp
@@ -4,6 +4,7 @@
4 4
5#include "common/logging/log.h" 5#include "common/logging/log.h"
6#include "core/hle/ipc_helpers.h" 6#include "core/hle/ipc_helpers.h"
7#include "core/hle/kernel/session.h"
7#include "core/hle/service/sm/controller.h" 8#include "core/hle/service/sm/controller.h"
8 9
9namespace Service { 10namespace Service {
@@ -21,17 +22,21 @@ void Controller::ConvertSessionToDomain(Kernel::HLERequestContext& ctx) {
21} 22}
22 23
23void Controller::DuplicateSession(Kernel::HLERequestContext& ctx) { 24void Controller::DuplicateSession(Kernel::HLERequestContext& ctx) {
25 // TODO(bunnei): This is just creating a new handle to the same Session. I assume this is wrong
26 // and that we probably want to actually make an entirely new Session, but we still need to
27 // verify this on hardware.
24 IPC::ResponseBuilder rb{ctx, 2, 0, 1, IPC::ResponseBuilder::Flags::AlwaysMoveHandles}; 28 IPC::ResponseBuilder rb{ctx, 2, 0, 1, IPC::ResponseBuilder::Flags::AlwaysMoveHandles};
25 rb.Push(RESULT_SUCCESS); 29 rb.Push(RESULT_SUCCESS);
26 rb.PushMoveObjects(ctx.Session()); 30 Kernel::SharedPtr<Kernel::ClientSession> session{ctx.Session()->parent->client};
31 rb.PushMoveObjects(session);
27 32
28 LOG_DEBUG(Service, "called"); 33 LOG_DEBUG(Service, "called, session=%u", session->GetObjectId());
29} 34}
30 35
31void Controller::DuplicateSessionEx(Kernel::HLERequestContext& ctx) { 36void Controller::DuplicateSessionEx(Kernel::HLERequestContext& ctx) {
32 DuplicateSession(ctx);
33
34 LOG_WARNING(Service, "(STUBBED) called, using DuplicateSession"); 37 LOG_WARNING(Service, "(STUBBED) called, using DuplicateSession");
38
39 DuplicateSession(ctx);
35} 40}
36 41
37void Controller::QueryPointerBufferSize(Kernel::HLERequestContext& ctx) { 42void Controller::QueryPointerBufferSize(Kernel::HLERequestContext& ctx) {