X-Git-Url: https://git.netwichtig.de/gitweb/?a=blobdiff_plain;f=win%2Fwin32service.cpp;h=59a06b7097dd6ebf2af7bd664137b42fafce1379;hb=819147178db00008a215670992d0f532dd57f9e5;hp=e75b2eeba73e6533953c5c937adbb885ddb3d6ae;hpb=b708dff6d2897271321764117582a47699e72876;p=user%2Fhenk%2Fcode%2Finspircd.git diff --git a/win/win32service.cpp b/win/win32service.cpp index e75b2eeba..59a06b709 100644 --- a/win/win32service.cpp +++ b/win/win32service.cpp @@ -2,8 +2,8 @@ * | Inspire Internet Relay Chat Daemon | * +------------------------------------+ * - * InspIRCd: (C) 2002-2008 InspIRCd Development Team - * See: http://www.inspircd.org/wiki/index.php/Credits + * InspIRCd: (C) 2002-2009 InspIRCd Development Team + * See: http://wiki.inspircd.org/Credits * * This program is free but copyrighted software; see * the file COPYING for details. @@ -12,6 +12,7 @@ */ #include "inspircd_config.h" #include "inspircd.h" +#include "exitcodes.h" #include #include #include @@ -43,6 +44,7 @@ struct Commandline /* A function pointer for dynamic linking tricks */ SETSERVDESC ChangeServiceConf; +/* Returns true if this program is running as a service, false if it is running interactive */ bool IsAService() { USEROBJECTFLAGS uoflags; @@ -68,8 +70,8 @@ DWORD WINAPI WorkerThread(LPDWORD param) { char modname[MAX_PATH]; GetModuleFileName(NULL, modname, sizeof(modname)); - char* argv[] = { modname, "--nofork", "--debug" }; - smain(3, argv); + char* argv[] = { modname, "--nofork" }; + smain(2, argv); KillService(); return 0; } @@ -143,7 +145,7 @@ void terminateService(int code, int wincode) return; } -/* In windows we hook this to exit() */ +/* In windows we hook this to InspIRCd::Exit() */ void SetServiceStopped(int status) { if (!IsAService()) @@ -179,7 +181,6 @@ VOID ServiceCtrlHandler(DWORD controlCode) VOID ServiceMain(DWORD argc, LPTSTR *argv) { BOOL success; - DWORD type=0, size=0; serviceStatusHandle = RegisterServiceCtrlHandler("InspIRCd", (LPHANDLER_FUNCTION)ServiceCtrlHandler); if (!serviceStatusHandle)