After upgrade to Wine 1.1.0 from 0.9.56 I found out that my WinEdt can't launch 
Unix binaries (xdvi, xterm etc) anymore. A dialog box saying "Cannot execute 
command ..." appears, but binaries are started anyway. AFAICS it is caused by 
patch by Dmitry Timoshkov that introduces "winoldap.mod". Now WinExec creates a 
process and then executes wait_input_idle() that fails for Unix processes that 
have hProcess == 0. I attach a quick fix that solves the problem for me, but I 
am not sure that my patch is quite correct and complete. Now we can only check 
that a Unix process is started successfully, but we don't know what is going on 
later. Can somebody propose a better solution? 

--- kernel32/process.c.orig     2008-06-27 17:24:42.000000000 +0300
+++ kernel32/process.c  2008-07-16 10:03:15.000000000 +0300
@@ -1987,8 +1987,8 @@
     if (CreateProcessA( NULL, cmdline, NULL, NULL, FALSE,
                         0, NULL, NULL, &startup, &info ))
     {
-        /* Give 30 seconds to the app to come up */
-        if (wait_input_idle( info.hProcess, 30000 ) == WAIT_FAILED)
+        /* Give 30 seconds to the non-Unix app to come up */
+        if (info.hProcess && (wait_input_idle( info.hProcess, 30000 ) == 
WAIT_FAILED))
             WARN("WaitForInputIdle failed: Error %d\n", GetLastError() );
         ret = 33;
         /* Close off the handles */
--- kernel32/kernel16.c.orig    2008-07-16 09:59:04.000000000 +0300
+++ kernel32/kernel16.c 2008-07-16 10:04:12.000000000 +0300
@@ -190,6 +190,7 @@
     if (CreateProcessA( NULL, cmdline, NULL, NULL, FALSE,
                         0, NULL, NULL, &startup, &info ))
     {
+      if ( info.hProcess ) {
         /* Give 10 seconds to the app to come up */
         if (wait_input_idle( info.hProcess, 10000 ) == WAIT_FAILED)
             WARN("WaitForInputIdle failed: Error %d\n", GetLastError() );
@@ -199,6 +200,15 @@
         GetExitCodeProcess( info.hProcess, &exit_code );
         CloseHandle( info.hThread );
         CloseHandle( info.hProcess );
+      }
+      else
+      {
+       /* Unix binary */
+        ReleaseThunkLock( &count );
+        exit_code = 33;
+        CloseHandle( info.hThread );
+        CloseHandle( info.hProcess );
+      }
     }
     else
         ReleaseThunkLock( &count );


Reply via email to