Alexandre Julliard writes:
> Uwe Bonnes <[EMAIL PROTECTED]> writes:
> 
> > I think in nearly every patch I gave an example program the didn't run 
> > because of the way the command line arguments are handled (tortured
> > :-) in present CVS. Could you please be more specific where this
> > information wasn't enough or where you suspect problems?
> 
> That's my main objection: I have the feeling that you are patching the
> code to fix a specific example, adding a quote here, removing one
> there, with no guarantee that it won't break another case. What I'd
> like to see is a description of the algorithm for cmdline->argv and
> argv->cmdline conversion that can be shown to work for all possible
> combinations of quotes/spaces/whatever. I don't doubt that your patch
> fixes the problems you see in your example; but I want to be convinced
> that it also fixes the cases you haven't tested.
> 

Hallo,

I am quite sure that my patches break very few situation and fixes
many :-)  And as my first approch was to fix only few places, this
resulted in "adding a quote here, removing one there"...

Obviously a greater overhaul is needed, making things easier in the
long run. However as I will take 3 weeks vacation starting Aug 12, I
don't think I can do that overhaul before Mid of September. Perhaps
accept the patches "Don't double quote in build_commandline" and
"Building the commandline and the argv array" as a temporary
solution. Consider Peter's winexec16 patch too.
A patch regarding the arg handling in crtdll is pending on my
machine at home

But let's look at the present situation in wine and what
happens after a call to CreateProcess and proposed changes

Functionflow    Remark                     Proposed fix

CreateProcessA
 get_filename   lpApplicationName (lpA)and - Only return name,don't touch
                lpCommandLine (lpC) are    lpA and lpC
                joined. Sometimes quotes
                are inserted         

Process_Create  Needs joined commandline   - Use untouched lpA and lpC instead
fork_and_exec   Needs joined commandline   "
 build_argv     Needs joined commandline   "
                                           - Handle Whitespace at begin
                                           of lpC (*1). 
                                           - Add additional argument 
                                           argv[1] (*2) to tell
                                           main() that called by 
                                           CreateProcess. 
                                           - Put lpA as arg[3], 
                                           duplicating the first lpC 
                                           arg when lpA==NULL.
exec_wine_binary
execve
main            May be called from the
                Unix Command line too.
                In this case, quotes
                are stripped from
                arguments by the shell.
                Also arguments may be 
                Unix filenames
PROCESS_InitWine
PROCESS_Start
start_process
 build_command_line                        - Handle arguments with spaces
                                           - When not called by
                                           CreateProcess:
                                           -- Handle quoted 
                                           and unquoted arguments. 
                                           -- At least check argv[0] if
                                           possible Unix name and
                                           exchange with full dos name
                                           -When called by CreateProcess:
                                           -- drop arg[3]

(*1) A whitespace at the beginning of lpC is considered as an existing, 
but empty argument by Windows
(*2) Maybe --argvchecked?

I think this does minimal manipulation on the lpA and lpC arguments
given to CreateProcessA, as requested be Alexandre. 
 
Is this acceptable? Any comments and ideas?

Bye

Uwe Bonnes                [EMAIL PROTECTED]

Institut fuer Kernphysik  Schlossgartenstrasse 9  64289 Darmstadt
--------- Tel. 06151 162516 -------- Fax. 06151 164321 ----------



Reply via email to