[EVENTLOG]

- Open the application log if the desired log does not exist.
- Log eventlog service stop and shutdown.

svn path=/trunk/; revision=54580
This commit is contained in:
Eric Kohl 2011-12-04 10:53:43 +00:00
parent 4ce4744000
commit ebf5940723
2 changed files with 18 additions and 0 deletions

View 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;

View 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)