dll: service: use FspServiceLog instead of FspEventLog

This commit is contained in:
Bill Zissimopoulos 2016-05-07 14:57:39 -07:00
parent 0b1bba36f8
commit 3d2a2dd90d

View File

@ -134,7 +134,7 @@ static VOID FspServiceSetStatus(FSP_SERVICE *Service, ULONG Flags, SERVICE_STATU
if (0 != Service->StatusHandle) if (0 != Service->StatusHandle)
{ {
if (!SetServiceStatus(Service->StatusHandle, &Service->ServiceStatus)) if (!SetServiceStatus(Service->StatusHandle, &Service->ServiceStatus))
FspEventLog(EVENTLOG_ERROR_TYPE, FspServiceLog(EVENTLOG_ERROR_TYPE,
L"" __FUNCTION__ ": error = %ld", GetLastError()); L"" __FUNCTION__ ": error = %ld", GetLastError());
} }
else if (0 != Service->ConsoleModeEvent && else if (0 != Service->ConsoleModeEvent &&
@ -257,7 +257,7 @@ FSP_API VOID FspServiceStop(FSP_SERVICE *Service)
FspServiceSetStatus(Service, FspServiceSetStatus(Service,
SetStatus_CurrentState | SetStatus_Win32ExitCode, &ServiceStatus); SetStatus_CurrentState | SetStatus_Win32ExitCode, &ServiceStatus);
FspEventLog(EVENTLOG_INFORMATION_TYPE, FspServiceLog(EVENTLOG_INFORMATION_TYPE,
L"The service %s has been stopped.", Service->ServiceName); L"The service %s has been stopped.", Service->ServiceName);
} }
else else
@ -267,7 +267,7 @@ FSP_API VOID FspServiceStop(FSP_SERVICE *Service)
SetStatus_CurrentState | SetStatus_CheckPoint | SetStatus_WaitHint, SetStatus_CurrentState | SetStatus_CheckPoint | SetStatus_WaitHint,
&ServiceStatus); &ServiceStatus);
FspEventLog(EVENTLOG_ERROR_TYPE, FspServiceLog(EVENTLOG_ERROR_TYPE,
L"The service %s has failed to stop (Status=%lx).", Service->ServiceName, Result); L"The service %s has failed to stop (Status=%lx).", Service->ServiceName, Result);
} }
} }
@ -279,7 +279,7 @@ static VOID WINAPI FspServiceEntry(DWORD Argc, PWSTR *Argv)
Service = FspServiceFromTable(); Service = FspServiceFromTable();
if (0 == Service) if (0 == Service)
{ {
FspEventLog(EVENTLOG_ERROR_TYPE, FspServiceLog(EVENTLOG_ERROR_TYPE,
L"" __FUNCTION__ ": internal error: FspServiceFromTable = 0"); L"" __FUNCTION__ ": internal error: FspServiceFromTable = 0");
return; return;
} }
@ -288,7 +288,7 @@ static VOID WINAPI FspServiceEntry(DWORD Argc, PWSTR *Argv)
FspServiceCtrlHandler, Service); FspServiceCtrlHandler, Service);
if (0 == Service->StatusHandle) if (0 == Service->StatusHandle)
{ {
FspEventLog(EVENTLOG_ERROR_TYPE, FspServiceLog(EVENTLOG_ERROR_TYPE,
L"" __FUNCTION__ ": RegisterServiceCtrlHandlerW = %ld", GetLastError()); L"" __FUNCTION__ ": RegisterServiceCtrlHandlerW = %ld", GetLastError());
return; return;
} }
@ -320,7 +320,7 @@ static VOID FspServiceMain(FSP_SERVICE *Service, DWORD Argc, PWSTR *Argv)
FspServiceSetStatus(Service, FspServiceSetStatus(Service,
SetStatus_CurrentState | SetStatus_ControlsAccepted, &ServiceStatus); SetStatus_CurrentState | SetStatus_ControlsAccepted, &ServiceStatus);
FspEventLog(EVENTLOG_INFORMATION_TYPE, FspServiceLog(EVENTLOG_INFORMATION_TYPE,
L"The service %s has been started.", Service->ServiceName); L"The service %s has been started.", Service->ServiceName);
} }
else else
@ -330,7 +330,7 @@ static VOID FspServiceMain(FSP_SERVICE *Service, DWORD Argc, PWSTR *Argv)
FspServiceSetStatus(Service, FspServiceSetStatus(Service,
SetStatus_CurrentState | SetStatus_Win32ExitCode, &ServiceStatus); SetStatus_CurrentState | SetStatus_Win32ExitCode, &ServiceStatus);
FspEventLog(EVENTLOG_ERROR_TYPE, FspServiceLog(EVENTLOG_ERROR_TYPE,
L"The service %s has failed to start (Status=%lx).", Service->ServiceName, Result); L"The service %s has failed to start (Status=%lx).", Service->ServiceName, Result);
} }
} }
@ -389,7 +389,7 @@ static DWORD WINAPI FspServiceInteractiveThread(PVOID Context)
Service = FspServiceFromTable(); Service = FspServiceFromTable();
if (0 == Service) if (0 == Service)
{ {
FspEventLog(EVENTLOG_ERROR_TYPE, FspServiceLog(EVENTLOG_ERROR_TYPE,
L"" __FUNCTION__ ": internal error: FspServiceFromTable = 0"); L"" __FUNCTION__ ": internal error: FspServiceFromTable = 0");
return FALSE; return FALSE;
} }
@ -417,7 +417,7 @@ static BOOL WINAPI FspServiceConsoleCtrlHandler(DWORD CtrlType)
Service = FspServiceFromTable(); Service = FspServiceFromTable();
if (0 == Service) if (0 == Service)
{ {
FspEventLog(EVENTLOG_ERROR_TYPE, FspServiceLog(EVENTLOG_ERROR_TYPE,
L"" __FUNCTION__ ": internal error: FspServiceFromTable = 0"); L"" __FUNCTION__ ": internal error: FspServiceFromTable = 0");
return FALSE; return FALSE;
} }