ClfsReadLogRecord function (wdm.h)

The ClfsReadLogRecord routine reads a target record in a CLFS stream and returns a read context that the caller can use to read the records preceding or following it in the stream.

Syntax

CLFSUSER_API NTSTATUS ClfsReadLogRecord(
  [in]      PVOID             pvMarshalContext,
  [in, out] PCLFS_LSN         plsnFirst,
  [in]      CLFS_CONTEXT_MODE peContextMode,
  [out]     PVOID             *ppvReadBuffer,
  [out]     PULONG            pcbReadBuffer,
  [out]     PCLFS_RECORD_TYPE peRecordType,
  [out]     PCLFS_LSN         plsnUndoNext,
  [out]     PCLFS_LSN         plsnPrevious,
  [out]     PVOID             *ppvReadContext
);

Parameters

[in] pvMarshalContext

A pointer to an opaque context that represents a marshalling area. The caller previously obtained this pointer by calling ClfsCreateMarshallingArea.

[in, out] plsnFirst

A pointer to a CLFS_LSN structure that supplies the LSN of the target record in the log.

[in] peContextMode

A value from the CLFS_CONTEXT_MODE enumeration that specifies the initial mode (ClfsContextUndoNext, ClfsContextPrevious, or ClfsContextForward) of the read context returned in ppvReadContext.

[out] ppvReadBuffer

A pointer to a variable that receives a pointer to the data buffer of the target record.

[out] pcbReadBuffer

A pointer to a ULONG-typed variable that receives the size, in bytes, of the buffer pointed to by *ppvReadBuffer. This is the length of the data buffer of the target record.

[out] peRecordType

A pointer to a variable of type CLFS_RECORD_TYPE that receives one of the following values.

Value Meaning
ClfsDataRecord The target record is a data record.
ClfsRestartRecord The target record is a restart record.

[out] plsnUndoNext

A pointer to a CLFS_LSN structure that receives the undo-next LSN of the target record.

[out] plsnPrevious

A pointer to a CLFS_LSN structure that receives the previous LSN of the target record.

[out] ppvReadContext

A pointer to a variable that receives a pointer to an opaque read context. The client repeatedly passes this context to ClfsReadNextLogRecord to read the remaining records in a sequence. After the client has read all the records in the sequence, it calls ClfsTerminateReadLog to free the read context.

Return value

ClfsReadLogRecord returns STATUS_SUCCESS if it succeeds; otherwise, it returns one of the error codes defined in Ntstatus.h.

Remarks

You must call ClfsTerminateReadLog when you have finished using the read context in order to avoid a memory leak.

For an explanation of CLFS concepts and terminology, see Common Log File System.

For information about reading records from CLFS streams, see Reading Data Records from a CLFS Stream and Reading Restart Records from a CLFS Stream.

Read contexts are not thread-safe. Clients are responsible for serializing access to read contexts.

Requirements

Requirement Value
Minimum supported client Available in Windows Server 2003 R2, Windows Vista, and later versions of Windows.
Target Platform Desktop
Header wdm.h (include Wdm.h)
Library Clfs.lib
DLL Clfs.sys
IRQL <= APC_LEVEL

See also

ClfsReadNextLogRecord

ClfsTerminateReadLog