#include "nssm.h"\r
\r
+/*\r
+ Environment block is of the form:\r
+\r
+ KEY1=VALUE1 NULL\r
+ KEY2=VALUE2 NULL\r
+ NULL\r
+\r
+ A single variable KEY=VALUE has length 15:\r
+\r
+ KEY=VALUE (13) NULL (1)\r
+ NULL (1)\r
+\r
+ Environment variable names are case-insensitive!\r
+*/\r
+\r
/* Find the length in characters of an environment block. */\r
size_t environment_length(TCHAR *env) {\r
size_t len = 0;\r
if (! ok) *buffer = default_value;\r
}\r
\r
+/* Open the key of the service itself Services\<service_name>. */\r
HKEY open_service_registry(const TCHAR *service_name, REGSAM sam, bool must_exist) {\r
/* Get registry */\r
TCHAR registry[KEY_LENGTH];\r
return open_registry_key(registry, sam, must_exist);\r
}\r
\r
+/* Open a subkey of the service Services\<service_name>\<sub>. */\r
long open_registry(const TCHAR *service_name, const TCHAR *sub, REGSAM sam, HKEY *key, bool must_exist) {\r
/* Get registry */\r
TCHAR registry[KEY_LENGTH];\r