diff options
author | Christopher Faylor <me@cgf.cx> | 2005-12-21 17:14:34 +0000 |
---|---|---|
committer | Christopher Faylor <me@cgf.cx> | 2005-12-21 17:14:34 +0000 |
commit | 247ac234f46c038e1c23094172a6151efc17c6f0 (patch) | |
tree | ac8e7b423834c0ad0eb6ad7ada60a8e100367308 /winsup/cygwin/hookapi.cc | |
parent | d4c8d84da6f556265a560515e144c4b03cb4afb1 (diff) | |
download | cygnal-247ac234f46c038e1c23094172a6151efc17c6f0.tar.gz cygnal-247ac234f46c038e1c23094172a6151efc17c6f0.tar.bz2 cygnal-247ac234f46c038e1c23094172a6151efc17c6f0.zip |
* 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.
Diffstat (limited to 'winsup/cygwin/hookapi.cc')
-rw-r--r-- | winsup/cygwin/hookapi.cc | 4 |
1 files changed, 3 insertions, 1 deletions
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) |