X-Git-Url: http://git.iain.cx/?a=blobdiff_plain;f=service.h;h=596b82b502dde81230b3647b82ba35316aafc913;hb=b6cfe6e22a89192c1bdcf234f17a72fd9993d570;hp=474f365ac2ede74085891638648ee7b496baf913;hpb=a02019297db435c1de6846fd0387a53335f4289e;p=nssm.git diff --git a/service.h b/service.h index 474f365..596b82b 100644 --- a/service.h +++ b/service.h @@ -1,6 +1,8 @@ #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. @@ -17,11 +19,20 @@ #define ACTION_LEN 16 +#define NSSM_LOCALSYSTEM_ACCOUNT _T("LocalSystem") + typedef struct { + bool native; TCHAR name[SERVICE_NAME_LENGTH]; TCHAR displayname[SERVICE_DISPLAYNAME_LENGTH]; TCHAR description[VALUE_LENGTH]; unsigned long startup; + TCHAR *username; + size_t usernamelen; + TCHAR *password; + size_t passwordlen; + unsigned long type; + TCHAR image[MAX_PATH]; TCHAR exe[EXE_LENGTH]; TCHAR flags[VALUE_LENGTH]; TCHAR dir[MAX_PATH]; @@ -78,10 +89,13 @@ 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(); +QUERY_SERVICE_CONFIG *query_service_config(const TCHAR *, SC_HANDLE); int pre_install_service(int, TCHAR **); int pre_remove_service(int, TCHAR **); +int pre_edit_service(int, TCHAR **); int install_service(nssm_service_t *); int remove_service(nssm_service_t *); +int edit_service(nssm_service_t *, bool); void set_service_recovery(nssm_service_t *); int monitor_service(nssm_service_t *); int start_service(nssm_service_t *);