From 1204c515fe00335920c5707cc136e9562fd7cf38 Mon Sep 17 00:00:00 2001 From: Corinna Vinschen Date: Wed, 28 Sep 2005 19:02:53 +0000 Subject: * fhandler.h (class fhandler_dev_raw): Delete current_position and eof_detected status flag. Delete is_eom and is_eof methods. Move drive_size, bytes_per_sector, eom_detected status flag, as well as the methods read_file, write_file, raw_read and raw_write to ... (class fhandler_dev_floppy): ... here. Remove is_eom and is_eof methods. Add dup method. * fhandler_floppy.cc (IS_EOM): New macro. (fhandler_dev_floppy::is_eom): Remove. (fhandler_dev_floppy::is_eof): Remove. (fhandler_dev_floppy::fhandler_dev_floppy): Initialize status flags. (fhandler_dev_floppy::get_drive_info): Only call EX functions on systems supporting them and stop suffering strange delays. (fhandler_dev_floppy::read_file): Move here, drop setting current_position. (fhandler_dev_floppy::write_file): Move here, drop setting current_position. (fhandler_dev_floppy::open): Rearrange comment. (fhandler_dev_floppy::dup): New method. (fhandler_dev_floppy::get_current_position): New inline method. Use instead of former current_position were appropriate. (fhandler_dev_floppy::raw_read): Move here. Drop EOF handling. (fhandler_dev_floppy::raw_write): Move here. Drop EOF handling. (fhandler_dev_floppy::lseek): Remove useless conditions. Convert sector_aligned_offset to LARGE_INTEGER to improve SetFilePointer call. (fhandler_dev_floppy::ioctl): Move blocksize check in RDSETBLK case to here. * fhandler_raw.cc (fhandler_dev_raw::is_eom): Remove. (fhandler_dev_raw::is_eof): Remove. (fhandler_dev_raw::write_file): Remove. (fhandler_dev_raw::read_file): Remove. (fhandler_dev_raw::raw_read): Remove. (fhandler_dev_raw::raw_write): Remove. (fhandler_dev_raw::dup): Drop copying removed members. (fhandler_dev_raw::ioctl): Drop blocksize testing. * wincap.h: Implement has_disk_ex_ioctls throughout. * wincap.cc: Ditto. (wincap_vista): Preliminary wincaps for Windows Vista/Longhorn. (wincapc::init): Add Vista/Longhorn handling. --- winsup/cygwin/sigproc.cc | 57 ++++++++++++++++++++++++++++++++++++++++++++++-- 1 file changed, 55 insertions(+), 2 deletions(-) (limited to 'winsup/cygwin/sigproc.cc') diff --git a/winsup/cygwin/sigproc.cc b/winsup/cygwin/sigproc.cc index e27fccdd9..bc21c33ec 100644 --- a/winsup/cygwin/sigproc.cc +++ b/winsup/cygwin/sigproc.cc @@ -582,7 +582,8 @@ sig_send (_pinfo *p, siginfo_t& si, _cygtls *tls) sigproc_printf ("sendsig handle never materialized"); goto out; } - HANDLE hp = OpenProcess (PROCESS_DUP_HANDLE, false, dwProcessId); + HANDLE hp = OpenProcess (PROCESS_DUP_HANDLE | SYNCHRONIZE, + false, dwProcessId); if (!hp) { __seterrno (); @@ -598,7 +599,59 @@ sig_send (_pinfo *p, siginfo_t& si, _cygtls *tls) CloseHandle (hp); goto out; } - CloseHandle (hp); + if (si.si_signo == __SIGCOMMUNE) + { + if (!(myself->gotit = CreateEvent (&sec_none_nih, true, false, NULL))) + { + __seterrno (); + sigproc_printf ("CreateEvent failed, %E"); + CloseHandle (hp); + goto out; + } + if (!DuplicateHandle (hMainProc, myself->gotit, hp, + &myself->__gotit, false, 0, + DUPLICATE_SAME_ACCESS)) + { + __seterrno (); + sigproc_printf ("DuplicateHandle failed, %E"); + CloseHandle (myself->gotit); + CloseHandle (hp); + goto out; + } + if (!DuplicateHandle (hMainProc, myself->tothem, hp, + &myself->__tothem, false, 0, + DUPLICATE_SAME_ACCESS)) + { + __seterrno (); + sigproc_printf ("DuplicateHandle failed, %E"); + CloseHandle (myself->gotit); + CloseHandle (hp); + goto out; + } + if (!DuplicateHandle (hMainProc, myself->fromthem, hp, + &myself->__fromthem, false, 0, + DUPLICATE_SAME_ACCESS)) + { + __seterrno (); + sigproc_printf ("DuplicateHandle failed, %E"); + CloseHandle (myself->gotit); + CloseHandle (hp); + goto out; + } + if (!DuplicateHandle (hMainProc, hMainProc, hp, + &myself->__them, false, 0, + DUPLICATE_SAME_ACCESS)) + { + __seterrno (); + sigproc_printf ("DuplicateHandle failed, %E"); + CloseHandle (myself->gotit); + CloseHandle (hp); + goto out; + } + myself->them = hp; + } + else + CloseHandle (hp); VerifyHandle (sendsig); } -- cgit v1.2.3