mirror of
https://github.com/reactos/wine.git
synced 2024-11-28 22:20:26 +00:00
kernel: Error out of CreateProcess if the specified current directory
doesn't exist.
This commit is contained in:
parent
94dcabecd8
commit
61c3bb03a0
@ -1661,7 +1661,11 @@ BOOL WINAPI CreateProcessW( LPCWSTR app_name, LPWSTR cmd_line, LPSECURITY_ATTRIB
|
||||
|
||||
if (cur_dir)
|
||||
{
|
||||
unixdir = wine_get_unix_file_name( cur_dir );
|
||||
if (!(unixdir = wine_get_unix_file_name( cur_dir )))
|
||||
{
|
||||
SetLastError(ERROR_DIRECTORY);
|
||||
goto done;
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
|
@ -811,6 +811,18 @@ static void test_Directory(void)
|
||||
okChildIString("Misc", "CurrDirA", windir);
|
||||
release_memory();
|
||||
assert(DeleteFileA(resfile) != 0);
|
||||
|
||||
/* search PATH for the exe if directory is NULL */
|
||||
ok(CreateProcessA(NULL, "winver.exe", NULL, NULL, FALSE, 0L, NULL, NULL, &startup, &info), "CreateProcess\n");
|
||||
ok(TerminateProcess(info.hProcess, 0), "Child process termination\n");
|
||||
|
||||
/* if any directory is provided, don't search PATH, error on bad directory */
|
||||
SetLastError(0xdeadbeef);
|
||||
memset(&info, 0, sizeof(info));
|
||||
ok(!CreateProcessA(NULL, "winver.exe", NULL, NULL, FALSE, 0L,
|
||||
NULL, "non\\existent\\directory", &startup, &info), "CreateProcess\n");
|
||||
ok(GetLastError() == ERROR_DIRECTORY, "Expected ERROR_DIRECTORY, got %ld\n", GetLastError());
|
||||
ok(!TerminateProcess(info.hProcess, 0), "Child process should not exist\n");
|
||||
}
|
||||
|
||||
static BOOL is_str_env_drive_dir(const char* str)
|
||||
|
Loading…
Reference in New Issue
Block a user