2018-11-11 21:53:15 +00:00
|
|
|
#include <mesosphere/processes/KLightSession.hpp>
|
2018-11-13 00:14:55 +00:00
|
|
|
#include <mesosphere/processes/KPort.hpp>
|
2018-11-11 21:53:15 +00:00
|
|
|
#include <mesosphere/core/KCoreContext.hpp>
|
|
|
|
|
|
|
|
namespace mesosphere
|
|
|
|
{
|
|
|
|
|
|
|
|
KLightSession::~KLightSession()
|
|
|
|
{
|
|
|
|
}
|
|
|
|
|
2018-11-13 00:14:55 +00:00
|
|
|
Result KLightSession::Initialize(KPort *parentPort)
|
2018-11-11 21:53:15 +00:00
|
|
|
{
|
|
|
|
SetClientServerParent();
|
2018-11-12 08:54:22 +00:00
|
|
|
isClientAlive = true;
|
|
|
|
isServerAlive = true;
|
2018-11-11 21:53:15 +00:00
|
|
|
|
|
|
|
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;
|
|
|
|
}
|
2018-11-11 21:53:15 +00:00
|
|
|
}
|
|
|
|
|
2018-11-12 08:54:22 +00:00
|
|
|
void KLightSession::Terminate(bool fromServer)
|
|
|
|
{
|
|
|
|
server.Terminate(fromServer);
|
|
|
|
}
|
|
|
|
|
2018-11-11 21:53:15 +00:00
|
|
|
}
|