shell32: Properly create shell links for commands on path. [PATCH 2/2]

Misha Koshelev mk144210 at bcm.tmc.edu
Fri Feb 9 10:52:21 CST 2007


* This is the exact same patch as before but since I updated the
conformance test I thought I'd send this patch out again with it.
This is a one line fix for bug 7359, where the Vector NTI installer
incorrectly creates a shell link to rundll32.exe in the current
directory instead of the current path. The previously posted conformance
test shows that when creating a shell link to a command on the path
Windows XP will properly create the shell link to point to the
executable, whereas wine will just create a shell link to the
(nonexistent) executable in the current/working directory.

Changelog:

        * shell32: Properly create shell links for commands on path.
-------------- next part --------------
From c8336f17363cc05efa929b0b8e1df179800dd2e6 Mon Sep 17 00:00:00 2001
From: Misha Koshelev <mk144210 at bcm.tmc.edu>
Date: Fri, 9 Feb 2007 10:48:43 -0600
Subject: shell32: Properly create shell links for commands on path.
---
 dlls/shell32/shelllink.c |    5 +++--
 1 files changed, 3 insertions(+), 2 deletions(-)

diff --git a/dlls/shell32/shelllink.c b/dlls/shell32/shelllink.c
index 8a3d69d..5d358d8 100644
--- a/dlls/shell32/shelllink.c
+++ b/dlls/shell32/shelllink.c
@@ -2191,8 +2191,9 @@ static HRESULT WINAPI IShellLinkW_fnSetP
             *buffer = '\0';
         else if (!GetFullPathNameW(pszFile, MAX_PATH, buffer, &fname))
 	    return E_FAIL;
-        else if(!PathFileExistsW(buffer))
-            hr = S_FALSE;
+        else if(!PathFileExistsW(buffer) &&
+		!SearchPathW(NULL, pszFile, NULL, MAX_PATH, buffer, NULL)) 
+	  hr = S_FALSE;
 
         This->pPidl = SHSimpleIDListFromPathW(pszFile);
         ShellLink_GetVolumeInfo(buffer, &This->volume);
-- 
1.4.1



More information about the wine-patches mailing list