Commit fd3735cf authored by Alexandre Julliard's avatar Alexandre Julliard

kernel32: Move dll load path initialization to ntdll.

parent 2607bfa2
......@@ -1028,7 +1028,6 @@ void * CDECL __wine_kernel_init(void)
RTL_USER_PROCESS_PARAMETERS *params = peb->ProcessParameters;
HANDLE boot_events[2];
BOOL got_environment = TRUE;
WCHAR *load_path, *dummy;
/* Initialize everything */
......@@ -1058,9 +1057,6 @@ void * CDECL __wine_kernel_init(void)
TRACE( "starting process name=%s argv[0]=%s\n",
debugstr_w(main_exe_name), debugstr_w(__wine_main_wargv[0]) );
LdrGetDllPath( main_exe_name, 0, &load_path, &dummy );
RtlInitUnicodeString( &NtCurrentTeb()->Peb->ProcessParameters->DllPath, load_path );
if (boot_events[0])
{
DWORD timeout = 2 * 60 * 1000, count = 1;
......
......@@ -1140,7 +1140,7 @@ static inline void get_unicode_string( UNICODE_STRING *str, WCHAR **src, UINT le
*/
void init_user_process_params( SIZE_T data_size )
{
WCHAR *src;
WCHAR *src, *load_path, *dummy;
SIZE_T info_size, env_size;
NTSTATUS status;
startup_info_t *info = NULL;
......@@ -1160,6 +1160,9 @@ void init_user_process_params( SIZE_T data_size )
get_image_path( __wine_main_argv[0], &params->ImagePathName );
set_library_wargv( __wine_main_argv, &params->ImagePathName );
build_command_line( __wine_main_wargv, &params->CommandLine );
LdrGetDllPath( params->ImagePathName.Buffer, 0, &load_path, &dummy );
RtlCreateUnicodeString( &params->DllPath, load_path );
RtlReleasePath( load_path );
if (isatty(0) || isatty(1) || isatty(2))
params->ConsoleHandle = (HANDLE)2; /* see kernel32/kernel_private.h */
......
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