Alexandre Julliard : ntdll: Free the initial process parameters once they are copied.
Alexandre Julliard
julliard at winehq.org
Tue May 25 16:08:15 CDT 2021
Module: wine
Branch: master
Commit: 2b03b2873e675ecb8e0d92fdb950487bfafc8029
URL: https://source.winehq.org/git/wine.git/?a=commit;h=2b03b2873e675ecb8e0d92fdb950487bfafc8029
Author: Alexandre Julliard <julliard at winehq.org>
Date: Tue May 25 17:16:30 2021 +0200
ntdll: Free the initial process parameters once they are copied.
Signed-off-by: Alexandre Julliard <julliard at winehq.org>
---
dlls/ntdll/env.c | 13 +++++++------
1 file changed, 7 insertions(+), 6 deletions(-)
diff --git a/dlls/ntdll/env.c b/dlls/ntdll/env.c
index c11960db165..bb8931a556b 100644
--- a/dlls/ntdll/env.c
+++ b/dlls/ntdll/env.c
@@ -634,7 +634,7 @@ void WINAPI RtlDestroyProcessParameters( RTL_USER_PROCESS_PARAMETERS *params )
void init_user_process_params(void)
{
WCHAR *env;
- SIZE_T env_size;
+ SIZE_T size = 0, env_size;
RTL_USER_PROCESS_PARAMETERS *new_params, *params = NtCurrentTeb()->Peb->ProcessParameters;
UNICODE_STRING curdir;
@@ -671,15 +671,16 @@ void init_user_process_params(void)
new_params->dwFlags = params->dwFlags;
new_params->wShowWindow = params->wShowWindow;
- NtCurrentTeb()->Peb->ProcessParameters = params = new_params;
+ NtCurrentTeb()->Peb->ProcessParameters = new_params;
+ NtFreeVirtualMemory( GetCurrentProcess(), (void **)¶ms, &size, MEM_RELEASE );
- if (RtlSetCurrentDirectory_U( ¶ms->CurrentDirectory.DosPath ))
+ if (RtlSetCurrentDirectory_U( &new_params->CurrentDirectory.DosPath ))
{
MESSAGE("wine: could not open working directory %s, starting in the Windows directory.\n",
- debugstr_w( params->CurrentDirectory.DosPath.Buffer ));
+ debugstr_w( new_params->CurrentDirectory.DosPath.Buffer ));
RtlInitUnicodeString( &curdir, windows_dir );
RtlSetCurrentDirectory_U( &curdir );
}
- set_wow64_environment( ¶ms->Environment );
- params->EnvironmentSize = RtlSizeHeap( GetProcessHeap(), 0, params->Environment );
+ set_wow64_environment( &new_params->Environment );
+ new_params->EnvironmentSize = RtlSizeHeap( GetProcessHeap(), 0, new_params->Environment );
}
More information about the wine-cvs
mailing list