Make cmdline writable (cmdline4)

Francois Gouget fgouget at
Fri Sep 7 13:09:59 CDT 2001

On 7 Sep 2001, Alexandre Julliard wrote:

> Francois Gouget <fgouget at> writes:
> >    In the case below. Works on Win98 but not in Wine. I believe the
> > reason is that Windows does not need to modify the command line anyway.
> In some cases it does; for instance your test program should fail
> under NT when using Unicode. Do you have a real app that requires
> this?

   I don't remember if I tried this on Win2000. I'll try to test
   No I don't have a 'real world' exemple where this is a problem. I
became aware of the issue because of warnings when I was working on
dlls/msvcrt/process.c: system is const char* so I made msvcrt_spawn
const char* but then I had to add a cast when calling CreateProcessA
(see second hunk of cmdline3).
   It seemed better to copy the cmdline in CreateProcess, which we
already do in some cases, rather than copy it in msvcrt_system to avoid
the cast. We can also just cast and not copy and wait for a real world
example where this causes a problem (but I'm afraid it may cost us a lot
in debugging then, I prefer being pro-active). Damn, I just saw that I
left a (char*) cast in MSVCRT_system anyway, it should not be there.
   I knew this CreateProcess change could be controversial, this is why
i isolated it in its own little patch.
   Btw, did you look at xxx-cmdline1? I posted it to wine-dev to get
comments but since no one commented on wine-dev I guess it means no-one
objects so it could go to wine-patches now.

Francois Gouget         fgouget at
                         Stolen from an Internet user:
              "f u cn rd ths, u cn gt a gd jb n cmptr prgrmmng !"

More information about the wine-devel mailing list