Use close_handle().
[nssm.git] / registry.h
1 #ifndef REGISTRY_H\r
2 #define REGISTRY_H\r
3 \r
4 #define NSSM_REGISTRY _T("SYSTEM\\CurrentControlSet\\Services\\%s")\r
5 #define NSSM_REG_PARAMETERS _T("Parameters")\r
6 #define NSSM_REGISTRY_GROUPS _T("SYSTEM\\CurrentControlSet\\Control\\ServiceGroupOrder")\r
7 #define NSSM_REG_GROUPS _T("List")\r
8 #define NSSM_REG_EXE _T("Application")\r
9 #define NSSM_REG_FLAGS _T("AppParameters")\r
10 #define NSSM_REG_DIR _T("AppDirectory")\r
11 #define NSSM_REG_ENV _T("AppEnvironment")\r
12 #define NSSM_REG_ENV_EXTRA _T("AppEnvironmentExtra")\r
13 #define NSSM_REG_EXIT _T("AppExit")\r
14 #define NSSM_REG_RESTART_DELAY _T("AppRestartDelay")\r
15 #define NSSM_REG_THROTTLE _T("AppThrottle")\r
16 #define NSSM_REG_STOP_METHOD_SKIP _T("AppStopMethodSkip")\r
17 #define NSSM_REG_KILL_CONSOLE_GRACE_PERIOD _T("AppStopMethodConsole")\r
18 #define NSSM_REG_KILL_WINDOW_GRACE_PERIOD _T("AppStopMethodWindow")\r
19 #define NSSM_REG_KILL_THREADS_GRACE_PERIOD _T("AppStopMethodThreads")\r
20 #define NSSM_REG_KILL_PROCESS_TREE _T("AppKillProcessTree")\r
21 #define NSSM_REG_STDIN _T("AppStdin")\r
22 #define NSSM_REG_STDOUT _T("AppStdout")\r
23 #define NSSM_REG_STDERR _T("AppStderr")\r
24 #define NSSM_REG_STDIO_SHARING _T("ShareMode")\r
25 #define NSSM_REG_STDIO_DISPOSITION _T("CreationDisposition")\r
26 #define NSSM_REG_STDIO_FLAGS _T("FlagsAndAttributes")\r
27 #define NSSM_REG_STDIO_COPY_AND_TRUNCATE _T("CopyAndTruncate")\r
28 #define NSSM_REG_HOOK_SHARE_OUTPUT_HANDLES _T("AppRedirectHook")\r
29 #define NSSM_REG_ROTATE _T("AppRotateFiles")\r
30 #define NSSM_REG_ROTATE_ONLINE _T("AppRotateOnline")\r
31 #define NSSM_REG_ROTATE_SECONDS _T("AppRotateSeconds")\r
32 #define NSSM_REG_ROTATE_BYTES_LOW _T("AppRotateBytes")\r
33 #define NSSM_REG_ROTATE_BYTES_HIGH _T("AppRotateBytesHigh")\r
34 #define NSSM_REG_ROTATE_DELAY _T("AppRotateDelay")\r
35 #define NSSM_REG_PRIORITY _T("AppPriority")\r
36 #define NSSM_REG_AFFINITY _T("AppAffinity")\r
37 #define NSSM_REG_NO_CONSOLE _T("AppNoConsole")\r
38 #define NSSM_REG_HOOK _T("AppEvents")\r
39 #define NSSM_STDIO_LENGTH 29\r
40 \r
41 HKEY open_service_registry(const TCHAR *, REGSAM sam, bool);\r
42 long open_registry(const TCHAR *, const TCHAR *, REGSAM sam, HKEY *, bool);\r
43 HKEY open_registry(const TCHAR *, const TCHAR *, REGSAM sam, bool);\r
44 HKEY open_registry(const TCHAR *, const TCHAR *, REGSAM sam);\r
45 HKEY open_registry(const TCHAR *, REGSAM sam);\r
46 long enumerate_registry_values(HKEY, unsigned long *, TCHAR *, unsigned long);\r
47 int create_messages();\r
48 int create_parameters(nssm_service_t *, bool);\r
49 int create_exit_action(TCHAR *, const TCHAR *, bool);\r
50 int get_environment(TCHAR *, HKEY, TCHAR *, TCHAR **, unsigned long *);\r
51 int get_string(HKEY, TCHAR *, TCHAR *, unsigned long, bool, bool, bool);\r
52 int get_string(HKEY, TCHAR *, TCHAR *, unsigned long, bool);\r
53 int expand_parameter(HKEY, TCHAR *, TCHAR *, unsigned long, bool, bool);\r
54 int expand_parameter(HKEY, TCHAR *, TCHAR *, unsigned long, bool);\r
55 int set_string(HKEY, TCHAR *, TCHAR *, bool);\r
56 int set_string(HKEY, TCHAR *, TCHAR *);\r
57 int set_expand_string(HKEY, TCHAR *, TCHAR *);\r
58 int set_number(HKEY, TCHAR *, unsigned long);\r
59 int get_number(HKEY, TCHAR *, unsigned long *, bool);\r
60 int get_number(HKEY, TCHAR *, unsigned long *);\r
61 int format_double_null(TCHAR *, unsigned long, TCHAR **, unsigned long *);\r
62 int unformat_double_null(TCHAR *, unsigned long, TCHAR **, unsigned long *);\r
63 int copy_double_null(TCHAR *, unsigned long, TCHAR **);\r
64 int append_to_double_null(TCHAR *, unsigned long, TCHAR **, unsigned long *, TCHAR *, size_t, bool);\r
65 int remove_from_double_null(TCHAR *, unsigned long, TCHAR **, unsigned long *, TCHAR *, size_t, bool);\r
66 void override_milliseconds(TCHAR *, HKEY, TCHAR *, unsigned long *, unsigned long, unsigned long);\r
67 int get_io_parameters(nssm_service_t *, HKEY);\r
68 int get_parameters(nssm_service_t *, STARTUPINFO *);\r
69 int get_exit_action(const TCHAR *, unsigned long *, TCHAR *, bool *);\r
70 int set_hook(const TCHAR *, const TCHAR *, const TCHAR *, TCHAR *);\r
71 int get_hook(const TCHAR *, const TCHAR *, const TCHAR *, TCHAR *, unsigned long);\r
72 \r
73 #endif\r