ClfsAddLogContainer function (wdm.h)

The ClfsAddLogContainer routine adds a container to a CLFS log.

Syntax

CLFSUSER_API NTSTATUS ClfsAddLogContainer(
  [in] PLOG_FILE_OBJECT plfoLog,
  [in] PULONGLONG       pcbContainer,
  [in] PUNICODE_STRING  puszContainerPath
);

Parameters

[in] plfoLog

A pointer to a LOG_FILE_OBJECT structure that represents the log to which the container will be added. The caller previously obtained this pointer by calling ClfsCreateLogFile.

[in] pcbContainer

A pointer to a ULONGLONG-typed variable. The role of this parameter depends on whether the log currently has at least one container.

  • If the log currently has no containers, the caller supplies a positive integer that is the requested size, in bytes, of the new container. CLFS creates a container that is the requested size rounded up to a multiple of 512KB (for a dedicated log) or 1MB (for a multiplexed log).
  • If the log currently has at least one container and this parameter is the NULL pointer, CLFS creates a new container that is the same size as the existing containers. (All containers in a log must be the same size.)
  • If the log currently has at least one container and this parameter is a valid pointer, the caller supplies a positive integer that is the requested size, in bytes, of the new container. The requested size is rounded up to a multiple of 512KB (for a dedicated log) or 1MB (for a multiplexed log). If the rounded-up size is at least as large as the existing container size, CLFS creates a new container that is the same size as the existing containers. On successful return, this parameter receives the existing container size. If the rounded-up size is less than the existing container size, ClfsAddLogContainer fails.

[in] puszContainerPath

A pointer to a UNICODE_STRING structure that supplies the path name for the new container. The path can be absolute or relative to the location of the base log file. Paths that are relative to the base log file must begin with CLFS_CONTAINER_RELATIVE_PREFIX, which is the string literal (L"%BLF%\").

Return value

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

Remarks

A container is a contiguous extent on stable storage. For example, a container could be a contiguous file on disk. A log is a set of containers along with a base log file. For more information about containers, see CLFS Stable Storage.

A container specified by a path that is relative to the base log file must be in the same directory as the base log file or a subdirectory of the base log file. The directories "." and ".." are not allowed in a relative path.

A log can have some containers with absolute paths and other containers with relative paths.

Containers are created in a non-compressed mode and are initialized with zeros.

A log must have at least two containers before any I/O can be performed on it.

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

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

ClfsAddLogContainerSet

ClfsRemoveLogContainer