From: Yuxuan Shui yshui@codeweavers.com
--- dlls/shell32/tests/shlexec.c | 15 +++++++++++++++ 1 file changed, 15 insertions(+)
diff --git a/dlls/shell32/tests/shlexec.c b/dlls/shell32/tests/shlexec.c index 2a039f61f8b..0e5d7cab5d2 100644 --- a/dlls/shell32/tests/shlexec.c +++ b/dlls/shell32/tests/shlexec.c @@ -2271,6 +2271,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); @@ -2358,6 +2360,19 @@ 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 = CreateDirectoryA("tmpdir", NULL); + okShell(rc || GetLastError() == ERROR_ALREADY_EXISTS, "Failed to create 'tmpdir' err %lu\n", GetLastError()); + SetCurrentDirectoryA("tmpdir"); + rc = shell_execute(NULL, basename, params, NULL); + trace("shell_execute(%s) returned %Iu\n", basename, rc); + todo_wine okShell(rc == SE_ERR_FNF, "returned %Iu\n", rc); + SetCurrentDirectoryA(".."); + RemoveDirectoryA("tmpdir"); + SetCurrentDirectoryA(curdir); + if (!skip_shlexec_tests) { /* A class overrides the normal handling of executables too */