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:
authorChristopher Faylor <me@cgf.cx>2003-09-27 07:44:31 +0400
committerChristopher Faylor <me@cgf.cx>2003-09-27 07:44:31 +0400
commitaff963076710f29348ae1e0249df94a27cde942d (patch)
tree90726cc8ea8c606ac3f4eb5afc01fffb7aacf7a9 /winsup/cygwin/wincap.cc
parenta3cbb4a7e09732e34e6a7d194f314aab6c35e4d0 (diff)
* Makefile.in: Add libusr32.a to DLL_IMPORTS.
* wincap.h (wincaps::is_server): New flag. (wincapc::version): Change type to OSVERSIONINFOEX. (wincapc::is_server): New function. * wincap.cc (wincap_unknown::is_server): New initializer. (wincap_95): Ditto. (wincap_95osr2): Ditto. (wincap_98): Ditto. (wincap_me): Ditto. (wincap_nt3): Ditto. (wincap_nt4): Ditto. (wincap_nt4sp4): Ditto. (wincap_2000): Ditto. (wincap_xp): Ditto. (wincapc::init): Adapt to OSVERSIONINFOEX. Add detection of NT server systems. * sched.cc: Include windows.h and registry.h. (sched_rr_get_interval): Re-implement for NT systems.
Diffstat (limited to 'winsup/cygwin/wincap.cc')
-rw-r--r--winsup/cygwin/wincap.cc25
1 files changed, 23 insertions, 2 deletions
diff --git a/winsup/cygwin/wincap.cc b/winsup/cygwin/wincap.cc
index 33676ee6f..0f69abee9 100644
--- a/winsup/cygwin/wincap.cc
+++ b/winsup/cygwin/wincap.cc
@@ -16,6 +16,7 @@ static NO_COPY wincaps wincap_unknown = {
chunksize:0x0,
shared:FILE_SHARE_READ | FILE_SHARE_WRITE,
is_winnt:false,
+ is_server:false,
access_denied_on_delete:false,
has_delete_on_close:false,
has_page_guard:false,
@@ -58,6 +59,7 @@ static NO_COPY wincaps wincap_95 = {
chunksize:32 * 1024 * 1024,
shared:FILE_SHARE_READ | FILE_SHARE_WRITE,
is_winnt:false,
+ is_server:false,
access_denied_on_delete:true,
has_delete_on_close:false,
has_page_guard:false,
@@ -100,6 +102,7 @@ static NO_COPY wincaps wincap_95osr2 = {
chunksize:32 * 1024 * 1024,
shared:FILE_SHARE_READ | FILE_SHARE_WRITE,
is_winnt:false,
+ is_server:false,
access_denied_on_delete:true,
has_delete_on_close:false,
has_page_guard:false,
@@ -142,6 +145,7 @@ static NO_COPY wincaps wincap_98 = {
chunksize:32 * 1024 * 1024,
shared:FILE_SHARE_READ | FILE_SHARE_WRITE,
is_winnt:false,
+ is_server:false,
access_denied_on_delete:true,
has_delete_on_close:false,
has_page_guard:false,
@@ -184,6 +188,7 @@ static NO_COPY wincaps wincap_98se = {
chunksize:32 * 1024 * 1024,
shared:FILE_SHARE_READ | FILE_SHARE_WRITE,
is_winnt:false,
+ is_server:false,
access_denied_on_delete:true,
has_delete_on_close:false,
has_page_guard:false,
@@ -226,6 +231,7 @@ static NO_COPY wincaps wincap_me = {
chunksize:32 * 1024 * 1024,
shared:FILE_SHARE_READ | FILE_SHARE_WRITE,
is_winnt:false,
+ is_server:false,
access_denied_on_delete:true,
has_delete_on_close:false,
has_page_guard:false,
@@ -268,6 +274,7 @@ static NO_COPY wincaps wincap_nt3 = {
chunksize:0,
shared:FILE_SHARE_READ | FILE_SHARE_WRITE | FILE_SHARE_DELETE,
is_winnt:true,
+ is_server:false,
access_denied_on_delete:false,
has_delete_on_close:true,
has_page_guard:true,
@@ -310,6 +317,7 @@ static NO_COPY wincaps wincap_nt4 = {
chunksize:0,
shared:FILE_SHARE_READ | FILE_SHARE_WRITE | FILE_SHARE_DELETE,
is_winnt:true,
+ is_server:false,
access_denied_on_delete:false,
has_delete_on_close:true,
has_page_guard:true,
@@ -352,6 +360,7 @@ static NO_COPY wincaps wincap_nt4sp4 = {
chunksize:0,
shared:FILE_SHARE_READ | FILE_SHARE_WRITE | FILE_SHARE_DELETE,
is_winnt:true,
+ is_server:false,
access_denied_on_delete:false,
has_delete_on_close:true,
has_page_guard:true,
@@ -394,6 +403,7 @@ static NO_COPY wincaps wincap_2000 = {
chunksize:0,
shared:FILE_SHARE_READ | FILE_SHARE_WRITE | FILE_SHARE_DELETE,
is_winnt:true,
+ is_server:false,
access_denied_on_delete:false,
has_delete_on_close:true,
has_page_guard:true,
@@ -436,6 +446,7 @@ static NO_COPY wincaps wincap_xp = {
chunksize:0,
shared:FILE_SHARE_READ | FILE_SHARE_WRITE | FILE_SHARE_DELETE,
is_winnt:true,
+ is_server:false,
access_denied_on_delete:false,
has_delete_on_close:true,
has_page_guard:true,
@@ -478,6 +489,7 @@ static NO_COPY wincaps wincap_2003 = {
chunksize:0,
shared:FILE_SHARE_READ | FILE_SHARE_WRITE | FILE_SHARE_DELETE,
is_winnt:true,
+ is_server:true,
access_denied_on_delete:false,
has_delete_on_close:true,
has_page_guard:true,
@@ -526,8 +538,8 @@ wincapc::init ()
return; // already initialized
memset (&version, 0, sizeof version);
- version.dwOSVersionInfoSize = sizeof version;
- GetVersionEx (&version);
+ version.dwOSVersionInfoSize = sizeof (OSVERSIONINFO);
+ GetVersionEx (reinterpret_cast<LPOSVERSIONINFO> (&version));
switch (version.dwPlatformId)
{
@@ -599,6 +611,15 @@ wincapc::init ()
caps = &wincap_unknown;
break;
}
+
+ if (((wincaps *)this->caps)->is_winnt && version.dwMajorVersion > 4)
+ {
+ version.dwOSVersionInfoSize = sizeof version;
+ GetVersionEx (reinterpret_cast<LPOSVERSIONINFO>(&version));
+ if (version.wProductType != VER_NT_WORKSTATION)
+ ((wincaps *)this->caps)->is_server = true;
+ }
+
__small_sprintf (osnam, "%s-%d.%d", os, version.dwMajorVersion,
version.dwMinorVersion);
}