Commit 7cea9434 authored by Alexandre Julliard's avatar Alexandre Julliard

services: Propagate the WINEBOOTSTRAPMODE variable to spawned services.

parent 446f7e3a
...@@ -25,6 +25,7 @@ ...@@ -25,6 +25,7 @@
#include <assert.h> #include <assert.h>
#include <windows.h> #include <windows.h>
#include <winsvc.h> #include <winsvc.h>
#include <winternl.h>
#include <rpc.h> #include <rpc.h>
#include <userenv.h> #include <userenv.h>
#include <setupapi.h> #include <setupapi.h>
...@@ -1069,7 +1070,16 @@ found: ...@@ -1069,7 +1070,16 @@ found:
if (!environment && OpenProcessToken(GetCurrentProcess(), TOKEN_QUERY | TOKEN_DUPLICATE, &token)) if (!environment && OpenProcessToken(GetCurrentProcess(), TOKEN_QUERY | TOKEN_DUPLICATE, &token))
{ {
WCHAR val[16];
CreateEnvironmentBlock(&environment, token, FALSE); 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); CloseHandle(token);
} }
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment