Windows Dev Center

ReadPreviousLogRestartArea function

Reads the previous log restart area that is relative to the current restart record specified in the read context, pvReadContext. This read context is the one previously created by a call to ReadLogRestartArea.

Syntax


BOOL WINAPI ReadPreviousLogRestartArea(
  _In_        PVOID        pvReadContext,
  _Out_       PVOID        *ppvRestartBuffer,
  _Out_       PULONG       pcbRestartBuffer,
  _Out_       PCLFS_LSN    plsnRestart,
  _Inout_opt_ LPOVERLAPPED pOverlapped
);

Parameters

pvReadContext [in]

A pointer to a system-allocated read context that ReadLogRestartArea returns.

Even when those functions return ERROR_IO_PENDING, they still return a pointer to a valid read context. For information about asynchronous completion, see the Remarks section of this topic.

ppvRestartBuffer [out]

A pointer to a variable that receives a pointer to the restart data.

pcbRestartBuffer [out]

A pointer to a variable that receives the size of the restart data at *ppvRestartBuffer, in bytes.

plsnRestart [out]

A pointer to a CLFS_LSN structure that receives the log sequence number (LSN) of the restart area that this function returns.

pOverlapped [in, out, optional]

A pointer to an OVERLAPPED structure that is required for asynchronous operation.

This parameter can be NULL if asynchronous operation is not used.

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_INVALID_USER_BUFFER
ERROR_IO_DEVICE
ERROR_IO_PENDING
ERROR_LOG_BLOCK_INCOMPLETE

Remarks

The error message ERROR_LOG_BLOCK_INCOMPLETE is returned if the log block size specified by CreateLogMarshallingArea is not large enough to hold a complete log block.

If ReadPreviousLogRestartArea fails with an error code of ERROR_IO_PENDING, a pointer to a valid read context is placed in the variable that is pointed to by the ppvReadContext parameter.

To complete the log-record copy, the client should first synchronize its execution with deferred completion of the overlapped I/O operation by using GetOverlappedResult or one of the synchronization Wait Functions. For more information, see Synchronization and Overlapped Input and Output.

After ReadPreviousLogRestartArea completes asynchronously, the requested restart area is read from the disk, but a valid pointer to it is not placed in *ppvRestartBuffer.

To obtain a valid pointer, the client must call ReadPreviousLogRestartArea a second time.

Note  Common Log File System (CLFS) read contexts are not thread-safe. They should not be used by more than one thread at a time.

CLFS read contexts should not be passed into more than one asynchronous read at a time, or the function fails with ERROR_READ.

 

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
CreateLogFile
OVERLAPPED
ReadLogRestartArea
Synchronization and Overlapped Input and Output

 

 

Community Additions

ADD
Show:
© 2015 Microsoft