Module: wine Branch: master Commit: cd616409ba367e601bd61df44f57e436a14d0a7b URL: http://source.winehq.org/git/wine.git/?a=commit;h=cd616409ba367e601bd61df44f...
Author: Paul Chitescu paulc@voip.null.ro Date: Mon Dec 8 21:06:12 2008 +0200
shell32.dll: Return SE_ERR_FNF if file not found before checking for associations.
---
dlls/shell32/shlexec.c | 6 ++++++ dlls/shell32/tests/shlexec.c | 8 ++++---- 2 files changed, 10 insertions(+), 4 deletions(-)
diff --git a/dlls/shell32/shlexec.c b/dlls/shell32/shlexec.c index e8c6e7b..515bb48 100644 --- a/dlls/shell32/shlexec.c +++ b/dlls/shell32/shlexec.c @@ -588,6 +588,12 @@ static UINT SHELL_FindExecutable(LPCWSTR lpPath, LPCWSTR lpFile, LPCWSTR lpOpera } else { + /* Did we get something? Anything? */ + if (xlpFile[0]==0) + { + TRACE("Returning SE_ERR_FNF\n"); + return SE_ERR_FNF; + } /* First thing we need is the file's extension */ extension = strrchrW(xlpFile, '.'); /* Assume last "." is the one; */ /* File->Run in progman uses */ diff --git a/dlls/shell32/tests/shlexec.c b/dlls/shell32/tests/shlexec.c index 80ccdf7..4ea855a 100644 --- a/dlls/shell32/tests/shlexec.c +++ b/dlls/shell32/tests/shlexec.c @@ -627,8 +627,8 @@ typedef struct static filename_tests_t filename_tests[]= { /* Test bad / nonexistent filenames */ - {NULL, "%s\nonexistent.shlexec", 0x11, SE_ERR_FNF}, - {NULL, "%s\nonexistent.noassoc", 0x11, SE_ERR_FNF}, + {NULL, "%s\nonexistent.shlexec", 0x0, SE_ERR_FNF}, + {NULL, "%s\nonexistent.noassoc", 0x0, SE_ERR_FNF},
/* Standard tests */ {NULL, "%s\test file.shlexec", 0x0, 33}, @@ -644,7 +644,7 @@ static filename_tests_t filename_tests[]= {NULL, "%s\test file.shlexec.noassoc", 0x0, SE_ERR_NOASSOC},
/* Test alternate verbs */ - {"LowerL", "%s\nonexistent.shlexec", 0x11, SE_ERR_FNF}, + {"LowerL", "%s\nonexistent.shlexec", 0x0, SE_ERR_FNF}, {"LowerL", "%s\test file.noassoc", 0x0, SE_ERR_NOASSOC},
{"QuotedLowerL", "%s\test file.shlexec", 0x0, 33}, @@ -868,7 +868,7 @@ static void test_find_executable(void) ok(rc > 32, "FindExecutable(%s) returned %d\n", filename, rc);
rc=(int)FindExecutableA("test file.sfe", NULL, command); - todo_wine ok(rc == SE_ERR_FNF, "FindExecutable(%s) returned %d\n", filename, rc); + ok(rc == SE_ERR_FNF, "FindExecutable(%s) returned %d\n", filename, rc);
delete_test_association(".sfe");