msvcrt: Fix getmainargs() family to return correct environment block.

Signed-off-by: Eric Pouech <epouech@codeweavers.com>
This commit is contained in:
Eric Pouech 2023-11-10 09:13:28 +01:00 committed by Alexandre Julliard
parent bba9e5aea1
commit 988884a4f1
2 changed files with 2 additions and 4 deletions

View file

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

View file

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