httpd-cvs mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From wr...@apache.org
Subject svn commit: r730870 - /httpd/httpd/trunk/server/mpm/winnt/service.c
Date Fri, 02 Jan 2009 23:37:42 GMT
Author: wrowe
Date: Fri Jan  2 15:37:42 2009
New Revision: 730870

URL: http://svn.apache.org/viewvc?rev=730870&view=rev
Log:
Drop support for Service Description labels from < Win2000

Modified:
    httpd/httpd/trunk/server/mpm/winnt/service.c

Modified: httpd/httpd/trunk/server/mpm/winnt/service.c
URL: http://svn.apache.org/viewvc/httpd/httpd/trunk/server/mpm/winnt/service.c?rev=730870&r1=730869&r2=730870&view=diff
==============================================================================
--- httpd/httpd/trunk/server/mpm/winnt/service.c (original)
+++ httpd/httpd/trunk/server/mpm/winnt/service.c Fri Jan  2 15:37:42 2009
@@ -295,22 +295,14 @@
     return(rv);
 }
 
-/* Set the service description regardless of platform.
- * We revert to set_service_description, the
- explicit
- * way so any Apache management program can grab the
- * description.  This would be bad on Win2000, since 
- * it doesn't notify the service control manager of 
- * the name change.
+/* Note this works on Win2000 and later due to ChangeServiceConfig2
+ * Continue to test it's existence, but at least drop the feature
+ * of revising service description tags prior to Win2000.
  */
 
 /* borrowed from mpm_winnt.c */
 extern apr_pool_t *pconf;
 
-/* Windows 2000 alone supports ChangeServiceConfig2 in order to
- * register our server_version string... so we need some fixups
- * to avoid binding to that function if we are on WinNT.
- */
 static void set_service_description(void)
 {
     const char *full_description;
@@ -326,10 +318,8 @@
      */
     full_description = ap_get_server_description();
 
-    if ((osver.dwPlatformId == VER_PLATFORM_WIN32_NT)
-          && (osver.dwMajorVersion > 4)
-          && (ChangeServiceConfig2)
-          && (schSCManager = OpenSCManager(NULL, NULL, SC_MANAGER_CONNECT)))
+    if ((ChangeServiceConfig2) &&
+        (schSCManager = OpenSCManager(NULL, NULL, SC_MANAGER_CONNECT)))
     {
         SC_HANDLE schService = OpenService(schSCManager, mpm_service_name,
                                            SERVICE_CHANGE_CONFIG);
@@ -338,35 +328,13 @@
              * object types, some volatile, some not.
              */
             /* ###: utf-ize */
-            if (ChangeServiceConfig2(schService,
-                                     1 /* SERVICE_CONFIG_DESCRIPTION */,
-                                     (LPVOID) &full_description)) {
-                full_description = NULL;
-            }
+            ChangeServiceConfig2(schService,
+                                 1 /* SERVICE_CONFIG_DESCRIPTION */,
+                                 (LPVOID) &full_description));
             CloseServiceHandle(schService);
         }
         CloseServiceHandle(schSCManager);
     }
-
-    if (full_description)
-    {
-        char szPath[MAX_PATH];
-        ap_regkey_t *svckey;
-        apr_status_t rv;
-
-        /* Find the Service key that Monitor Applications iterate */
-        apr_snprintf(szPath, sizeof(szPath),
-                     "SYSTEM\\CurrentControlSet\\Services\\%s",
-                     mpm_service_name);
-        rv = ap_regkey_open(&svckey, AP_REGKEY_LOCAL_MACHINE, szPath,
-                            APR_READ | APR_WRITE, pconf);
-        if (rv != APR_SUCCESS) {
-            return;
-        }
-        /* Attempt to set the Description value for our service */
-        ap_regkey_value_set(svckey, "Description", full_description, 0, pconf);
-        ap_regkey_close(svckey);
-    }
 }
 
 /* handle the SCM's ControlService() callbacks to our service */



Mime
View raw message