Author: ekohl
Date: Thu May 5 20:27:05 2011
New Revision: 51598
URL:
http://svn.reactos.org/svn/reactos?rev=51598&view=rev
Log:
[EVENTLOG]
Fix the calculation of the number of event records.
Modified:
trunk/reactos/base/services/eventlog/rpc.c
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] Thu May 5 20:27:05 2011
@@ -199,7 +199,7 @@
DWORD *NumberOfRecords)
{
PLOGHANDLE lpLogHandle;
- DWORD dwRecords;
+ PLOGFILE lpLogFile;
lpLogHandle = ElfGetLogHandleEntryByHandle(LogHandle);
if (!lpLogHandle)
@@ -207,9 +207,13 @@
return STATUS_INVALID_HANDLE;
}
- dwRecords = lpLogHandle->LogFile->Header.CurrentRecordNumber;
-
- *NumberOfRecords = (dwRecords > 0) ? (dwRecords - 1) : 0;
+ lpLogFile = lpLogHandle->LogFile;
+
+ if (lpLogFile->Header.OldestRecordNumber == 0)
+ *NumberOfRecords = 0;
+ else
+ *NumberOfRecords = lpLogFile->Header.CurrentRecordNumber -
+ lpLogFile->Header.OldestRecordNumber;
return STATUS_SUCCESS;
}