Make ShellExecuteA(0, NULL, "file.html", NULL, NULL, SW_SHOW) work again: #2

Dmitry Timoshkov dmitry at baikal.ru
Mon Jun 7 09:21:08 CDT 2004


Hello,

while investigating why simple
ShellExecuteA(0, NULL, "file.html", NULL, NULL, SW_SHOW);
no more works I've found 2 bugs preventing it from work.

The second bug is caused by a way the quotes are added/stripped
to the command line. Current code tests a previous character before
%1 format string, and format strings like "file://%1" get double
quotes. I've changed code to test a next character after %1, and this
makes IE launching work. It's not a perfect solution either, but
it works.

Changelog:
    Dmitry Timoshkov <dmitry at codeweavers.com>
    Add support for quoting "file://%1" like format strings.

--- cvs/hq/wine/dlls/shell32/shlexec.c	Tue Apr 27 01:25:40 2004
+++ wine/dlls/shell32/shlexec.c	Mon Jun 07 13:56:13 2004
@@ -86,6 +86,9 @@ static BOOL SHELL_ArgifyW(WCHAR* out, in
     PCWSTR  cmd;
     LPVOID  pv;
 
+    TRACE("%p, %d, %s, %s, %p, %p\n", out, len, debugstr_w(fmt),
+          debugstr_w(lpFile), pidl, args);
+
     while (*fmt)
     {
         if (*fmt == '%')
@@ -136,8 +139,8 @@ static BOOL SHELL_ArgifyW(WCHAR* out, in
                     else
                         cmd = lpFile;
 
-                    /* Add double quotation marks unless we already have them (e.g.: "%1" %* for exefile) */
-                    if (res==out || res[-1]!='"')
+                    /* Add double quotation marks unless we already have them (e.g.: "file://%1" %* for exefile) */
+                    if (res == out || *(fmt + 1) != '"')
                     {
                         *res++ = '"';
                         strcpyW(res, cmd);






More information about the wine-patches mailing list