summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorGravatar bunnei2018-02-03 10:25:01 -0800
committerGravatar GitHub2018-02-03 10:25:01 -0800
commitabc4be8e0fe3ab2736e26dde035435512a541d0e (patch)
treefab9aec7c0df8b91247dedc3b1299894f72aeb74 /src
parentMerge pull request #156 from mailwl/nifm (diff)
parentcontroller: DuplicateSession should return a ClientSession. (diff)
downloadyuzu-abc4be8e0fe3ab2736e26dde035435512a541d0e.tar.gz
yuzu-abc4be8e0fe3ab2736e26dde035435512a541d0e.tar.xz
yuzu-abc4be8e0fe3ab2736e26dde035435512a541d0e.zip
Merge pull request #157 from bunnei/fix-duplicate-session
controller: DuplicateSession should return a ClientSession.
Diffstat (limited to 'src')
-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) {