__p___argc, MSVCRT,__wine_get_main_args and ParseOptions

Uwe Bonnes bon at elektron.ikp.physik.tu-darmstadt.de
Tue Dec 4 02:45:57 CST 2001


>>>>> "Francois" == Francois Gouget <fgouget at 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);

-- 
Uwe Bonnes                bon at elektron.ikp.physik.tu-darmstadt.de

Institut fuer Kernphysik  Schlossgartenstrasse 9  64289 Darmstadt
--------- Tel. 06151 162516 -------- Fax. 06151 164321 ----------




More information about the wine-devel mailing list