* Makefile.in: Build wincap.o.
* wincap.cc: New file.
* wincap.h: Ditto.
* autoload.cc: Add dynamic load statement for `CreateHardLinkA'.
* dcrt0.cc (os_being_run): Eliminated.
(osname): Ditto.
(iswinnt): Ditto.
(set_os_type): Ditto.
(dll_crt0_1): Call wincap.init() instead of set_os_type().
(_dll_crt0): Ditto.
* environ.cc (set_chunksize): New function.
(parse_thing): `forkchunk' setting now invokes function `set_chunksize'.
* fork.cc (chunksize): Eliminated. Moved to be member of wincap.
* host_dependent.h: Removed.
* syscalls.cc (_link): Try using `CreateHardLinkA' first, if available.
* cygheap.cc, dcrt0.cc, delqueue.cc, dir.cc,
environ.cc, fhandler.cc, fhandler.h, fhandler_console.cc,
fhandler_mem.cc, fork.cc, mmap.cc, net.cc, pinfo.cc, pinfo.h,
security.cc, syscalls.cc, sysconf.cc, syslog.cc, thread.cc,
times.cc, tty.cc, uinfo.cc, uname.cc, winsup.h: Use new wincap
capability check throughout.
* winsup.h: Include wincap.h. Eliminate extern declarations of
`os_being_run' and `iswinnt'. Eliminate `os_type" definition.
* include/cygwin/version.h: Bump version to 1.3.4.
2001-09-13 01:46:37 +08:00
|
|
|
/* wincap.h: Header for OS capability class.
|
|
|
|
|
2013-01-21 12:38:31 +08:00
|
|
|
Copyright 2001, 2002, 2003, 2004, 2005, 2006, 2007, 2008, 2009, 2010, 2011,
|
2015-07-29 19:45:46 +08:00
|
|
|
2012, 2013, 2014, 2015 Red Hat, Inc.
|
* Makefile.in: Build wincap.o.
* wincap.cc: New file.
* wincap.h: Ditto.
* autoload.cc: Add dynamic load statement for `CreateHardLinkA'.
* dcrt0.cc (os_being_run): Eliminated.
(osname): Ditto.
(iswinnt): Ditto.
(set_os_type): Ditto.
(dll_crt0_1): Call wincap.init() instead of set_os_type().
(_dll_crt0): Ditto.
* environ.cc (set_chunksize): New function.
(parse_thing): `forkchunk' setting now invokes function `set_chunksize'.
* fork.cc (chunksize): Eliminated. Moved to be member of wincap.
* host_dependent.h: Removed.
* syscalls.cc (_link): Try using `CreateHardLinkA' first, if available.
* cygheap.cc, dcrt0.cc, delqueue.cc, dir.cc,
environ.cc, fhandler.cc, fhandler.h, fhandler_console.cc,
fhandler_mem.cc, fork.cc, mmap.cc, net.cc, pinfo.cc, pinfo.h,
security.cc, syscalls.cc, sysconf.cc, syslog.cc, thread.cc,
times.cc, tty.cc, uinfo.cc, uname.cc, winsup.h: Use new wincap
capability check throughout.
* winsup.h: Include wincap.h. Eliminate extern declarations of
`os_being_run' and `iswinnt'. Eliminate `os_type" definition.
* include/cygwin/version.h: Bump version to 1.3.4.
2001-09-13 01:46:37 +08:00
|
|
|
|
|
|
|
This file is part of Cygwin.
|
|
|
|
|
|
|
|
This software is a copyrighted work licensed under the terms of the
|
|
|
|
Cygwin license. Please consult the file "CYGWIN_LICENSE" for
|
|
|
|
details. */
|
|
|
|
|
|
|
|
#ifndef _WINCAP_H
|
|
|
|
#define _WINCAP_H
|
|
|
|
|
|
|
|
struct wincaps
|
2001-11-05 14:09:15 +08:00
|
|
|
{
|
2015-07-05 04:49:30 +08:00
|
|
|
DWORD def_guard_pages;
|
2007-07-19 16:33:22 +08:00
|
|
|
DWORD max_sys_priv;
|
2003-09-27 11:44:31 +08:00
|
|
|
unsigned is_server : 1;
|
2006-11-08 19:38:05 +08:00
|
|
|
unsigned has_mandatory_integrity_control : 1;
|
2006-12-05 18:59:21 +08:00
|
|
|
unsigned needs_count_in_si_lpres2 : 1;
|
2006-12-11 00:43:30 +08:00
|
|
|
unsigned has_recycle_dot_bin : 1;
|
2007-01-18 03:26:58 +08:00
|
|
|
unsigned has_gaa_on_link_prefix : 1;
|
2012-05-03 16:34:44 +08:00
|
|
|
unsigned has_gaa_largeaddress_bug : 1;
|
2007-02-01 23:54:40 +08:00
|
|
|
unsigned supports_all_posix_ai_flags : 1;
|
2008-02-13 17:42:22 +08:00
|
|
|
unsigned has_restricted_stack_args : 1;
|
2008-05-16 00:34:01 +08:00
|
|
|
unsigned has_transactions : 1;
|
2009-01-20 19:16:59 +08:00
|
|
|
unsigned has_sendmsg : 1;
|
2009-01-30 04:32:08 +08:00
|
|
|
unsigned has_broken_udf : 1;
|
2009-06-26 23:12:06 +08:00
|
|
|
unsigned has_broken_alloc_console : 1;
|
2009-07-20 23:44:55 +08:00
|
|
|
unsigned has_always_all_codepages : 1;
|
2010-01-23 06:31:31 +08:00
|
|
|
unsigned has_localenames : 1;
|
2010-10-09 18:54:13 +08:00
|
|
|
unsigned has_fast_cwd : 1;
|
2011-01-11 22:50:45 +08:00
|
|
|
unsigned has_restricted_raw_disk_access : 1;
|
2011-03-01 08:19:23 +08:00
|
|
|
unsigned use_dont_resolve_hack : 1;
|
2011-10-16 00:31:57 +08:00
|
|
|
unsigned has_console_logon_sid : 1;
|
2011-12-19 20:50:35 +08:00
|
|
|
unsigned wow64_has_secondary_stack : 1;
|
2012-04-16 01:51:22 +08:00
|
|
|
unsigned has_program_compatibility_assistant : 1;
|
2013-04-23 17:44:36 +08:00
|
|
|
unsigned has_pipe_reject_remote_clients : 1;
|
2013-03-30 01:00:36 +08:00
|
|
|
unsigned terminate_thread_frees_stack : 1;
|
2013-06-14 23:41:17 +08:00
|
|
|
unsigned has_precise_system_time : 1;
|
2014-05-09 03:33:07 +08:00
|
|
|
unsigned has_microsoft_accounts : 1;
|
2015-07-05 04:49:30 +08:00
|
|
|
unsigned has_set_thread_stack_guarantee : 1;
|
2015-07-05 18:51:52 +08:00
|
|
|
unsigned has_broken_rtl_query_process_debug_information : 1;
|
2015-08-13 23:59:47 +08:00
|
|
|
unsigned has_processor_groups : 1;
|
* Makefile.in: Build wincap.o.
* wincap.cc: New file.
* wincap.h: Ditto.
* autoload.cc: Add dynamic load statement for `CreateHardLinkA'.
* dcrt0.cc (os_being_run): Eliminated.
(osname): Ditto.
(iswinnt): Ditto.
(set_os_type): Ditto.
(dll_crt0_1): Call wincap.init() instead of set_os_type().
(_dll_crt0): Ditto.
* environ.cc (set_chunksize): New function.
(parse_thing): `forkchunk' setting now invokes function `set_chunksize'.
* fork.cc (chunksize): Eliminated. Moved to be member of wincap.
* host_dependent.h: Removed.
* syscalls.cc (_link): Try using `CreateHardLinkA' first, if available.
* cygheap.cc, dcrt0.cc, delqueue.cc, dir.cc,
environ.cc, fhandler.cc, fhandler.h, fhandler_console.cc,
fhandler_mem.cc, fork.cc, mmap.cc, net.cc, pinfo.cc, pinfo.h,
security.cc, syscalls.cc, sysconf.cc, syslog.cc, thread.cc,
times.cc, tty.cc, uinfo.cc, uname.cc, winsup.h: Use new wincap
capability check throughout.
* winsup.h: Include wincap.h. Eliminate extern declarations of
`os_being_run' and `iswinnt'. Eliminate `os_type" definition.
* include/cygwin/version.h: Bump version to 1.3.4.
2001-09-13 01:46:37 +08:00
|
|
|
};
|
|
|
|
|
|
|
|
class wincapc
|
|
|
|
{
|
2013-11-20 06:21:11 +08:00
|
|
|
SYSTEM_INFO system_info;
|
|
|
|
RTL_OSVERSIONINFOEXW version;
|
|
|
|
char osnam[40];
|
|
|
|
ULONG_PTR wow64;
|
|
|
|
void *caps;
|
* Makefile.in: Build wincap.o.
* wincap.cc: New file.
* wincap.h: Ditto.
* autoload.cc: Add dynamic load statement for `CreateHardLinkA'.
* dcrt0.cc (os_being_run): Eliminated.
(osname): Ditto.
(iswinnt): Ditto.
(set_os_type): Ditto.
(dll_crt0_1): Call wincap.init() instead of set_os_type().
(_dll_crt0): Ditto.
* environ.cc (set_chunksize): New function.
(parse_thing): `forkchunk' setting now invokes function `set_chunksize'.
* fork.cc (chunksize): Eliminated. Moved to be member of wincap.
* host_dependent.h: Removed.
* syscalls.cc (_link): Try using `CreateHardLinkA' first, if available.
* cygheap.cc, dcrt0.cc, delqueue.cc, dir.cc,
environ.cc, fhandler.cc, fhandler.h, fhandler_console.cc,
fhandler_mem.cc, fork.cc, mmap.cc, net.cc, pinfo.cc, pinfo.h,
security.cc, syscalls.cc, sysconf.cc, syslog.cc, thread.cc,
times.cc, tty.cc, uinfo.cc, uname.cc, winsup.h: Use new wincap
capability check throughout.
* winsup.h: Include wincap.h. Eliminate extern declarations of
`os_being_run' and `iswinnt'. Eliminate `os_type" definition.
* include/cygwin/version.h: Bump version to 1.3.4.
2001-09-13 01:46:37 +08:00
|
|
|
|
|
|
|
public:
|
|
|
|
void init ();
|
|
|
|
|
2011-05-10 23:39:02 +08:00
|
|
|
const DWORD cpu_count () const { return system_info.dwNumberOfProcessors; }
|
2013-04-23 17:44:36 +08:00
|
|
|
/* The casts to size_t make sure that the returned value has the size of
|
|
|
|
a pointer on any system. This is important when using them for bit
|
|
|
|
mask operations, like in roundup2. */
|
|
|
|
const size_t page_size () const { return (size_t) system_info.dwPageSize; }
|
|
|
|
const size_t allocation_granularity () const
|
|
|
|
{ return (size_t) system_info.dwAllocationGranularity; }
|
* Makefile.in: Build wincap.o.
* wincap.cc: New file.
* wincap.h: Ditto.
* autoload.cc: Add dynamic load statement for `CreateHardLinkA'.
* dcrt0.cc (os_being_run): Eliminated.
(osname): Ditto.
(iswinnt): Ditto.
(set_os_type): Ditto.
(dll_crt0_1): Call wincap.init() instead of set_os_type().
(_dll_crt0): Ditto.
* environ.cc (set_chunksize): New function.
(parse_thing): `forkchunk' setting now invokes function `set_chunksize'.
* fork.cc (chunksize): Eliminated. Moved to be member of wincap.
* host_dependent.h: Removed.
* syscalls.cc (_link): Try using `CreateHardLinkA' first, if available.
* cygheap.cc, dcrt0.cc, delqueue.cc, dir.cc,
environ.cc, fhandler.cc, fhandler.h, fhandler_console.cc,
fhandler_mem.cc, fork.cc, mmap.cc, net.cc, pinfo.cc, pinfo.h,
security.cc, syscalls.cc, sysconf.cc, syslog.cc, thread.cc,
times.cc, tty.cc, uinfo.cc, uname.cc, winsup.h: Use new wincap
capability check throughout.
* winsup.h: Include wincap.h. Eliminate extern declarations of
`os_being_run' and `iswinnt'. Eliminate `os_type" definition.
* include/cygwin/version.h: Bump version to 1.3.4.
2001-09-13 01:46:37 +08:00
|
|
|
const char *osname () const { return osnam; }
|
2013-04-23 17:44:36 +08:00
|
|
|
const bool is_wow64 () const { return !!wow64; }
|
* Makefile.in: Build wincap.o.
* wincap.cc: New file.
* wincap.h: Ditto.
* autoload.cc: Add dynamic load statement for `CreateHardLinkA'.
* dcrt0.cc (os_being_run): Eliminated.
(osname): Ditto.
(iswinnt): Ditto.
(set_os_type): Ditto.
(dll_crt0_1): Call wincap.init() instead of set_os_type().
(_dll_crt0): Ditto.
* environ.cc (set_chunksize): New function.
(parse_thing): `forkchunk' setting now invokes function `set_chunksize'.
* fork.cc (chunksize): Eliminated. Moved to be member of wincap.
* host_dependent.h: Removed.
* syscalls.cc (_link): Try using `CreateHardLinkA' first, if available.
* cygheap.cc, dcrt0.cc, delqueue.cc, dir.cc,
environ.cc, fhandler.cc, fhandler.h, fhandler_console.cc,
fhandler_mem.cc, fork.cc, mmap.cc, net.cc, pinfo.cc, pinfo.h,
security.cc, syscalls.cc, sysconf.cc, syslog.cc, thread.cc,
times.cc, tty.cc, uinfo.cc, uname.cc, winsup.h: Use new wincap
capability check throughout.
* winsup.h: Include wincap.h. Eliminate extern declarations of
`os_being_run' and `iswinnt'. Eliminate `os_type" definition.
* include/cygwin/version.h: Bump version to 1.3.4.
2001-09-13 01:46:37 +08:00
|
|
|
|
2003-09-27 11:44:31 +08:00
|
|
|
#define IMPLEMENT(cap) cap() const { return ((wincaps *) this->caps)->cap; }
|
* Makefile.in: Build wincap.o.
* wincap.cc: New file.
* wincap.h: Ditto.
* autoload.cc: Add dynamic load statement for `CreateHardLinkA'.
* dcrt0.cc (os_being_run): Eliminated.
(osname): Ditto.
(iswinnt): Ditto.
(set_os_type): Ditto.
(dll_crt0_1): Call wincap.init() instead of set_os_type().
(_dll_crt0): Ditto.
* environ.cc (set_chunksize): New function.
(parse_thing): `forkchunk' setting now invokes function `set_chunksize'.
* fork.cc (chunksize): Eliminated. Moved to be member of wincap.
* host_dependent.h: Removed.
* syscalls.cc (_link): Try using `CreateHardLinkA' first, if available.
* cygheap.cc, dcrt0.cc, delqueue.cc, dir.cc,
environ.cc, fhandler.cc, fhandler.h, fhandler_console.cc,
fhandler_mem.cc, fork.cc, mmap.cc, net.cc, pinfo.cc, pinfo.h,
security.cc, syscalls.cc, sysconf.cc, syslog.cc, thread.cc,
times.cc, tty.cc, uinfo.cc, uname.cc, winsup.h: Use new wincap
capability check throughout.
* winsup.h: Include wincap.h. Eliminate extern declarations of
`os_being_run' and `iswinnt'. Eliminate `os_type" definition.
* include/cygwin/version.h: Bump version to 1.3.4.
2001-09-13 01:46:37 +08:00
|
|
|
|
2015-07-05 04:49:30 +08:00
|
|
|
DWORD def_guard_page_size () const
|
|
|
|
{
|
|
|
|
return ((wincaps *) this->caps)->def_guard_pages * page_size ();
|
|
|
|
}
|
2007-07-19 16:33:22 +08:00
|
|
|
DWORD IMPLEMENT (max_sys_priv)
|
2003-09-27 11:44:31 +08:00
|
|
|
bool IMPLEMENT (is_server)
|
2006-11-08 19:38:05 +08:00
|
|
|
bool IMPLEMENT (has_mandatory_integrity_control)
|
2006-12-05 18:59:21 +08:00
|
|
|
bool IMPLEMENT (needs_count_in_si_lpres2)
|
2006-12-11 00:43:30 +08:00
|
|
|
bool IMPLEMENT (has_recycle_dot_bin)
|
2007-01-18 03:26:58 +08:00
|
|
|
bool IMPLEMENT (has_gaa_on_link_prefix)
|
2012-05-03 16:34:44 +08:00
|
|
|
bool IMPLEMENT (has_gaa_largeaddress_bug)
|
2007-02-01 23:54:40 +08:00
|
|
|
bool IMPLEMENT (supports_all_posix_ai_flags)
|
2008-02-13 17:42:22 +08:00
|
|
|
bool IMPLEMENT (has_restricted_stack_args)
|
2008-05-16 00:34:01 +08:00
|
|
|
bool IMPLEMENT (has_transactions)
|
2009-01-20 19:16:59 +08:00
|
|
|
bool IMPLEMENT (has_sendmsg)
|
2009-01-30 04:32:08 +08:00
|
|
|
bool IMPLEMENT (has_broken_udf)
|
2009-06-26 23:12:06 +08:00
|
|
|
bool IMPLEMENT (has_broken_alloc_console)
|
2009-07-20 23:44:55 +08:00
|
|
|
bool IMPLEMENT (has_always_all_codepages)
|
2010-01-23 06:31:31 +08:00
|
|
|
bool IMPLEMENT (has_localenames)
|
2010-10-09 18:54:13 +08:00
|
|
|
bool IMPLEMENT (has_fast_cwd)
|
2011-01-11 22:50:45 +08:00
|
|
|
bool IMPLEMENT (has_restricted_raw_disk_access)
|
2011-03-01 08:19:23 +08:00
|
|
|
bool IMPLEMENT (use_dont_resolve_hack)
|
2011-10-16 00:31:57 +08:00
|
|
|
bool IMPLEMENT (has_console_logon_sid)
|
2011-12-19 20:50:35 +08:00
|
|
|
bool IMPLEMENT (wow64_has_secondary_stack)
|
2012-04-16 01:51:22 +08:00
|
|
|
bool IMPLEMENT (has_program_compatibility_assistant)
|
2013-04-23 17:44:36 +08:00
|
|
|
bool IMPLEMENT (has_pipe_reject_remote_clients)
|
2013-03-30 01:00:36 +08:00
|
|
|
bool IMPLEMENT (terminate_thread_frees_stack)
|
2013-06-14 23:41:17 +08:00
|
|
|
bool IMPLEMENT (has_precise_system_time)
|
2014-05-09 03:33:07 +08:00
|
|
|
bool IMPLEMENT (has_microsoft_accounts)
|
2015-07-05 04:49:30 +08:00
|
|
|
bool IMPLEMENT (has_set_thread_stack_guarantee)
|
2015-07-05 18:51:52 +08:00
|
|
|
bool IMPLEMENT (has_broken_rtl_query_process_debug_information)
|
2015-08-13 23:59:47 +08:00
|
|
|
bool IMPLEMENT (has_processor_groups)
|
* Makefile.in: Build wincap.o.
* wincap.cc: New file.
* wincap.h: Ditto.
* autoload.cc: Add dynamic load statement for `CreateHardLinkA'.
* dcrt0.cc (os_being_run): Eliminated.
(osname): Ditto.
(iswinnt): Ditto.
(set_os_type): Ditto.
(dll_crt0_1): Call wincap.init() instead of set_os_type().
(_dll_crt0): Ditto.
* environ.cc (set_chunksize): New function.
(parse_thing): `forkchunk' setting now invokes function `set_chunksize'.
* fork.cc (chunksize): Eliminated. Moved to be member of wincap.
* host_dependent.h: Removed.
* syscalls.cc (_link): Try using `CreateHardLinkA' first, if available.
* cygheap.cc, dcrt0.cc, delqueue.cc, dir.cc,
environ.cc, fhandler.cc, fhandler.h, fhandler_console.cc,
fhandler_mem.cc, fork.cc, mmap.cc, net.cc, pinfo.cc, pinfo.h,
security.cc, syscalls.cc, sysconf.cc, syslog.cc, thread.cc,
times.cc, tty.cc, uinfo.cc, uname.cc, winsup.h: Use new wincap
capability check throughout.
* winsup.h: Include wincap.h. Eliminate extern declarations of
`os_being_run' and `iswinnt'. Eliminate `os_type" definition.
* include/cygwin/version.h: Bump version to 1.3.4.
2001-09-13 01:46:37 +08:00
|
|
|
|
|
|
|
#undef IMPLEMENT
|
|
|
|
};
|
|
|
|
|
|
|
|
extern wincapc wincap;
|
|
|
|
|
|
|
|
#endif /* _WINCAP_H */
|