+ int syslogUser = DEFAULT_SYSLOG_USER;
+#endif
+
+ int g_argc = argc;
+ char **g_argv = argv;
+
+#ifdef HAVE_NT_SERVICE_MANAGER
+ char *configfile = ".\\slapd.conf";
+#else
+ char *configfile = SLAPD_DEFAULT_CONFIGFILE;
+#endif
+ char *serverName = NULL;
+ int serverMode = SLAP_SERVER_MODE;
+
+#ifdef CSRIMALLOC
+ FILE *leakfile;
+ if( ( leakfile = fopen( "slapd.leak", "w" )) == NULL ) {
+ leakfile = stderr;
+ }
+#endif
+
+
+#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
+ LDAP_LOG(( "operation", LDAP_LEVEL_INFO,
+ "main: new debug level from registry is: %d\n", slap_debug ));
+#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(( "operation", LDAP_LEVEL_INFO,
+ "main: new urls from registry: %s\n", urls ));
+#else
+ Debug(LDAP_DEBUG_ANY, "new urls from registry: %s\n",
+ urls, 0, 0);