kernel32: Don't validate the command line parameter of CreateProcessW.

This commit is contained in:
Andrew Nguyen 2009-05-18 05:07:04 -05:00 committed by Alexandre Julliard
parent b0abafe70f
commit 6c27fa1038
2 changed files with 10 additions and 6 deletions

View file

@ -1787,12 +1787,6 @@ static LPWSTR get_file_name( LPCWSTR appname, LPWSTR cmdline, LPWSTR buffer,
return ret;
}
if (!cmdline)
{
SetLastError( ERROR_INVALID_PARAMETER );
return NULL;
}
/* first check for a quoted file name */
if ((cmdline[0] == '"') && ((p = strchrW( cmdline + 1, '"' ))))

View file

@ -925,6 +925,16 @@ static void test_CommandLine(void)
okChildStringWA("Arguments", "CommandLineW", buffer2);
release_memory();
assert(DeleteFileA(resfile) != 0);
if (0) /* Test crashes on NT-based Windows. */
{
/* Test NULL application name and command line parameters. */
SetLastError(0xdeadbeef);
ret = CreateProcessA(NULL, NULL, NULL, NULL, FALSE, 0L, NULL, NULL, &startup, &info);
ok(!ret, "CreateProcessA unexpectedly succeeded\n");
ok(GetLastError() == ERROR_INVALID_PARAMETER,
"Expected ERROR_INVALID_PARAMETER, got %d\n", GetLastError());
}
}
static void test_Directory(void)