Author: gedmurphy
Date: Wed Apr 2 03:54:50 2008
New Revision: 32817
URL:
http://svn.reactos.org/svn/reactos?rev=32817&view=rev
Log:
A few small changes
Modified:
trunk/rosapps/skel_service/ServiceMain.c
trunk/rosapps/skel_service/log.c
Modified: trunk/rosapps/skel_service/ServiceMain.c
URL:
http://svn.reactos.org/svn/reactos/trunk/rosapps/skel_service/ServiceMain.c…
==============================================================================
--- trunk/rosapps/skel_service/ServiceMain.c [iso-8859-1] (original)
+++ trunk/rosapps/skel_service/ServiceMain.c [iso-8859-1] Wed Apr 2 03:54:50 2008
@@ -52,13 +52,15 @@
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
Modified: trunk/rosapps/skel_service/log.c
URL:
http://svn.reactos.org/svn/reactos/trunk/rosapps/skel_service/log.c?rev=328…
==============================================================================
--- trunk/rosapps/skel_service/log.c [iso-8859-1] (original)
+++ trunk/rosapps/skel_service/log.c [iso-8859-1] Wed Apr 2 03:54:50 2008
@@ -82,7 +82,7 @@
0,
NULL);
- msgLen = msgLen + eMsgLen + 26;
+ msgLen = msgLen + eMsgLen + 40;
lpFullMsg = HeapAlloc(GetProcessHeap(),
0,
@@ -91,7 +91,7 @@
{
_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 @@
WriteFile(hLogFile,
lpFullMsg,
- msgLen * sizeof(TCHAR),
+ _tcslen(lpFullMsg) * sizeof(TCHAR),
&bytesWritten,
NULL);
if (bytesWritten == 0)
@@ -155,7 +155,7 @@
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)