Author: ekohl
Date: Sat Dec 31 15:23:59 2011
New Revision: 54794
URL:
http://svn.reactos.org/svn/reactos?rev=54794&view=rev
Log:
[EVENTLOG]
Fix the record number hacks in ElfrNumberOfRecords and LogfWriteData by initializing the
oldest record number to 1.
Modified:
trunk/reactos/base/services/eventlog/file.c
trunk/reactos/base/services/eventlog/rpc.c
Modified: trunk/reactos/base/services/eventlog/file.c
URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/base/services/eventlog/fil…
==============================================================================
--- trunk/reactos/base/services/eventlog/file.c [iso-8859-1] (original)
+++ trunk/reactos/base/services/eventlog/file.c [iso-8859-1] Sat Dec 31 15:23:59 2011
@@ -34,6 +34,7 @@
LogFile->Header.MajorVersion = MAJORVER;
LogFile->Header.MinorVersion = MINORVER;
LogFile->Header.CurrentRecordNumber = 1;
+ LogFile->Header.OldestRecordNumber = 1;
/* FIXME: Read MaxSize from registry for this LogFile.
But for now limit EventLog size to just under 5K. */
LogFile->Header.MaxSize = 5000;
@@ -986,9 +987,6 @@
LogFile->Header.CurrentRecordNumber++;
- if (LogFile->Header.OldestRecordNumber == 0)
- LogFile->Header.OldestRecordNumber = 1;
-
if (WriteOffSet == LogFile->Header.EndOffset)
{
LogFile->Header.EndOffset += dwWritten;
Modified: trunk/reactos/base/services/eventlog/rpc.c
URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/base/services/eventlog/rpc…
==============================================================================
--- trunk/reactos/base/services/eventlog/rpc.c [iso-8859-1] (original)
+++ trunk/reactos/base/services/eventlog/rpc.c [iso-8859-1] Sat Dec 31 15:23:59 2011
@@ -243,11 +243,8 @@
lpLogFile->Header.OldestRecordNumber,
lpLogFile->Header.CurrentRecordNumber);
- if (lpLogFile->Header.OldestRecordNumber == 0)
- *NumberOfRecords = 0;
- else
- *NumberOfRecords = lpLogFile->Header.CurrentRecordNumber -
- lpLogFile->Header.OldestRecordNumber;
+ *NumberOfRecords = lpLogFile->Header.CurrentRecordNumber -
+ lpLogFile->Header.OldestRecordNumber;
return STATUS_SUCCESS;
}
@@ -271,8 +268,8 @@
return STATUS_INVALID_PARAMETER;
}
- *OldestRecordNumber = 0;
*OldestRecordNumber = LogfGetOldestRecord(lpLogHandle->LogFile);
+
return STATUS_SUCCESS;
}