shell32.dll: Return SE_ERR_FNF if file not found before checking for associations.
authorPaul Chitescu <paulc@voip.null.ro>
Mon, 8 Dec 2008 19:06:12 +0000 (21:06 +0200)
committerAlexandre Julliard <julliard@winehq.org>
Tue, 9 Dec 2008 09:25:38 +0000 (10:25 +0100)
dlls/shell32/shlexec.c
dlls/shell32/tests/shlexec.c

index e8c6e7be9668c30d9471975b9443539ae79772d4..515bb48648c98762a85d45b7c6b5b96a4beeaa32 100644 (file)
@@ -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 */
index 80ccdf7c3ad0d44ffce4124a350b49a06463118f..4ea855ac57662d3fa1217212afeb9a6cb89935a0 100644 (file)
@@ -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");