6 #include "isisdatasvr_i.h"
14 DECLARE_LIBID(LIBID_isisdatasvrLib)
18 HRESULT InitializeSecurity() throw()
20 // TODO : Call CoInitializeSecurity and provide the appropriate security settings for
22 // Suggested - PKT Level Authentication,
23 // Impersonation Level of RPC_C_IMP_LEVEL_IDENTIFY
24 // and an appropiate Non NULL Security Descriptor.
28 HRESULT Start(int nShowCmd) throw();
32 CisisdatasvrModule _AtlModule;
34 class ISISDataSvrApp : public Poco::Util::Application
38 ISISDataSvrApp(int nShowCmd) : Poco::Util::Application(), m_nShowCmd(nShowCmd) { }
39 virtual int main(const std::vector<std::string>& args);
41 void initialize(Poco::Util::Application& self)
43 registerExtraLoggerChannels();
44 if (loadAppConfig("isisdatasvr
") != 0) // does equivalent job of default loadConfiguration()
46 // LogEventEx(ICP_MSG_ERROR, "Cannot load isisicp.default.properties
", EVENTLOG_ERROR_TYPE);
47 throw std::exception("Cannot load isisdatasvr.default.properties
");
49 Application::initialize(self);
53 int ISISDataSvrApp::main(const std::vector<std::string>& args)
55 return _AtlModule.WinMain(m_nShowCmd);
58 static ISISDataSvrApp* the_app = NULL;
61 extern "C
" int WINAPI _tWinMain(HINSTANCE /*hInstance*/, HINSTANCE /*hPrevInstance*/,
62 LPTSTR lpCmdLine, int nShowCmd)
64 std::vector<std::string> args;
65 if ( !stricmp(lpCmdLine, "/RegServer
") )
67 return 0; // we are not a com server and may hang?
69 args.push_back("isisdatasvr.exe
");
70 the_app = new ISISDataSvrApp(nShowCmd);
72 int ret = the_app->run();
78 HRESULT CisisdatasvrModule::Start(int nShowCmd) throw()
81 m_dwTimeOut = 0; // so we do not terminate when there are no active commections
82 Poco::NamedMutex proc_lock("ISISDATASVR_PROCESS_LOCK
");
83 if ( !proc_lock.tryLock() )
89 // LogEvent("starting
");
90 the_app->logger().information("Starting isisdatasvr
");
91 while(m_ds->isRunning())
95 return CAtlServiceModuleT<CisisdatasvrModule,IDS_SERVICENAME>::Start(nShowCmd);
98 HRESULT CisisdatasvrModule::OnStop()
100 the_app->logger().information("Stopping isisdatasvr
");
DECLARE_REGISTRY_APPID_RESOURCEID(IDR_ISISDATASVR,"{30E8C5AF-52D0-4FCB-AF0A-2E3EE7A392C8}") HRESULT InitializeSecurity()