[EVENTLOG]
authorEric Kohl <eric.kohl@reactos.org>
Sun, 4 Dec 2011 10:53:43 +0000 (10:53 +0000)
committerEric Kohl <eric.kohl@reactos.org>
Sun, 4 Dec 2011 10:53:43 +0000 (10:53 +0000)
- Open the application log if the desired log does not exist.
- Log eventlog service stop and shutdown.

svn path=/trunk/; revision=54580

reactos/base/services/eventlog/eventlog.c
reactos/base/services/eventlog/rpc.c

index 33927d6..aebcc8a 100644 (file)
@@ -63,6 +63,12 @@ ServiceControlHandler(DWORD dwControl,
     {
         case SERVICE_CONTROL_STOP:
             DPRINT("  SERVICE_CONTROL_STOP received\n");
+
+            LogfReportEvent(EVENTLOG_INFORMATION_TYPE,
+                            0,
+                            EVENT_EventlogStopped, 0, NULL, 0, NULL);
+
+
             /* Stop listening to incoming RPC messages */
             RpcMgmtStopServerListening(NULL);
             UpdateServiceStatus(SERVICE_STOPPED);
@@ -86,6 +92,11 @@ ServiceControlHandler(DWORD dwControl,
 
         case SERVICE_CONTROL_SHUTDOWN:
             DPRINT("  SERVICE_CONTROL_SHUTDOWN received\n");
+
+            LogfReportEvent(EVENTLOG_INFORMATION_TYPE,
+                            0,
+                            EVENT_EventlogStopped, 0, NULL, 0, NULL);
+
             UpdateServiceStatus(SERVICE_STOPPED);
             return ERROR_SUCCESS;
 
index 9a2c868..79ad84a 100644 (file)
@@ -104,6 +104,13 @@ PLOGHANDLE ElfCreateEventLogHandle(LPCWSTR Name, BOOL Create)
                 break;
             }
         }
+
+        /* Use the application log if the desired log does not exist */
+        if (lpLogHandle->LogFile == NULL)
+        {
+            lpLogHandle->LogFile = LogfListItemByName(L"Application");
+            lpLogHandle->CurrentRecord = LogfGetOldestRecord(lpLogHandle->LogFile);
+        }
     }
 
     if (!lpLogHandle->LogFile)