diff options
author | Markus Grüneis <gimpf@gimpf.org> | 2010-02-16 19:17:43 +0000 |
---|---|---|
committer | Markus Grüneis <gimpf@gimpf.org> | 2010-02-16 19:17:43 +0000 |
commit | 9865b9fde2d675d974d6a0414a4ec084e1905b84 (patch) | |
tree | b54265a0e3225560701a01d3d82efe3333e9c70b /src/win32/signalServiceHandler.hpp | |
parent | cleaned up manpages (diff) |
fixed win32 build
Diffstat (limited to 'src/win32/signalServiceHandler.hpp')
-rw-r--r-- | src/win32/signalServiceHandler.hpp | 19 |
1 files changed, 8 insertions, 11 deletions
diff --git a/src/win32/signalServiceHandler.hpp b/src/win32/signalServiceHandler.hpp index 28121f4..da16de5 100644 --- a/src/win32/signalServiceHandler.hpp +++ b/src/win32/signalServiceHandler.hpp @@ -30,22 +30,19 @@ * along with anytun. If not, see <http://www.gnu.org/licenses/>. */ -#ifndef ANYTUN_signalServiceHandler_h_INCLUDED -#define ANYTUN_signalServiceHandler_h_INCLUDED +#ifndef ANYTUN_signalServiceHandler_hpp_INCLUDED +#define ANYTUN_signalServiceHandler_hpp_INCLUDED #include "winService.h" -void registerSignalHandler(SignalController& ctrl, WinService* service) +void registerSignalHandler(SignalController& ctrl, WinService& service) { - if(!service) - return; + 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.handler[SIGUNKNOWN] = boost::bind(&WinService::handleCtrlSignal, &service, _1, _2); - 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.handler[SIGUNKNOWN] = 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))); + 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 |