summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorGravatar bunnei2021-05-10 15:53:07 -0700
committerGravatar bunnei2021-05-10 20:33:53 -0700
commit44c763f9c6306a431739e69760ef3646141e2107 (patch)
treeb6e0250305bcf1dbcc5a97e061785edbd98baaa5 /src
parenthle: service: sm: Increase point buffer size. (diff)
downloadyuzu-44c763f9c6306a431739e69760ef3646141e2107.tar.gz
yuzu-44c763f9c6306a431739e69760ef3646141e2107.tar.xz
yuzu-44c763f9c6306a431739e69760ef3646141e2107.zip
hle: kernel: KSession: Improve implementation of CloneCurrentObject.
Diffstat (limited to 'src')
-rw-r--r--src/core/hle/service/sm/controller.cpp12
1 files changed, 10 insertions, 2 deletions
diff --git a/src/core/hle/service/sm/controller.cpp b/src/core/hle/service/sm/controller.cpp
index a8f5125ab..de530cbfb 100644
--- a/src/core/hle/service/sm/controller.cpp
+++ b/src/core/hle/service/sm/controller.cpp
@@ -26,15 +26,23 @@ void Controller::CloneCurrentObject(Kernel::HLERequestContext& ctx) {
26 // TODO(bunnei): This is just creating a new handle to the same Session. I assume this is wrong 26 // TODO(bunnei): This is just creating a new handle to the same Session. I assume this is wrong
27 // and that we probably want to actually make an entirely new Session, but we still need to 27 // and that we probably want to actually make an entirely new Session, but we still need to
28 // verify this on hardware. 28 // verify this on hardware.
29
29 LOG_DEBUG(Service, "called"); 30 LOG_DEBUG(Service, "called");
30 31
32 auto session = ctx.Session()->GetParent();
33
34 // Open a reference to the session to simulate a new one being created.
35 session->Open();
36 session->GetClientSession().Open();
37 session->GetServerSession().Open();
38
31 IPC::ResponseBuilder rb{ctx, 2, 0, 1, IPC::ResponseBuilder::Flags::AlwaysMoveHandles}; 39 IPC::ResponseBuilder rb{ctx, 2, 0, 1, IPC::ResponseBuilder::Flags::AlwaysMoveHandles};
32 rb.Push(RESULT_SUCCESS); 40 rb.Push(RESULT_SUCCESS);
33 rb.PushMoveObjects(ctx.Session()->GetParent()->GetClientSession()); 41 rb.PushMoveObjects(session->GetClientSession());
34} 42}
35 43
36void Controller::CloneCurrentObjectEx(Kernel::HLERequestContext& ctx) { 44void Controller::CloneCurrentObjectEx(Kernel::HLERequestContext& ctx) {
37 LOG_WARNING(Service, "(STUBBED) called, using CloneCurrentObject"); 45 LOG_DEBUG(Service, "called");
38 46
39 CloneCurrentObject(ctx); 47 CloneCurrentObject(ctx);
40} 48}