Welcome to mirror list, hosted at ThFree Co, Russian Federation.

cygwin.com/git/newlib-cygwin.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorChristopher Faylor <me@cgf.cx>2005-12-21 20:14:34 +0300
committerChristopher Faylor <me@cgf.cx>2005-12-21 20:14:34 +0300
commit247ac234f46c038e1c23094172a6151efc17c6f0 (patch)
treeac8e7b423834c0ad0eb6ad7ada60a8e100367308 /winsup/cygwin/hookapi.cc
parentd4c8d84da6f556265a560515e144c4b03cb4afb1 (diff)
* 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.cc4
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)