Welcome to mirror list, hosted at ThFree Co, Russian Federation.

cygwin.com/git/newlib-cygwin.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
Diffstat (limited to 'winsup/cygwin/wincap.cc')
-rw-r--r--winsup/cygwin/wincap.cc91
1 files changed, 69 insertions, 22 deletions
diff --git a/winsup/cygwin/wincap.cc b/winsup/cygwin/wincap.cc
index 4026167ad..01b6660b3 100644
--- a/winsup/cygwin/wincap.cc
+++ b/winsup/cygwin/wincap.cc
@@ -1,7 +1,7 @@
/* wincap.cc -- figure out on which OS we're running. Set the
capability class to the appropriate values.
- Copyright 2001 Red Hat, Inc.
+ Copyright 2001, 2002 Red Hat, Inc.
This file is part of Cygwin.
@@ -22,7 +22,6 @@ static NO_COPY wincaps wincap_unknown = {
has_security:false,
has_security_descriptor_control:false,
has_get_process_times:false,
- has_specific_access_rights:false,
has_lseek_bug:false,
has_lock_file_ex:false,
has_signal_object_and_wait:false,
@@ -43,6 +42,11 @@ static NO_COPY wincaps wincap_unknown = {
has_negative_pids:false,
has_unreliable_pipes:false,
has_try_enter_critical_section:false,
+ has_raw_devices:false,
+ has_valid_processorlevel:false,
+ has_64bit_file_access:false,
+ has_process_io_counters:false,
+ supports_reading_modem_output_lines:false,
};
static NO_COPY wincaps wincap_95 = {
@@ -56,7 +60,6 @@ static NO_COPY wincaps wincap_95 = {
has_security:false,
has_security_descriptor_control:false,
has_get_process_times:false,
- has_specific_access_rights:false,
has_lseek_bug:true,
has_lock_file_ex:false,
has_signal_object_and_wait:false,
@@ -77,6 +80,11 @@ static NO_COPY wincaps wincap_95 = {
has_negative_pids:true,
has_unreliable_pipes:true,
has_try_enter_critical_section:false,
+ has_raw_devices:false,
+ has_valid_processorlevel:false,
+ has_64bit_file_access:false,
+ has_process_io_counters:false,
+ supports_reading_modem_output_lines:false,
};
static NO_COPY wincaps wincap_95osr2 = {
@@ -90,7 +98,6 @@ static NO_COPY wincaps wincap_95osr2 = {
has_security:false,
has_security_descriptor_control:false,
has_get_process_times:false,
- has_specific_access_rights:false,
has_lseek_bug:true,
has_lock_file_ex:false,
has_signal_object_and_wait:false,
@@ -111,6 +118,11 @@ static NO_COPY wincaps wincap_95osr2 = {
has_negative_pids:true,
has_unreliable_pipes:true,
has_try_enter_critical_section:false,
+ has_raw_devices:false,
+ has_valid_processorlevel:false,
+ has_64bit_file_access:false,
+ has_process_io_counters:false,
+ supports_reading_modem_output_lines:false,
};
static NO_COPY wincaps wincap_98 = {
@@ -124,7 +136,6 @@ static NO_COPY wincaps wincap_98 = {
has_security:false,
has_security_descriptor_control:false,
has_get_process_times:false,
- has_specific_access_rights:false,
has_lseek_bug:true,
has_lock_file_ex:false,
has_signal_object_and_wait:false,
@@ -145,6 +156,11 @@ static NO_COPY wincaps wincap_98 = {
has_negative_pids:true,
has_unreliable_pipes:true,
has_try_enter_critical_section:false,
+ has_raw_devices:false,
+ has_valid_processorlevel:true,
+ has_64bit_file_access:false,
+ has_process_io_counters:false,
+ supports_reading_modem_output_lines:false,
};
static NO_COPY wincaps wincap_98se = {
@@ -158,7 +174,6 @@ static NO_COPY wincaps wincap_98se = {
has_security:false,
has_security_descriptor_control:false,
has_get_process_times:false,
- has_specific_access_rights:false,
has_lseek_bug:true,
has_lock_file_ex:false,
has_signal_object_and_wait:false,
@@ -179,6 +194,11 @@ static NO_COPY wincaps wincap_98se = {
has_negative_pids:true,
has_unreliable_pipes:true,
has_try_enter_critical_section:false,
+ has_raw_devices:false,
+ has_valid_processorlevel:true,
+ has_64bit_file_access:false,
+ has_process_io_counters:false,
+ supports_reading_modem_output_lines:false,
};
static NO_COPY wincaps wincap_me = {
@@ -192,7 +212,6 @@ static NO_COPY wincaps wincap_me = {
has_security:false,
has_security_descriptor_control:false,
has_get_process_times:false,
- has_specific_access_rights:false,
has_lseek_bug:true,
has_lock_file_ex:false,
has_signal_object_and_wait:false,
@@ -213,6 +232,11 @@ static NO_COPY wincaps wincap_me = {
has_negative_pids:true,
has_unreliable_pipes:true,
has_try_enter_critical_section:false,
+ has_raw_devices:false,
+ has_valid_processorlevel:true,
+ has_64bit_file_access:false,
+ has_process_io_counters:false,
+ supports_reading_modem_output_lines:false,
};
static NO_COPY wincaps wincap_nt3 = {
@@ -226,7 +250,6 @@ static NO_COPY wincaps wincap_nt3 = {
has_security:true,
has_security_descriptor_control:false,
has_get_process_times:true,
- has_specific_access_rights:true,
has_lseek_bug:false,
has_lock_file_ex:true,
has_signal_object_and_wait:false,
@@ -247,6 +270,11 @@ static NO_COPY wincaps wincap_nt3 = {
has_negative_pids:false,
has_unreliable_pipes:false,
has_try_enter_critical_section:false,
+ has_raw_devices:true,
+ has_valid_processorlevel:true,
+ has_64bit_file_access:true,
+ has_process_io_counters:false,
+ supports_reading_modem_output_lines:true,
};
static NO_COPY wincaps wincap_nt4 = {
@@ -260,7 +288,6 @@ static NO_COPY wincaps wincap_nt4 = {
has_security:true,
has_security_descriptor_control:false,
has_get_process_times:true,
- has_specific_access_rights:true,
has_lseek_bug:false,
has_lock_file_ex:true,
has_signal_object_and_wait:true,
@@ -281,6 +308,11 @@ static NO_COPY wincaps wincap_nt4 = {
has_negative_pids:false,
has_unreliable_pipes:false,
has_try_enter_critical_section:true,
+ has_raw_devices:true,
+ has_valid_processorlevel:true,
+ has_64bit_file_access:true,
+ has_process_io_counters:false,
+ supports_reading_modem_output_lines:true,
};
static NO_COPY wincaps wincap_nt4sp4 = {
@@ -294,7 +326,6 @@ static NO_COPY wincaps wincap_nt4sp4 = {
has_security:true,
has_security_descriptor_control:false,
has_get_process_times:true,
- has_specific_access_rights:true,
has_lseek_bug:false,
has_lock_file_ex:true,
has_signal_object_and_wait:true,
@@ -315,6 +346,11 @@ static NO_COPY wincaps wincap_nt4sp4 = {
has_negative_pids:false,
has_unreliable_pipes:false,
has_try_enter_critical_section:true,
+ has_raw_devices:true,
+ has_valid_processorlevel:true,
+ has_64bit_file_access:true,
+ has_process_io_counters:false,
+ supports_reading_modem_output_lines:true,
};
static NO_COPY wincaps wincap_2000 = {
@@ -328,7 +364,6 @@ static NO_COPY wincaps wincap_2000 = {
has_security:true,
has_security_descriptor_control:true,
has_get_process_times:true,
- has_specific_access_rights:true,
has_lseek_bug:false,
has_lock_file_ex:true,
has_signal_object_and_wait:true,
@@ -349,6 +384,11 @@ static NO_COPY wincaps wincap_2000 = {
has_negative_pids:false,
has_unreliable_pipes:false,
has_try_enter_critical_section:true,
+ has_raw_devices:true,
+ has_valid_processorlevel:true,
+ has_64bit_file_access:true,
+ has_process_io_counters:true,
+ supports_reading_modem_output_lines:true,
};
static NO_COPY wincaps wincap_xp = {
@@ -362,7 +402,6 @@ static NO_COPY wincaps wincap_xp = {
has_security:true,
has_security_descriptor_control:true,
has_get_process_times:true,
- has_specific_access_rights:true,
has_lseek_bug:false,
has_lock_file_ex:true,
has_signal_object_and_wait:true,
@@ -383,15 +422,23 @@ static NO_COPY wincaps wincap_xp = {
has_negative_pids:false,
has_unreliable_pipes:false,
has_try_enter_critical_section:true,
+ has_raw_devices:true,
+ has_valid_processorlevel:true,
+ has_64bit_file_access:true,
+ has_process_io_counters:true,
+ supports_reading_modem_output_lines:true,
};
-wincapc NO_COPY wincap;
+wincapc wincap;
void
wincapc::init ()
{
const char *os;
+ if (caps)
+ return; // already initialized
+
memset (&version, 0, sizeof version);
version.dwOSVersionInfoSize = sizeof version;
GetVersionEx (&version);
@@ -408,9 +455,9 @@ wincapc::init ()
case 4:
os = "NT";
if (strcmp (version.szCSDVersion, "Service Pack 4") < 0)
- caps = &wincap_nt4;
+ caps = &wincap_nt4;
else
- caps = &wincap_nt4sp4;
+ caps = &wincap_nt4sp4;
break;
case 5:
os = "NT";
@@ -424,23 +471,23 @@ wincapc::init ()
caps = &wincap_unknown;
break;
}
- break;
+ break;
case VER_PLATFORM_WIN32_WINDOWS:
switch (version.dwMinorVersion)
{
case 0:
os = "95";
- if (strchr(version.szCSDVersion, 'C'))
+ if (strchr (version.szCSDVersion, 'C'))
caps = &wincap_95osr2;
else
caps = &wincap_95;
break;
case 10:
os = "98";
- if (strchr(version.szCSDVersion, 'A'))
- caps = &wincap_98se;
+ if (strchr (version.szCSDVersion, 'A'))
+ caps = &wincap_98se;
else
- caps = &wincap_98;
+ caps = &wincap_98;
break;
case 90:
os = "ME";
@@ -451,9 +498,9 @@ wincapc::init ()
caps = &wincap_unknown;
break;
}
- break;
+ break;
default:
- os = "??";
+ os = "??";
caps = &wincap_unknown;
break;
}