TruncateLog

TruncateLog function

Truncates the log. The function sets the end of the log to the specified value.

Syntax


BOOL WINAPI TruncateLog(
  _In_        PVOID        pvMarshal,
  _In_        PCLFS_LSN    plsnEnd,
  _Inout_opt_ LPOVERLAPPED lpOverlapped
);

Parameters

pvMarshal [in]

A pointer to the opaque marshaling context that is allocated by calling the CreateLogMarshallingArea function.

plsnEnd [in]

A pointer to a CLFS_LSN structure that specifies the new end of a log.

The LSN must be between the base log sequence number (LSN) of the log and the last LSN of the log.

lpOverlapped [in, out, optional]

Reserved. Set Reserved to NULL.

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. The following list identifies the possible error codes:

ERROR_ACCESS_DENIED
ERROR_HANDLE_EOF
ERROR_INVALID_HANDLE
ERROR_INVALID_PARAMETER
ERROR_LOG_INVALID_RANGE
ERROR_NOT_SUPPORTED

Remarks

If the volume sector size is greater than 512 bytes, TruncateLog returns ERROR_NOT_SUPPORTED.

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

CLFS_LSN
Common Log File System Functions
OVERLAPPED

 

 

Community Additions

ADD
Show:
© 2016 Microsoft