open a fresh console for the tests

Ferenc Wagner wferi at afavant.elte.hu
Fri Oct 8 12:06:13 CDT 2004


As per Eric's suggestion:

Changelog: * Unconditionally open a fresh console for the tests.

Index: dlls/kernel/tests/console.c
===================================================================
RCS file: /home/wine/wine/dlls/kernel/tests/console.c,v
retrieving revision 1.8
diff -u -r1.8 console.c
--- dlls/kernel/tests/console.c	13 Sep 2004 18:04:50 -0000	1.8
+++ dlls/kernel/tests/console.c	8 Oct 2004 16:43:09 -0000
@@ -565,17 +565,12 @@
      * the curses backend
      */
 
+    /* first, we detach and open a fresh console to play with */
+    FreeConsole();
+    AllocConsole();
     hConIn = CreateFileA("CONIN$", GENERIC_READ|GENERIC_WRITE, 0, NULL, OPEN_EXISTING, 0, 0);
     hConOut = CreateFileA("CONOUT$", GENERIC_READ|GENERIC_WRITE, 0, NULL, OPEN_EXISTING, 0, 0);
 
-    /* first, we need to be sure we're attached to a console */
-    if (hConIn == INVALID_HANDLE_VALUE || hConOut == INVALID_HANDLE_VALUE)
-    {
-        /* we're not attached to a console, let's do it */
-        AllocConsole();
-        hConIn = CreateFileA("CONIN$", GENERIC_READ|GENERIC_WRITE, 0, NULL, OPEN_EXISTING, 0, 0);
-        hConOut = CreateFileA("CONOUT$", GENERIC_READ|GENERIC_WRITE, 0, NULL, OPEN_EXISTING, 0, 0);
-    }
     /* now verify everything's ok */
     ok(hConIn != INVALID_HANDLE_VALUE, "Opening ConIn\n");
     ok(hConOut != INVALID_HANDLE_VALUE, "Opening ConOut\n");



More information about the wine-patches mailing list