diff options
author | Christian Pointner <equinox@anytun.org> | 2010-01-20 08:19:16 +0000 |
---|---|---|
committer | Christian Pointner <equinox@anytun.org> | 2010-01-20 08:19:16 +0000 |
commit | 9c363297c80c00d5b940b8614fb1b4e375b45fe6 (patch) | |
tree | e7e87832dfb0890b42f87f989dbd855e9d64105b /src/win32/signalServiceHandler.hpp | |
parent | integrated winservice into signal controller (diff) |
winService works now together with signalController
Diffstat (limited to 'src/win32/signalServiceHandler.hpp')
-rw-r--r-- | src/win32/signalServiceHandler.hpp | 13 |
1 files changed, 8 insertions, 5 deletions
diff --git a/src/win32/signalServiceHandler.hpp b/src/win32/signalServiceHandler.hpp index 3c6be7e..67d0774 100644 --- a/src/win32/signalServiceHandler.hpp +++ b/src/win32/signalServiceHandler.hpp @@ -35,13 +35,16 @@ #include "winService.h" -void registerSignalHandler(SignalController& ctrl, WinService& service) +void registerSignalHandler(SignalController& ctrl, WinService* service) { - ctrl.handler[SERVICE_CONTROL_STOP] = boost::bind(WinService::handleCtrlSignal, &service, _1, _2); - ctrl.handler[SERVICE_CONTROL_INTERROGATE] = boost::bind(WinService::handleCtrlSignal, &service, _1, _2); + if(!service) + return; - ctrl.callbacks.insert(SignalController::CallbackMap::value_type(CALLB_RUNNING, boost::bind(&WinService::reportStatus, &service, SERVICE_RUNNING, NO_ERROR))); - ctrl.callbacks.insert(SignalController::CallbackMap::value_type(CALLB_STOPPING, boost::bind(&WinService::reportStatus, &service, SERVICE_STOP_PENDING, NO_ERROR))); + ctrl.handler[SERVICE_CONTROL_STOP] = boost::bind(&WinService::handleCtrlSignal, service, _1, _2); + ctrl.handler[SERVICE_CONTROL_INTERROGATE] = boost::bind(&WinService::handleCtrlSignal, service, _1, _2); + + ctrl.callbacks.insert(SignalController::CallbackMap::value_type(CALLB_RUNNING, boost::bind(&WinService::reportStatus, service, SERVICE_RUNNING, NO_ERROR))); + ctrl.callbacks.insert(SignalController::CallbackMap::value_type(CALLB_STOPPING, boost::bind(&WinService::reportStatus, service, SERVICE_STOP_PENDING, NO_ERROR))); } #endif |