ntdll: Adjust environment size for dynamic strings.

Wine-Bug: https://bugs.winehq.org/show_bug.cgi?id=50732
Signed-off-by: Alexandre Julliard <julliard@winehq.org>
This commit is contained in:
Alexandre Julliard 2021-02-27 17:42:26 +01:00
parent 1e2b060eb1
commit 5828d7c136
1 changed files with 2 additions and 2 deletions

View File

@ -1591,7 +1591,6 @@ void init_startup_info(void)
params->AllocationSize = size; params->AllocationSize = size;
params->Size = size; params->Size = size;
params->Flags = PROCESS_PARAMS_FLAG_NORMALIZED; params->Flags = PROCESS_PARAMS_FLAG_NORMALIZED;
params->EnvironmentSize = env_size;
params->DebugFlags = info->debug_flags; params->DebugFlags = info->debug_flags;
params->ConsoleHandle = wine_server_ptr_handle( info->console ); params->ConsoleHandle = wine_server_ptr_handle( info->console );
params->ConsoleFlags = info->console_flags; params->ConsoleFlags = info->console_flags;
@ -1637,7 +1636,8 @@ void init_startup_info(void)
dst += copy_environment( dst, src ); dst += copy_environment( dst, src );
memcpy( dst, dyn_env, dyn_size ); memcpy( dst, dyn_env, dyn_size );
dst += dyn_size / sizeof(WCHAR); dst += dyn_size / sizeof(WCHAR);
*dst = 0; *dst++ = 0;
params->EnvironmentSize = (dst - params->Environment) * sizeof(WCHAR);
free( dyn_env ); free( dyn_env );
free( info ); free( info );
NtCurrentTeb()->Peb->ProcessParameters = params; NtCurrentTeb()->Peb->ProcessParameters = params;