Commit 6ab88272 authored by Alexandre Julliard's avatar Alexandre Julliard

Set environment variables from the HKCU\Environment key too.

Moved current directory initialisation to process.c. Make sure to always pass the correct current directory in the process parameters for child processes.
parent 106e13ab
......@@ -107,7 +107,6 @@ int DIR_Init(void)
OBJECT_ATTRIBUTES attr;
UNICODE_STRING nameW;
HKEY hkey;
char path[MAX_PATHNAME_LEN];
WCHAR longpath[MAX_PATHNAME_LEN];
WCHAR *tmp_dir, *profile_dir;
static const WCHAR wineW[] = {'M','a','c','h','i','n','e','\\',
......@@ -153,26 +152,6 @@ int DIR_Init(void)
return 0;
}
if (!getcwd( path, MAX_PATHNAME_LEN ))
{
MESSAGE("Warning: could not get current Unix working directory, "
"starting in the Windows directory.\n" );
SetCurrentDirectoryW( DIR_Windows );
}
else
{
MultiByteToWideChar( CP_UNIXCP, 0, path, -1, longpath, MAX_PATHNAME_LEN);
GetFullPathNameW( longpath, MAX_PATHNAME_LEN, longpath, NULL );
if (!SetCurrentDirectoryW( longpath ))
{
MESSAGE("Warning: could not find DOS drive for current working directory '%s', "
"starting in the Windows directory.\n", path );
SetCurrentDirectoryW( DIR_Windows );
}
else if (!NtCurrentTeb()->Peb->ProcessParameters->CurrentDirectory.Handle)
chdir("/"); /* change to root directory so as not to lock cdroms */
}
/* Set the environment variables */
/* set COMSPEC only if it doesn't exist already */
......
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