* 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.
This commit is contained in:
@ -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)
|
||||
|
Reference in New Issue
Block a user