FW: argc/argv issue - More info, hack and questions...
Hi, I havent had any replies to the attached issue I was debugging - Can anyone assist, or should I just submit the patch. I know the patch works but I feel it is just masking a compatibility problem between two of the wine internal routines. Jason -----Original Message----- Hello, I am still investigating this argv/argc issue. The sequence of events as far as I can tell: CreateProcessA(NULL, "regsvr32 comdlg32.ocx",....) Process_CREATE calls fork_and_exec( NULL, "regsvr32 comdlg32.ocx", ...) This sees there is no explicitly specified filename so inserts wine and -- into the command line (now "wine -- regsvr32 comdlg32.ocx") Eventually the new process starts with the wine -- regsvr32 comdlg32.ocx as the command line, so it needs to strip off the inserted fields, and in PROCESS_InitWine, main_exe_name is correct (path\regsvr32.exe) but the argc/argv includes these new fields. At the top it states: (Scheduler/process.c, lines 491/492): app_argv++; /* remove argv[0] (wine itself) */ app_argc--; This obviously leaves behine the -- and things go downhill from there onwards. Interestingly wine -- regsvr32 comdlg32.ocx works fine, so there must be command line processing here which doesnt occur during the CreateProcess route. Question: Should fork_and_exec insert the -- into the command line? If it should, should PROCESS_InitWine check for it, ie: app_argv++; /* remove argv[0] (wine itself) */ app_argc--; if (app_argc && strcmp(app_argv[0], "--") == 0) { app_argv++; /* remove argv[1] ('--' inserted by fork_and_exec) */ app_argc--; } However, what implications are of doing this (it works, of course). This feels like hacking around an imcompatibility within wine but I am happy to submit a patch as it definitely resolves a problem for me. Regards, Jason
On Wed, 1 May 2002, Ann and Jason Edmeades wrote:
Hi, I havent had any replies to the attached issue I was debugging - Can anyone assist, or should I just submit the patch. I know the patch works but I feel it is just masking a compatibility problem between two of the wine internal routines.
Alexandre committed the following patch to CVS recently. Would it fix the bug? From: http://www.winehq.com/hypermail/wine-cvs/2002/04/0251.html Changes by: julliard(a)wine.codeweavers.com 02/04/29 14:34:06 Modified files: scheduler : process.c Log message: Don't prepend '--' to the command line when starting a Windows binary. Patch: http://cvs.winehq.com/patch.py?id=10201088460758018652713908 -- Francois Gouget fgouget(a)free.fr http://fgouget.free.fr/ Demander si un ordinateur peut penser revient à demander si un sous-marin peut nager.
Thanks for the information - I had literally just updated my cvs tree while watching the football (soccer?), and just tested it out and it works fine - Thanks to Alexandre and apologies for not spotting this Regards, Jason
Alexandre committed the following patch to CVS recently. Would it fix the bug?
From: http://www.winehq.com/hypermail/wine-cvs/2002/04/0251.html
"Ann" == Ann and Jason Edmeades <us(a)the-edmeades.demon.co.uk> writes:
Ann> Hi, I havent had any replies to the attached issue I was debugging Ann> - Can anyone assist, or should I just submit the patch. I know the Ann> patch works but I feel it is just masking a compatibility problem Ann> between two of the wine internal routines. There has been a patch submitted by Alexandre in the last days that changed something in the handling of "--" Did you try with a recent wine cvs version? Bye -- Uwe Bonnes bon(a)elektron.ikp.physik.tu-darmstadt.de Institut fuer Kernphysik Schlossgartenstrasse 9 64289 Darmstadt --------- Tel. 06151 162516 -------- Fax. 06151 164321 ----------
participants (3)
-
Ann and Jason Edmeades -
Francois Gouget -
Uwe Bonnes