libstrat: fix domain issues. in/out objects now work.
This commit is contained in:
@@ -90,6 +90,7 @@ namespace sts::sf::cmif {
|
||||
if (entry == nullptr) {
|
||||
return ServiceObjectHolder();
|
||||
}
|
||||
|
||||
{
|
||||
std::scoped_lock lk(this->manager->entry_owner_lock);
|
||||
if (entry->owner != this) {
|
||||
@@ -116,9 +117,11 @@ namespace sts::sf::cmif {
|
||||
|
||||
ServerDomainManager::Entry *ServerDomainManager::EntryManager::AllocateEntry() {
|
||||
std::scoped_lock lk(this->lock);
|
||||
|
||||
if (this->free_list.empty()) {
|
||||
return nullptr;
|
||||
}
|
||||
|
||||
Entry *e = &this->free_list.front();
|
||||
this->free_list.pop_front();
|
||||
return e;
|
||||
|
||||
@@ -48,6 +48,7 @@ namespace sts::sf::cmif {
|
||||
} else {
|
||||
ctx.processor->SetImplementationProcessor(&domain_processor);
|
||||
}
|
||||
ctx.srv_obj = target_object.GetServiceObjectUnsafe();
|
||||
return target_object.ProcessMessage(ctx, in_message_raw_data);
|
||||
}
|
||||
case CmifDomainRequestType_Close:
|
||||
@@ -86,6 +87,7 @@ namespace sts::sf::cmif {
|
||||
} else {
|
||||
ctx.processor->SetImplementationProcessor(&domain_processor);
|
||||
}
|
||||
ctx.srv_obj = target_object.GetServiceObjectUnsafe();
|
||||
return target_object.ProcessMessage(ctx, in_message_raw_data);
|
||||
}
|
||||
case CmifDomainRequestType_Close:
|
||||
@@ -136,7 +138,7 @@ namespace sts::sf::cmif {
|
||||
|
||||
/* Set output raw data. */
|
||||
out_raw_data = cmif::PointerAndSize(raw_data.GetAddress() + out_header_size, raw_data.GetSize() - out_header_size);
|
||||
this->out_object_ids = reinterpret_cast<DomainObjectId *>(out_raw_data.GetAddress() + out_raw_data.GetSize());
|
||||
this->out_object_ids = reinterpret_cast<DomainObjectId *>(out_raw_data.GetAddress() + impl_out_data_total_size);
|
||||
|
||||
return request;
|
||||
}
|
||||
|
||||
@@ -47,10 +47,7 @@ namespace sts::sf::hipc {
|
||||
R_ASSERT(tagged_manager->RegisterSession(server_handle, std::move(clone)));
|
||||
} else {
|
||||
/* Clone the forward service. */
|
||||
std::shared_ptr<::Service> new_forward_service(new ::Service(), [](::Service *srv) {
|
||||
serviceClose(srv);
|
||||
delete srv;
|
||||
});
|
||||
std::shared_ptr<::Service> new_forward_service = std::move(ServerSession::CreateForwardService());
|
||||
R_ASSERT(serviceClone(this->session->forward_service.get(), new_forward_service.get()));
|
||||
R_ASSERT(tagged_manager->RegisterMitmSession(server_handle, std::move(clone), std::move(new_forward_service)));
|
||||
}
|
||||
@@ -138,10 +135,7 @@ namespace sts::sf::hipc {
|
||||
R_ASSERT(hipc::CreateSession(&server_handle, out.GetHandlePointer()));
|
||||
|
||||
/* Register. */
|
||||
std::shared_ptr<::Service> new_forward_service(new ::Service(), [](::Service *srv) {
|
||||
serviceClose(srv);
|
||||
delete srv;
|
||||
});
|
||||
std::shared_ptr<::Service> new_forward_service = std::move(ServerSession::CreateForwardService());
|
||||
serviceCreate(new_forward_service.get(), new_forward_target);
|
||||
R_ASSERT(this->manager->RegisterMitmSession(server_handle, std::move(object), std::move(new_forward_service)));
|
||||
}
|
||||
@@ -178,7 +172,7 @@ namespace sts::sf::hipc {
|
||||
/* Note: This is safe, as no additional references to the hipc manager can ever be stored. */
|
||||
/* The shared pointer to stack object is definitely gross, though. */
|
||||
impl::HipcManager hipc_manager(this, session);
|
||||
return this->DispatchRequest(cmif::ServiceObjectHolder(std::shared_ptr<impl::HipcManager>(&hipc_manager, [](impl::HipcManager *) { /* Empty deleter. */ })), session, in_message, out_message);
|
||||
return this->DispatchRequest(cmif::ServiceObjectHolder(std::move(ServiceObjectTraits<impl::HipcManager>::SharedPointerHelper::GetEmptyDeleteSharedPointer(&hipc_manager))), session, in_message, out_message);
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user