DeleteLogFile function

Marks a log for deletion. The log is actually deleted when all handles, marshaling areas, and read contexts to the log are closed. If the log is a physical log, its underlying containers are deleted.

When a log is marked for deletion, requests to open new client log streams fail.

Note  A closely related function is DeleteLogByHandle, which deletes a log when given the handle of the file.

Syntax


BOOL WINAPI DeleteLogFile(
  _In_      LPCWSTR pszLogFileName,
  _In_opt_  PVOID pvReserved
);

Parameters

pszLogFileName [in]

The name of the log.

This name is specified when creating the log by using CreateLogFile. The following example identifies the format to use:

log:<log name>[::<log stream name>]

<log name> corresponds to a valid file path in the file system.

<log stream name> is the unique name of a log stream in the log.

For more information, see Log Types.

pvReserved [in, optional]

This parameter is reserved and should be set to NULL.

Return value

If the function succeeds, the return value is nonzero.

If the function fails, the return value is zero (0). To get extended error information, call GetLastError. The following list identifies the possible error codes:

ERROR_ACCESS_DENIED
ERROR_FILE_NOT_FOUND
ERROR_INVALID_PARAMETER

Requirements

Minimum supported client

Windows Vista [desktop apps only]

Minimum supported server

Windows Server 2003 R2 [desktop apps only]

Header

Clfsw32.h

Library

Clfsw32.lib

DLL

Clfsw32.dll

See also

Common Log File System Functions
CreateLogFile
DeleteLogByHandle
SECURITY_ATTRIBUTES

 

 

Community Additions

ADD
Show:
© 2014 Microsoft