X-Git-Url: http://git.iain.cx/?a=blobdiff_plain;f=service.h;h=d4ec8efd771256f22190ce1944f072ffe01dc7bb;hb=dd0e555ba889a74ae14487ca0b4a5c62cfa4d873;hp=04327c3c6ef29046db3b4179aab7ce890d3c8c46;hpb=2f219930f488b2551326900df5c201de2e9304f2;p=nssm.git diff --git a/service.h b/service.h index 04327c3..d4ec8ef 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. @@ -13,11 +15,24 @@ #define KEY_LENGTH 255 #define VALUE_LENGTH 16383 #define SERVICE_NAME_LENGTH KEY_LENGTH - 55 +#define SERVICE_DISPLAYNAME_LENGTH 256 #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]; @@ -76,8 +91,10 @@ void cleanup_nssm_service(nssm_service_t *); SC_HANDLE open_service_manager(); 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 *);