The ClearEventLog function clears the specified event log, and optionally saves the current copy of the logfile to a backup file.
BOOL ClearEventLog(
HANDLE hEventLog, |
// handle to event log |
LPCTSTR lpBackupFileName |
// name of backup file |
); |
The backup filename may contain a server name to save the backup file on a remote server.
If the lpBackupFileName parameter is NULL, the current event logfile is not backed up.
If the function succeeds, the return value is nonzero. The specified event log has been backed up (if lpBackupFileName is not NULL) and then cleared.
If the function fails, the return value is zero. To get extended error information, call GetLastError.
The ClearEventLog function fails if the event log is empty.
After this function returns, any handles that reference the cleared event log cannot be used to read the log.
If the backup filename specifies a remote server, the event log handle must identify a log on the local computer. You cannot back up an event logfile from a remote server to a file on a remote server (even if the backup file and the original log are on the same server).
The ClearEventLog function is used to optionally back up an existing logfile of the module represented by hEventLog. The function backs up the logfile to another file, and then clears the existing logfile. The caller must have write permission for the path specified, and must also have permission to move the current logfile. If a file already exists with the same name as lpBackupFileName, ClearEventLog fails.
file: /Techref/os/win/api/win32/func/src/f05_15.htm, 3KB, , updated: 2000/4/7 12:19, local time: 2024/9/4 09:48,
13.58.220.44:LOG IN
|
©2024 These pages are served without commercial sponsorship. (No popup ads, etc...).Bandwidth abuse increases hosting cost forcing sponsorship or shutdown. This server aggressively defends against automated copying for any reason including offline viewing, duplication, etc... Please respect this requirement and DO NOT RIP THIS SITE. Questions? <A HREF="http://sxlist.com/Techref/os/win/api/win32/func/src/f05_15.htm"> ClearEventLog</A> |
Did you find what you needed? |
Welcome to sxlist.com!sales, advertizing, & kind contributors just like you! Please don't rip/copy (here's why Copies of the site on CD are available at minimal cost. |
Welcome to sxlist.com! |
.