summaryrefslogtreecommitdiffstats
path: root/winsup/cygwin/wincap.h
Commit message (Collapse)AuthorAgeFilesLines
* cygwin: wincap: handle W10 1703Corinna Vinschen2017-04-241-0/+2
| | | | | | | Add has_unprivileged_createsymlink flag and set to true on 1703 and later. Signed-off-by: Corinna Vinschen <corinna@vinschen.de>
* Drop max_sys_priv wincapCorinna Vinschen2016-06-241-14/+16
| | | | | | | | | | | 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 has_broken_rtl_query_process_debug_information flagCorinna Vinschen2016-06-241-2/+0
|
* Drop terminate_thread_frees_stack flagCorinna Vinschen2016-06-241-2/+0
|
* Drop has_pipe_reject_remote_clients flagCorinna Vinschen2016-06-241-2/+0
|
* Drop has_set_thread_stack_guarantee flagCorinna Vinschen2016-06-241-2/+0
|
* Drop has_program_compatibility_assistant flagCorinna Vinschen2016-06-241-2/+0
|
* Drop wow64_has_secondary_stack flagCorinna Vinschen2016-06-241-2/+0
|
* Drop use_dont_resolve_hack flagCorinna Vinschen2016-06-241-2/+0
| | | | Signed-off-by: Corinna Vinschen <corinna@vinschen.de>
* Drop has_restricted_raw_disk_access flagCorinna Vinschen2016-06-241-2/+0
|
* Drop has_transactions flagCorinna Vinschen2016-06-241-2/+0
|
* Drop has_fast_cwd flagCorinna Vinschen2016-06-241-2/+0
|
* Drop has_localenames flagCorinna Vinschen2016-06-231-2/+0
|
* Drop has_always_all_codepages flagCorinna Vinschen2016-06-231-2/+0
|
* Drop has_broken_udf flagCorinna Vinschen2016-06-231-2/+0
|
* Drop has_sendmsg flagCorinna Vinschen2016-06-231-2/+0
|
* Drop has_mandatory_integrity_control flagCorinna Vinschen2016-06-231-2/+0
|
* Drop has_restricted_stack_args flagCorinna Vinschen2016-06-231-2/+0
|
* Drop supports_all_posix_ai_flagsCorinna Vinschen2016-06-231-2/+0
|
* Drop has_gaa_on_link_prefix flag and remove obsolete functions thuslyCorinna Vinschen2016-06-231-2/+0
|
* Drop has_recycle_dot_binCorinna Vinschen2016-06-231-2/+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>
* setuid: Create token from scratch without credentials of callerCorinna Vinschen2016-02-181-0/+2
| | | | | | | | | | | | | | | | * 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-2/+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/+2
| | | | | | | | | | | | * 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-2/+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/+2
| | | | | | | | | | | | | | | | | | | | | | 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-0/+2
| | | | | | | | | | | | | | | | * 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/+2
| | | | | | | | | | | | | | | | | | | * 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/+2
| | | | | | | | | | | | | | | | * 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/+2
| | | | | | | | | | * 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/+7
| | | | | | | | | | | | | | | | | | | | | | | | | | | * 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-2/+0
| | | | | | | (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/+3
| | | | | | | | (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-5/+5
| | | | | | | * 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.
* * autoload.cc (GetSystemTimePreciseAsFileTime): Define.Corinna Vinschen2013-06-141-0/+2
| | | | | | | | | | * 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-25/+10
|
* * cygthread.cc (cygthread::terminate_thread): Only try to freeCorinna Vinschen2013-03-291-1/+3
| | | | | | 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.
* * net.cc (get_adapters_addresses): Only create thread on affectedCorinna Vinschen2012-05-031-0/+2
| | | | | | | | | 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-2/+2
| | | | | | | | | | | | | * 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/+2
| | | | | | 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/+3
| | | | | | | * 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.
* * dcrt0.cc (dll_crt0_0): Check for wincap.wow64_has_secondary_stackCorinna Vinschen2011-12-191-0/+2
| | | | | | | | | | | | | | | rather than for wincap.is_wow64. Accommodate name change from wow64_has_64bit_parent to wow64_needs_stack_adjustment. Align comment. (_dll_crt0): Ditto. * wincap.h (wincaps::wow64_has_secondary_stack): New element. * wincap.cc: Implement above element throughout. (wincapc::init): Set wow64_has_secondary_stack to false on non-64 bit systems. * wow64.cc (wow64_needs_stack_adjustment): Rename (hopefully the last time) from wow64_has_64bit_parent. (wow64_eval_expected_main_stack): Fix comment to reflect real life. (wow64_test_for_64bit_parent): Fix comment. * wow64.h (wow64_needs_stack_adjustment): Accommodate new name.
* * sec_auth.cc (get_token_group_sidlist): Add CONSOLE LOGON SID onCorinna Vinschen2011-10-151-0/+2
| | | | | | | | | | | | | | | | | | | | | | | | | systems supporting it. Never add SERVICE SID but keep code in for future reference. Explain why. (get_priv_list): Add cygpsid pointer parameter. Point it to the mandatory integrity SID which matches account and privileges. (create_token): Fetch mandatory integrity SID from call to get_priv_list. (lsaauth): Call get_priv_list with additional NULL pointer. Change comment accordingly. * sec_helper.cc (well_known_console_logon_sid): New static SID. (cygpriv): Change to structure containing extra flag to store info about required integrity level. (privilege_luid): Accommodate changes to cygpriv. Return integrity level in new high_integrity parameter. (privilege_name): Accommodate changes to cygpriv. (set_privilege): Drop trailing \n from debug output. (set_cygwin_privileges): Don't set SE_CREATE_GLOBAL_PRIVILEGE anymore since it's just not needed, but keep code in for future reference. Change comment accordingly. * security.h (well_known_console_logon_sid): Declare. (privilege_luid): Align declaration to above change. * wincap.h (wincaps::has_console_logon_sid): New element. * wincap.cc: Implement above element throughout.
* * cygthread.cc (cygthread::async_create): Define new function.Christopher Faylor2011-07-301-2/+0
| | | | | | | | | | | * cygthread.h (cygthread::create): Use correct regparm. (cygthread::standalone): Delete from class and from all constructors. (cygthread::cygthread): Use three only arguments for detached threads, and start the thread via QueueUserAPC/async_create. * dcrt0.cc (dll_crt0_0): Remove handling for wincap.has_buggy_thread_startup. (dll_crt0_1): Ditto. * wincap.cc: Ditto throughout. * wincap.h: Ditto.
* * child_info.h (CURR_CHILD_INFO_MAGIC): Update.Corinna Vinschen2011-05-201-0/+2
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | (class child_info_fork): Remove stacksize, add stackaddr and guardsize members. * dcrt0.cc (child_info_fork::alloc_stack_hard_way): Partial rewrite to regenerate the stack exactly as in the parent. (child_info_fork::alloc_stack): Set stackaddr to 0, rather than stacksize. (dll_crt0_1): Check for stackaddr before changing the stack addresses in the TEB. * fork.cc (frok::child): Check for stackaddr here. (frok::parent): Set ch.stackaddr and ch.guardsize if not called from the main thread. * init.cc (dll_entry): Replace pointer to NT_TIB with pointer to TEB. Fix incorrectly changed address test before removing _my_tls. Set StackLimit to NULL on Windows 2000. Explain why. * miscfuncs.cc (struct thread_wrapper_arg): Store stackbase rather than stacksize, store commitaddr, remove guardsize. Store all pointers as char * for easier address arithmetic. (thread_wrapper): Rewrite to remove OS stack before calling thread function. Add lots of comments to explain what we do. (CygwinCreateThread): Reserve our own stack in case we got no application stack. Add comments. * ntdll.h (struct _TEB): Extend defintion up to DeallocationStack member. * thread.cc (pthread_attr::pthread_attr): Use "(size_t) -1" rather then 0xffffffff. * wincap.h (wincaps::has_stack_size_param_is_a_reservation): New element. * wincap.cc: Implement above element throughout.
* * heap.cc (heap_init): Rewrite initial heap allocation to use addressesCorinna Vinschen2011-05-161-2/+0
| | | | | | | | | | beyond 0x20000000. Explain why and how. * shared.cc (shared_info::heap_slop_size): Remove. * shared_info.h (class shared_info): Remove heap_slop_inited and heap_slop members. Remove heap_slop_size declaration. (CURR_SHARED_MAGIC): Update. * wincap.cc: Throughout, drop heapslop. * wincap.h (struct wincaps): Drop heapslop.
* * fhandler_proc.cc (format_proc_uptime): Don't call GetSystemInfo.Corinna Vinschen2011-05-101-0/+5
| | | | | | | | | | | | | | | Fetch CPU count from wincap. (format_proc_stat): Ditto. * globals.cc (system_info): Move to wincap. * heap.cc (heap_init): Fetch page size from wincap. * syscalls.cc (getpagesize): Fetch allocation granularity from wincap. (getsystempagesize): Fetch page size from wincap. * wincap.cc (wincap_2003): Default is_server to false. (wincapc::init): Call GetSystemInfo here. Always set is_server value. * wincap.h (class wincapc): Add system_info as private member. (wincapc::cpu_count): New public method. (wincapc::page_size): Ditto. (wincapc::allocation_granularity): Ditto.