mirror of
https://github.com/ApfelTeeSaft/reactos.git
synced 2026-08-31 19:26:42 +00:00
[EVENTVWR/EVENTLOG]
Fix a double off-by-one bug: - The eventlog service was reporting one event more than was available (+1). - The event viewer did not display the latest event from the eventlog service (-1). See issue #6182 for more details. svn path=/trunk/; revision=51558
This commit is contained in:
@@ -503,7 +503,7 @@ QueryEventMessages(LPWSTR lpMachineName,
|
||||
HWND hwndDlg;
|
||||
HANDLE hEventLog;
|
||||
EVENTLOGRECORD *pevlr;
|
||||
DWORD dwRead, dwNeeded, dwThisRecord, dwTotalRecords = 0, dwCurrentRecord = 1, dwRecordsToRead = 0, dwFlags, dwMaxLength;
|
||||
DWORD dwRead, dwNeeded, dwThisRecord, dwTotalRecords = 0, dwCurrentRecord = 0, dwRecordsToRead = 0, dwFlags, dwMaxLength;
|
||||
LPWSTR lpSourceName;
|
||||
LPWSTR lpComputerName;
|
||||
LPSTR lpData;
|
||||
|
||||
@@ -199,6 +199,7 @@ NTSTATUS ElfrNumberOfRecords(
|
||||
DWORD *NumberOfRecords)
|
||||
{
|
||||
PLOGHANDLE lpLogHandle;
|
||||
DWORD dwRecords;
|
||||
|
||||
lpLogHandle = ElfGetLogHandleEntryByHandle(LogHandle);
|
||||
if (!lpLogHandle)
|
||||
@@ -206,7 +207,9 @@ NTSTATUS ElfrNumberOfRecords(
|
||||
return STATUS_INVALID_HANDLE;
|
||||
}
|
||||
|
||||
*NumberOfRecords = lpLogHandle->LogFile->Header.CurrentRecordNumber;
|
||||
dwRecords = lpLogHandle->LogFile->Header.CurrentRecordNumber;
|
||||
|
||||
*NumberOfRecords = (dwRecords > 0) ? (dwRecords - 1) : 0;
|
||||
|
||||
return STATUS_SUCCESS;
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user