mirror of
https://github.com/ApfelTeeSaft/reactos.git
synced 2026-09-03 04:13:31 +00:00
A few small changes
svn path=/trunk/; revision=32817
This commit is contained in:
@@ -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
|
||||
|
||||
@@ -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)
|
||||
|
||||
Reference in New Issue
Block a user