[RESENT] MSVCRT: Use DuplicateHandle for CONOUT too

Uwe Bonnes bon at elektron.ikp.physik.tu-darmstadt.de
Sun May 22 11:47:08 CDT 2005


Changelog:
        dlls/msvcrt/console.c: msvcrt_init_console
        Use DuplicateHandle for STDOUT too ( CreateFileA("CONOUT$" failed)
        Bump up error reporting of missing console handles

This let's the MingW AVR-GCC produce Output for the -E compiler option.

--
Uwe Bonnes                bon at elektron.ikp.physik.tu-darmstadt.de

Institut fuer Kernphysik  Schlossgartenstrasse 9  64289 Darmstadt
--------- Tel. 06151 162516 -------- Fax. 06151 164321 ----------
Index: wine/dlls/msvcrt/console.c
===================================================================
RCS file: /home/wine/wine/dlls/msvcrt/console.c,v
retrieving revision 1.12
diff -u -r1.12 console.c
--- wine/dlls/msvcrt/console.c	25 Jun 2004 01:19:15 -0000	1.12
+++ wine/dlls/msvcrt/console.c	15 May 2005 22:30:09 -0000
@@ -51,12 +51,12 @@
    * NULL, OPEN_EXISTING, 0, NULL);
    */
 
-  MSVCRT_console_out= CreateFileA("CONOUT$", GENERIC_WRITE, FILE_SHARE_WRITE,
-				    NULL, OPEN_EXISTING, 0, NULL);
+  DuplicateHandle(GetCurrentProcess(), GetStdHandle(STD_OUTPUT_HANDLE),
+    GetCurrentProcess(), &MSVCRT_console_out, 0, FALSE, DUPLICATE_SAME_ACCESS);
 
   if ((MSVCRT_console_in == INVALID_HANDLE_VALUE) ||
       (MSVCRT_console_out== INVALID_HANDLE_VALUE))
-    WARN(":Console handle Initialisation FAILED!\n");
+    FIXME(":Console handle Initialisation FAILED!\n");
 }
 
 /* INTERNAL: Free console handles */



More information about the wine-patches mailing list