Save the environment.
authorIain Patterson <me@iain.cx>
Tue, 24 Feb 2015 13:37:17 +0000 (13:37 +0000)
committerIain Patterson <me@iain.cx>
Tue, 24 Feb 2015 13:37:17 +0000 (13:37 +0000)
commitf124b07b52a569dd9e332d0940af592d0e8e201d
tree76ef4f9f2e274a6473c3b6ef0448811e10262fa3
parentac3246ff809b060c2be8e0c004e294f0d00e210d
Save the environment.

Before the previous two commits we used to read the environment from the
registry and set it using an optimisation which modified the retrieved
block in-place.

Now we need to set the environment twice after querying the registry -
once in get_parameters() and once just before CreateProcess(), which
means we can't use the in-place optimisation and must copy the block
before operating on it.

Additionally, nssm_hook() cleans the environment so we have to reinstate
it immediately prior to launching the application.
hook.cpp
service.cpp