summaryrefslogtreecommitdiffstats
path: root/winsup/cygwin/hookapi.cc
Commit message (Collapse)AuthorAgeFilesLines
* * winsup.h (cygwin_hmodule): Declare.Christopher Faylor2006-02-231-1/+0
| | | | | | | | | * exceptions.cc (inside_kernel): Reverse return values to reflect function name. Return true if we're in cygwin1.dll or if we're executing in dll_entry. (_cygtls::interrupt_now): Reflect reversal of inside_kernel return value. * hookapi.cc (cygwin_hmodule): Remove declaration. * init.cc (dll_entry): Use in_dllentry global to record that we are executing in dllentry.
* * cygheap.cc (init_cygheap::manage_console_count): Revert previous change.Christopher Faylor2005-12-211-1/+3
| | | | | | | | | | | | | 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.
* * hookapi.cc (putmem): Remove query of previous memory protection since we getChristopher Faylor2005-12-161-14/+3
| | | | that for free the first time we call VirtualProtect.
* * hookapi.cc (hook_or_detect_cygwin): Correct inverted test for whether toChristopher Faylor2005-09-281-1/+1
| | | | allocate a buffer by always allocating a buffer.
* * hookapi.cc (hook_or_detect_cygwin): Simplify very slightly.Christopher Faylor2005-09-151-1/+1
| | | | | * spawn.cc (av::fixup): Guard against problems reading an executable which does not match Microsoft's documentation about PE format.
* * hookapi.cc (rvadelta): Change argument to DWORD to eliminate a compilerChristopher Faylor2005-09-081-1/+1
| | | | | | | | | | warning. * path.h (path_conv::set_cygexec): New function. * spawn.cc (av::iscygwin): Eliminate. (av::av): Don't initialize iscygwin. (spawn_guts): Just use real_path.iscygexec for all tests. (av::fixup): Short circuit test if .exe extension and known cygexec. Set cygexec flag appropriately if we find that program uses cygwin1.dll.
* * dcrt0.cc (initial_env): Don't attempt stracing if dynamically loaded.Christopher Faylor2005-09-071-6/+22
| | | | | | | | | | | | | | | (dll_crt0_0): Move console initialization earlier. * init.cc (dll_entry): Move console initialization here. * exceptions.cc (init_console_handler): Fully remove any old console handler. * spawn.cc (spawn_guts): Don't fill out windows argv if we've deduced that this is a cygwin-using program. (av::fixup): Always check executables to see if they are using cygwin1.dll. Don't consider .com files to be scripts. * hookapi.cc (rvadelta): New function. (PEHeaderFromHModule): Simplify slightly. (hook_or_detect_cygwin): Use passed in name argument for "HMODULE" rather than incorrectly reading current program. Calculate delta needed to read image data and file names if this isn't a real "HMODULE".
* * child_info.h (child_info::sync): Pass pid and HANDLE rather than using pinfo.Christopher Faylor2005-07-171-10/+13
| | | | | | | | | | | | | | | | | | | | | | | | (child_info::child_info): Accept an argument controlling whether to create proc_subproc. (child_info_spawn::child_info_spawn): Ditto. * sigproc.cc (child_info::child_info): Ditto. (child_info_spawn::child_info_spawn): Ditto. (child_info::sync): Use passed in pid and HANDLE. * fork.cc (fork_parent): Reflect additional arguments required for child_info::sync. * hookapi.cc (hook_or_detect_cygwin): Rename. Change so that NULL 'fn' argument just returns "true", indicating that program uses cygwin1.dll. * spawn.cc (av::win16_exe): New element. * spawn.cc (av::iscygwin): New element. (av::fixup): New function. (spawn_guts): Protect against SEGV. Use fixup function to detect when it is safe to wait for a spawned (as opposed to an execed) program. Reflect changes in child_info::sync arguments. * external.cc (cygwin_internal): Reflect function renaming to hook_or_detect_cygwin. * cygheap.cc (cygheap_fixup_in_child): Close handle after debug fixup has been done to prevent false positives in handle collision. * exceptions.cc (try_to_debug): Notify debugger if already being debugged.
* Eliminate (void) cast on standalone function calls throughout.Christopher Faylor2005-07-061-1/+1
|
* * dcrt0.cc (do_global_dtors): Run DLL dtors.Christopher Faylor2005-04-141-1/+1
| | | | | | | | | | | | | | | | | (__main): Don't rely on atexit to run dtors. (do_exit): Specifically call do_global_dtors here. (cygwin_exit): Ditto. * dll_init.cc (dll_global_dtors): Make global. Only run dtors once. (dll_list::init): Just set flag that dtors should be run. Don't rely on atexit. * dll_init.h (dll_global_dtors): Declare. * exceptions.cc (sigrelse): Define. * path.h (is_fs_device): New method. (is_lnk_special): Ditto. * fhandler_disk_file.cc (fhandler_disk_file::link): Use "is_lnk_special" rather than "is_lnk_symlink". * syscalls.cc (rename): Ditto. * hookapi.cc (ld_preload): Use colon as a separator rather than space.
* * Makefile.in (DLL_OFILES): Add hookapi.o. Eliminate some cruft.Christopher Faylor2005-03-221-0/+218
* cygheap.h (cygheap_types): Add new enum: HEAP_1_HOOK. (hook_chain): New struct. (init_cygheap::hooks): Define new element. * cygheap.cc (cygheap_fixup_in_child): Zero hook chain on exec. * dcrt0.cc (dll_crt0_1): Call ld_preload just before calling main function. * external.cc (cygwin_internal): Implement CW_HOOK. * fork.cc (fork_child): Call fixup_hooks_after_fork. * init.cc (cygwin_hmodule): Reinstate after a long absence. * include/sys/cygwin.h: Define CW_HOOK. * hookapi.cc: New file. * select.cc (start_thread_socket): Add debugging output. * fhandler_disk_file.cc (fhandler_disk_file::fchmod): gcc 4.x accommodation. * fhandler_socket.cc (fhandler_socket::connect): Make sure that err is initialized.