diff options
author | Yuri Kunde Schlesner <yuriks@yuriks.net> | 2017-06-23 08:54:36 +0200 |
---|---|---|
committer | Yuri Kunde Schlesner <yuriks@yuriks.net> | 2017-06-23 20:22:02 +0200 |
commit | aa0f3047d367819acdd4333c8290992b99433073 (patch) | |
tree | 39d0e56e7657b2325c182ffb39697d2eb14b7246 /src/core/hle | |
parent | Merge pull request #2798 from yuriks/svc-create-session (diff) | |
download | yuzu-aa0f3047d367819acdd4333c8290992b99433073.tar yuzu-aa0f3047d367819acdd4333c8290992b99433073.tar.gz yuzu-aa0f3047d367819acdd4333c8290992b99433073.tar.bz2 yuzu-aa0f3047d367819acdd4333c8290992b99433073.tar.lz yuzu-aa0f3047d367819acdd4333c8290992b99433073.tar.xz yuzu-aa0f3047d367819acdd4333c8290992b99433073.tar.zst yuzu-aa0f3047d367819acdd4333c8290992b99433073.zip |
Diffstat (limited to 'src/core/hle')
-rw-r--r-- | src/core/hle/svc.cpp | 13 |
1 files changed, 12 insertions, 1 deletions
diff --git a/src/core/hle/svc.cpp b/src/core/hle/svc.cpp index f459b1314..2e11d41ce 100644 --- a/src/core/hle/svc.cpp +++ b/src/core/hle/svc.cpp @@ -947,6 +947,17 @@ static ResultCode CreatePort(Kernel::Handle* server_port, Kernel::Handle* client return RESULT_SUCCESS; } +static ResultCode CreateSessionToPort(Handle* out_client_session, Handle client_port_handle) { + using Kernel::ClientPort; + SharedPtr<ClientPort> client_port = Kernel::g_handle_table.Get<ClientPort>(client_port_handle); + if (client_port == nullptr) + return ERR_INVALID_HANDLE; + + CASCADE_RESULT(auto session, client_port->Connect()); + CASCADE_RESULT(*out_client_session, Kernel::g_handle_table.Create(std::move(session))); + return RESULT_SUCCESS; +} + static ResultCode CreateSession(Handle* server_session, Handle* client_session) { auto sessions = Kernel::ServerSession::CreateSessionPair(); @@ -1134,7 +1145,7 @@ static const FunctionDef SVC_Table[] = { {0x45, nullptr, "Unknown"}, {0x46, nullptr, "Unknown"}, {0x47, HLE::Wrap<CreatePort>, "CreatePort"}, - {0x48, nullptr, "CreateSessionToPort"}, + {0x48, HLE::Wrap<CreateSessionToPort>, "CreateSessionToPort"}, {0x49, HLE::Wrap<CreateSession>, "CreateSession"}, {0x4A, nullptr, "AcceptSession"}, {0x4B, nullptr, "ReplyAndReceive1"}, |