The ClfsCreateScanContext routine creates a scan context that can be used to iterate over the containers of a specified CLFS log.
CLFSUSER_API NTSTATUS ClfsCreateScanContext( PLOG_FILE_OBJECT plfoLog, ULONG cFromContainer, ULONG cContainers, CLFS_SCAN_MODE eScanMode, PCLFS_SCAN_CONTEXT pcxScan );
A pointer to a LOG_FILE_OBJECT structure that represents a CLFS stream. The scan context is created for the log that provides the underlying storage for that stream. The caller previously obtained this pointer by calling ClfsCreateLogFile.
The index of the first container to be scanned. Containers are indexed starting at zero.
The number of containers to be scanned with each call to ClfsScanLogContainers.
A set of flags that specify whether the scan context is set up for scanning forward or backward and whether the scan context should be reinitialized. The following three flags are available for callers of this routine.
|CLFS_SCAN_FORWARD||Set up the scan context for scanning in the forward direction. For example, if container 5 is the most recently scanned container and cContainers is 2, then a forward scan would return descriptors for containers 6 and 7.|
|CLFS_SCAN_BACKWARD||Set up the scan context for scanning in the backward direction. For example, if container 5 is the most recently scanned container and cContainers is 2, then a backward scan would return descriptors for containers 4 and 3.|
|CLFS_SCAN_INIT||Reinitialize the scan context. The next time ClfsScanLogContainers is called, it will behave as if it were being called for the first time after the creation of the scan context.|
If pcxScan points to a CLFS_SCAN_CONTEXT structure that is being passed to this routine for the first time, one of the direction flags (CLFS_SCAN_FORWARD or CLFS_SCAN_BACKWARD) must be set. The CLFS_SCAN_INIT flag must not be set.
If pcxScan points to a CLFS_SCAN_CONTEXT structure that has been passed to this routine previously, the CLFS_SCAN_INIT flag must be set. Also, one and only one of the direction flags (CLFS_SCAN_FORWARD or CLFS_SCAN_BACKWARD) must be set.
ClfsCreateScanContext returns STATUS_SUCCESS if it succeeds; otherwise, it returns one of the error codes in Ntstatus.h.
For an explanation of CLFS concepts and terminology, see Common Log File System.
|Windows version||Available in Windows Server 2003 R2, Windows Vista, and later versions of Windows.|
|Header||wdm.h (include Wdm.h)|