bin/named/win32/ntservice.c
/*
 * Initialize the Service by registering it.
 */
Initialize the Service by registering it.
Initialize the Service by registering it .
void
ntservice_init() {
	if (!foreground) {
		hServiceStatus = RegisterServiceCtrlHandler(BIND_SERVICE_NAME,
					(LPHANDLER_FUNCTION)ServiceControl);
		if (!hServiceStatus) {
			ns_main_earlyfatal(
				"could not register service control handler");
			UpdateSCM(SERVICE_STOPPED);
			exit(1);
		}
		UpdateSCM(SERVICE_RUNNING);
	} else {
		strcpy(ConsoleTitle, "BIND Version ");
		strcat(ConsoleTitle, VERSION);
		SetConsoleTitle(ConsoleTitle);
	}
}
void ntservice_init ( ) { if ( ! foreground ) { hServiceStatus = RegisterServiceCtrlHandler ( BIND_SERVICE_NAME , ( LPHANDLER_FUNCTION ) ServiceControl ) ; if ( ! hServiceStatus ) { ns_main_earlyfatal ( " " ) ; UpdateSCM ( SERVICE_STOPPED ) ; exit ( 1 ) ; } UpdateSCM ( SERVICE_RUNNING ) ; } else { strcpy ( ConsoleTitle , " " ) ; strcat ( ConsoleTitle , VERSION ) ; SetConsoleTitle ( ConsoleTitle ) ; } }
Initialize the Service by registering it.
Initialize the Service by registering it .
/* Register handler with the SCM */