git://git.iain.cx/iain
/
nssm.git
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
|
inline
| side by side (parent:
f56089c
)
Some notes on the environment and registry.
author
Iain Patterson
<me@iain.cx>
Fri, 22 Jul 2016 14:43:08 +0000
(15:43 +0100)
committer
Iain Patterson
<me@iain.cx>
Thu, 28 Jul 2016 15:44:23 +0000
(16:44 +0100)
Documentation is good!
env.cpp
patch
|
blob
|
history
registry.cpp
patch
|
blob
|
history
diff --git
a/env.cpp
b/env.cpp
index
3ecf207
..
3366fc6
100644
(file)
--- a/
env.cpp
+++ b/
env.cpp
@@
-1,5
+1,20
@@
#include "nssm.h"
\r
\r
#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
/* Find the length in characters of an environment block. */
\r
size_t environment_length(TCHAR *env) {
\r
size_t len = 0;
\r
diff --git
a/registry.cpp
b/registry.cpp
index
c78cb8c
..
93c034d
100644
(file)
--- 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;
\r
}
\r
\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
HKEY open_service_registry(const TCHAR *service_name, REGSAM sam, bool must_exist) {
\r
/* Get registry */
\r
TCHAR registry[KEY_LENGTH];
\r
@@
-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);
\r
}
\r
\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
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