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;
*/
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);
* 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 */