shell32: Fix FindExecutableW() to not check if lpResult after using it. It's supposed to cause a segfault anyway.

Francois Gouget fgouget at codeweavers.com
Wed Dec 13 11:07:42 CST 2006


Use SE_ERR_FNF rather than a numeric literal.
---

This patch is related to the 3 patch series but can be applied
independently (because it's essentially a nop anyway).


 dlls/shell32/shlexec.c |    9 ++-------
 1 files changed, 2 insertions(+), 7 deletions(-)

diff --git a/dlls/shell32/shlexec.c b/dlls/shell32/shlexec.c
index 62a461a..433af9a 100644
--- a/dlls/shell32/shlexec.c
+++ b/dlls/shell32/shlexec.c
@@ -1003,13 +1003,8 @@ HINSTANCE WINAPI FindExecutableW(LPCWSTR lpFile, LPCWSTR lpDirectory, LPWSTR lpR
           (lpFile != NULL ? debugstr_w(lpFile) : "-"), (lpDirectory != NULL ? debugstr_w(lpDirectory) : "-"));
 
     lpResult[0] = '\0'; /* Start off with an empty return string */
-
-    /* trap NULL parameters on entry */
-    if ((lpFile == NULL) || (lpResult == NULL))
-    {
-        /* FIXME - should throw a warning, perhaps! */
-	return (HINSTANCE)2; /* File not found. Close enough, I guess. */
-    }
+    if (lpFile == NULL)
+	return (HINSTANCE)SE_ERR_FNF;
 
     if (lpDirectory)
     {
-- 
1.4.4.1




More information about the wine-patches mailing list