summaryrefslogtreecommitdiff
path: root/src/win32/signalServiceHandler.hpp
diff options
context:
space:
mode:
authorMarkus Grüneis <gimpf@gimpf.org>2010-02-16 19:17:43 +0000
committerMarkus Grüneis <gimpf@gimpf.org>2010-02-16 19:17:43 +0000
commit9865b9fde2d675d974d6a0414a4ec084e1905b84 (patch)
treeb54265a0e3225560701a01d3d82efe3333e9c70b /src/win32/signalServiceHandler.hpp
parentcleaned up manpages (diff)
fixed win32 build
Diffstat (limited to 'src/win32/signalServiceHandler.hpp')
-rw-r--r--src/win32/signalServiceHandler.hpp19
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