X-Git-Url: http://git.iain.cx/?a=blobdiff_plain;f=service.h;h=4ac3d6fad77d0e238aea15299d14d8c9b79ec3e9;hb=85fe241fc72957ceb77ed2c5587189a23246d87f;hp=496b54a9554c0e34ba5afaaf15d2772747519214;hpb=c03d51cbbfe9f4f8a28dbabbfc068573a1842b74;p=nssm.git diff --git a/service.h b/service.h index 496b54a..4ac3d6f 100644 --- a/service.h +++ b/service.h @@ -1,8 +1,6 @@ #ifndef SERVICE_H #define SERVICE_H -#include - /* MSDN says the commandline in CreateProcess() is limited to 32768 characters and the application name to MAX_PATH. @@ -19,7 +17,6 @@ #define ACTION_LEN 16 -#define NSSM_LOCALSYSTEM_ACCOUNT _T("LocalSystem") #define NSSM_KERNEL_DRIVER _T("SERVICE_KERNEL_DRIVER") #define NSSM_FILE_SYSTEM_DRIVER _T("SERVICE_FILE_SYSTEM_DRIVER") #define NSSM_WIN32_OWN_PROCESS _T("SERVICE_WIN32_OWN_PROCESS") @@ -49,6 +46,8 @@ typedef struct { TCHAR dir[DIR_LENGTH]; TCHAR *env; __int64 affinity; + TCHAR *dependencies; + unsigned long dependencieslen; unsigned long envlen; TCHAR *env_extra; unsigned long env_extralen; @@ -73,11 +72,14 @@ typedef struct { HANDLE stderr_thread; unsigned long stderr_tid; bool rotate_files; + bool stdout_copy_and_truncate; + bool stderr_copy_and_truncate; unsigned long rotate_stdout_online; unsigned long rotate_stderr_online; unsigned long rotate_seconds; unsigned long rotate_bytes_low; unsigned long rotate_bytes_high; + unsigned long rotate_delay; unsigned long default_exit_action; unsigned long restart_delay; unsigned long throttle_delay; @@ -85,6 +87,7 @@ typedef struct { unsigned long kill_console_delay; unsigned long kill_window_delay; unsigned long kill_threads_delay; + bool kill_process_tree; SC_HANDLE handle; SERVICE_STATUS status; SERVICE_STATUS_HANDLE status_handle; @@ -119,14 +122,16 @@ unsigned long priority_index_to_constant(int); nssm_service_t *alloc_nssm_service(); void set_nssm_service_defaults(nssm_service_t *); void cleanup_nssm_service(nssm_service_t *); -SC_HANDLE open_service_manager(); -SC_HANDLE open_service(SC_HANDLE, TCHAR *, TCHAR *, unsigned long); +SC_HANDLE open_service_manager(unsigned long); +SC_HANDLE open_service(SC_HANDLE, TCHAR *, unsigned long, TCHAR *, unsigned long); QUERY_SERVICE_CONFIG *query_service_config(const TCHAR *, SC_HANDLE); +int set_service_dependencies(const TCHAR *, SC_HANDLE, TCHAR *); +int get_service_dependencies(const TCHAR *, SC_HANDLE, TCHAR **, unsigned long *, int); +int get_service_dependencies(const TCHAR *, SC_HANDLE, TCHAR **, unsigned long *); int set_service_description(const TCHAR *, SC_HANDLE, TCHAR *); int get_service_description(const TCHAR *, SC_HANDLE, unsigned long, TCHAR *); int get_service_startup(const TCHAR *, SC_HANDLE, const QUERY_SERVICE_CONFIG *, unsigned long *); int get_service_username(const TCHAR *, const QUERY_SERVICE_CONFIG *, TCHAR **, size_t *); -int grant_logon_as_service(const TCHAR *); int pre_install_service(int, TCHAR **); int pre_remove_service(int, TCHAR **); int pre_edit_service(int, TCHAR **); @@ -141,5 +146,6 @@ int stop_service(nssm_service_t *, unsigned long, bool, bool); void CALLBACK end_service(void *, unsigned char); void throttle_restart(nssm_service_t *); int await_shutdown(nssm_service_t *, TCHAR *, unsigned long); +int await_startup(nssm_service_t *); #endif