Starting a Linux application from a Windows application

Eric Pouech eric.pouech at wanadoo.fr
Mon Oct 23 14:40:54 CDT 2006


Helmar Spangenberg wrote:

>Hello list,
>we have a Windows application "App1" which starts another application "App2" 
>using CreateProcessA, then doing some different work, and finally waiting for 
>"App2" to finish using WaitForSingleObject. It is important for "App1" to 
>catch the exit code of "App2" as well as "App2's" messages on stdout. This 
>works fine with Windows applications.
>
>Unfortunately, this does not work as soon as "App2" is a Linux application; 
>"App1" seems to wait forever.
>
>Looking at the code of process.c and sync.c in kernel32, it seems to me that 
>wine forgets everything about the Linux process once it is started.g
>  
>
the point is that we currently don't trace pure unix process as being 
windows processes
hence you lack the ability to get some information on them (wait on 
exit, get return code...)
one of the things we could do is to:
1/ create a winelib app (say winixec) which does basically:
        WinMain(HINSTANCE hInstance, HINSTANCE hPrevInstance, LPSTR 
lpCmdLine, int nShowCmd)
        {
            return system(lpCmdLine);
        }      
2/ setup the application to be called as "winixec  foo args" instead of 
"foo args"

this would work in some of the cases, but fail for all the other 
operations (resume/suspend, debug...) which shouldn't be an issue in 
your case

A+



More information about the wine-devel mailing list