ClfsReadLogRecord - NtDoc

Native API online documentation, based on the System Informer (formerly Process Hacker) phnt headers
// wdm.h

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
);
View the official Windows Driver Kit DDI reference

NtDoc

No description available.

Windows Driver Kit DDI reference (nf-wdm-clfsreadlogrecord)

ClfsReadLogRecord function

Description

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.

Parameters

pvMarshalContext [in]

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

plsnFirst [in, out]

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

peContextMode [in]

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

ppvReadBuffer [out]

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

pcbReadBuffer [out]

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.

peRecordType [out]

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.

plsnUndoNext [out]

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

plsnPrevious [out]

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

ppvReadContext [out]

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.

See also

ClfsReadNextLogRecord

ClfsTerminateReadLog