Andreas Mohr <[EMAIL PROTECTED]> writes:

> It's simply not possible.
> We *have* to mess with it.
> 
> Just go read the GetCommandLine docu if you don't believe it.

No, don't do that, run a test program instead. You'll find that the
command-line is *not* modified.

Anyway, could you please try the following patch?  It should at least
fix the debugger issues, and it should also help for the relative path
problems.

Index: scheduler/process.c
===================================================================
RCS file: /opt/cvs-commit/wine/scheduler/process.c,v
retrieving revision 1.134
diff -u -r1.134 process.c
--- scheduler/process.c 2000/12/27 04:02:47     1.134
+++ scheduler/process.c 2001/01/03 04:24:17
@@ -401,18 +401,23 @@
     }
     else
     {
-        /* if argv[0] is "wine", don't try to load anything */
-        if (!(name = strrchr( argv[0], '/' ))) name = argv[0];
-        else name++;
-        if (!strcmp( name, "wine" )) return NULL;
+        const char *argv0 = main_exe_name;
+        if (!*argv0)
+        {
+            /* if argv[0] is "wine", don't try to load anything */
+            argv0 = argv[0];
+            if (!(name = strrchr( argv0, '/' ))) name = argv0;
+            else name++;
+            if (!strcmp( name, "wine" )) return NULL;
+        }
 
         /* now try argv[0] with ".so" appended */
-        if ((tmp = HeapAlloc( GetProcessHeap(), 0, strlen(argv[0]) + 4 )))
+        if ((tmp = HeapAlloc( GetProcessHeap(), 0, strlen(argv0) + 4 )))
         {
-            strcpy( tmp, argv[0] );
+            strcpy( tmp, argv0 );
             strcat( tmp, ".so" );
             /* search in PATH only if there was no '/' in argv[0] */
-            ret = wine_dll_load_main_exe( tmp, (name == argv[0]) );
+            ret = wine_dll_load_main_exe( tmp, (name == argv0) );
             if (!ret && !argv[1])
             {
                 /* if no argv[1], this will be better than displaying usage */
@@ -735,23 +740,23 @@
     int pid;
     const char *unixfilename = NULL;
     const char *unixdir = NULL;
-    DOS_FULL_NAME full_name;
+    DOS_FULL_NAME full_dir, full_name;
     HANDLE load_done_evt = (HANDLE)-1;
 
     info->hThread = info->hProcess = INVALID_HANDLE_VALUE;
 
     if (lpCurrentDirectory)
     {
-        if (DOSFS_GetFullName( lpCurrentDirectory, TRUE, &full_name ))
-            unixdir = full_name.long_name;
+        if (DOSFS_GetFullName( lpCurrentDirectory, TRUE, &full_dir ))
+            unixdir = full_dir.long_name;
     }
     else
     {
         char buf[MAX_PATH];
         if (GetCurrentDirectoryA(sizeof(buf),buf))
         {
-            if (DOSFS_GetFullName( buf, TRUE, &full_name ))
-                unixdir = full_name.long_name;
+            if (DOSFS_GetFullName( buf, TRUE, &full_dir ))
+                unixdir = full_dir.long_name;
         }
     }
 
@@ -759,8 +764,7 @@
 
     SERVER_START_REQ
     {
-        size_t len = (hFile == -1) ? 0 : MAX_PATH;
-        struct new_process_request *req = server_alloc_req( sizeof(*req), len );
+        struct new_process_request *req = server_alloc_req( sizeof(*req), MAX_PATH );
         req->inherit_all  = inherit;
         req->create_flags = flags;
         req->start_flags  = startup->dwFlags;
@@ -784,6 +788,7 @@
             unixfilename = filename;
             if (DOSFS_GetFullName( filename, TRUE, &full_name ))
                 unixfilename = full_name.long_name;
+            lstrcpynA( server_data_ptr(req), unixfilename, MAX_PATH );
         }
         else  /* new wine process */
         {

-- 
Alexandre Julliard
[EMAIL PROTECTED]

Reply via email to