strat: use sf::NativeHandle for ipc templating

This commit is contained in:
Michael Scire
2021-10-05 00:11:36 -07:00
parent d97e97258e
commit 69777cf792
41 changed files with 447 additions and 454 deletions

View File

@@ -46,9 +46,12 @@ namespace ams::pgl {
explicit EventObserverByCmif(ams::sf::SharedPointer<pgl::sf::IEventObserver> intf) : m_cmif_interface(intf) { /* ... */ }
public:
virtual Result GetSystemEvent(os::SystemEventType *out) override {
ams::sf::CopyHandle handle;
ams::sf::NativeHandle handle;
R_TRY(m_cmif_interface->GetProcessEventHandle(std::addressof(handle)));
os::AttachSystemEvent(out, handle.GetValue(), true, svc::InvalidHandle, false, os::EventClearMode_AutoClear);
os::AttachReadableHandleToSystemEvent(out, handle.GetOsHandle(), handle.IsManaged(), os::EventClearMode_AutoClear);
handle.Detach();
return ResultSuccess();
}
@@ -70,7 +73,7 @@ namespace ams::pgl {
virtual Result GetSystemEvent(os::SystemEventType *out) override {
ams::tipc::CopyHandle handle;
R_TRY(m_tipc_interface.GetProcessEventHandle(std::addressof(handle)));
os::AttachSystemEvent(out, handle.GetValue(), true, svc::InvalidHandle, false, os::EventClearMode_AutoClear);
os::AttachReadableHandleToSystemEvent(out, handle.GetValue(), true, os::EventClearMode_AutoClear);
return ResultSuccess();
}