* fhandler_console.cc (fhandler_console::need_invisible): Only try to open

"CygwinInvisible" windows station if opening of default station fails.  Use
CloseWindowStation to close window station handle.
This commit is contained in:
Christopher Faylor 2006-01-05 03:58:19 +00:00
parent faec62caaf
commit 4c3faa85ce
2 changed files with 12 additions and 4 deletions

View File

@ -1,3 +1,9 @@
2006-01-04 Christopher Faylor <cgf@timesys.com>
* fhandler_console.cc (fhandler_console::need_invisible): Only try to
open "CygwinInvisible" windows station if opening of default station
fails. Use CloseWindowStation to close window station handle.
2006-01-04 Christopher Faylor <cgf@timesys.com> 2006-01-04 Christopher Faylor <cgf@timesys.com>
* fhandler_console.cc (fhandler_console::need_invisible): Open up the * fhandler_console.cc (fhandler_console::need_invisible): Open up the

View File

@ -1856,7 +1856,9 @@ fhandler_console::need_invisible ()
h = horig = GetProcessWindowStation (); h = horig = GetProcessWindowStation ();
if (myself->ctty == -1) if (myself->ctty == -1)
{ {
h = CreateWindowStation ("CygwinInvisible", 0, WINSTA_ALL_ACCESS, &sec_all_nih); if (!(h = CreateWindowStation (NULL, 0, WINSTA_ALL_ACCESS, &sec_all_nih)))
h = CreateWindowStation ("CygwinInvisible", 0, WINSTA_ALL_ACCESS,
&sec_all_nih);
termios_printf ("CreateWindowStation(\"CygwinInvisible\", %p), %E", h); termios_printf ("CreateWindowStation(\"CygwinInvisible\", %p), %E", h);
if (h) if (h)
{ {
@ -1864,11 +1866,11 @@ fhandler_console::need_invisible ()
termios_printf ("SetProcessWindowStation %d, %E", b); termios_printf ("SetProcessWindowStation %d, %E", b);
} }
} }
b = AllocConsole (); // will cause flashing if workstation b = AllocConsole (); /* will cause flashing if CreateWorkstation
// stuff fails failed */
debug_printf ("h (%p), horig (%p)", h, horig); debug_printf ("h (%p), horig (%p)", h, horig);
if (horig && h && h != horig && SetProcessWindowStation (horig)) if (horig && h && h != horig && SetProcessWindowStation (horig))
CloseHandle (h); CloseWindowStation (h);
termios_printf ("%d = AllocConsole (), %E", b); termios_printf ("%d = AllocConsole (), %E", b);
invisible_console = true; invisible_console = true;
} }