/*
- * Copyright (C) 2004, 2006, 2007 Internet Systems Consortium, Inc. ("ISC")
+ * Copyright (C) 2004, 2006, 2007, 2009 Internet Systems Consortium, Inc. ("ISC")
* Copyright (C) 1999-2002 Internet Software Consortium.
*
* Permission to use, copy, modify, and/or distribute this software for any
* PERFORMANCE OF THIS SOFTWARE.
*/
-/* $Id: ntservice.c,v 1.12.332.1 2009/06/23 07:51:00 marka Exp $ */
+/* $Id: ntservice.c,v 1.12.332.2 2009/06/23 23:47:11 tbox Exp $ */
#include <config.h>
#include <stdio.h>
#pragma comment(linker, "/entry:bindmain")
/*
- * This is the entry point for the executable
+ * This is the entry point for the executable
* We can now call main() explicitly or via StartServiceCtrlDispatcher()
* as we need to.
*/
ntservice_isservice() {
return(!foreground);
}
-/*
+/*
* ServiceControl(): Handles requests from the SCM and passes them on
* to named.
*/
ServiceControl(DWORD dwCtrlCode) {
/* Handle the requested control code */
switch(dwCtrlCode) {
- case SERVICE_CONTROL_INTERROGATE:
+ case SERVICE_CONTROL_INTERROGATE:
UpdateSCM(0);
break;
- case SERVICE_CONTROL_SHUTDOWN:
- case SERVICE_CONTROL_STOP:
+ case SERVICE_CONTROL_SHUTDOWN:
+ case SERVICE_CONTROL_STOP:
ns_server_flushonshutdown(ns_g_server, ISC_TRUE);
isc_app_shutdown();
UpdateSCM(SERVICE_STOPPED);
break;
- default:
+ default:
break;
}
}
* get argv, argc, envp.
*/
-typedef struct
+typedef struct
{
int newmode;
} _startupinfo;
void GetArgs(int *argc, char ***argv, char ***envp)
{
_startupinfo startinfo;
-
+
/*
* Set the app type to Console (check CRT/SRC/INTERNAL.H:
* \#define _CONSOLE_APP 1)
*/
__set_app_type(1);
-
+
/* Mark this module as an EXE file */
__onexitbegin = __onexitend = (_PVFV *)(-1);