1
0
Fork 0
mirror of synced 2025-03-07 03:53:26 +01:00

shell32/tests: Check ShellExecute is looking in the correct current directory.

This commit is contained in:
Yuxuan Shui 2024-03-18 15:09:41 +00:00 committed by Alexandre Julliard
parent ae70b66dce
commit c6fa51a949

View file

@ -2266,6 +2266,8 @@ static void test_exes(void)
{
char filename[2 * MAX_PATH + 17];
char params[1024];
char curdir[MAX_PATH];
char *basename = strrchr(argv0, '\\') + 1;
INT_PTR rc;
sprintf(params, "shlexec \"%s\" Exec", child_file);
@ -2353,6 +2355,13 @@ static void test_exes(void)
"notaverb", argv0, NULL, NULL, NULL);
todo_wine okShell(rc == SE_ERR_NOASSOC, "returned %Iu\n", rc);
/* Check the correct search path is used */
GetCurrentDirectoryA(MAX_PATH, curdir);
SetCurrentDirectoryA(tmpdir);
rc = shell_execute(NULL, basename, params, NULL);
todo_wine okShell(rc == SE_ERR_FNF, "returned %Iu\n", rc);
SetCurrentDirectoryA(curdir);
if (!skip_shlexec_tests)
{
/* A class overrides the normal handling of executables too */