Platform SDK: Debugging and Error Handling

GetEventLogInformation

The GetEventLogInformation function retrieves information about the specified event log.

BOOL GetEventLogInformation(
  HANDLE  hEventLog,      // handle to event log
  DWORD   dwInfoLevel,    // information to retrieve
  LPVOID  lpBuffer,       // buffer for read data
  DWORD   cbBufSize,      // size of buffer in bytes
  LPDWORD pcbBytesNeeded  // number of bytes needed
);

Parameters

hEventLog
[in] Handle to the event log. This handle is returned by the OpenEventLog or RegisterEventSource function.
dwInfoLevel
[in] Specifies the event log information to be returned. Use EVENTLOG_FULL_INFO to find out if the specified log is full. The lpBuffer parameter is a pointer to an EVENTLOG_FULL_INFORMATION structure.

Currently, no other information levels are defined.

lpBuffer
[out] Pointer to a buffer for the event log information. The format of this data depends on the value of the dwInfoLevel parameter.
cbBufSize
[in] Specifies the size, in bytes, of the buffer.
pcbBytesNeeded
[out] Pointer to a variable that receives the number of bytes required for the requested information, regardless of whether the function succeeds. This parameter can not be NULL.

Return Values

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.

Requirements

  Windows NT/2000: Requires Windows 2000.
  Windows 95/98: Unsupported.
  Header: Declared in Winbase.h; include Windows.h.
  Library: Use Advapi32.lib.

See Also

Event Logging Overview, Event Logging Functions, EVENTLOG_FULL_INFORMATION OpenEventLog, RegisterEventSource