aboutsummaryrefslogtreecommitdiff
path: root/winsup
diff options
context:
space:
mode:
authorCorinna Vinschen <corinna@vinschen.de>2021-10-29 18:08:32 +0200
committerCorinna Vinschen <corinna@vinschen.de>2021-10-29 18:19:45 +0200
commit4bc8f1adb462946c9f23b06295eed792574242aa (patch)
tree070bb091c7718b5e133290e0e82941f2cd255847 /winsup
parente8bfe362814ea5e6837cb94656fbc54a743ca940 (diff)
downloadnewlib-4bc8f1adb462946c9f23b06295eed792574242aa.zip
newlib-4bc8f1adb462946c9f23b06295eed792574242aa.tar.gz
newlib-4bc8f1adb462946c9f23b06295eed792574242aa.tar.bz2
Cygwin: drop support for simple invisible console code
i. e., Vista/2008. AllocConsole appears to allow creating a console only on the currently visible desktop since Windows 7, which broke the simple code opening the console on an invisible desktop in an invisible window station. Signed-off-by: Corinna Vinschen <corinna@vinschen.de>
Diffstat (limited to 'winsup')
-rw-r--r--winsup/cygwin/fhandler.h1
-rw-r--r--winsup/cygwin/fhandler_console.cc34
-rw-r--r--winsup/cygwin/wincap.cc11
-rw-r--r--winsup/cygwin/wincap.h2
4 files changed, 2 insertions, 46 deletions
diff --git a/winsup/cygwin/fhandler.h b/winsup/cygwin/fhandler.h
index c033f78..ea8d6e9 100644
--- a/winsup/cygwin/fhandler.h
+++ b/winsup/cygwin/fhandler.h
@@ -2118,7 +2118,6 @@ private:
/* Input calls */
int igncr_enabled ();
void set_cursor_maybe ();
- static bool create_invisible_console (HWINSTA);
static bool create_invisible_console_workaround (bool force);
static console_state *open_shared_console (HWND, HANDLE&, bool&);
void fix_tab_position (void);
diff --git a/winsup/cygwin/fhandler_console.cc b/winsup/cygwin/fhandler_console.cc
index aee5e82..940c66a 100644
--- a/winsup/cygwin/fhandler_console.cc
+++ b/winsup/cygwin/fhandler_console.cc
@@ -3530,34 +3530,7 @@ fhandler_console::fixup_after_fork_exec (bool execing)
setup_io_mutex ();
}
-// #define WINSTA_ACCESS (WINSTA_READATTRIBUTES | STANDARD_RIGHTS_READ | STANDARD_RIGHTS_WRITE | WINSTA_CREATEDESKTOP | WINSTA_EXITWINDOWS)
-#define WINSTA_ACCESS WINSTA_ALL_ACCESS
-
-/* Create a console in an invisible window station. This should work
- in all versions of Windows NT except Windows 7 (so far). */
-bool
-fhandler_console::create_invisible_console (HWINSTA horig)
-{
- HWINSTA h = CreateWindowStationW (NULL, 0, WINSTA_ACCESS, NULL);
- termios_printf ("%p = CreateWindowStation(NULL), %E", h);
- BOOL b;
- if (h)
- {
- b = SetProcessWindowStation (h);
- termios_printf ("SetProcessWindowStation %d, %E", b);
- }
- b = AllocConsole (); /* will cause flashing if CreateWindowStation
- failed */
- if (!h)
- SetParent (GetConsoleWindow (), HWND_MESSAGE);
- if (horig && h && h != horig && SetProcessWindowStation (horig))
- CloseWindowStation (h);
- termios_printf ("%d = AllocConsole (), %E", b);
- invisible_console = true;
- return b;
-}
-
-/* Ugly workaround for Windows 7 and later.
+/* Ugly workaround to create invisible console required since Windows 7.
First try to just attach to any console which may have started this
app. If that works use this as our "invisible console".
@@ -3707,10 +3680,7 @@ fhandler_console::need_invisible (bool force)
AllocConsole ();
invisible_console = true;
}
- else if (wincap.has_broken_alloc_console ())
- b = create_invisible_console_workaround (force);
- else
- b = create_invisible_console (h);
+ b = create_invisible_console_workaround (force);
}
debug_printf ("invisible_console %d", invisible_console);
diff --git a/winsup/cygwin/wincap.cc b/winsup/cygwin/wincap.cc
index b94f38e..6c4bcd0 100644
--- a/winsup/cygwin/wincap.cc
+++ b/winsup/cygwin/wincap.cc
@@ -25,7 +25,6 @@ wincaps wincap_vista __attribute__((section (".cygwin_dll_common"), shared)) = {
is_server:false,
needs_query_information:true,
has_gaa_largeaddress_bug:true,
- has_broken_alloc_console:false,
has_console_logon_sid:false,
has_precise_system_time:false,
has_microsoft_accounts:false,
@@ -59,7 +58,6 @@ wincaps wincap_7 __attribute__((section (".cygwin_dll_common"), shared)) = {
is_server:false,
needs_query_information:true,
has_gaa_largeaddress_bug:true,
- has_broken_alloc_console:true,
has_console_logon_sid:true,
has_precise_system_time:false,
has_microsoft_accounts:false,
@@ -93,7 +91,6 @@ wincaps wincap_8 __attribute__((section (".cygwin_dll_common"), shared)) = {
is_server:false,
needs_query_information:true,
has_gaa_largeaddress_bug:false,
- has_broken_alloc_console:true,
has_console_logon_sid:true,
has_precise_system_time:true,
has_microsoft_accounts:true,
@@ -127,7 +124,6 @@ wincaps wincap_8_1 __attribute__((section (".cygwin_dll_common"), shared)) = {
is_server:false,
needs_query_information:false,
has_gaa_largeaddress_bug:false,
- has_broken_alloc_console:true,
has_console_logon_sid:true,
has_precise_system_time:true,
has_microsoft_accounts:true,
@@ -161,7 +157,6 @@ wincaps wincap_10_1507 __attribute__((section (".cygwin_dll_common"), shared))
is_server:false,
needs_query_information:false,
has_gaa_largeaddress_bug:false,
- has_broken_alloc_console:true,
has_console_logon_sid:true,
has_precise_system_time:true,
has_microsoft_accounts:true,
@@ -195,7 +190,6 @@ wincaps wincap_10_1607 __attribute__((section (".cygwin_dll_common"), shared))
is_server:false,
needs_query_information:false,
has_gaa_largeaddress_bug:false,
- has_broken_alloc_console:true,
has_console_logon_sid:true,
has_precise_system_time:true,
has_microsoft_accounts:true,
@@ -229,7 +223,6 @@ wincaps wincap_10_1703 __attribute__((section (".cygwin_dll_common"), shared)) =
is_server:false,
needs_query_information:false,
has_gaa_largeaddress_bug:false,
- has_broken_alloc_console:true,
has_console_logon_sid:true,
has_precise_system_time:true,
has_microsoft_accounts:true,
@@ -263,7 +256,6 @@ wincaps wincap_10_1709 __attribute__((section (".cygwin_dll_common"), shared)) =
is_server:false,
needs_query_information:false,
has_gaa_largeaddress_bug:false,
- has_broken_alloc_console:true,
has_console_logon_sid:true,
has_precise_system_time:true,
has_microsoft_accounts:true,
@@ -297,7 +289,6 @@ wincaps wincap_10_1803 __attribute__((section (".cygwin_dll_common"), shared)) =
is_server:false,
needs_query_information:false,
has_gaa_largeaddress_bug:false,
- has_broken_alloc_console:true,
has_console_logon_sid:true,
has_precise_system_time:true,
has_microsoft_accounts:true,
@@ -331,7 +322,6 @@ wincaps wincap_10_1809 __attribute__((section (".cygwin_dll_common"), shared)) =
is_server:false,
needs_query_information:false,
has_gaa_largeaddress_bug:false,
- has_broken_alloc_console:true,
has_console_logon_sid:true,
has_precise_system_time:true,
has_microsoft_accounts:true,
@@ -365,7 +355,6 @@ wincaps wincap_10_1903 __attribute__((section (".cygwin_dll_common"), shared)) =
is_server:false,
needs_query_information:false,
has_gaa_largeaddress_bug:false,
- has_broken_alloc_console:true,
has_console_logon_sid:true,
has_precise_system_time:true,
has_microsoft_accounts:true,
diff --git a/winsup/cygwin/wincap.h b/winsup/cygwin/wincap.h
index 5b81af5..7645196 100644
--- a/winsup/cygwin/wincap.h
+++ b/winsup/cygwin/wincap.h
@@ -19,7 +19,6 @@ struct wincaps
unsigned is_server : 1;
unsigned needs_query_information : 1;
unsigned has_gaa_largeaddress_bug : 1;
- unsigned has_broken_alloc_console : 1;
unsigned has_console_logon_sid : 1;
unsigned has_precise_system_time : 1;
unsigned has_microsoft_accounts : 1;
@@ -85,7 +84,6 @@ public:
bool IMPLEMENT (is_server)
bool IMPLEMENT (needs_query_information)
bool IMPLEMENT (has_gaa_largeaddress_bug)
- bool IMPLEMENT (has_broken_alloc_console)
bool IMPLEMENT (has_console_logon_sid)
bool IMPLEMENT (has_precise_system_time)
bool IMPLEMENT (has_microsoft_accounts)