diff --git a/reactos/lib/3rdparty/mingw/crt1.c b/reactos/lib/3rdparty/mingw/crt1.c index dec13337fb6..e5795642a8a 100644 --- a/reactos/lib/3rdparty/mingw/crt1.c +++ b/reactos/lib/3rdparty/mingw/crt1.c @@ -47,6 +47,10 @@ __MINGW_IMPORT void __set_app_type(int); #endif /* __MSVCRT__ */ +#ifndef __initenv +extern char ***_imp____initenv; +#define __initenv (*_imp____initenv) +#endif /* * Setup the default file handles to have the _CRT_fmode mode, as well as @@ -235,7 +239,7 @@ __mingw_CRTStartup (void) * that one calls WinMain. See main.c in the 'lib' dir * for more details. */ - nRet = main (_argc, _argv, _environ); + nRet = main (_argc, _argv, __initenv); /* * Perform exit processing for the C library. This means diff --git a/reactos/lib/3rdparty/mingw/wcrt1.c b/reactos/lib/3rdparty/mingw/wcrt1.c index 28e933ba76b..4edbbdcfe16 100644 --- a/reactos/lib/3rdparty/mingw/wcrt1.c +++ b/reactos/lib/3rdparty/mingw/wcrt1.c @@ -45,6 +45,10 @@ extern int wmain (int, wchar_t **, wchar_t **); __MINGW_IMPORT void __set_app_type(int); #endif /* __MSVCRT__ */ +#ifndef __winitenv +extern wchar_t ***_imp____winitenv; +#define __winitenv (*_imp____winitenv) +#endif /* * Setup the default file handles to have the _CRT_fmode mode, as well as @@ -233,7 +237,7 @@ __mingw_wCRTStartup (void) * that one calls WinMain. See main.c in the 'lib' dir * for more details. */ - nRet = wmain (_argc, _wargv, NULL); + nRet = wmain (_argc, _wargv, __winitenv); /* * Perform exit processing for the C library. This means