Eric Pouech : msvcrt: Fix getmainargs() family to return correct environment block.
Module: wine Branch: master Commit: 988884a4f1d689879ab03936b3160dbfed892d82 URL: https://gitlab.winehq.org/wine/wine/-/commit/988884a4f1d689879ab03936b3160db... Author: Eric Pouech <epouech(a)codeweavers.com> Date: Fri Nov 10 09:13:28 2023 +0100 msvcrt: Fix getmainargs() family to return correct environment block. Signed-off-by: Eric Pouech <epouech(a)codeweavers.com> --- dlls/msvcrt/data.c | 4 ++-- dlls/msvcrt/tests/environ.c | 2 -- 2 files changed, 2 insertions(+), 4 deletions(-) diff --git a/dlls/msvcrt/data.c b/dlls/msvcrt/data.c index 6312c1e0e32..8a8552a151e 100644 --- a/dlls/msvcrt/data.c +++ b/dlls/msvcrt/data.c @@ -559,7 +559,7 @@ int CDECL __wgetmainargs(int *argc, wchar_t** *wargv, wchar_t** *wenvp, MSVCRT__wenviron = msvcrt_SnapshotOfEnvironmentW(NULL); *argc = MSVCRT___argc; *wargv = MSVCRT___wargv; - *wenvp = MSVCRT___winitenv; + *wenvp = MSVCRT__wenviron; if (new_mode) _set_new_mode( *new_mode ); return 0; @@ -593,7 +593,7 @@ int CDECL __getmainargs(int *argc, char** *argv, char** *envp, *argc = MSVCRT___argc; *argv = MSVCRT___argv; - *envp = MSVCRT___initenv; + *envp = MSVCRT__environ; if (new_mode) _set_new_mode( *new_mode ); diff --git a/dlls/msvcrt/tests/environ.c b/dlls/msvcrt/tests/environ.c index a3d3156c01a..f14764ea5a0 100644 --- a/dlls/msvcrt/tests/environ.c +++ b/dlls/msvcrt/tests/environ.c @@ -152,7 +152,6 @@ static void test__environ(void) ok( envp != NULL, "Expected initial environment block pointer to be non-NULL\n" ); - todo_wine ok( envp == *p_environ, "Expected initial environment to be equal to _environ\n" ); @@ -224,7 +223,6 @@ static void test__wenviron(void) __wgetmainargs(&argc, &wargv, &wenvp, 0, &mode); ok( wenvp != NULL, "Expected initial environment block pointer to be non-NULL\n" ); - todo_wine ok( wenvp == *p_wenviron, "Expected initial environment to be _wenviron[]\n" ); if (p__p___winitenv)
participants (1)
-
Alexandre Julliard