From f861e6d6962857d82d82e33108a044e1921b06d7 Mon Sep 17 00:00:00 2001 From: Lei Zhang Date: Thu, 31 Jul 2008 17:57:24 -0700 Subject: [PATCH 2/2] shell32: Resolve the full path in FindExecutable. --- dlls/shell32/shlexec.c | 7 +++++++ dlls/shell32/tests/shlexec.c | 2 +- 2 files changed, 8 insertions(+), 1 deletions(-) diff --git a/dlls/shell32/shlexec.c b/dlls/shell32/shlexec.c index fec7870..83a3b00 100644 --- a/dlls/shell32/shlexec.c +++ b/dlls/shell32/shlexec.c @@ -716,6 +716,13 @@ UINT SHELL_FindExecutable(LPCWSTR lpPath, LPCWSTR lpFile, LPCWSTR lpOperation, } } + if (NULL == strchrW(lpResult, '\\') && MAX_PATH >= resultLen) + { + WCHAR result[MAX_PATH]; + + strcpyW(result, lpResult); + SearchPathW(lpPath, result, NULL, resultLen, lpResult, NULL); + } TRACE("returning %s\n", debugstr_w(lpResult)); return retval; } diff --git a/dlls/shell32/tests/shlexec.c b/dlls/shell32/tests/shlexec.c index 0b7eb2a..49ba607 100644 --- a/dlls/shell32/tests/shlexec.c +++ b/dlls/shell32/tests/shlexec.c @@ -849,7 +849,7 @@ static void test_find_executable(void) ok(ExpandEnvironmentStringsA("\%systemroot\%\\system32\\msiexec.exe", expand, MAX_PATH) != 0, "ExpandEnvironmentStringsA failed\n"); rc = (int)FindExecutableA(filename, NULL, command); ok(rc > 32, "FindExecutableA returned %d\n", rc); - todo_wine ok(0 == lstrcmpi(expand, command), "FindExecutable returned the wrong result for foo.msi, expected %s, got %s\n", expand, command); + ok(0 == lstrcmpi(expand, command), "FindExecutable returned the wrong result for foo.msi, expected %s, got %s\n", expand, command); ok(DeleteFileA(filename), "Error deleting %s\n", filename); } -- 1.5.4.5