GetNumberOfEventLogRecords function (winbase.h)

Retrieves the number of records in the specified event log.

Syntax

BOOL GetNumberOfEventLogRecords(
  [in]  HANDLE hEventLog,
  [out] PDWORD NumberOfRecords
);

Parameters

[in] hEventLog

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

[out] NumberOfRecords

A pointer to a variable that receives the number of records 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. To determine the oldest record number in an event log, use the GetOldestEventLogRecord function.

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

GetOldestEventLogRecord

OpenBackupEventLog

OpenEventLog