From 85874d4da508ec6eb6acf521c68a450e97faa69f Mon Sep 17 00:00:00 2001 From: Jeffrey Altman Date: Wed, 30 Aug 2006 21:20:19 +0000 Subject: [PATCH] STABLE14-windows-firewall-config-20060830 Enable the firewall detection logic to work on Vista (cherry picked from commit f56dff0860d5f9a9d92e9a06c1b7cd1728a2844a) --- src/WINNT/afsd/cm_daemon.c | 19 ++++++++++++++++--- 1 file changed, 16 insertions(+), 3 deletions(-) diff --git a/src/WINNT/afsd/cm_daemon.c b/src/WINNT/afsd/cm_daemon.c index 7243dd620..b2235036d 100644 --- a/src/WINNT/afsd/cm_daemon.c +++ b/src/WINNT/afsd/cm_daemon.c @@ -142,7 +142,13 @@ IsWindowsFirewallPresent(void) if (!scm) return FALSE; /* Open Windows Firewall service */ - svc = OpenService(scm, "SharedAccess", SERVICE_QUERY_CONFIG); + svc = OpenService(scm, "MpsSvc", SERVICE_QUERY_CONFIG); + if (!svc) { + afsi_log("MpsSvc Service could not be opened for query: 0x%x", GetLastError()); + svc = OpenService(scm, "SharedAccess", SERVICE_QUERY_CONFIG); + if (!svc) + afsi_log("SharedAccess Service could not be opened for query: 0x%x", GetLastError()); + } if (!svc) goto close_scm; @@ -160,10 +166,13 @@ IsWindowsFirewallPresent(void) /* Query Windows Firewall service config, this time for real */ flag = QueryServiceConfig(svc, pConfig, BufSize, &BufSize); - if (!flag) + if (!flag) { + afsi_log("QueryServiceConfig failed: 0x%x", GetLastError()); goto free_pConfig; + } /* Is it autostart? */ + afsi_log("AutoStart 0x%x", pConfig->dwStartType); if (pConfig->dwStartType < SERVICE_DEMAND_START) result = TRUE; @@ -193,6 +202,10 @@ void cm_Daemon(long parm) HMODULE hHookDll; int configureFirewall = IsWindowsFirewallPresent(); + if (!configureFirewall) { + afsi_log("No Windows Firewall detected"); + } + /* ping all file servers, up or down, with unauthenticated connection, * to find out whether we have all our callbacks from the server still. * Also, ping down VLDBs. @@ -244,7 +257,7 @@ void cm_Daemon(long parm) default: afsi_log("Unknown Windows Firewall Configuration error"); } - } + } /* find out what time it is */ now = osi_Time(); -- 2.39.5