[Fedora-directory-commits] winsync/passwordsync/passsync ntservice.cpp, 1.6, 1.7

Richard Allen Megginson rmeggins at fedoraproject.org
Thu Mar 12 14:39:43 UTC 2009


Author: rmeggins

Update of /cvs/dirsec/winsync/passwordsync/passsync
In directory cvs1.fedora.phx.redhat.com:/tmp/cvs-serv32164

Modified Files:
	ntservice.cpp 
Log Message:
Resolves: Bug 482892
Description: Passsync service start and stop messages in Windows event viewer are not logged correctly
Fix Description: Omit "The Password Synchronization Service service was installed." message at service startup.



Index: ntservice.cpp
===================================================================
RCS file: /cvs/dirsec/winsync/passwordsync/passsync/ntservice.cpp,v
retrieving revision 1.6
retrieving revision 1.7
diff -u -r1.6 -r1.7
--- ntservice.cpp	16 Feb 2009 22:20:21 -0000	1.6
+++ ntservice.cpp	12 Mar 2009 14:39:40 -0000	1.7
@@ -199,6 +199,7 @@
     // Get the executable file path
     TCHAR szFilePath[_MAX_PATH];
     ::GetModuleFileName(NULL, szFilePath, sizeof(szFilePath)/sizeof(*szFilePath));
+    int didinstall = FALSE;
 
 	// install if not already installed
 	if (!IsInstalled()) {
@@ -229,6 +230,7 @@
 		// clean up
 		::CloseServiceHandle(hService);
 		::CloseServiceHandle(hSCM);
+        didinstall = TRUE;
 	}
 
     // make registry entries to support logging messages
@@ -263,10 +265,12 @@
                     0,
                     REG_DWORD,
                     (CONST BYTE*)&dwData,
-                     sizeof(DWORD));
+                    sizeof(DWORD));
     ::RegCloseKey(hKey);
 
-    LogEvent(EVENTLOG_INFORMATION_TYPE, EVMSG_INSTALLED, m_szServiceName);
+    if (didinstall) {
+        LogEvent(EVENTLOG_INFORMATION_TYPE, EVMSG_INSTALLED, m_szServiceName);
+    }
 
     return TRUE;
 }




More information about the Fedora-directory-commits mailing list