Commit bae3769e authored by Rémi Bernon's avatar Rémi Bernon Committed by Alexandre Julliard

ntdll: Set main_(argc|argv|envp) as early as possible.

Fixes: 62a97934
parent d9342e85
...@@ -892,7 +892,7 @@ static void init_locale(void) ...@@ -892,7 +892,7 @@ static void init_locale(void)
/*********************************************************************** /***********************************************************************
* init_environment * init_environment
*/ */
void init_environment( int argc, char *argv[], char *envp[] ) void init_environment(void)
{ {
USHORT *case_table; USHORT *case_table;
...@@ -904,10 +904,6 @@ void init_environment( int argc, char *argv[], char *envp[] ) ...@@ -904,10 +904,6 @@ void init_environment( int argc, char *argv[], char *envp[] )
uctable = case_table + 2; uctable = case_table + 2;
lctable = case_table + case_table[1] + 2; lctable = case_table + case_table[1] + 2;
} }
main_argc = argc;
main_argv = argv;
main_envp = envp;
} }
......
...@@ -1890,9 +1890,13 @@ static jstring wine_init_jni( JNIEnv *env, jobject obj, jobjectArray cmdline, jo ...@@ -1890,9 +1890,13 @@ static jstring wine_init_jni( JNIEnv *env, jobject obj, jobjectArray cmdline, jo
java_object = (*env)->NewGlobalRef( env, obj ); java_object = (*env)->NewGlobalRef( env, obj );
main_argc = argc;
main_argv = argv;
main_envp = environ;
init_paths( argv ); init_paths( argv );
virtual_init(); virtual_init();
init_environment( argc, argv, environ ); init_environment();
#ifdef __i386__ #ifdef __i386__
{ {
...@@ -2107,6 +2111,10 @@ static void check_command_line( int argc, char *argv[] ) ...@@ -2107,6 +2111,10 @@ static void check_command_line( int argc, char *argv[] )
*/ */
DECLSPEC_EXPORT void __wine_main( int argc, char *argv[], char *envp[] ) DECLSPEC_EXPORT void __wine_main( int argc, char *argv[], char *envp[] )
{ {
main_argc = argc;
main_argv = argv;
main_envp = envp;
init_paths( argv ); init_paths( argv );
if (!getenv( "WINELOADERNOEXEC" )) /* first time around */ if (!getenv( "WINELOADERNOEXEC" )) /* first time around */
...@@ -2132,7 +2140,7 @@ DECLSPEC_EXPORT void __wine_main( int argc, char *argv[], char *envp[] ) ...@@ -2132,7 +2140,7 @@ DECLSPEC_EXPORT void __wine_main( int argc, char *argv[], char *envp[] )
#endif #endif
virtual_init(); virtual_init();
init_environment( argc, argv, envp ); init_environment();
#ifdef __APPLE__ #ifdef __APPLE__
apple_main_thread(); apple_main_thread();
......
...@@ -176,7 +176,7 @@ extern SYSTEM_CPU_INFORMATION cpu_info; ...@@ -176,7 +176,7 @@ extern SYSTEM_CPU_INFORMATION cpu_info;
extern struct ldt_copy __wine_ldt_copy; extern struct ldt_copy __wine_ldt_copy;
#endif #endif
extern void init_environment( int argc, char *argv[], char *envp[] ); extern void init_environment(void);
extern void init_startup_info(void); extern void init_startup_info(void);
extern void *create_startup_info( const UNICODE_STRING *nt_image, ULONG process_flags, extern void *create_startup_info( const UNICODE_STRING *nt_image, ULONG process_flags,
const RTL_USER_PROCESS_PARAMETERS *params, const RTL_USER_PROCESS_PARAMETERS *params,
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment