mirror of
https://github.com/reactos/reactos.git
synced 2024-09-28 13:34:53 +00:00
[EVENTLOG]
Fix the calculation of the number of event records. svn path=/trunk/; revision=51598
This commit is contained in:
parent
e2d00b9f53
commit
45e1070d6d
|
@ -199,7 +199,7 @@ NTSTATUS ElfrNumberOfRecords(
|
|||
DWORD *NumberOfRecords)
|
||||
{
|
||||
PLOGHANDLE lpLogHandle;
|
||||
DWORD dwRecords;
|
||||
PLOGFILE lpLogFile;
|
||||
|
||||
lpLogHandle = ElfGetLogHandleEntryByHandle(LogHandle);
|
||||
if (!lpLogHandle)
|
||||
|
@ -207,9 +207,13 @@ NTSTATUS ElfrNumberOfRecords(
|
|||
return STATUS_INVALID_HANDLE;
|
||||
}
|
||||
|
||||
dwRecords = lpLogHandle->LogFile->Header.CurrentRecordNumber;
|
||||
lpLogFile = lpLogHandle->LogFile;
|
||||
|
||||
*NumberOfRecords = (dwRecords > 0) ? (dwRecords - 1) : 0;
|
||||
if (lpLogFile->Header.OldestRecordNumber == 0)
|
||||
*NumberOfRecords = 0;
|
||||
else
|
||||
*NumberOfRecords = lpLogFile->Header.CurrentRecordNumber -
|
||||
lpLogFile->Header.OldestRecordNumber;
|
||||
|
||||
return STATUS_SUCCESS;
|
||||
}
|
||||
|
|
Loading…
Reference in a new issue