mirror of
https://github.com/reactos/wine.git
synced 2024-11-26 05:00:30 +00:00
kernel32: Correct the last error of CreateProcessW with an empty application name string.
This commit is contained in:
parent
6c27fa1038
commit
645e59c490
@ -210,15 +210,10 @@ static HANDLE open_exe_file( const WCHAR *name )
|
||||
{
|
||||
WCHAR buffer[MAX_PATH];
|
||||
/* file doesn't exist, check for builtin */
|
||||
if (!contains_path( name )) goto error;
|
||||
if (!get_builtin_path( name, NULL, buffer, sizeof(buffer) )) goto error;
|
||||
handle = 0;
|
||||
if (contains_path( name ) && get_builtin_path( name, NULL, buffer, sizeof(buffer) ))
|
||||
handle = 0;
|
||||
}
|
||||
return handle;
|
||||
|
||||
error:
|
||||
SetLastError( ERROR_FILE_NOT_FOUND );
|
||||
return INVALID_HANDLE_VALUE;
|
||||
}
|
||||
|
||||
|
||||
|
@ -935,6 +935,26 @@ static void test_CommandLine(void)
|
||||
ok(GetLastError() == ERROR_INVALID_PARAMETER,
|
||||
"Expected ERROR_INVALID_PARAMETER, got %d\n", GetLastError());
|
||||
}
|
||||
|
||||
buffer[0] = '\0';
|
||||
|
||||
/* Test empty application name parameter. */
|
||||
SetLastError(0xdeadbeef);
|
||||
ret = CreateProcessA(buffer, NULL, NULL, NULL, FALSE, 0L, NULL, NULL, &startup, &info);
|
||||
ok(!ret, "CreateProcessA unexpectedly succeeded\n");
|
||||
ok(GetLastError() == ERROR_PATH_NOT_FOUND ||
|
||||
broken(GetLastError() == ERROR_ACCESS_DENIED) /* Win98 */,
|
||||
"Expected ERROR_PATH_NOT_FOUND, got %d\n", GetLastError());
|
||||
|
||||
buffer2[0] = '\0';
|
||||
|
||||
/* Test empty application name and command line parameters. */
|
||||
SetLastError(0xdeadbeef);
|
||||
ret = CreateProcessA(buffer, buffer2, NULL, NULL, FALSE, 0L, NULL, NULL, &startup, &info);
|
||||
ok(!ret, "CreateProcessA unexpectedly succeeded\n");
|
||||
ok(GetLastError() == ERROR_PATH_NOT_FOUND ||
|
||||
broken(GetLastError() == ERROR_ACCESS_DENIED) /* Win98 */,
|
||||
"Expected ERROR_PATH_NOT_FOUND, got %d\n", GetLastError());
|
||||
}
|
||||
|
||||
static void test_Directory(void)
|
||||
|
Loading…
Reference in New Issue
Block a user