From 247ac234f46c038e1c23094172a6151efc17c6f0 Mon Sep 17 00:00:00 2001 From: Christopher Faylor Date: Wed, 21 Dec 2005 17:14:34 +0000 Subject: * cygheap.cc (init_cygheap::manage_console_count): Revert previous change. Handle this a different way. * external.cc (cygwin_internal): Accommodate extra hook_or_detect_cygwin argument. * hookapi.cc (cygwin_internal): Fill in subsys variable with the subsystem of the executable. * spawn.cc (av::iscui): New variable. (spawn_guts): Hide window when we don't have a console and this isn't NT/XP/2003. (av::fixup): Set iscui flag. * winsup.h (hook_or_detect_cygwin): Accommodate extra argument. --- winsup/cygwin/hookapi.cc | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) (limited to 'winsup/cygwin/hookapi.cc') diff --git a/winsup/cygwin/hookapi.cc b/winsup/cygwin/hookapi.cc index 26aff5165..2ef1eea47 100644 --- a/winsup/cygwin/hookapi.cc +++ b/winsup/cygwin/hookapi.cc @@ -151,7 +151,7 @@ makename (const char *name, char *&buf, int& i, int inc) // Top level routine to find the EXE's imports, and redirect them void * -hook_or_detect_cygwin (const char *name, const void *fn) +hook_or_detect_cygwin (const char *name, const void *fn, WORD& subsys) { HMODULE hm = fn ? GetModuleHandle (NULL) : (HMODULE) name; PIMAGE_NT_HEADERS pExeNTHdr = PEHeaderFromHModule (hm); @@ -159,6 +159,8 @@ hook_or_detect_cygwin (const char *name, const void *fn) if (!pExeNTHdr) return false; + subsys = pExeNTHdr->OptionalHeader.Subsystem; + DWORD importRVA = pExeNTHdr->OptionalHeader.DataDirectory [IMAGE_DIRECTORY_ENTRY_IMPORT].VirtualAddress; if (!importRVA) -- cgit v1.2.3