Module: wine Branch: master Commit: 7cea94349a48b5e4ff5a015175d7e27922323b13 URL: https://source.winehq.org/git/wine.git/?a=commit;h=7cea94349a48b5e4ff5a01517...
Author: Alexandre Julliard julliard@winehq.org Date: Thu Apr 8 12:23:09 2021 +0200
services: Propagate the WINEBOOTSTRAPMODE variable to spawned services.
Signed-off-by: Alexandre Julliard julliard@winehq.org
---
programs/services/services.c | 10 ++++++++++ 1 file changed, 10 insertions(+)
diff --git a/programs/services/services.c b/programs/services/services.c index d9c4e484e42..39cd9ee4ffa 100644 --- a/programs/services/services.c +++ b/programs/services/services.c @@ -25,6 +25,7 @@ #include <assert.h> #include <windows.h> #include <winsvc.h> +#include <winternl.h> #include <rpc.h> #include <userenv.h> #include <setupapi.h> @@ -1069,7 +1070,16 @@ found:
if (!environment && OpenProcessToken(GetCurrentProcess(), TOKEN_QUERY | TOKEN_DUPLICATE, &token)) { + WCHAR val[16]; CreateEnvironmentBlock(&environment, token, FALSE); + if (GetEnvironmentVariableW( L"WINEBOOTSTRAPMODE", val, ARRAY_SIZE(val) )) + { + UNICODE_STRING name, value; + + RtlInitUnicodeString( &name, L"WINEBOOTSTRAPMODE" ); + RtlInitUnicodeString( &value, val ); + RtlSetEnvironmentVariable( (WCHAR **)&environment, &name, &value ); + } CloseHandle(token); }