A few small changes

svn path=/trunk/; revision=32817
This commit is contained in:
Ged Murphy 2008-04-02 08:54:50 +00:00
parent 1c556f1df5
commit 304e3452f8
2 changed files with 9 additions and 7 deletions

View file

@ -52,13 +52,15 @@ UpdateStatus(PSERVICEINFO pServInfo,
if (NewStatus > 0)
pServInfo->servStatus.dwCurrentState = NewStatus;
_sntprintf(szSet, 49, _T("Setting service to 0x%lu, CheckPoint %lu"), NewStatus, pServInfo->servStatus.dwCheckPoint);
_sntprintf(szSet,
49,
_T("Service state 0x%lu, CheckPoint %lu"),
pServInfo->servStatus.dwCurrentState,
pServInfo->servStatus.dwCheckPoint);
LogEvent(szSet, 0, 0, LOG_FILE);
if (!SetServiceStatus(pServInfo->hStatus, &pServInfo->servStatus))
LogEvent(_T("Cannot set service status"), GetLastError(), 0, LOG_ALL);
return;
}
static BOOL

View file

@ -82,7 +82,7 @@ LogToFile(LPCTSTR lpMsg,
0,
NULL);
msgLen = msgLen + eMsgLen + 26;
msgLen = msgLen + eMsgLen + 40;
lpFullMsg = HeapAlloc(GetProcessHeap(),
0,
@ -91,7 +91,7 @@ LogToFile(LPCTSTR lpMsg,
{
_sntprintf(lpFullMsg,
msgLen,
_T("%s %s ErrNum = %lu ExitCode = %lu\r\n"),
_T("%s : %s\tErrNum = %lu ExitCode = %lu\r\n"),
lpMsg,
lpSysMsg,
errNum,
@ -125,7 +125,7 @@ LogToFile(LPCTSTR lpMsg,
WriteFile(hLogFile,
lpFullMsg,
msgLen * sizeof(TCHAR),
_tcslen(lpFullMsg) * sizeof(TCHAR),
&bytesWritten,
NULL);
if (bytesWritten == 0)
@ -155,7 +155,7 @@ LogEvent(LPCTSTR lpMsg,
UINT flags)
{
#ifdef DEBUG
if (flags & LOG_FILE)
if (flags & LOG_FILE || flags & LOG_ERROR)
LogToFile(lpMsg, errNum, exitCode, flags);
#endif
if (flags & LOG_EVENTLOG)