* | 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.
*/
#include "inspircd_config.h"
#include "inspircd.h"
+#include "exitcodes.h"
#include <windows.h>
#include <stdlib.h>
#include <string.h>
/* 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;
{
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;
}
return;
}
-/* In windows we hook this to exit() */
+/* In windows we hook this to InspIRCd::Exit() */
void SetServiceStopped(int status)
{
if (!IsAService())
VOID ServiceMain(DWORD argc, LPTSTR *argv)
{
BOOL success;
- DWORD type=0, size=0;
serviceStatusHandle = RegisterServiceCtrlHandler("InspIRCd", (LPHANDLER_FUNCTION)ServiceCtrlHandler);
if (!serviceStatusHandle)