GetOldestEventLogRecord function (winbase.h)

Retrieves the absolute record number of the oldest record in the specified event log.

Syntax

BOOL GetOldestEventLogRecord(
  [in]  HANDLE hEventLog,
  [out] PDWORD OldestRecord
);

Parameters

[in] hEventLog

A handle to the open event log. The OpenEventLog or OpenBackupEventLog function returns this handle.

[out] OldestRecord

A pointer to a variable that receives the absolute record number of the oldest record in the specified event log.

Return value

If the function succeeds, the return value is nonzero.

If the function fails, the return value is zero. To get extended error information, call GetLastError.

Remarks

The oldest record in an event log is not necessarily record number 1. For more information, see Event Log Records.

Examples

For an example, see Querying for Event Information.

Requirements

Requirement Value
Minimum supported client Windows 2000 Professional [desktop apps only]
Minimum supported server Windows 2000 Server [desktop apps only]
Target Platform Windows
Header winbase.h (include Windows.h)
Library Advapi32.lib
DLL Advapi32.dll
API set ext-ms-win-advapi32-eventlog-l1-1-1 (introduced in Windows 10, version 10.0.10240)

See also

Event Logging Functions

GetNumberOfEventLogRecords

OpenBackupEventLog

OpenEventLog