Misha Koshelev : shell32: Fix shelllink creation to non-executable files and remove unnecessary code .

Alexandre Julliard julliard at wine.codeweavers.com
Fri Jun 29 08:14:59 CDT 2007


Module: wine
Branch: master
Commit: 0d750e3282c88af6daae433874554c6e2a616a54
URL:    http://source.winehq.org/git/wine.git/?a=commit;h=0d750e3282c88af6daae433874554c6e2a616a54

Author: Misha Koshelev <mk144210 at bcm.edu>
Date:   Thu Jun 28 20:00:30 2007 -0500

shell32: Fix shelllink creation to non-executable files and remove unnecessary code.

---

 dlls/shell32/shelllink.c       |   19 +------------------
 dlls/shell32/tests/shelllink.c |    2 +-
 2 files changed, 2 insertions(+), 19 deletions(-)

diff --git a/dlls/shell32/shelllink.c b/dlls/shell32/shelllink.c
index 5f99c9d..62fc3e5 100644
--- a/dlls/shell32/shelllink.c
+++ b/dlls/shell32/shelllink.c
@@ -1048,10 +1048,7 @@ static HRESULT WINAPI IPersistStream_fnSave(
 	IStream*         stm,
 	BOOL             fClearDirty)
 {
-    static const WCHAR wOpen[] = {'o','p','e','n',0};
-
     LINK_HEADER header;
-    WCHAR   exePath[MAX_PATH];
     ULONG   count;
     DWORD   zero;
     HRESULT r;
@@ -1060,20 +1057,6 @@ static HRESULT WINAPI IPersistStream_fnSave(
 
     TRACE("%p %p %x\n", This, stm, fClearDirty);
 
-    *exePath = '\0';
-
-    if (This->sPath)
-    {
-        SHELL_FindExecutable(NULL, This->sPath, wOpen, exePath, MAX_PATH,
-                             NULL, NULL, NULL, NULL);
-        /*
-         * windows can create lnk files to executables that do not exist yet
-         * so if the executable does not exist the just trust the path they
-         * gave us
-         */
-        if (!*exePath) lstrcpyW(exePath,This->sPath);
-    }
-
     memset(&header, 0, sizeof(header));
     header.dwSize = sizeof(header);
     header.fStartup = This->iShowCmd;
@@ -1125,7 +1108,7 @@ static HRESULT WINAPI IPersistStream_fnSave(
     }
 
     if( This->sPath )
-        Stream_WriteLocationInfo( stm, exePath, &This->volume );
+        Stream_WriteLocationInfo( stm, This->sPath, &This->volume );
 
     if( This->sDescription )
         r = Stream_WriteString( stm, This->sDescription );
diff --git a/dlls/shell32/tests/shelllink.c b/dlls/shell32/tests/shelllink.c
index 237ce8f..8db88bb 100644
--- a/dlls/shell32/tests/shelllink.c
+++ b/dlls/shell32/tests/shelllink.c
@@ -586,7 +586,7 @@ static void test_load_save(void)
     desc.icon_id=0;
     desc.hotkey=0x1234;
     create_lnk(lnkfile, &desc, 0);
-    check_lnk(lnkfile, &desc, 0x4);
+    check_lnk(lnkfile, &desc, 0x0);
 
     r = DeleteFileA(mypath);
     ok(r, "failed to delete file %s (%d)\n", mypath, GetLastError());




More information about the wine-cvs mailing list