services: Propagate the WINEBOOTSTRAPMODE variable to spawned services.

Signed-off-by: Alexandre Julliard <julliard@winehq.org>
This commit is contained in:
Alexandre Julliard 2021-04-08 12:23:09 +02:00
parent 446f7e3aa8
commit 7cea94349a

View file

@ -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);
}