Re[2]: shell32: remove unneeded parsing of SHELLEXECUTEINFO.lpFile [try 3]

2010-04-24 Thread Ilya Basin
PV> Hi Ilya,

PV> In your last email on wine-devel about this subject you mentioned adding 
PV> some extra tests. There was at least some communication with you and the 
PV> author of that piece you are now removing. The reason for that piece was 
PV> shown in a code-snippet he gave and adding tests for that specific case 
PV> would be worthwhile I think.



Hi Paul. Yore're right, I forgot.
IB> Add a new verb that has '%*' in it. I put the reply from M.Fuchs in
IB> the bottom. It seems that it was related to .lnk handling.
Then postponing till my next slack period, the more so I got another
e-mail:

=== W7PROX64 (32 bit shlexec) ===
No test failures found

=== W7PROX64 (64 bit shlexec) ===

shell32:
shlexec.c:1609: Test failed: ShellExecuteEx(null, 
"C:\Users\winetest\AppData\Local\Temp\wt1F81.tmp\test file.sde", null, null) 
failed: rc=29 err=2
shlexec.c:1609: Test failed: ShellExecuteEx(null, 
"C:\Users\winetest\AppData\Local\Temp\wt1F81.tmp\test file.sde", null, null) 
failed: rc=29 err=2
shlexec.c:1609: Test failed: ShellExecuteEx(null, 
"C:\Users\winetest\AppData\Local\Temp\wt1F81.tmp\test file.sde", null, null) 
failed: rc=29 err=2
shlexec.c:1609: Test failed: ShellExecuteEx(null, 
"C:\Users\winetest\AppData\Local\Temp\wt1F81.tmp\test file.sde", null, null) 
failed: rc=29 err=2
shlexec.c:1609: Test failed: ShellExecuteEx(null, 
"C:\Users\winetest\AppData\Local\Temp\wt1F81.tmp\test file.sde", null, null) 
failed: rc=29 err=2

Strange, isn't it? I wonder if the tests succeeded without my patch.


I was wrong in the following part:
IB> But currently I'm more worried by
IB> http://bugs.winehq.org/show_bug.cgi?id=19385
IB> ( the 'wine start' launcher does not open MS Office documents that
IB> have spaces in their path )

IB> If the \command doesn't contain '%', e.g.
IB> '"C:\PROGRA~1\MICROS~2\OFFICE11\WINWORD.EXE" /n /dde'
IB> it's argyfied incorrectly

IB> Now there's no test verb without '%', I think I should add it
IB> and add related tests.

Later I reviewed the code and learned that this was
unrelated to the bug with lpFile parsing.
I sent another patch, so the bug 19385 is fixed now.
We can still add more DDE tests, but, I repeat, it's not related to
the current topic.


-- 





Re[2]: shell32: remove unneeded parsing of SHELLEXECUTEINFO.lpFile [try 2]

2010-03-23 Thread Ilya Basin
PV> The only thing I'm wondering is why this big piece was added in the
PV> first place (2004) but that in itself is of course no guarantee it was 
PV> needed.

PV> Is it possible to create more tests or is everything possible already
PV> catered for by that one test?
Add a new verb that has '%*' in it. I put the reply from M.Fuchs in
the bottom. It seems that it was related to .lnk handling.

But currently I'm more worried by
http://bugs.winehq.org/show_bug.cgi?id=19385
( the 'wine start' launcher does not open MS Office documents that
have spaces in their path )

If the \command doesn't contain '%', e.g.
'"C:\PROGRA~1\MICROS~2\OFFICE11\WINWORD.EXE" /n /dde'
it's argyfied incorrectly

Now there's no test verb without '%', I think I should add it
and add related tests.



MF> well you see it's a long time ago and I don't know the exact reason for 
this code. But it may help if I show you the first occurence of this code 
snippet I could get hold of in the ReactOS repository find at 
http://svn.reactos.org/svn/reactos/trunk/reactos/lib/shell32/shlexec.c?revision=7409&view=markup&pathrev=7409
 .
MF>  
MF>  
MF>   927 /* The following code is needed for example to resolve a shortcut
MF>   928to control panel applet "Keyboard", since this is accessed 
using
MF>   929"rundll32.exe shell32.dll,Control_RunDLL %1,%*" with a command 
line
MF>   930parameter received from ISF_ControlPanel_fnGetDisplayNameOf(). 
*/
MF>   931 if (!*szCommandline) {
MF>   932   if (*szApplicationName == '"') {
MF>   933   LPCSTR src = szApplicationName + 1;
MF>   934   LPSTR dst = fileName;
MF>   935 
MF>   936   while(*src && *src!='"')
MF>   937 *dst++ = *src++;
MF>   938 
MF>   939   *dst = '\0';
MF>   940 
MF>   941   if (*src == '"')
MF>   942 for(++src; isspace(*src); )
MF>   943 ++src;
MF>   944 
MF>   945   strcpy(szCommandline, src);
MF>   946   }
MF>   947   else
MF>   948   {
MF>   949   LPSTR space, s;
MF>   950   char buffer[MAX_PATH], xlpFile[MAX_PATH];
MF>   951 
MF>   952   LPSTR beg = szApplicationName;
MF>   953   for(s=beg; space=strchr(s, ' '); s=space+1) {
MF>   954 int idx = space-szApplicationName;
MF>   955 strncpy(buffer, szApplicationName, idx);
MF>   956 buffer[idx] = '\0';
MF>   957 
MF>   958 if (SearchPathA(sei->lpDirectory, buffer, ".exe", 
sizeof(xlpFile), xlpFile, NULL))
MF>   959 {
MF>   960 /* separate out command from parameter string */
MF>   961 LPCSTR p = space + 1;
MF>   962 
MF>   963 while(isspace(*p))
MF>   964   ++p;
MF>   965 
MF>   966 strcpy(szCommandline, p);
MF>   967 *space = '\0';
MF>   968 
MF>   969 break;
MF>   970 }
MF>   971   }
MF>   972 
MF>   973   strcpy(fileName, szApplicationName);
MF>   974   }
MF>   975 } else
MF>   976   strcpy(fileName, szApplicationName);
MF>   977 
MF>   978 lpFile = fileName;
MF>   979 
MF>   980 if (szCommandline[0]) {
MF>   981 strcat(szApplicationName, " ");
MF>   982 strcat(szApplicationName, szCommandline);
MF>   983 }
MF>   984 
MF>   985 retval = execfunc(szApplicationName, NULL, sei, FALSE);
MF>   986 if (retval > 32)
MF>   987 {
MF>   988   /* Now, that we have successfully launched a process, we can free 
the PIDL.
MF>   989   It may have been used before for %I command line options. */
MF>   990   if (tmpPidl)
MF>   991   SHFree(tmpPidl);
MF>   992 
MF>   993 TRACE("execfunc: retval=%d sei->hInstApp=%p\n", retval, 
sei->hInstApp);
MF>   994 return TRUE;
MF>   995 }
MF>  
MF> Please note the comment at the top, which may lead you to a valid test case 
for this algorithm in SHELL_execute(). This text remained there until revision 
7522, where it was replaced by the current text "separate out command line 
arguments from executable file name". The code itself was extended to handle 
more cases and ported to UNICODE strings until now.
MF> May be it is now superflous because of some other code changes (just a 
guess: FindExecutable may be a candidate). But may it is still necessary to 
correctly handle some rare cases when executing shell/explorer related calls 
with complicated command line arguments.
MF>  
MF>  

MF> Regards,
MF>  
MF> Martin



-- 





Re: Re[2]: shell32: remove unneeded parsing of SHELLEXECUTEINFO.lpFile

2010-03-18 Thread Ricardo Filipe
2010/3/18 Ilya Basin :
> PV> If this is no longer a todo_wine you should change the filename_tests
> PV> struct:
> You're right.
>
> Do you have any clue why this block of code was added to
> SHELL_execute() ?
>
>

try git blame and see if the commit message is of any help...




Re[2]: shell32: remove unneeded parsing of SHELLEXECUTEINFO.lpFile

2010-03-18 Thread Ilya Basin
PV> If this is no longer a todo_wine you should change the filename_tests
PV> struct:
You're right.

Do you have any clue why this block of code was added to
SHELL_execute() ?