"Francois" == Francois Gouget fgouget@free.fr writes:
Francois> On Tue, 20 Nov 2001, Uwe Bonnes wrote: >> Hallo, >> >> running with builtin msvcrt like >> >> > wine --dll msvcrt=b a.exe Francois> [...] >> still counts _two_ arguments, as it sees "wine a.exe".
Francois> Yes, there is a problem. How did I miss it when I looked Francois> into the parameter passing?
...
Francois> The problem with this patch is that it removes the Francois> application name for Winelib applications. More investigation Francois> is needed...
How about removing the parameters in msvcrt/data.c like:
Index: wine/dlls/msvcrt/data.c =================================================================== RCS file: /home/wine/wine/dlls/msvcrt/data.c,v retrieving revision 1.11 diff -u -w -r1.11 data.c --- wine/dlls/msvcrt/data.c 2001/09/07 19:47:30 1.11 +++ wine/dlls/msvcrt/data.c 2001/12/04 07:10:43 @@ -50,7 +50,10 @@ /*********************************************************************** * __p___argc (MSVCRT.@) */ -int* __p___argc(void) { return &MSVCRT___argc; } +int* __p___argc(void) { +TRACE("BON: %p %d\n",&MSVCRT___argc,MSVCRT___argc); +return &MSVCRT___argc; +}
/*********************************************************************** * __p__commode (MSVCRT.@) @@ -156,7 +159,10 @@ MSVCRT__acmdln = _strdup( GetCommandLineA() ); MSVCRT__wcmdln = wstrdupa(MSVCRT__acmdln); MSVCRT___argc = __wine_get_main_args(&MSVCRT___argv); + MSVCRT___argv = &(MSVCRT___argv[1]); + MSVCRT___argc--; __wine_get_wmain_args(&MSVCRT___wargv); + MSVCRT___wargv = &(MSVCRT___wargv[1]);
TRACE("got '%s', wide = %s argc=%d\n", MSVCRT__acmdln, debugstr_w(MSVCRT__wcmdln),MSVCRT___argc);