2
1
Fork 0
mirror of https://github.com/yuzu-emu/yuzu.git synced 2024-07-04 23:31:19 +01:00

Kernel: Add methods in HLERequestContext abstracting handle creation

This commit is contained in:
Yuri Kunde Schlesner 2017-06-08 23:55:18 -07:00
parent 20e5abb308
commit 05fee70211
2 changed files with 12 additions and 0 deletions

View file

@ -5,6 +5,7 @@
#include <boost/range/algorithm_ext/erase.hpp> #include <boost/range/algorithm_ext/erase.hpp>
#include "common/assert.h" #include "common/assert.h"
#include "common/common_types.h" #include "common/common_types.h"
#include "core/hle/kernel/handle_table.h"
#include "core/hle/kernel/hle_ipc.h" #include "core/hle/kernel/hle_ipc.h"
#include "core/hle/kernel/kernel.h" #include "core/hle/kernel/kernel.h"
#include "core/hle/kernel/server_session.h" #include "core/hle/kernel/server_session.h"
@ -23,4 +24,12 @@ void SessionRequestHandler::ClientDisconnected(SharedPtr<ServerSession> server_s
HLERequestContext::~HLERequestContext() = default; HLERequestContext::~HLERequestContext() = default;
SharedPtr<Object> HLERequestContext::GetIncomingHandle(Handle id_from_cmdbuf) const {
return Kernel::g_handle_table.GetGeneric(id_from_cmdbuf);
}
Handle HLERequestContext::AddOutgoingHandle(SharedPtr<Object> object) {
return Kernel::g_handle_table.Create(object).Unwrap();
}
} // namespace Kernel } // namespace Kernel

View file

@ -80,6 +80,9 @@ public:
return session; return session;
} }
SharedPtr<Object> GetIncomingHandle(Handle id_from_cmdbuf) const;
Handle AddOutgoingHandle(SharedPtr<Object> object);
private: private:
friend class Service::ServiceFrameworkBase; friend class Service::ServiceFrameworkBase;