(tty::gethwnd): Ditto.
(tty::sethwnd): Ditto.
(tty_min::hwnd): Receive variable from tty class.
(tty_min::gethwnd): Receive function from tty classs.
(tty_min::sethwnd): Ditto.
* dtable.cc (dtable::stdio_init): Only call init_console_handler when we
actually own the console.
* fhandler_console.cc (fhandler_console::get_tty_stuff): Set tty's hwnd to
non-zero value.
* fhandler_termios.cc (fhandler_termios::tcsetpgrp): Semi-reinstate handling of
console when pgrp is set.
(findenv_func): New function pointer, predefined to getearly.
(getenv): Call findenv function over the findenv_func pointer.
(environ_init): Change findenv_func pointer to my_findenv after Cygwin
environment is initialized.
Use as guard for the WAVEFORMATEX structure instead of
_WAVEFORMATEX_ to avoid clashes with DirectSound. Keep
_WAVEFORMATEX_ for compatibility.
Thanks to: Andrew Jones <guln at sf dot net>
PocketPC support.
* include/aygshell.h: New file [_WIN32_WCE]. Declare most common
functions for using aygshell on PocketPC:
SHCreateMenuBar, SHFindMenuBar, SHCreateNewItem, SHFullScreen,
SHSipInfo, SHHandleWMActivate, SHHandleWMSettingChange
* include/commctrl.h [_WIN32_WCE] Add function prototypes for
command bar API on PocketPC:
CommandBar_Create, CommandBar_Show, CommandBar_AddBitmap,
CommandBar_InsertComboBox, CommandBar_InsertMenubar,
CommandBar_InsertMenubarEx, CommandBar_DrawMenuBar,
CommandBar_GetMenu, CommandBar_AddAdornments, CommandBar_Height,
CommandBar_InsertButton, CommandBar_Destroy.
* include/winbase.h [_WIN32_WCE] (WIN32_FIND_DATA{A|W}): Remove
fields not present on PocketPC.
(GetCurrentThreadId): Conditionally declare as extern function
without dllimport attribute on PocketPC.
(ResetEvent): Likwise.
(SetEvent): Likewise.
* include/wingdi.h [_WIN32_WCE] (GetTextExtentPoint32{A|W}):
Conditionally declare as extern function without dllimport
attribute on PocketPC.
* winuser.h [_WIN32_WCE] (DialogBoxParam{A|W}): Conditionally
declare as extern function without dllimport attribute on PocketPC.
PocketPC support.
* include/aygshell.h: New file [_WIN32_WCE]. Declare most common
functions for using aygshell on PocketPC:
SHCreateMenuBar, SHFindMenuBar, SHCreateNewItem, SHFullScreen,
SHSipInfo, SHHandleWMActivate, SHHandleWMSettingChange
* include/commctrl.h [_WIN32_WCE] Add function prototypes for
command bar API on PocketPC:
CommandBar_Create, CommandBar_Show, CommandBar_AddBitmap,
CommandBar_InsertComboBox, CommandBar_InsertMenubar,
CommandBar_InsertMenubarEx, CommandBar_DrawMenuBar,
CommandBar_GetMenu, CommandBar_AddAdornments, CommandBar_Height,
CommandBar_InsertButton, CommandBar_Destroy.
* include/winbase.h [_WIN32_WCE] (WIN32_FIND_DATA{A|W}): Remove
fields not present on PocketPC.
(GetCurrentThreadId): Conditionally declare as extern function
without dllimport attribute on PocketPC.
(ResetEvent): Likwise.
(SetEvent): Likewise.
* include/wingdi.h [_WIN32_WCE] (GetTextExtentPoint32{A|W}):
Conditionally declare as extern function without dllimport
attribute on PocketPC.
* winuser.h [_WIN32_WCE] (DialogBoxParam{A|W}): Conditionally
declare as extern function without dllimport attribute on PocketPC.
* include/winnt.h (IMAGE_FILE_MACHINE_IA64): New define.
(IMAGE_FILE_MACHINE_AMD64): New define.
(IMAGE_NT_OPTIONAL_HDR{32|64}_MAGIC. New. Map to IMAGE_NT_OPTIONAL_HDR_MAGIC.
(IMAGE_SUBSYSTEM_NATIVE_WINDOWS): New define.
(IMAGE_SUBSYSTEM_WINDOWS_CE_GUI): New define.
(IMAGE_DLLCHARACTERISTICS_WDM_DRIVER): New define.
(IMAGE_DIRECTORY_ENTRY_*): New defines.
(IMAGE_SCN_TYPE_*): New defines.
(IMAGE_SCN_ALIGN_*): New defines.
(IMAGE_DEBUG_TYPE_BORLAND): New define.
(IMAGE_OPTIONAL_HEADER{32|64}): New structure definitions and typedefs. Map to
IMAGE_OPTIONAL_HEADERS.
(IMAGE_NT_HEADERS{32|64}): New structure definitions and typedefs. Map to
IMAGE_NT_HEADERS.
(IMAGE_LOAD_CONFIG_DIRECTORY64): New structure definition and typedefs.
(IMAGE_CE_RUNTIME_FUNCTION_ENTRY): Likewise.
(IMAGE_FUNCTION_ENTRY64): Likewise.
* include/ws2spi.h (system_header): Add pragma.
* include/rasdlg.h (system_header): Add pragma.
* include/rasdlg.h (_RASDLG_H): Define.
Define instead of _RASDLG_H_, this is the w32api standard.
* include/mlang.h (_MLANG_H): Define.
Define instead of _MLANG_H_, this is the w32api standard.
* include/setupapi.h (_SETUPAPI_H): Define.
Define instead of _SETUPAPI_H_, this is the w32api standard.
Thanks to: James du Russel <ephelon at users dot sf dot net>
* include/rpcndr.h (_RPCNDR_H): Define.
Define in addition to __RPCNDR_H__, this is the w32api standard.
Drop remote fs handling entirely since unreliable inode numbers
are now recognized differently.
(path_conv::is_samba): Make inline.
(fhandler_disk_file::opendir): Reformat comment.
(fhandler_base::fstat_helper): Special case remote file systems
returning (unreliable) 32 bit inode numbers.
(fhandler_base::readdir): Ditto.
* fhandler_netdrive.cc (fhandler_netdrive::readdir): Ditto.
differently from those which are mounted with -X. Pass extra argument to
linebuf::fromargv.
* winf.h (MAXCYGWINCMDLEN): New define.
(linebuf::finish): Add a new argument denoting when command line overflow is
ok.
(linebuf::fromargv): Ditto.
* winf.cc (linebuf::finish): Implement above change.
(linebuf::fromargv): Ditto.
* include/comcat.h: INTERFACE should not remain defined
at the end of the header.
* include/docobj.h: Ditto.
* include/exdisp.h: Ditto.
* include/intshcut.h: Ditto.
* include/mlang.h: Ditto.
* include/mshtml.h: Ditto.
* include/oaidl.h: Ditto.
We should probably remove PROV_MS_MAIL but I'm keeping it for
now for compatibility reasons.
Thanks to: Marcus Agehall <agehall at users dot sf dot net>
(GetAdaptersAddresses): Add function declaration.
* lib/iphlpapi.def (GetAdaptersAddresses): Add function stub.
Thanks to: ross <rossboulet at users dot sf dot net>
LOGON32_PROVIDER_WINNT50, LOGON32_LOGON_NETWORK,
LOGON32_LOGON_UNLOCK, LOGON32_LOGON_NETWORK_CLEARTEXT,
LOGON32_LOGON_NEW_CREDENTIALS): Define.
Thanks to: Oliver Stoeneberg <kidkat at users dot sf dot net>
(alloc_stack_hard_way): Figure out where the stack lives here rather than
relying on previously filled out information which has been invalid since
1.5.19.
(path_conv::hasgood_inode): Recognize Samba with quota support
compiled in.
(path_conv::is_samba): Ditto. Fix comment to include Samba version
numbers for later reference.
be used by subsequent startup functions.
(dll_crt0_0): Issue a warning if DuplicateTokenEx fails and DEBUGGING.
(dll_crt0_1): Move user_data->{resourcelocks,threadinterface} initialization
here from dll_crt0_0.
* fork.cc (frok::child): Tell wait_for_sigthread that this is fork.
(frok::parent): Only initialize start_time once. Tighten time when we're
"deimpersonated".
* sigproc.cc (signal_fixup_after_exec): Rework (futiley) sa_buf stuff. Add
debugging output.
(wait_for_sigthread): Accept an argument which illustrates whether we are
forked or not.
(wait_sig): Avoid using myself pointer.
* winsup.h ((wait_for_sigthread): Reflect change to argument.
(fhandler_dev_floppy::get_drive_info): Rearrange so that now
NtQueryVolumeInformationFile is called on drives which don't support
IOCTL_DISK_GET_DRIVE_GEOMETRY.
* ntdll.h (struct _FILE_FS_SIZE_INFORMATION): Add.
(enum _FSINFOCLASS): Add missing values.
* signal.cc (_SA_NORESTART): New flag.
(sigaction_worker): New function, derived from sigaction. Don't set internal
flags unless called internally.
(sigaction): Use sigaction_worker.
(signal): Honor new _SA_NORESTART flag.
(siginterrupt): Set _SA_NORESTART flag appropriately. Use sigaction_worker to
set flags.
* include/cygwin/signal.h: Define _SA_INTERNAL_MASK here.
* dcrt0.cc (dll_crt0_0): Semi-revert 2006-03-14 change which moved pinfo_init
and uinfo_init here.
(dll_crt0_1): Ditto.
(__dll_crt0): Ditto. Don't call update_envptrs here.
(dll_crt0_1): Ditto. Move wait_for_sigthread call here from dll_crt0_0.
* environ.cc (environ_init): Call it here instead.
* sigproc.cc (my_readsig): New static variable.
(wait_for_sigthread): Set up read pipe here since we are assured that we have
the proper privileges when this is called.
(talktome): Eliminate second argument since it is available as a global now.
(wait_sig): Reflect use of my_readsig.
iscygwin.
(child_info::isstraced): Booleanize.
(child_info::iscygwin): Ditto.
* sigproc.cc (child_info::child_info): Minor cleanup of flag setting.
* spawn.cc (spawn_guts): Only close_all_files when we know the process has
started successfully.
* exceptions.cc (init_console_handler): Fix indentation.
* pinfo.cc (_pinfo::dup_proc_pipe): Reset wr_proc_pipe on failure. Return
previous pipe handle.
* pinfo.h (_pinfo::dup_proc_pipe): Reflect change to return value.
* spawn.cc (spawn_guts): Restore previous proc pipe on retry or if process
exits before synchronization.
(child_info::flag): Rename from 'straced'.
(child_info::isstraced): New function.
(child_info::iscygwin): Ditto.
(child_info_fork::handle_fork): Reparmize.
(child_info_fork::handle_failure): Ditto.
(child_info_spawn::handle_spawn): New function.
* dcrt0.cc (get_cygwin_startup_info): Use isstraced method.
(child_info_spawn::handle_spawn): Define new function from code previously in
dll_crt0_0.
(dll_crt0_0): Move spawn stuff into handle_spawn. Only call
init_console_handler for fork case.
* sigproc.cc (child_info::child_info): Set flag appropriately.
(child_info::proc_retry): Treat exit code as "funny" if it's a cygwin process.
* spawn.cc (spawn_guts): Remove commented out flag setting.
* sigproc.cc (child_info::sync): Return EXITCODE_OK if entering with exit_code
== 0.
(sig_send): Don't complain if sending signals while blocked if the sender isn't
in the main thread.
(child_info::retry): Move here from fork subclass.
(child_info::exit_code): New field.
(child_info::retry_count): Max retry count for process start.
(child_info::proc_retry): Declare new function.
(child_info_fork::retry): Move to parent.
(child_info_fork::fork_retry): Ditto.
* dcrt0.cc (child_info::fork_retry): Rename and move.
(child_info_fork::handle_failure): Move.
(dll_crt0_0): Initialize console handler based on whether we have a controlling
tty or not. Avoid nonsensical check for fork where it can never occur.
* environ.cc (set_proc_retry): Rename from set_fork_retry. Set retry_count in
child_info.
(parse_thing): Reflect above change.
* exceptions.cc (dummy_ctrl_c_handler): Remove unused variable name.
(ctrl_c_handler): Always return TRUE for the annoying CTRL_LOGOFF_EVENT.
* fhandler_termios.cc (fhandler_termios::tcsetpgrp): Remove call to
init_console_handler.
* fhandler_tty.cc (fhandler_tty_slave::open): Just call mange_console_count
here and let it decide what to do with initializing console control handling.
* fork.cc (fork_retry): Remove definition.
(frok::parent): Define static errbuf and use in error messages (not thread safe
yet). Close pi.hThread as soon as possible. Protect pi.hProcess as soon as
possible. Don't set retry_count. That happens automatically in the
constructor now. Accommodate name change from fork_retry to proc_retry.
* init.cc (dll_entry): Turn off ctrl-c handling early until we know how it is
supposed to be handled.
* pinfo.cc (_pinfo::dup_proc_pipe): Remember original proc pipe value for
failure error message. Tweak debug message slightly.
* sigproc.cc (child_info::retry_count): Define.
(child_info::child_info): Initialize retry count.
(child_info::sync): Set exit code if process dies before synchronization.
(child_info::proc_retry): Rename from child_info_fork::fork_retry. Use
previously derived exit code. Be more defensive about what is classified as an
error exit.
(child_info_fork::handle_failure): Move here from dcrt0.cc.
* spawn.cc (spawn_guts): Maintain error mode when starting new process to avoid
annoying pop ups. Move deimpersonate call within new loop. Move envblock
freeing to end. Loop if process dies prematurely with bad exit code.
* syscalls.cc (init_console_handler): Remove hopefully unneeded call to
init_console_handler.