void Plugin::ExecuteFunction(ExecuteStruct& es, const std::function<void()>& f) { Prologue(); ++Activity; try { f(); } catch (SException &e) { if (ProcessSEHException(this, m_model->GetExportName(es.id), e.GetInfo())) { m_model->GetOwner()->UnloadPlugin(this, es.id); es.Result = es.Default; Global->ProcessException=FALSE; } else { throw; } } catch (std::exception &e) { if (ProcessStdException(e, this, m_model->GetExportName(es.id))) { m_model->GetOwner()->UnloadPlugin(this, es.id); es.Result = es.Default; Global->ProcessException = FALSE; } else { throw; } } --Activity; Epilogue(); }
// for Far inline bool ProcessStdException(const std::exception& e, const wchar_t* function) { return ProcessStdException(e, nullptr, function); }