httpd-cvs mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From stodd...@locus.apache.org
Subject cvs commit: apache-2.0/src/lib/apr/misc/win32 start.c
Date Fri, 07 Apr 2000 03:07:50 GMT
stoddard    00/04/06 20:07:50

  Modified:    src      CHANGES
               src/lib/apr/include apr_config.hw
               src/lib/apr/misc/win32 start.c
  Log:
  Win32: Fix a bug in ap_get_oslevel which causes GetVersionEx() to
  always fail. Need to initialise the dwOSVersionInfoSize member of the
  OSVERSIONINFO struct before calling GetVersionEx, so GetVersionEx
  always fails.
  
  The patch also enhances ap_get_oslevel (and the associated enum) to
  handle selected service packs for NT4, and adds recognition for
  Windows 2000. This is useful, eg. if we can recognise NT4 SP2 then
  we can use ReadFileScatter and WriteFileGather in readwrite.c.
  
  Submitted by:	Tim Costello
  Reviewed by:	Bill Stoddard
  
  Revision  Changes    Path
  1.59      +11 -0     apache-2.0/src/CHANGES
  
  Index: CHANGES
  ===================================================================
  RCS file: /home/cvs/apache-2.0/src/CHANGES,v
  retrieving revision 1.58
  retrieving revision 1.59
  diff -u -r1.58 -r1.59
  --- CHANGES	2000/04/05 21:01:05	1.58
  +++ CHANGES	2000/04/07 03:07:49	1.59
  @@ -1,4 +1,15 @@
   Changes with Apache 2.0a3-dev
  +  *) Win32: Fix a bug in ap_get_oslevel which causes GetVersionEx() to 
  +     always fail. Need to initialise the dwOSVersionInfoSize member of the 
  +     OSVERSIONINFO struct before calling GetVersionEx, so GetVersionEx 
  +     always fails. 
  +
  +     The patch also enhances ap_get_oslevel (and the associated enum) to 
  +     handle selected service packs for NT4, and adds recognition for 
  +     Windows 2000. This is useful, eg. if we can recognise NT4 SP2 then 
  +     we can use ReadFileScatter and WriteFileGather in readwrite.c. 
  +     [Tim Costello <Tim.Costello@BTFinancialgroup.com>]
  +
     *) Get mod_rewrite building and running, and mod_status building for Win NT
        [Allan Edwards <ake@raleigh.ibm.com>]
   
  
  
  
  1.5       +7 -1      apache-2.0/src/lib/apr/include/apr_config.hw
  
  Index: apr_config.hw
  ===================================================================
  RCS file: /home/cvs/apache-2.0/src/lib/apr/include/apr_config.hw,v
  retrieving revision 1.4
  retrieving revision 1.5
  diff -u -r1.4 -r1.5
  --- apr_config.hw	2000/04/05 03:14:49	1.4
  +++ apr_config.hw	2000/04/07 03:07:50	1.5
  @@ -155,7 +155,13 @@
   typedef enum {
   	APR_WIN_95 = 0, 
   	APR_WIN_98 = 4, 
  -	APR_WIN_NT = 8
  +	APR_WIN_NT = 8,
  +	APR_WIN_NT_4 = 12,
  +	APR_WIN_NT_4_SP2 = 14,
  +	APR_WIN_NT_4_SP3 = 15,
  +	APR_WIN_NT_4_SP4 = 16,
  +	APR_WIN_NT_4_SP6 = 18,
  +	APR_WIN_2000 = 24
   } ap_oslevel_e;
   
   
  
  
  
  1.19      +33 -1     apache-2.0/src/lib/apr/misc/win32/start.c
  
  Index: start.c
  ===================================================================
  RCS file: /home/cvs/apache-2.0/src/lib/apr/misc/win32/start.c,v
  retrieving revision 1.18
  retrieving revision 1.19
  diff -u -r1.18 -r1.19
  --- start.c	2000/04/03 19:44:58	1.18
  +++ start.c	2000/04/07 03:07:50	1.19
  @@ -119,14 +119,46 @@
   ap_status_t ap_get_oslevel(ap_context_t *cont, ap_oslevel_e *level)
   {
       static OSVERSIONINFO oslev;
  +    static unsigned int servpack = 0;
       static BOOL first = TRUE;
  +    char *pservpack;
   
       if (first) {
           first = FALSE;
  +        oslev.dwOSVersionInfoSize = sizeof(OSVERSIONINFO);
           GetVersionEx(&oslev);
  +        if (oslev.dwPlatformId == VER_PLATFORM_WIN32_NT) {
  +            for (pservpack = oslev.szCSDVersion; 
  +                 *pservpack && !isdigit(*pservpack); pservpack++)
  +                ;
  +            if (*pservpack)
  +                servpack = atoi(pservpack);
  +        }
       }
       if (oslev.dwPlatformId == VER_PLATFORM_WIN32_NT) {
  -        (*level) = APR_WIN_NT;
  +        if (oslev.dwMajorVersion == 5) {
  +            (*level) = APR_WIN_2000;
  +        }
  +        else if (oslev.dwMajorVersion == 4) {
  +            if (servpack >= 6) {
  +                (*level) = APR_WIN_NT_4_SP6;
  +            }
  +            else if (servpack >= 4) {
  +                (*level) = APR_WIN_NT_4_SP4;
  +            }
  +            else if (servpack >= 3) {
  +                (*level) = APR_WIN_NT_4_SP3;
  +            }
  +            else if (servpack >= 2) {
  +                (*level) = APR_WIN_NT_4_SP2;
  +            }
  +            else {
  +                (*level) = APR_WIN_NT_4;
  +            }
  +        }
  +        else {
  +            (*level) = APR_WIN_NT;
  +        }
           return APR_SUCCESS;
       }
       else if (oslev.dwPlatformId == VER_PLATFORM_WIN32_WINDOWS) {
  
  
  

Mime
View raw message