1
0
Fork 0
mirror of https://github.com/Atmosphere-NX/Atmosphere.git synced 2024-11-15 00:16:48 +00:00
Atmosphere/mesosphere/source/processes/KLightSession.cpp

38 lines
937 B
C++
Raw Normal View History

#include <mesosphere/processes/KLightSession.hpp>
2018-11-13 00:14:55 +00:00
#include <mesosphere/processes/KPort.hpp>
#include <mesosphere/core/KCoreContext.hpp>
namespace mesosphere
{
KLightSession::~KLightSession()
{
}
2018-11-13 00:14:55 +00:00
Result KLightSession::Initialize(KPort *parentPort)
{
SetClientServerParent();
isClientAlive = true;
isServerAlive = true;
SetResourceOwner(KCoreContext::GetCurrentInstance().GetCurrentProcess());
2018-11-13 00:14:55 +00:00
if (parentPort == nullptr) {
return ResultSuccess();
} else {
// Another difference with official kernel: if adding the session fails, the session isn't added to allocator set (since it'll be deleted right away).
Result res = parentPort->AddLightServerSession(server);
if (res.IsSuccess()) {
client.parentClientPort = &parentPort->GetClient();
}
return res;
}
}
void KLightSession::Terminate(bool fromServer)
{
server.Terminate(fromServer);
}
}