ntdll: Initialize file redirects only after the server is connected.

Wine-Bug: https://bugs.winehq.org/show_bug.cgi?id=49380
Signed-off-by: Alexandre Julliard <julliard@winehq.org>
This commit is contained in:
Alexandre Julliard 2020-06-13 12:59:17 +02:00
parent c3e2013b61
commit 98eab245d3
3 changed files with 3 additions and 4 deletions

View File

@ -2689,7 +2689,7 @@ static void init_redirects(void)
char *dir; char *dir;
struct stat st; struct stat st;
if (!(dir = RtlAllocateHeap( GetProcessHeap(), 0, strlen(config_dir) + sizeof(windows_dir) ))) return; if (!(dir = malloc( strlen(config_dir) + sizeof(windows_dir) ))) return;
strcpy( dir, config_dir ); strcpy( dir, config_dir );
strcat( dir, windows_dir ); strcat( dir, windows_dir );
if (!stat( dir, &st )) if (!stat( dir, &st ))
@ -2699,7 +2699,7 @@ static void init_redirects(void)
nb_redirects = ARRAY_SIZE( redirects ); nb_redirects = ARRAY_SIZE( redirects );
} }
else ERR( "%s: %s\n", dir, strerror(errno) ); else ERR( "%s: %s\n", dir, strerror(errno) );
RtlFreeHeap( GetProcessHeap(), 0, dir ); free( dir );
} }

View File

@ -1227,7 +1227,6 @@ void __wine_main( int argc, char *argv[], char *envp[] )
fixup_ntdll_imports( &__wine_spec_nt_header, module ); fixup_ntdll_imports( &__wine_spec_nt_header, module );
init_environment( argc, argv, envp ); init_environment( argc, argv, envp );
init_files();
#ifdef __APPLE__ #ifdef __APPLE__
apple_main_thread(); apple_main_thread();
@ -1262,7 +1261,6 @@ NTSTATUS __cdecl __wine_init_unix_lib( HMODULE module, const void *ptr_in, void
map_so_dll( nt, module ); map_so_dll( nt, module );
fixup_ntdll_imports( &__wine_spec_nt_header, module ); fixup_ntdll_imports( &__wine_spec_nt_header, module );
init_environment( __wine_main_argc, __wine_main_argv, envp ); init_environment( __wine_main_argc, __wine_main_argv, envp );
init_files();
*(struct unix_funcs **)ptr_out = &unix_funcs; *(struct unix_funcs **)ptr_out = &unix_funcs;
wine_mmap_enum_reserved_areas( add_area, NULL, 0 ); wine_mmap_enum_reserved_areas( add_area, NULL, 0 );
return STATUS_SUCCESS; return STATUS_SUCCESS;

View File

@ -110,6 +110,7 @@ TEB * CDECL init_threading( int *nb_threads_ptr, struct ldt_copy **ldt_copy, SIZ
server_init_process(); server_init_process();
info_size = server_init_thread( teb->Peb, suspend ); info_size = server_init_thread( teb->Peb, suspend );
virtual_map_user_shared_data(); virtual_map_user_shared_data();
init_files();
NtCreateKeyedEvent( &keyed_event, GENERIC_READ | GENERIC_WRITE, NULL, 0 ); NtCreateKeyedEvent( &keyed_event, GENERIC_READ | GENERIC_WRITE, NULL, 0 );
if (size) *size = info_size; if (size) *size = info_size;