mirror of
https://github.com/Atmosphere-NX/Atmosphere-libs.git
synced 2025-08-07 07:59:27 +02:00
sm: fix deadlock semantics surrounding mitm installation
This commit is contained in:
parent
8b88149742
commit
fea438eb76
@ -32,6 +32,7 @@ namespace ams::sm::impl {
|
|||||||
AMS_SF_METHOD_INFO(C, H, 65004, Result, AtmosphereHasMitm, (sf::Out<bool> out, ServiceName service)) \
|
AMS_SF_METHOD_INFO(C, H, 65004, Result, AtmosphereHasMitm, (sf::Out<bool> out, ServiceName service)) \
|
||||||
AMS_SF_METHOD_INFO(C, H, 65005, Result, AtmosphereWaitMitm, (ServiceName service)) \
|
AMS_SF_METHOD_INFO(C, H, 65005, Result, AtmosphereWaitMitm, (ServiceName service)) \
|
||||||
AMS_SF_METHOD_INFO(C, H, 65006, Result, AtmosphereDeclareFutureMitm, (ServiceName service)) \
|
AMS_SF_METHOD_INFO(C, H, 65006, Result, AtmosphereDeclareFutureMitm, (ServiceName service)) \
|
||||||
|
AMS_SF_METHOD_INFO(C, H, 65007, Result, AtmosphereClearFutureMitm, (ServiceName service)) \
|
||||||
AMS_SF_METHOD_INFO(C, H, 65100, Result, AtmosphereHasService, (sf::Out<bool> out, ServiceName service)) \
|
AMS_SF_METHOD_INFO(C, H, 65100, Result, AtmosphereHasService, (sf::Out<bool> out, ServiceName service)) \
|
||||||
AMS_SF_METHOD_INFO(C, H, 65101, Result, AtmosphereWaitService, (ServiceName service))
|
AMS_SF_METHOD_INFO(C, H, 65101, Result, AtmosphereWaitService, (ServiceName service))
|
||||||
|
|
||||||
|
@ -24,6 +24,7 @@ namespace ams::sm::mitm {
|
|||||||
Result InstallMitm(Handle *out_port, Handle *out_query, ServiceName name);
|
Result InstallMitm(Handle *out_port, Handle *out_query, ServiceName name);
|
||||||
Result UninstallMitm(ServiceName name);
|
Result UninstallMitm(ServiceName name);
|
||||||
Result DeclareFutureMitm(ServiceName name);
|
Result DeclareFutureMitm(ServiceName name);
|
||||||
|
Result ClearFutureMitm(ServiceName name);
|
||||||
Result AcknowledgeSession(Service *out_service, MitmProcessInfo *out_info, ServiceName name);
|
Result AcknowledgeSession(Service *out_service, MitmProcessInfo *out_info, ServiceName name);
|
||||||
Result HasMitm(bool *out, ServiceName name);
|
Result HasMitm(bool *out, ServiceName name);
|
||||||
Result WaitMitm(ServiceName name);
|
Result WaitMitm(ServiceName name);
|
||||||
|
@ -27,6 +27,10 @@ namespace ams::sf::hipc {
|
|||||||
|
|
||||||
/* Register the query handle. */
|
/* Register the query handle. */
|
||||||
impl::RegisterMitmQueryHandle(query_handle, query_func);
|
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();
|
return ResultSuccess();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -107,6 +107,10 @@ Result smAtmosphereMitmDeclareFuture(SmServiceName name) {
|
|||||||
return _smAtmosphereCmdInServiceNameNoOut(name, smGetServiceSession(), 65006);
|
return _smAtmosphereCmdInServiceNameNoOut(name, smGetServiceSession(), 65006);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Result smAtmosphereMitmClearFuture(SmServiceName name) {
|
||||||
|
return _smAtmosphereCmdInServiceNameNoOut(name, smGetServiceSession(), 65007);
|
||||||
|
}
|
||||||
|
|
||||||
Result smAtmosphereMitmAcknowledgeSession(Service *srv_out, void *_out, SmServiceName name) {
|
Result smAtmosphereMitmAcknowledgeSession(Service *srv_out, void *_out, SmServiceName name) {
|
||||||
struct {
|
struct {
|
||||||
u64 process_id;
|
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 smAtmosphereMitmInstall(Service *fwd_srv, Handle *handle_out, Handle *query_out, SmServiceName name);
|
||||||
Result smAtmosphereMitmUninstall(SmServiceName name);
|
Result smAtmosphereMitmUninstall(SmServiceName name);
|
||||||
Result smAtmosphereMitmDeclareFuture(SmServiceName name);
|
Result smAtmosphereMitmDeclareFuture(SmServiceName name);
|
||||||
|
Result smAtmosphereMitmClearFuture(SmServiceName name);
|
||||||
Result smAtmosphereMitmAcknowledgeSession(Service *srv_out, void *info_out, SmServiceName name);
|
Result smAtmosphereMitmAcknowledgeSession(Service *srv_out, void *info_out, SmServiceName name);
|
||||||
|
|
||||||
#ifdef __cplusplus
|
#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) {
|
Result AcknowledgeSession(Service *out_service, MitmProcessInfo *out_info, ServiceName name) {
|
||||||
return impl::DoWithMitmAcknowledgementSession([&]() {
|
return impl::DoWithMitmAcknowledgementSession([&]() {
|
||||||
return smAtmosphereMitmAcknowledgeSession(out_service, reinterpret_cast<void *>(out_info), impl::ConvertName(name));
|
return smAtmosphereMitmAcknowledgeSession(out_service, reinterpret_cast<void *>(out_info), impl::ConvertName(name));
|
||||||
|
Loading…
Reference in New Issue
Block a user