It may work if the app would close 0,1,2 and reopen them on standard handles
Do you mean StdHandles a la Windows? I'm not sure a GUI app has them. Even if it had, there's no way to convert them into libc handles or streams AFAIK.
a GUI app gets the std-handles its parent requires it to have. then msvcrt on startup will only initialize 0,1,2 to the std-handle if the app is a CUI app (from the PE flag) check out in msvcrt _open_osfhandle to open a msvcrt file descriptor from a kernel32 handle http://msdn.microsoft.com/library/default.asp?url=/library/en-us/vclib/html/...
In short, I've got the impression that things are working out now (by using some black magic -- ie. winetest being a CUI -- which I don't understand), so maybe we could simply leave it for now. Or do I miss serious issues?
the only point is that we don't have a consistent basis across platforms were we start the tests from:
- all tests programs are CUI exec
- but, we don't know if it's attached to a console or not
A CLI program is attached to a console unless created with fancy flags, isn't it?
it's attached to the parent console, if the parent has a console, and if you don't pass DETACH_CONSOLE as a flag in CreateProcess
Presently I only ask for the window to be hidden, nothing else.
- if attached to a console, we don't know whether other
processes are outputting to the same console (which could impact the tests...)
I never thought of this. If this really can be a problem, we must solve it, thanks for bringing it up. However I seem to recall that the console test pops up a separate console,
no, they create a console if the process doesn't have one. don't forget that on unix, the test will output to stdout/stderr using the unix streams, even without a console is created, which is rather different from windows were normally the program will output its info on the same console it's run from
A+