X-Git-Url: http://git.iain.cx/?a=blobdiff_plain;f=service.h;h=1a1b2637707350b8106cd18241572c160b68641a;hb=2a259b54caa08ef6d4dbc99f6fe7ec97837c25e8;hp=96498c7884ac5e865e39367f75c8db1db7a494f6;hpb=f13f3f81d7ad3ccda728d06f615ce5f724023f4e;p=nssm.git diff --git a/service.h b/service.h index 96498c7..1a1b263 100644 --- a/service.h +++ b/service.h @@ -61,6 +61,8 @@ typedef struct { unsigned long stdout_sharing; unsigned long stdout_disposition; unsigned long stdout_flags; + bool use_stdout_pipe; + HANDLE stdout_si; HANDLE stdout_pipe; HANDLE stdout_thread; unsigned long stdout_tid; @@ -68,9 +70,12 @@ typedef struct { unsigned long stderr_sharing; unsigned long stderr_disposition; unsigned long stderr_flags; + bool use_stderr_pipe; + HANDLE stderr_si; HANDLE stderr_pipe; HANDLE stderr_thread; unsigned long stderr_tid; + bool hook_share_output_handles; bool rotate_files; bool stdout_copy_and_truncate; bool stderr_copy_and_truncate; @@ -94,17 +99,25 @@ typedef struct { HANDLE process_handle; unsigned long pid; HANDLE wait_handle; + unsigned long exitcode; bool stopping; bool allow_restart; unsigned long throttle; CRITICAL_SECTION throttle_section; bool throttle_section_initialised; + CRITICAL_SECTION hook_section; + bool hook_section_initialised; CONDITION_VARIABLE throttle_condition; HANDLE throttle_timer; LARGE_INTEGER throttle_duetime; + FILETIME nssm_creation_time; FILETIME creation_time; FILETIME exit_time; TCHAR *initial_env; + unsigned long last_control; + unsigned long start_requested_count; + unsigned long start_count; + unsigned long exit_count; } nssm_service_t; void WINAPI service_main(unsigned long, TCHAR **); @@ -132,6 +145,8 @@ 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 *); +void set_service_environment(nssm_service_t *); +void unset_service_environment(nssm_service_t *); int pre_install_service(int, TCHAR **); int pre_remove_service(int, TCHAR **); int pre_edit_service(int, TCHAR **); @@ -145,6 +160,7 @@ int start_service(nssm_service_t *); 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_service_status_change(nssm_service_t *, unsigned long, unsigned long, TCHAR *, unsigned long); +int await_single_handle(SERVICE_STATUS_HANDLE, SERVICE_STATUS *, HANDLE, TCHAR *, TCHAR *, unsigned long); +int list_nssm_services(); #endif