diff options
author | Christian Pointner <equinox@anytun.org> | 2009-02-20 14:45:26 +0000 |
---|---|---|
committer | Christian Pointner <equinox@anytun.org> | 2009-02-20 14:45:26 +0000 |
commit | 76a437ed322ae5a5fe317d4a2dbe392a21ac9932 (patch) | |
tree | 390d3a66da5c7624d91872003c2914f1a463f162 /src/win32/winService.h | |
parent | moved NO_SYSLOG to inverse LOG_SYSLOG switch (diff) |
windows service works now
Diffstat (limited to 'src/win32/winService.h')
-rw-r--r-- | src/win32/winService.h | 19 |
1 files changed, 12 insertions, 7 deletions
diff --git a/src/win32/winService.h b/src/win32/winService.h index dc648d8..53c2750 100644 --- a/src/win32/winService.h +++ b/src/win32/winService.h @@ -32,22 +32,26 @@ #ifndef _WIN_SERVICE_H_ #define _WIN_SERVICE_H_ +#ifdef WIN_SERVICE + #include "../threadUtils.hpp" class WinService { public: static WinService& instance(); + #define SVC_NAME "anytun" + static void install(); + static void uninstall(); + static void start(); - void install(); - void start(); - void waitForExit(); + void waitForStop(); void stop(); static VOID WINAPI main(DWORD dwArgc, LPTSTR *lpszArgv); static VOID WINAPI ctrlHandler(DWORD dwCtrl); private: - WinService() : name_("anytun"), started_(false) {}; + WinService() : started_(false) {}; ~WinService(); WinService(const WinService &w); void operator=(const WinService &w); @@ -63,14 +67,15 @@ private: } }; friend class instanceCleaner; - - std::string name_; + bool started_; SERVICE_STATUS status_; SERVICE_STATUS_HANDLE status_handle_; - HANDLE exit_event_; + HANDLE stop_event_; }; extern WinService& gWinService; +#endif + #endif
\ No newline at end of file |