OpenEventLog

  HANDLE OpenEventLog(lpszUNCServerName, lpszModuleName)    
  LPTSTR lpszUNCServerName; /* address of server name */
  LPTSTR lpszModuleName; /* address of module */

The OpenEventLog function opens a handle to an event log. The handle returned by this function can be used to query or read the event log.

Parameters

lpszUNCServerName

Points to a null-terminated string that specifies the name of the server where the event log is to be opened. If this parameter is NULL, the log is opened on the local machine.

lpszModuleName

Points to a null-terminated string that specifies the name of the module that the returned handle will reference. The node must exist in the registration database, and the module name has the following form:

\EventLog\System\Network\LANMan\Server

or

\EventLog\Application\SQL

Return Value

If the function is successful, the return value is an event-log handle.

If the function fails, the return value is NULL. Use the GetLastError function to obtain extended error information.

See Also

ClearEventLog, CloseEventLog, GetNumberOfEventLogRecords, GetOldestEventLogRecord, ReadEventLog