shell32 patch 25

Martin Fuchs martin-fuchs at gmx.net
Wed Mar 24 15:08:08 CST 2004


Sorry - the shlexec.c change belongs to this patch, not to patch #24.


Changelog:
call SHELL_FindExecutable() in IPersistStream_fnSave()


Index: shell32_main.h
===================================================================
RCS file: /home/wine/wine/dlls/shell32/shell32_main.h,v
retrieving revision 1.83
diff -u -p -d -r1.83 shell32_main.h
--- shell32_main.h	22 Mar 2004 20:43:07 -0000	1.83
+++ shell32_main.h	24 Mar 2004 21:05:56 -0000
@@ -233,6 +233,9 @@ typedef UINT (*SHELL_ExecuteW32)(const W
 
 BOOL WINAPI ShellExecuteExW32(LPSHELLEXECUTEINFOW sei, SHELL_ExecuteW32 execfunc);
 
+UINT SHELL_FindExecutable(LPCWSTR lpPath, LPCWSTR lpFile, LPCWSTR lpOperation,
+                          LPWSTR lpResult, /*int resultLen, */LPWSTR key, void **env);
+
 extern WCHAR swShell32Name[MAX_PATH];
 
 #endif

Index: shlexec.c
===================================================================
RCS file: /home/wine/wine/dlls/shell32/shlexec.c,v
retrieving revision 1.35
diff -u -p -d -r1.35 shlexec.c
--- shlexec.c	19 Mar 2004 01:52:30 -0000	1.35
+++ shlexec.c	24 Mar 2004 21:05:57 -0000
@@ -343,8 +343,8 @@ static UINT SHELL_FindExecutableByOperat
  *              command (it'll be used afterwards for more information
  *              on the operation)
  */
-static UINT SHELL_FindExecutable(LPCWSTR lpPath, LPCWSTR lpFile, LPCWSTR lpOperation,
-                                 LPWSTR lpResult, LPWSTR key, void **env)
+UINT SHELL_FindExecutable(LPCWSTR lpPath, LPCWSTR lpFile, LPCWSTR lpOperation,
+                                 LPWSTR lpResult, /*int resultLen, */LPWSTR key, void **env)
 {
     static const WCHAR wWindows[] = {'w','i','n','d','o','w','s',0};
     static const WCHAR wPrograms[] = {'p','r','o','g','r','a','m','s',0};

Index: shelllink.c
===================================================================
RCS file: /home/wine/wine/dlls/shell32/shelllink.c,v
retrieving revision 1.62
diff -u -p -d -r1.62 shelllink.c
--- shelllink.c	22 Mar 2004 22:58:37 -0000	1.62
+++ shelllink.c	24 Mar 2004 21:05:57 -0000
@@ -652,20 +652,29 @@ static HRESULT WINAPI IPersistStream_fnS
 	IStream*         stm,
 	BOOL             fClearDirty)
 {
+    static const WCHAR wOpen[] = {'o','p','e','n',0};
+
     LINK_HEADER header;
-    ULONG    count;
-    HRESULT    r;
+    WCHAR   exePath[MAX_PATH];
+    ULONG   count;
+    HRESULT r;
 
-	_ICOM_THIS_From_IPersistStream(IShellLinkImpl, iface);
+    _ICOM_THIS_From_IPersistStream(IShellLinkImpl, iface);
 
     TRACE("(%p) %p %x\n", This, stm, fClearDirty);
 
+    *exePath = '\0';
+
+    if (This->sPath)
+	SHELL_FindExecutable(NULL, This->sPath, wOpen, exePath, /*MAX_PATH, */NULL, NULL);
+
     /* if there's no PIDL, generate one */
     if( ! This->pPidl )
     {
-        if( ! This->sPath )
+        if( !*exePath )
             return E_FAIL;
-        This->pPidl = ILCreateFromPathW( This->sPath );
+
+        This->pPidl = ILCreateFromPathW(exePath);
     }
 
     memset(&header, 0, sizeof(header));
@@ -712,10 +721,7 @@ static HRESULT WINAPI IPersistStream_fnS
         }
     }
 
-    TRACE("Path = %s\n", debugstr_w(This->sPath));
-    if( ! This->sPath )
-        return E_FAIL;
-    Stream_WriteLocationInfo( stm, This->sPath );
+    Stream_WriteLocationInfo( stm, exePath );
 
     TRACE("Description = %s\n", debugstr_w(This->sDescription));
     if( This->sDescription )





More information about the wine-patches mailing list