early-access version 3059

This commit is contained in:
pineappleEA
2022-10-28 04:12:11 +02:00
parent 6e35cb128e
commit ac60707093
25 changed files with 293 additions and 445 deletions

View File

@@ -99,10 +99,6 @@ ServiceFrameworkBase::ServiceFrameworkBase(Core::System& system_, const char* se
ServiceFrameworkBase::~ServiceFrameworkBase() {
// Wait for other threads to release access before destroying
const auto guard = LockService();
if (named_port != nullptr) {
named_port->Close();
}
}
void ServiceFrameworkBase::InstallAsService(SM::ServiceManager& service_manager) {
@@ -119,12 +115,13 @@ Kernel::KClientPort& ServiceFrameworkBase::CreatePort() {
ASSERT(!service_registered);
named_port = Kernel::KPort::Create(kernel);
named_port->Initialize(max_sessions, false, service_name);
auto* port = Kernel::KPort::Create(kernel);
port->Initialize(max_sessions, false, service_name);
port->GetServerPort().SetSessionHandler(shared_from_this());
service_registered = true;
return named_port->GetClientPort();
return port->GetClientPort();
}
void ServiceFrameworkBase::RegisterHandlersBase(const FunctionInfoBase* functions, std::size_t n) {
@@ -202,6 +199,7 @@ Result ServiceFrameworkBase::HandleSyncRequest(Kernel::KServerSession& session,
switch (ctx.GetCommandType()) {
case IPC::CommandType::Close:
case IPC::CommandType::TIPC_Close: {
session.Close();
IPC::ResponseBuilder rb{ctx, 2};
rb.Push(ResultSuccess);
result = IPC::ERR_REMOTE_PROCESS_DEAD;
@@ -246,7 +244,6 @@ Services::Services(std::shared_ptr<SM::ServiceManager>& sm, Core::System& system
system.GetFileSystemController().CreateFactories(*system.GetFilesystem(), false);
system.Kernel().RegisterNamedService("sm:", SM::ServiceManager::InterfaceFactory);
system.Kernel().RegisterInterfaceForNamedService("sm:", SM::ServiceManager::SessionHandler);
Account::InstallInterfaces(system);
AM::InstallInterfaces(*sm, *nv_flinger, system);