Skip to content

Latest commit

 

History

History
208 lines (135 loc) · 8.43 KB

nf-clfsw32-readlogrecord.md

File metadata and controls

208 lines (135 loc) · 8.43 KB
UID title description helpviewer_keywords old-location tech.root ms.assetid ms.date ms.keywords req.header req.include-header req.target-type req.target-min-winverclnt req.target-min-winversvr req.kmdf-ver req.umdf-ver req.ddi-compliance req.unicode-ansi req.idl req.max-support req.namespace req.assembly req.type-library req.lib req.dll req.irql targetos req.typenames req.redist ms.custom f1_keywords dev_langs topic_type api_type api_location api_name
NF:clfsw32.ReadLogRecord
ReadLogRecord function (clfsw32.h)
Initiates a sequence of reads from a specified log sequence number (LSN) in one of three modes, and returns the first of the specified log records and a read context.
ClfsContextForward
ClfsContextPrevious
ClfsContextUndoNext
ReadLogRecord
ReadLogRecord function [Files]
clfsw32/ReadLogRecord
fs.readlogrecord
fs\readlogrecord.htm
fs
1c56c47b-d898-4c70-ba70-8978057c66b9
12/05/2018
ClfsContextForward, ClfsContextPrevious, ClfsContextUndoNext, ReadLogRecord, ReadLogRecord function [Files], clfsw32/ReadLogRecord, fs.readlogrecord
clfsw32.h
Windows
Windows Vista [desktop apps only]
Windows Server 2003 R2 [desktop apps only]
Clfsw32.lib
Clfsw32.dll
Windows
19H1
ReadLogRecord
clfsw32/ReadLogRecord
c++
APIRef
kbSyntax
DllExport
Clfsw32.dll
ReadLogRecord

ReadLogRecord function

-description

Initiates a sequence of reads from a specified log sequence number (LSN) in one of three modes, and returns the first of the specified log records and a read context. A client can read subsequent records in the designated mode by passing the read context to ReadNextLogRecord.

-parameters

-param pvMarshal [in]

A pointer to a marshaling context that is allocated by using the CreateLogMarshallingArea function.

-param plsnFirst [in]

A pointer to a CLFS_LSN structure that specifies the log sequence number (LSN) of the record where the read operation should start.

This value must be an LSN of a valid record in the active range of the log.

-param eContextMode [in]

The mode for the read context that is returned in *ppvReadContext.

The following table identifies the three mutually exclusive read modes.

Value Meaning
ClfsContextPrevious
Reads the record linked to by plsnPrevious.
ClfsContextUndoNext
Reads the record chain linked to by plsnUndoNext.
ClfsContextForward
Reads the record with the LSN that immediately follows the current LSN in the read context.

-param ppvReadBuffer [out]

A pointer to a variable that receives a pointer to the target record in the log I/O block.

-param pcbReadBuffer [out]

A pointer to a variable that receives the size of the data that is returned in *ppvReadBuffer, in bytes.

-param peRecordType [out]

A pointer to a variable that receives the type of record read.

This parameter is one of the CLFS_RECORD_TYPE Constants.

-param plsnUndoNext [out]

A pointer to a CLFS_LSN structure that receives the LSN of the next record in the undo record chain.

-param plsnPrevious [out]

A pointer to a CLFS_LSN structure that receives the LSN of the next record in the previous record chain.

-param ppvReadContext [out]

A pointer to a variable that receives a pointer to a system-allocated read context when a read is successful.

If the function defers completion of an operation, it returns a valid read-context pointer and an error status of ERROR_IO_PENDING. On all other errors, the read-context pointer is NULL. For more information about handling deferred completion of the function, see the Remarks section of this topic.

After obtaining all requested log records, the client must pass the read context to TerminateReadLog to free the associated memory. Failure to do so results in memory leakage.

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, or passed into more than one asynchronous read at a time.
 

-param pOverlapped [in, out, optional]

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

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

-returns

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.

-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 ReadLogRecord is called with a valid pOverlapped structure and the log handle is created with the overlapped option, then if a call to this function 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.

If you attempt to open more read contexts than the number buffers specified in a previous call to CreateLogMarshallingArea, ERROR_LOG_BLOCK_EXHAUSTED is returned.

To complete a 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 ReadLogRecord completes asynchronously, the requested record is read from the disk, but is not resolved to a pointer in *ppvReadBuffer.

To complete the requested read and obtain a valid pointer to the log record, the client must call ReadNextLogRecord, which passes in the read-context pointer that ReadLogRecord returns.

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_BUSY.

 

-see-also

CLFS_CONTEXT_MODE

CLFS_LSN

CLFS_RECORD_TYPE

Common Log File System Functions

CreateLogMarshallingArea

OVERLAPPED

ReadNextLogRecord

TerminateReadLog