summaryrefslogtreecommitdiffstats
path: root/winsup/cygwin/wincap.cc
Commit message (Collapse)AuthorAgeFilesLines
* Drop max_sys_priv wincapCorinna Vinschen2016-06-241-60/+65
| | | | | | | | | | | Convert sys_privs to const struct with TOKEN_PRIVILEGES layout. Drop function get_system_priv_list. Just use pointer to sys_privs. Dropping max_sys_priv from wincaps requires to make sure that the bitfield is 8 byte aligned on x86_64, otherwise gcc (5.3 only?) apparently breaks access to the bitfield (off by 4 bytes). Signed-off-by: Corinna Vinschen <corinna@vinschen.de>
* Drop accidentally leftover comment from wincapc::initCorinna Vinschen2016-06-241-3/+0
|
* Default to latest wincapCorinna Vinschen2016-06-241-3/+3
|
* Drop Windows XP/2003 wincapsCorinna Vinschen2016-06-241-43/+0
|
* Drop has_broken_rtl_query_process_debug_information flagCorinna Vinschen2016-06-241-11/+0
|
* Drop terminate_thread_frees_stack flagCorinna Vinschen2016-06-241-7/+0
|
* Drop has_pipe_reject_remote_clients flagCorinna Vinschen2016-06-241-7/+0
|
* Drop has_set_thread_stack_guarantee flagCorinna Vinschen2016-06-241-7/+0
|
* Drop has_program_compatibility_assistant flagCorinna Vinschen2016-06-241-7/+0
|
* Drop wow64_has_secondary_stack flagCorinna Vinschen2016-06-241-8/+0
|
* Drop use_dont_resolve_hack flagCorinna Vinschen2016-06-241-7/+0
| | | | Signed-off-by: Corinna Vinschen <corinna@vinschen.de>
* Drop has_restricted_raw_disk_access flagCorinna Vinschen2016-06-241-7/+0
|
* Drop has_transactions flagCorinna Vinschen2016-06-241-7/+0
|
* Drop has_fast_cwd flagCorinna Vinschen2016-06-241-7/+0
|
* Drop has_localenames flagCorinna Vinschen2016-06-231-7/+0
|
* Drop has_always_all_codepages flagCorinna Vinschen2016-06-231-7/+0
|
* Drop has_broken_udf flagCorinna Vinschen2016-06-231-7/+0
|
* Drop has_sendmsg flagCorinna Vinschen2016-06-231-7/+0
|
* Drop has_mandatory_integrity_control flagCorinna Vinschen2016-06-231-7/+0
|
* Drop has_restricted_stack_args flagCorinna Vinschen2016-06-231-8/+0
|
* Drop supports_all_posix_ai_flagsCorinna Vinschen2016-06-231-7/+0
|
* Drop has_gaa_on_link_prefix flag and remove obsolete functions thuslyCorinna Vinschen2016-06-231-7/+0
|
* Drop has_recycle_dot_binCorinna Vinschen2016-06-231-7/+0
|
* Switching the Cygwin DLL to LGPLv3+, dropping commercial buyout optioncygwin-2_5_2-releaseCorinna Vinschen2016-06-231-3/+0
| | | | | | | | | | | | | | Bump GPLv2+ to GPLv3+ for some files, clarify BSD 2-clause. Everything else stays under GPLv3+. New Linking Exception exempts resulting executables from LGPLv3 section 4. Add CONTRIBUTORS file to keep track of licensing. Remove 'Copyright Red Hat Inc' comments. Signed-off-by: Corinna Vinschen <corinna@vinschen.de>
* Overwite potentially faked kernel version with correct valuesCorinna Vinschen2016-03-091-0/+5
| | | | | | | | | | | | | | | | | | | | | | * ntdll.h (RtlGetNtVersionNumbers): Declare. * wincap.cc (wincapc::init): Overwrite kernel version info returned by RtlGetVersion with correct info returnd by RtlGetNtVersionNumbers. Add comment. Originally, using RtlGetVersion instead of GetVersionEx was supposed to fix the fact that GetVersionInfo returns the wrong kernel version if the executable has been built with an old manifest (or none at all), starting with Windows 8.1. Either this never really worked as desired and our testing was flawed, or this has been changed again with Windows 10, so that RtlGetVersion does the kernel faking twist as well. Since we're only reading the value in the first process in a process tree. the entire process tree is running with a wrong OS version information in that case. Fortunately, the (undocumented) RtlGetNtVersionNumbers function is not affected by this nonsense, so we simply override the OS version info fields with the correct values now. Signed-off-by: Corinna Vinschen <corinna@vinschen.de>
* setuid: Create token from scratch without credentials of callerCorinna Vinschen2016-02-181-0/+7
| | | | | | | | | | | | | | | | * sec_auth.cc (get_token_group_sidlist): Drop auth_luid and auth_pos parameter. Remove code adding a logon SID. (get_initgroups_sidlist): Drop auth_luid and auth_pos parameter. Drop in call to get_token_group_sidlist. Accommodate in callers. (get_setgroups_sidlist): Ditto. (create_token): Explicitely set auth_luid to ANONYMOUS_LOGON_LUID or LOCALSERVICE_LUID depending on OS. Explain why. Remove handling of logon SID since we don't generate one anymore. (lsaauth): Drop now unused local variable auth_luid and auth_pos. * wincap.h (wincaps::has_broken_whoami): New element. * wincap.cc: Implement above element throughout. Signed-off-by: Corinna Vinschen <corinna@vinschen.de>
* Don't use LoadLibraryEx(..., LOAD_LIBRARY_SEARCH_SYSTEM32). It hangsCorinna Vinschen2016-01-271-7/+0
| | | | | | | | | | | | | | | | Observed running hexchat under X. For some reason the call to LoadLibraryEx(..., LOAD_LIBRARY_SEARCH_SYSTEM32) in dll_load hangs when trying to autoload MsgWaitForMultipleObjectsEx in select.cc after hexchat forks to run DNS calls. Dropping the call and just using full paths as in 2.3.1 fixes the issue. * autoload.cc (dll_load): Drop call to LoadLibraryEx with LOAD_LIBRARY_SEARCH_SYSTEM32 flag. * wincap.h (wincaps::has_load_lib_search_flags): Remove. * wincap.cc (wincaps::has_load_lib_search_flags): Drop handling this flag. Signed-off-by: Corinna Vinschen <corinna@vinschen.de>
* Try loading with safe path using LOAD_LIBRARY_SEARCH_SYSTEM32 firstCorinna Vinschen2016-01-121-0/+7
| | | | | | | | | | | | * autoload.cc (dll_load): Move safe loading from std_dll_init here. Add code to handle systems supporting LOAD_LIBRARY_SEARCH flags. Add comments to explain what the code is doing. Fix up comment preceeding this function. (std_dll_init): Move safe loading code to dll_load. * wincap.h (wincaps::has_load_lib_search_flags): New element. * wincap.cc: Implement above element throughout. Signed-off-by: Corinna Vinschen <corinna@vinschen.de>
* Always allocate main thread stack from pthread stack area on x86_64.Corinna Vinschen2015-12-071-8/+0
| | | | | | | | | | | | | | | | | | | | | | | | | * dcrt0.cc: Semi-revert commit 12743c2d5d2721f3a80b4d7671a349be03c1f520. (dll_crt0_0): Drop setting wow64_needs_stack_adjustment on 64 bit. (_dll_crt0): Split out 64 bit code again and always create new main thread stack, unless forked off from the non main thread in the parent. Call create_new_main_thread_stack with parent stack commitsize if started from the parent's main thread. Only call child_info_fork::alloc_stack for the latter case on 64 bit. Slightly rearrange moving rsp and rbp to new stack and document how. Revert 32 bit wow64 handling to its former self. * miscfunc.cc (create_new_main_thread_stack): Take a commitsize parameter and use it if it's not 0. Don't set _main_tls here, it's done in the caller _dll_crt0 anyway. Return stackbase - 16 bytes, rather than stacklimit (which was very wrong anyway). * miscfuncs.h (create_new_main_thread_stack): Accommodate declaration to aforementioned change. * wincap.h (wincaps::has_3264_stack_broken): Remove element. * wincap.cc: Ditto, throughout. * wow64.cc: Semi-revert to pre-12743c2d5d2721f3a80b4d7671a349be03c1f520 but keep architecture-agnostic type changes intact. Fix formatting. * wow64.h: Revert to pre-12743c2d5d2721f3a80b4d7671a349be03c1f520. Signed-off-by: Corinna Vinschen <corinna@vinschen.de>
* On 64 bit, only create new thread stack if started from 32 bit process on ↵Corinna Vinschen2015-12-031-0/+11
| | | | | | | | | | | | | | | | | | | | | | affected platforms * dcrt0.cc (dll_crt0_0): On 64 bit, set wow64_needs_stack_adjustment if not started from a 64 bit process. (_dll_crt0): Enable wow64_needs_stack_adjustment branch on 64 bit as well. Remove 64 bit only code. Introduce CREATE_STACK and FIX_STACK macros to conditionalize the code. Rearrange and partially rewrite comments. * wincap.h (wincaps::has_3264_stack_broken): New element. * wincap.cc: Implement above element throughout. (wincapc::init): Set has_3264_stack_broken to false on 32 bit. * wow64.cc: Enable functionality on 64 bit architecture, except for wow64_revert_to_original_stack. Enhance comments to explain. (wow64_eval_expected_main_stack): Make 64 bit clean. (wow64_test_for_64bit_parent): Ditto. * wow64.h: Export wow64_revert_to_original_stack on 32 bit only, everything else on all architectures. Signed-off-by: Corinna Vinschen <corinna@vinschen.de>
* Fix /proc/<PID>/maps output for PEB and TEBs on W10 1511Corinna Vinschen2015-12-031-1/+44
| | | | | | | | | | | | | | | | * fhandler_process.cc (heap_info::fill_if_match): Return NULL, not 0. (thread_info::fill_if_match): Ditto. (thread_info::fill_if_match): New method to extract TEB info from PEB/TEB region since W10 1511. (format_process_maps): Drop outdated FIXME comment. Add code to handle PEB/TEB region since W10 1511. * mmap.cc (posix_madvise): Align comment to new W10 1511 version. * wincap.h (wincaps::has_new_pebteb_region): New element. * wincap.cc: Implement above element throughout. (wincap_10_1511): New global wincaps to support Windows 10 since 1511. (wincapc::init): Use wincap_10_1511 for W10 builds >= 10586. Signed-off-by: Corinna Vinschen <corinna@vinschen.de>
* Implement POSIX_MADV_WILLNEED/POSIX_MADV_DONTNEED for newer OSesCorinna Vinschen2015-08-271-0/+7
| | | | | | | | | | | | | | | | | | | * autoload.cc (DiscardVirtualMemory): Import. (PrefetchVirtualMemory): Import. * mmap.cc (posix_madvise): Actually implement POSIX_MADV_WILLNEED utilizing PrefetchVirtualMemory and POSIX_MADV_DONTNEED utilizing DiscardVirtualMemory on systems supporting them. * wincap.h (wincaps::has_broken_prefetchvm): New element. * wincap.cc: Implement above element throughout. (wincapc::init): Make sure has_broken_prefetchvm is only true on W10 under WOW64. * include/cygwin/version.h (CYGWIN_VERSION_DLL_MAJOR): Bump to 2003. (CYGWIN_VERSION_API_MINOR): Reset to 0. * new-features.xml (ov-new2.3): New section, document posix_madvise POSIX_MADV_WILLNEED/POSIX_MADV_DONTNEED change. Signed-off-by: Corinna Vinschen <corinna@vinschen.de>
* Fix /proc/cpuinfo topology and cache size infoCorinna Vinschen2015-08-131-0/+6
| | | | | | | | | | | | | | | | * autoload.cc (GetLogicalProcessorInformationEx): Import. (SetThreadGroupAffinity): Import. * fhandler_proc.cc (add_size): New macro. (get_msb): New inline function. (mask_bits): Ditto. (format_proc_cpuinfo): Drop handling of old CPUs. Check if we're running on a OS version supporting porcessor groups. If so, use SetThreadGroupAffinity to set thread affinity. Improve cache info to include 3rd level cache on Intel CPUs. Improve multi core info. * wincap.h (wincaps::has_processor_groups): New element. * wincap.cc: Implement above element throughout. Signed-off-by: Corinna Vinschen <corinna@vinschen.de>
* cygwin: Fix copyright datesCorinna Vinschen2015-07-291-1/+1
| | | | Signed-off-by: Corinna Vinschen <corinna@vinschen.de>
* Disable fetching heap info on 64 bit XP/2003Corinna Vinschen2015-07-051-0/+10
| | | | | | | | | | * fhandler_process.cc (heap_info::heap_info): Disable fetching heap info on 64 bit XP/2003. Explain why. * wincap.h (wincaps::has_broken_rtl_query_process_debug_information): New element. * wincap.cc: Implement above element throughout. Signed-off-by: Corinna Vinschen <corinna@vinschen.de>
* Fix original stack when running signal handler on alternate stackCorinna Vinschen2015-07-041-0/+14
| | | | | | | | | | | | | | | | | | | | | | | | | | | * autoload.cc (SetThreadStackGuarantee): Import. * cygtls.h (struct _cygtls): Replace thread_context with a ucontext_t called context. * exceptions.cc (exception::handle): Exit from process via signal_exit in case sig_send returns from handling a stack overflow SIGSEGV. Explain why. (dumpstack_overflow_wrapper): Thread wrapper to create a stackdump from another thread. (signal_exit): Fix argument list to reflect three-arg signal handler. In case we have to create a stackdump for a stack overflow condition, do so from a separate thread. Explain why. (sigpacket::process): Don't run signal_exit on alternate stack. (altstack_wrapper): Wrapper function to do stack correction when calling the signal handler on an alternate stack to handle a stack overflow. Make sure to have lots of comments. (_cygtls::call_signal_handler): Drop local context variable to reduce stack pressure. Use this->context instead. Change inline assembler to call altstack_wrapper. (_cygtls::signal_debugger): Accommodate aforementioned change to struct _cygtls. * tlsoffset.h: Regenerate. * tlsoffset64.h: Regenerate. Signed-off-by: Corinna Vinschen <corinna@vinschen.de>
* * wincap.cc (wincap_minimal): Remove.Corinna Vinschen2014-12-011-10/+35
| | | | | | | (wincaps): Drop has_physical_mem_access. (wincap_10): New global wincaps to support Windows 10. (wincapc::init): Use wincap_10 for version >= 6.4 and as default. * wincap.h (wincaps::has_physical_mem_access): remove.
* * uinfo.cc (cygheap_user::init): Fix formatting in debug output.Corinna Vinschen2014-05-081-1/+6
| | | | | | | | (struct cyg_USER_INFO_24): Define temporarily. Explain why. (pwdgrp::fetch_account_from_windows): Handle sane primary group setting for Microsoft Accounts. Explain why. * wincap.h (wincaps::has_microsoft_accounts): New element. * wincap.cc: Implement above element throughout.
* * ntdll.h (RtlGetVersion): Declare.Corinna Vinschen2013-11-191-2/+2
| | | | | | | * wincap.cc (wincapc::init): Rather than GetVersionEx, call RtlGetVersion which is not crippled by missing Windows 8.1 manifest. * wincap.h (wincapc): Change type of version to RTL_OSVERSIONINFOEXW. Align formatting of all class members.
* * wincap.cc (wincapc::init): Revert previous change. It's not working.Corinna Vinschen2013-11-191-9/+0
|
* * wincap.cc (wincapc::init): Fix dwMinorVersion for Windows 8.1 andCorinna Vinschen2013-11-191-0/+9
| | | | Server 2012. Explain why this is necessary.
* * autoload.cc (GetSystemTimePreciseAsFileTime): Define.Corinna Vinschen2013-06-141-0/+5
| | | | | | | | | | * times.cc (GetSystemTimePreciseAsFileTime): Temporarily declare here to workaround missing definition in 32 bit w32api headers. (get_system_time): New always inline function to call either GetSystemTimePreciseAsFileTime or GetSystemTimeAsFileTime on a per OS basis. Call throughout instead of GetSystemTimeAsFileTime. * wincap.h (wincaps::has_precise_system_time): New element. * wincap.cc: Implement above element throughout.
* * Merge in cygwin-64bit-branch.Corinna Vinschen2013-04-231-212/+11
|
* * cygthread.cc (cygthread::terminate_thread): Only try to freeCorinna Vinschen2013-03-291-1/+10
| | | | | | thread stack on systems not freeing it by themselves. * wincap.h (wincaps::terminate_thread_frees_stack): New element. * wincap.cc: Implement above element throughout.
* Throughout, update copyrights to reflect dates which correspond to main-branchChristopher Faylor2013-01-211-2/+2
| | | | checkins. Regularize copyright format.
* * wincap.cc (wincapc::init): Drop memset call since it can result inCorinna Vinschen2012-07-241-53/+33
| | | | | a race condition. Drop all considerations for pre-Windows 2000 systems since Cygwin won't start on them anyway.
* * net.cc (get_adapters_addresses): Only create thread on affectedCorinna Vinschen2012-05-031-1/+48
| | | | | | | | | systems. Change comment acordingly. * wincap.h (wincaps::has_gaa_largeaddress_bug): New element. * wincap.cc: Implement above element throughout. (wincap_8): New globale wincaps to support Windows 8. (wincapc::init): Take Windows 8 into account. Set new has_gaa_largeaddress_bug member to false on 32 bit systems.
* wincap.h: Rename assitant to assistant throughout. wincap.cc: Ditto.Christopher Faylor2012-04-151-8/+8
| | | | | | | | | | | | | * devices.in (exists_console): Use fhandler_console::exists () rather than raw test. * devices.cc: Regenerate. * fhandler.h (fhandler_console::exists): Define new function. * fhandler_console.cc (fhandler_console::need_invisible): Use fhandler_console::exists () rather than raw test. * spawn.cc: Rename assitant to assistant throughout. (child_info_spawn::worker): Simplify test for when to start a non-Cygwin process in its own process group. Just do it whenever we start a non-Cygwin process.
* * shared.cc (shared_info::init_obcaseinsensitive): Check actual stateCorinna Vinschen2012-02-211-0/+8
| | | | | | of case sensitivity on post-Windows 2000 systems. * wincap.h (wincaps::kernel_is_always_casesensitive): New element. * wincap.cc: Implement above element throughout.
* * ntdll.h (struct _PEB): Add EnvironmentUpdateCount member.Corinna Vinschen2012-02-171-1/+9
| | | | | | | * spawn.cc (child_info_spawn::worker): Speed up job recognition. Expand comment to explain every little detail and so we never forget. * wincap.h (wincaps::has_program_compatibility_assitant): New element. * wincap.cc: Implement above element throughout.