10 ldap_abandon(NULL, 0);
11 ldap_add_s(NULL, NULL, NULL);
12 ldap_bind_s(NULL, NULL, NULL, 0);
13 ldap_delete_s(NULL, NULL);
14 ldap_first_attribute(NULL, NULL, NULL);
15 ldap_first_entry(NULL, NULL);
16 ldap_get_dn(NULL, NULL);
17 ldap_get_option(NULL, 0, NULL);
18 ldap_get_values_len(NULL, NULL, NULL);
20 ldap_modify_s(NULL, NULL, NULL);
21 ldap_modrdn_s(NULL, NULL, NULL);
23 ldap_next_attribute(NULL, NULL, NULL);
24 ldap_result(NULL, 0, 0, NULL, NULL);
25 ldap_search(NULL, NULL, 0, NULL, NULL, 0);
29 #ifdef HAVE_NT_SERVICE_MANAGER
31 ldap_pvt_thread_cond_t started_event, stopped_event;
32 ldap_pvt_thread_t start_status_tid, stop_status_tid;
36 void WINAPI ServiceMain( DWORD argc, LPTSTR *argv );
39 int srv_install( char* service, char* filename );
40 int srv_remove ( char* service, char* filename );
42 int main( int argc, LPTSTR *argv )
45 char filename[MAX_PATH], *fname_start;
46 extern int is_NT_Service;
48 SERVICE_TABLE_ENTRY DispatchTable[] = {
49 { SERVICE_NAME, (LPSERVICE_MAIN_FUNCTION) ServiceMain },
54 // set the service's current directory to being the installation directory for the service.
55 // this way we don't have to write absolute paths in the configuration files
57 GetModuleFileName( NULL, filename, sizeof( filename ) );
58 fname_start = strrchr( filename, *LDAP_DIRSEP );
60 SetCurrentDirectory( filename );
63 if ( _stricmp( "install", argv[1] ) == 0 )
65 char *svcName = SERVICE_NAME;
66 if ( (argc > 2) && (argv[2] != NULL) )
68 if ( (length = GetModuleFileName(NULL, filename, sizeof( filename ))) == 0 )
70 fputs( "unable to retrieve file name for the service.\n", stderr );
73 if ( !srv_install(svcName, filename) )
75 fputs( "service failed installation ...\n", stderr );
78 fputs( "service has been installed ...\n", stderr );
82 if ( _stricmp( "remove", argv[1] ) == 0 )
84 char *svcName = SERVICE_NAME;
85 if ( (argc > 2) && (argv[2] != NULL) )
87 if ( (length = GetModuleFileName(NULL, filename, sizeof( filename ))) == 0 )
89 fputs( "unable to retrieve file name for the service.\n", stderr );
92 if ( !srv_remove(svcName, filename) )
94 fputs( "failed to remove the service ...\n", stderr );
97 fputs( "service has been removed ...\n", stderr );
102 puts( "starting slapd..." );
103 if ( !StartServiceCtrlDispatcher(DispatchTable) )
106 ServiceMain( argc, argv );