CreateLogContainerScanContext function (clfsw32.h)
Creates a scan context to use with ScanLogContainers to enumerate all log containers that are associated with a log, and performs the first scan.
CLFSUSER_API BOOL CreateLogContainerScanContext( HANDLE hLog, ULONG cFromContainer, ULONG cContainers, CLFS_SCAN_MODE eScanMode, PCLFS_SCAN_CONTEXT pcxScan, LPOVERLAPPED pOverlapped );
A handle to the log that is obtained from CreateLogFile with permissions to scan the log containers.
The file can be a dedicated or multiplexed log.
The container where the scan is to be started.
This parameter is an ordinal number relative to the number of containers in the log.
The number of CLFS_CONTAINER_INFORMATION structures for CreateLogContainerScanContext to allocate.
This number is the number of containers scanned with each scan call so the caller knows the scan is complete when the number of containers returned is less than this value.
On exit, a pointer to the system-allocated array of CLFS_CONTAINER_INFORMATION structures is placed in the pinfoContainer member of the client-allocated CLFS_SCAN_CONTEXT structure. This member is pointed to by the pcxScan parameter (that is, "pcxScan->pinfoContainer"), and the actual number of structures in the array is placed in "pcxScan->cContainersReturned".
The client must call ScanLogContainers with the eScanMode parameter set to CLFS_SCAN_CLOSE so that it can free this array; otherwise, memory leaks result.
The mode to scan containers.
Containers can be scanned in any one of the following modes.
A pointer to a client-allocated CLFS_SCAN_CONTEXT structure that receives a scan context that can be passed to the ScanLogContainers function when a client scans the log containers of a dedicated log.
A pointer to an OVERLAPPED structure that is required for asynchronous operation.
This parameter can be NULL if an asynchronous operation is not used.
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:
After completing a scan, the client must call ScanLogContainers again with the eScanMode parameter set to CLFS_SCAN_CLOSE so that it can free the system-allocated array of CLFS_CONTAINER_INFORMATION structures; otherwise, memory leaks result.
For an example that uses this function, see Enumerating Log Containers.
|Minimum supported client||Windows Vista [desktop apps only]|
|Minimum supported server||Windows Server 2003 R2 [desktop apps only]|