This patch pretty much fixes it. It still isn't quite right, although this probably isn't the same problem. In windows, GetCommandLine returns a string with quotes around it, while in wine, only the sub process command line has quotes around it (ie, in windows the first window displays "MainProc.exe", while the second displays "SubProc.exe", while in wine it's MainProc.exe and "SubProc.exe").
-Steve
Alexandre Julliard To: Steve Lustbader/ANR/MS/PHILIPS@AMEC <julliard@winehq cc: Uwe Bonnes bon@elektron.ikp.physik.tu-darmstadt.de .com> wine-devel@winehq.com Sent by: Subject: Re: GetCommandLine julliard@winehq. com Classification:
10/17/2002 01:49 PM
steve.lustbader@philips.com writes:
I uploaded a zip of both the source and the executables to http://www.lustbader.net/getcmdlinetest/ (it's a modification of the "Hello World" app generated by MSVC automatically). Run MainProc.exe and choose Help, About, which will run the other process (make sure to run MainProc.exe from the directory it's in). Both windows should display the commandline they were started with. In Windows, you should see one window display MainProc.exe and the other display SubProc.exe.
Thanks for the test program. This should fix it:
Index: scheduler/process.c =================================================================== RCS file: /opt/cvs-commit/wine/scheduler/process.c,v retrieving revision 1.201 diff -u -r1.201 process.c --- scheduler/process.c 9 Oct 2002 18:35:02 -0000 1.201 +++ scheduler/process.c 17 Oct 2002 17:45:11 -0000 @@ -1078,7 +1078,7 @@ /* use the unmodified app name as file name */ lstrcpynA( buffer, appname, buflen ); *handle = open_exe_file( buffer ); - if (!(ret = cmdline)) + if (!(ret = cmdline) || !cmdline[0]) { /* no command-line, create one */ if ((ret = HeapAlloc( GetProcessHeap(), 0, strlen(appname) + 3 )))
-- Alexandre Julliard julliard@winehq.com
"steve" == steve lustbader steve.lustbader@philips.com writes:
steve> This patch pretty much fixes it. It still isn't quite right, steve> although this probably isn't the same problem. In windows, steve> GetCommandLine returns a string with quotes around it, while in steve> wine, only the sub process command line has quotes around it (ie, steve> in windows the first window displays "MainProc.exe", while the steve> second displays "SubProc.exe", while in wine it's MainProc.exe steve> and "SubProc.exe").
With first window I guess you mean the first window when you started your program on the command line. Did you try to put your commandline in excaped quotes? Like 'wine -- "test.exe"'. I think that was the consense when we last time discussed that problem.
Bye
steve.lustbader@philips.com writes:
This patch pretty much fixes it. It still isn't quite right, although this probably isn't the same problem. In windows, GetCommandLine returns a string with quotes around it, while in wine, only the sub process command line has quotes around it (ie, in windows the first window displays "MainProc.exe", while the second displays "SubProc.exe", while in wine it's MainProc.exe and "SubProc.exe").
What Windows version are you using? I don't get quotes here on NT 4.
On Thu, Oct 17, 2002 at 02:36:41PM -0400, steve.lustbader@philips.com wrote:
This patch pretty much fixes it. It still isn't quite right, although this probably isn't the same problem. In windows, GetCommandLine returns a string with quotes around it, while in wine, only the sub process command line has quotes around it (ie, in windows the first window displays "MainProc.exe", while the second displays "SubProc.exe", while in wine it's MainProc.exe and "SubProc.exe").
That's because in Windows, Start -> Execute *always* quotes the argument. (dito with Explorer file execution)
Needless to say, some programs are having trouble with the Wine way of doing things: not quoting arguments. (they are prepared to cut away quotes and fail horribly if they don't exist)
Not quoting the arguments is a legal way of doing it, but I guess in order to be 150% compliant with Windows, we might want to think of a way to reintroduce quotes for programs we start. (IIRC Alexandre said it's a bit difficult, but should be doable)
Andreas Mohr andi@rhlx01.fht-esslingen.de writes:
Not quoting the arguments is a legal way of doing it, but I guess in order to be 150% compliant with Windows, we might want to think of a way to reintroduce quotes for programs we start. (IIRC Alexandre said it's a bit difficult, but should be doable)
Well, if you want quotes you can add them to the Wine command-line, or use a wrapper script. Wine itself shouldn't force quotes since otherwise there is no way to start a program without quotes (and I most definitely can start a program without quotes under Windows).
On Thu, Oct 17, 2002 at 12:37:31PM -0700, Alexandre Julliard wrote:
Andreas Mohr andi@rhlx01.fht-esslingen.de writes:
Not quoting the arguments is a legal way of doing it, but I guess in order to be 150% compliant with Windows, we might want to think of a way to reintroduce quotes for programs we start. (IIRC Alexandre said it's a bit difficult, but should be doable)
Well, if you want quotes you can add them to the Wine command-line, or use a wrapper script. Wine itself shouldn't force quotes since otherwise there is no way to start a program without quotes (and I most definitely can start a program without quotes under Windows).
Hmm, strange, I thought last time we discovered that adding quotes to the argument in the shell would not work for some strange reason (I believe Wine itself got confused about the quotes in the argument). Or maybe this is fixed now ? Anyway...
Yep, e.g. simply doing a CreateProcess() would enable you to run a program without quotes. Thus any program which assumes to get launched *with* quotes *only* should be considered broken. What astonishes me a bit is that you tell us that NT 4 doesn't quote shell launching (Win 9x definitely does). Next time someone is bold enough to tell me that UNIX/Linux is "fragmented"...
Andi