"steve" == steve lustbader steve.lustbader@philips.com writes:
steve> I have an app that starts 2 other processes using CreateProcess. steve> When one of these new proceses calls GetCommandLine, an empty steve> string is returned (the correct string is returned for the steve> original process). I tried looking into it, but I think this steve> part of Wine is a little over my head. Any thoughts/fixes for steve> this, anyone?
Can you produce a short C program that reproduces the problem and make that program available?
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. With Wine, the first window will display MainProc.exe and the other won't display anything. If you run SubProc.exe by itself, in either Wine or Windows, the command line is displayed correctly.
-Steve
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 )))