- (void) memset( (void*) &bind_addr, '\0', sizeof(bind_addr));
- bind_addr.sin_family = AF_INET;
- bind_addr.sin_addr.s_addr = htonl(INADDR_ANY);
- bind_addr.sin_port = htons(LDAP_PORT);
+#ifdef HAVE_NT_SERVICE_MANAGER
+ {
+ int *i;
+ char *newConfigFile;
+ char *newUrls;
+ char *regService = NULL;
+
+ if ( is_NT_Service ) {
+ serverName = argv[0];
+ CommenceStartupProcessing( serverName, slap_sig_shutdown );
+ if ( strcmp(serverName, SERVICE_NAME) )
+ regService = serverName;
+ }
+
+ i = (int*)getRegParam( regService, "DebugLevel" );
+ if ( i != NULL )
+ {
+ slap_debug = *i;
+#ifdef NEW_LOGGING
+ lutil_log_initialize( argc, argv );
+ LDAP_LOG( SLAPD, INFO,
+ "main: new debug level from registry is: %d\n",
+ slap_debug, 0, 0 );
+#else
+ Debug( LDAP_DEBUG_ANY, "new debug level from registry is: %d\n", slap_debug, 0, 0 );
+#endif
+ }
+
+ newUrls = (char *) getRegParam(regService, "Urls");
+ if (newUrls)
+ {
+ if (urls)
+ ch_free(urls);
+
+ urls = ch_strdup(newUrls);
+#ifdef NEW_LOGGING
+ LDAP_LOG( SLAPD, INFO,
+ "main: new urls from registry: %s\n", urls, 0, 0 );
+#else
+ Debug(LDAP_DEBUG_ANY, "new urls from registry: %s\n",
+ urls, 0, 0);
+#endif
+
+ }
+
+ newConfigFile = (char*)getRegParam( regService, "ConfigFile" );
+ if ( newConfigFile != NULL )
+ {
+ configfile = newConfigFile;
+#ifdef NEW_LOGGING
+ LDAP_LOG( SLAPD, INFO,
+ "main: new config file from registry is: %s\n", configfile, 0, 0 );
+#else
+ Debug ( LDAP_DEBUG_ANY, "new config file from registry is: %s\n", configfile, 0, 0 );
+#endif