]> granicus.if.org Git - pdns/commitdiff
reinstated hooks to NT event log
authorBert Hubert <bert.hubert@netherlabs.nl>
Sun, 30 Apr 2006 15:25:15 +0000 (15:25 +0000)
committerBert Hubert <bert.hubert@netherlabs.nl>
Sun, 30 Apr 2006 15:25:15 +0000 (15:25 +0000)
git-svn-id: svn://svn.powerdns.com/pdns/trunk/pdns@813 d19b8d6e-7fed-0310-83ef-9ca221ded41b

pdns/ntservice.cc

index b92f03a9f5d2b0f5b183e2fe4fa5f63ce718fb85..9982660366b5500c04c071d6aa87032fd513ef0b 100644 (file)
@@ -68,8 +68,9 @@ bool NTService::registerService( const std::string & description, bool registerL
     return false; // Could not open the Service Control Manager.
 
   GetModuleFileName( NULL, temp, sizeof( temp ));
-
+       
   str << temp << " --ntservice";
+  
   if ( CreateService( 
     sc, 
     getServiceName().c_str(), 
@@ -83,11 +84,11 @@ bool NTService::registerService( const std::string & description, bool registerL
     NULL,
     NULL,
     NULL,
-    NULL ) == NULL && GetLastError() != ERROR_SERVICE_EXISTS )
+    NULL ) == NULL  )
   {
-    return false; // Don't we all like functions with 43 billion parameters?
+       if(GetLastError() != ERROR_SERVICE_EXISTS)
+      return false; // Don't we all like functions with 43 billion parameters?
   }
-
   CloseServiceHandle( sc );
 
   str.str( "" );
@@ -133,7 +134,7 @@ bool NTService::registerService( const std::string & description, bool registerL
     GetCurrentDirectory( sizeof( path ), path );
 
     // FIXME: This really should be: str << path << "\\" << getServiceName() << "msg.dll";
-    str << path << "\\pdnsmsg.dll";
+    str << path << "\\Eventlogger.dll";
     if ( RegSetValueEx( pkey, "EventMessageFile", 0, REG_SZ, reinterpret_cast< const unsigned char * >( str.str().c_str()), str.str().length()) != ERROR_SUCCESS )
     {
       RegCloseKey( pkey );