mirror of
https://github.com/Atmosphere-NX/Atmosphere.git
synced 2025-05-30 06:25:20 -04:00
sm: fix deadlock semantics surrounding mitm installation
This commit is contained in:
parent
fac502aaa3
commit
99b5458539
10 changed files with 62 additions and 3 deletions
|
@ -27,6 +27,10 @@ namespace ams::sf::hipc {
|
|||
|
||||
/* Register the query handle. */
|
||||
impl::RegisterMitmQueryHandle(query_handle, query_func);
|
||||
|
||||
/* Clear future declarations if any, now that our query handler is present. */
|
||||
R_ABORT_UNLESS(sm::mitm::ClearFutureMitm(service_name));
|
||||
|
||||
return ResultSuccess();
|
||||
}
|
||||
|
||||
|
|
|
@ -107,6 +107,10 @@ Result smAtmosphereMitmDeclareFuture(SmServiceName name) {
|
|||
return _smAtmosphereCmdInServiceNameNoOut(name, smGetServiceSession(), 65006);
|
||||
}
|
||||
|
||||
Result smAtmosphereMitmClearFuture(SmServiceName name) {
|
||||
return _smAtmosphereCmdInServiceNameNoOut(name, smGetServiceSession(), 65007);
|
||||
}
|
||||
|
||||
Result smAtmosphereMitmAcknowledgeSession(Service *srv_out, void *_out, SmServiceName name) {
|
||||
struct {
|
||||
u64 process_id;
|
||||
|
|
|
@ -26,6 +26,7 @@ void smAtmosphereCloseSession(Service *srv);
|
|||
Result smAtmosphereMitmInstall(Service *fwd_srv, Handle *handle_out, Handle *query_out, SmServiceName name);
|
||||
Result smAtmosphereMitmUninstall(SmServiceName name);
|
||||
Result smAtmosphereMitmDeclareFuture(SmServiceName name);
|
||||
Result smAtmosphereMitmClearFuture(SmServiceName name);
|
||||
Result smAtmosphereMitmAcknowledgeSession(Service *srv_out, void *info_out, SmServiceName name);
|
||||
|
||||
#ifdef __cplusplus
|
||||
|
|
|
@ -37,6 +37,12 @@ namespace ams::sm::mitm {
|
|||
});
|
||||
}
|
||||
|
||||
Result ClearFutureMitm(ServiceName name) {
|
||||
return impl::DoWithUserSession([&]() {
|
||||
return smAtmosphereMitmClearFuture(impl::ConvertName(name));
|
||||
});
|
||||
}
|
||||
|
||||
Result AcknowledgeSession(Service *out_service, MitmProcessInfo *out_info, ServiceName name) {
|
||||
return impl::DoWithMitmAcknowledgementSession([&]() {
|
||||
return smAtmosphereMitmAcknowledgeSession(out_service, reinterpret_cast<void *>(out_info), impl::ConvertName(name));
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue