IShellLink and non-existant exe files

Christian Costa titan.costa at wanadoo.fr
Fri Aug 20 17:31:42 CDT 2004


Hi,

I don't know much about this code but some line below there is:

   Stream_WriteLocationInfo( stm, exePath );

In our case exePath is still empty.

Shouldn't we set exePath to the same value as This->sPath ?

Christian

Aric Stewart wrote:

> It is possible under windows to create a .Lnk file to an exe file 
> before it exists. Office 2000 does this, Scientific Word does this as 
> do other apps as well.
>
> So a quick fix so that in IPersistFile_Save if the exe file is not 
> found, trust the path we are given and allow creation of the link.
>
> ------------------------------------------------------------------------
>
> Index: dlls/shell32/shelllink.c
> ===================================================================
> RCS file: /home/wine/wine/dlls/shell32/shelllink.c,v
> retrieving revision 1.70
> diff -u -w -r1.70 shelllink.c
> --- dlls/shell32/shelllink.c    12 Aug 2004 23:00:53 -0000    1.70
> +++ dlls/shell32/shelllink.c    20 Aug 2004 13:27:38 -0000
> @@ -683,9 +683,14 @@
>     /* if there's no PIDL, generate one */
>     if( ! This->pPidl )
>     {
> +        /* +         * 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 )
> -            return E_FAIL;
> -
> +            This->pPidl = ILCreateFromPathW(This->sPath);
> +        else
>         This->pPidl = ILCreateFromPathW(exePath);
>     }
>
>  
>





More information about the wine-devel mailing list