msvcrt: handle inheritance problem

qingdoa daoo qingdao33122 at
Fri Apr 7 23:49:36 CDT 2006

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

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

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);
        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.
-------------- next part --------------
An HTML attachment was scrubbed...

More information about the wine-devel mailing list