From: Iain Patterson Date: Fri, 22 Jul 2016 14:43:08 +0000 (+0100) Subject: Some notes on the environment and registry. X-Git-Url: http://git.iain.cx/?p=nssm.git;a=commitdiff_plain;h=64567097975b06d71d6602baf2df2d56f0525f2f Some notes on the environment and registry. Documentation is good! --- diff --git a/env.cpp b/env.cpp index 3ecf207..3366fc6 100644 --- a/env.cpp +++ b/env.cpp @@ -1,5 +1,20 @@ #include "nssm.h" +/* + Environment block is of the form: + + KEY1=VALUE1 NULL + KEY2=VALUE2 NULL + NULL + + A single variable KEY=VALUE has length 15: + + KEY=VALUE (13) NULL (1) + NULL (1) + + Environment variable names are case-insensitive! +*/ + /* Find the length in characters of an environment block. */ size_t environment_length(TCHAR *env) { size_t len = 0; diff --git a/registry.cpp b/registry.cpp index c78cb8c..93c034d 100644 --- a/registry.cpp +++ b/registry.cpp @@ -667,6 +667,7 @@ void override_milliseconds(TCHAR *service_name, HKEY key, TCHAR *value, unsigned if (! ok) *buffer = default_value; } +/* Open the key of the service itself Services\. */ HKEY open_service_registry(const TCHAR *service_name, REGSAM sam, bool must_exist) { /* Get registry */ TCHAR registry[KEY_LENGTH]; @@ -678,6 +679,7 @@ HKEY open_service_registry(const TCHAR *service_name, REGSAM sam, bool must_exis return open_registry_key(registry, sam, must_exist); } +/* Open a subkey of the service Services\\. */ long open_registry(const TCHAR *service_name, const TCHAR *sub, REGSAM sam, HKEY *key, bool must_exist) { /* Get registry */ TCHAR registry[KEY_LENGTH];