From c6fa51a9491ac92759eeb5f4fe62c2c92662c016 Mon Sep 17 00:00:00 2001 From: Yuxuan Shui Date: Mon, 18 Mar 2024 15:09:41 +0000 Subject: [PATCH] shell32/tests: Check ShellExecute is looking in the correct current directory. --- dlls/shell32/tests/shlexec.c | 9 +++++++++ 1 file changed, 9 insertions(+) diff --git a/dlls/shell32/tests/shlexec.c b/dlls/shell32/tests/shlexec.c index ba28bbc83d2..c9e23c7062e 100644 --- a/dlls/shell32/tests/shlexec.c +++ b/dlls/shell32/tests/shlexec.c @@ -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 */