HI all,

Recently I have been trying to improve support for some MinGW based IDEs without native msvcrt. Now I am dealing with a problem with standard io handle redirection which prevents output from gcc tools from being piped to IDE message  windows.

I have been able to find that the problem is related to this patch on dlls/msvcrt/file.c
http://cvs.winehq.org/cvsweb/wine/dlls/msvcrt/file.c.diff?r1=1.59&r2=1.60&f=h

It has a one line changlog saying:
Duplicate stdin/stdout handles to avoid closing them when library is
unloaded.

If I revert file.c to pre-patch state, redirection works fine. But
am not sure if there will be unexpected consequences. So I searched
the wine-patch and wine-devel archives but didn't find the patch or
 any discussion about it.

Could someone explain what exactly that changelog line means?

A simple test program
------------------------------------------------------------------------
#include "stdio.h"
#include "process.h"

int main(int argc, char* argv[])
{
if( argc == 1 )
{
char *argv2[] = { argv[0], "foo", NULL };
_spawnv(_P_NOWAIT, argv[0], argv2);
}
else
{
puts("This won't print with builtin msvcrt");
}
return 0;
}



Love cheap thrills? Enjoy PC-to-Phone calls to 30+ countries for just 2¢/min with Yahoo! Messenger with Voice.