diff options
Diffstat (limited to 'winsup/cygwin/wincap.cc')
-rw-r--r-- | winsup/cygwin/wincap.cc | 143 |
1 files changed, 58 insertions, 85 deletions
diff --git a/winsup/cygwin/wincap.cc b/winsup/cygwin/wincap.cc index 48b51c275..6fe172f77 100644 --- a/winsup/cygwin/wincap.cc +++ b/winsup/cygwin/wincap.cc @@ -37,7 +37,6 @@ wincaps wincap_2000 __attribute__((section (".cygwin_dll_common"), shared)) = { has_recycle_dot_bin:false, has_gaa_prefixes:false, has_gaa_on_link_prefix:false, - has_gaa_largeaddress_bug:false, supports_all_posix_ai_flags:false, has_restricted_stack_args:false, has_transactions:false, @@ -54,7 +53,7 @@ wincaps wincap_2000 __attribute__((section (".cygwin_dll_common"), shared)) = { has_stack_size_param_is_a_reservation:false, has_console_logon_sid:false, wow64_has_secondary_stack:false, - has_program_compatibility_assistant:false, + has_program_compatibility_assitant:false, kernel_is_always_casesensitive:true, }; @@ -72,7 +71,6 @@ wincaps wincap_2000sp4 __attribute__((section (".cygwin_dll_common"), shared)) = has_recycle_dot_bin:false, has_gaa_prefixes:false, has_gaa_on_link_prefix:false, - has_gaa_largeaddress_bug:false, supports_all_posix_ai_flags:false, has_restricted_stack_args:false, has_transactions:false, @@ -89,7 +87,7 @@ wincaps wincap_2000sp4 __attribute__((section (".cygwin_dll_common"), shared)) = has_stack_size_param_is_a_reservation:false, has_console_logon_sid:false, wow64_has_secondary_stack:false, - has_program_compatibility_assistant:false, + has_program_compatibility_assitant:false, kernel_is_always_casesensitive:true, }; @@ -107,7 +105,6 @@ wincaps wincap_xp __attribute__((section (".cygwin_dll_common"), shared)) = { has_recycle_dot_bin:false, has_gaa_prefixes:false, has_gaa_on_link_prefix:false, - has_gaa_largeaddress_bug:false, supports_all_posix_ai_flags:false, has_restricted_stack_args:false, has_transactions:false, @@ -124,7 +121,7 @@ wincaps wincap_xp __attribute__((section (".cygwin_dll_common"), shared)) = { has_stack_size_param_is_a_reservation:true, has_console_logon_sid:false, wow64_has_secondary_stack:false, - has_program_compatibility_assistant:false, + has_program_compatibility_assitant:false, kernel_is_always_casesensitive:false, }; @@ -142,7 +139,6 @@ wincaps wincap_xpsp1 __attribute__((section (".cygwin_dll_common"), shared)) = { has_recycle_dot_bin:false, has_gaa_prefixes:true, has_gaa_on_link_prefix:false, - has_gaa_largeaddress_bug:false, supports_all_posix_ai_flags:false, has_restricted_stack_args:false, has_transactions:false, @@ -159,7 +155,7 @@ wincaps wincap_xpsp1 __attribute__((section (".cygwin_dll_common"), shared)) = { has_stack_size_param_is_a_reservation:true, has_console_logon_sid:false, wow64_has_secondary_stack:false, - has_program_compatibility_assistant:false, + has_program_compatibility_assitant:false, kernel_is_always_casesensitive:false, }; @@ -177,7 +173,6 @@ wincaps wincap_xpsp2 __attribute__((section (".cygwin_dll_common"), shared)) = { has_recycle_dot_bin:false, has_gaa_prefixes:true, has_gaa_on_link_prefix:false, - has_gaa_largeaddress_bug:false, supports_all_posix_ai_flags:false, has_restricted_stack_args:false, has_transactions:false, @@ -194,7 +189,7 @@ wincaps wincap_xpsp2 __attribute__((section (".cygwin_dll_common"), shared)) = { has_stack_size_param_is_a_reservation:true, has_console_logon_sid:false, wow64_has_secondary_stack:false, - has_program_compatibility_assistant:false, + has_program_compatibility_assitant:false, kernel_is_always_casesensitive:false, }; @@ -212,7 +207,6 @@ wincaps wincap_2003 __attribute__((section (".cygwin_dll_common"), shared)) = { has_recycle_dot_bin:false, has_gaa_prefixes:true, has_gaa_on_link_prefix:false, - has_gaa_largeaddress_bug:false, supports_all_posix_ai_flags:false, has_restricted_stack_args:true, has_transactions:false, @@ -229,7 +223,7 @@ wincaps wincap_2003 __attribute__((section (".cygwin_dll_common"), shared)) = { has_stack_size_param_is_a_reservation:true, has_console_logon_sid:false, wow64_has_secondary_stack:true, - has_program_compatibility_assistant:false, + has_program_compatibility_assitant:false, kernel_is_always_casesensitive:false, }; @@ -247,7 +241,6 @@ wincaps wincap_vista __attribute__((section (".cygwin_dll_common"), shared)) = { has_recycle_dot_bin:true, has_gaa_prefixes:true, has_gaa_on_link_prefix:true, - has_gaa_largeaddress_bug:true, supports_all_posix_ai_flags:true, has_restricted_stack_args:false, has_transactions:true, @@ -264,7 +257,7 @@ wincaps wincap_vista __attribute__((section (".cygwin_dll_common"), shared)) = { has_stack_size_param_is_a_reservation:true, has_console_logon_sid:false, wow64_has_secondary_stack:false, - has_program_compatibility_assistant:true, + has_program_compatibility_assitant:true, kernel_is_always_casesensitive:false, }; @@ -282,7 +275,6 @@ wincaps wincap_7 __attribute__((section (".cygwin_dll_common"), shared)) = { has_recycle_dot_bin:true, has_gaa_prefixes:true, has_gaa_on_link_prefix:true, - has_gaa_largeaddress_bug:true, supports_all_posix_ai_flags:true, has_restricted_stack_args:false, has_transactions:true, @@ -299,42 +291,7 @@ wincaps wincap_7 __attribute__((section (".cygwin_dll_common"), shared)) = { has_stack_size_param_is_a_reservation:true, has_console_logon_sid:true, wow64_has_secondary_stack:false, - has_program_compatibility_assistant:true, - kernel_is_always_casesensitive:false, -}; - -wincaps wincap_8 __attribute__((section (".cygwin_dll_common"), shared)) = { - max_sys_priv:SE_CREATE_SYMBOLIC_LINK_PRIVILEGE, - is_server:false, - has_physical_mem_access:false, - has_create_global_privilege:true, - has_ioctl_storage_get_media_types_ex:true, - has_disk_ex_ioctls:true, - has_buggy_restart_scan:false, - has_mandatory_integrity_control:true, - needs_logon_sid_in_sid_list:false, - needs_count_in_si_lpres2:false, - has_recycle_dot_bin:true, - has_gaa_prefixes:true, - has_gaa_on_link_prefix:true, - has_gaa_largeaddress_bug:false, - supports_all_posix_ai_flags:true, - has_restricted_stack_args:false, - has_transactions:true, - has_recvmsg:true, - has_sendmsg:true, - has_broken_udf:false, - has_console_handle_problem:true, - has_broken_alloc_console:true, - has_always_all_codepages:true, - has_localenames:true, - has_fast_cwd:true, - has_restricted_raw_disk_access:true, - use_dont_resolve_hack:false, - has_stack_size_param_is_a_reservation:true, - has_console_logon_sid:true, - wow64_has_secondary_stack:false, - has_program_compatibility_assistant:true, + has_program_compatibility_assitant:true, kernel_is_always_casesensitive:false, }; @@ -347,52 +304,69 @@ wincapc::init () return; // already initialized GetSystemInfo (&system_info); + memset (&version, 0, sizeof version); version.dwOSVersionInfoSize = sizeof (OSVERSIONINFOEX); - GetVersionEx (reinterpret_cast<LPOSVERSIONINFO>(&version)); + if (!GetVersionEx (reinterpret_cast<LPOSVERSIONINFO>(&version))) + api_fatal ("Cygwin requires at least Windows 2000."); - switch (version.dwMajorVersion) + switch (version.dwPlatformId) { - case 5: - switch (version.dwMinorVersion) + case VER_PLATFORM_WIN32_NT: + switch (version.dwMajorVersion) { - case 0: - if (version.wServicePackMajor < 4) - caps = &wincap_2000; - else - caps = &wincap_2000sp4; + case 4: + /* I'd be very surprised if this code is ever hit, but it doesn't + hurt to keep it. */ + api_fatal ("Cygwin requires at least Windows 2000."); break; - - case 1: - caps = &wincap_xp; - switch (version.wServicePackMajor) + case 5: + switch (version.dwMinorVersion) { - case 0: - caps = &wincap_xp; - case 1: - caps = &wincap_xpsp1; - default: - caps = &wincap_xpsp2; - } - break; + case 0: + if (version.wServicePackMajor < 4) + caps = &wincap_2000; + else + caps = &wincap_2000sp4; + break; - default: - caps = &wincap_2003; - } - break; - case 6: - switch (version.dwMinorVersion) - { - case 0: - caps = &wincap_vista; + case 1: + caps = &wincap_xp; + switch (version.wServicePackMajor) + { + case 0: + caps = &wincap_xp; + case 1: + caps = &wincap_xpsp1; + default: + caps = &wincap_xpsp2; + } + break; + + default: + caps = &wincap_2003; + } break; - case 1: - caps = &wincap_7; + case 6: + switch (version.dwMinorVersion) + { + case 0: + caps = &wincap_vista; + break; + default: + caps = &wincap_7; + break; + } break; default: - caps = &wincap_8; + caps = &wincap_minimal; break; } break; + case VER_PLATFORM_WIN32_WINDOWS: + /* I'd be very surprised if this code is ever hit, but it doesn't + hurt to keep it. */ + api_fatal ("Windows 95/98/Me are not supported."); + break; default: caps = &wincap_minimal; break; @@ -407,7 +381,6 @@ wincapc::init () ((wincaps *)caps)->needs_count_in_si_lpres2 = false; ((wincaps *)caps)->has_restricted_stack_args = false; ((wincaps *)caps)->wow64_has_secondary_stack = false; - ((wincaps *)caps)->has_gaa_largeaddress_bug = false; } __small_sprintf (osnam, "NT-%d.%d", version.dwMajorVersion, |