argc / argv issue?

Ann and Jason Edmeades us at the-edmeades.demon.co.uk
Sun Apr 28 16:13:51 CDT 2002


Hello,

I started debugging a relatively simple problem, which is I copied
comdlg32.ocx and regsvr32.exe from a windows 2000 box to a no-windows wine
installation (on Mandrake 8.2), and found that if I run 'wine regsvr32.exe
comdlg32.ocx', it succeeds fine, whereas running the same command under wcmd
caused failures.

I debugged a little further and the problem appears to be caused by argc
being wrong when wcmd (a winelib program) launches regsvr32.exe. I am
continuing to investigate but I know argv/argc issues have cropped up lots
and would appreciate any pointers.

My debugging so far (edited, @@@@ are my extra trace points):

./wcmd -debugmsg +msvcrt,+process >~/wine/patches/dbg/wcmdproccessinfo 2>&1

WCMD starting:
trace:process:process_init @@@@@ argv[0] = ./wcmd
trace:process:process_init @@@@@ argc = 1
trace:process:process_init @@@@@ argv[0] = /usr/local/bin/wineconsole
trace:process:process_init @@@@@ argv[1] = --use-event=52
trace:process:process_init @@@@@ argc = 2

Launching regsvr32.exe:
trace:process:process_init @@@@@ argv[0] = /usr/local/bin/wine
trace:process:process_init @@@@@ argv[1] = --
trace:process:process_init @@@@@ argv[2] = regsvr32
trace:process:process_init @@@@@ argv[3] = comdlg32.ocx
trace:process:process_init @@@@@ argc = 4
  *** Note argc is 4 (correctly)

trace:msvcrt:msvcrt_init_mt_locks initializing mtlocks
trace:msvcrt:msvcrt_init_io :handles (8)(12)(16)
trace:msvcrt:msvcrt_init_console :Opening console handles
trace:msvcrt:msvcrt_init_args got 'regsvr32 comdlg32.ocx', wide = L"regsvr32
comdlg32.ocx" argc=3
   *** Note argc is 3 now, incorrectly


Other debugging bits of info, originally I thought the problem was in native
msvcrt so I added trace to local __getmainargs to trace out what was passed:

wine:
trace:msvcrt:msvcrt_init_args got 'regsvr32 comdlg32.ocx', wide = L"regsvr32
comdlg32.ocx" argc=2
  *** 2 parms
trace:msvcrt:__getmainargs @@@ MSVCRT Info
trace:msvcrt:__getmainargs @@@ Arg 0 = regsvr32
trace:msvcrt:__getmainargs @@@ Arg 1 = comdlg32.ocx

wcmd:
trace:msvcrt:msvcrt_init_args got 'regsvr32 comdlg32.ocx', wide = L"regsvr32
comdlg32.ocx" argc=3
  *** 3 parms
trace:msvcrt:__getmainargs @@@ MSVCRT Info
trace:msvcrt:__getmainargs @@@ Arg 0 = --
trace:msvcrt:__getmainargs @@@ Arg 1 = regsvr32
trace:msvcrt:__getmainargs @@@ Arg 2 = comdlg32.ocx

I'll continue to investigate, but suggestions welcome.

Regards,
Jason

jason  @  the-edmeades.demon.co.uk




More information about the wine-devel mailing list