ClfsCreateMarshallingArea function (wdm.h)

The ClfsCreateMarshallingArea routine creates a marshalling area for a CLFS stream and returns a pointer to an opaque context that represents the new marshalling area.

Syntax

CLFSUSER_API NTSTATUS ClfsCreateMarshallingArea(
  [in]           PLOG_FILE_OBJECT   plfoLog,
  [in]           POOL_TYPE          ePoolType,
  [in, optional] PALLOCATE_FUNCTION pfnAllocBuffer,
  [in, optional] PFREE_FUNCTION     pfnFreeBuffer,
  [in]           ULONG              cbMarshallingBuffer,
  [in]           ULONG              cMaxWriteBuffers,
  [in]           ULONG              cMaxReadBuffers,
  [out]          PVOID              *ppvMarshalContext
);

Parameters

[in] plfoLog

A pointer to a LOG_FILE_OBJECT structure that represents a CLFS stream. The caller previously obtained this pointer by calling ClfsCreateLogFile.

[in] ePoolType

A POOL_TYPE value that specifies the type of memory (paged, non-paged, for example) that the new marshalling area will use for its log I/O blocks.

[in, optional] pfnAllocBuffer

Either NULL or a pointer to a caller-supplied function that allocates a log I/O block for the marshalling area. The allocation function has the following prototype:

PVOID
(*PALLOCATE_FUNCTION) (
    IN POOL_TYPE PoolType,
    IN SIZE_T NumberOfBytes,
    IN ULONG Tag
    );

The return value of the allocation function is a pointer to the newly allocated log I/O block.

[in, optional] pfnFreeBuffer

Either NULL or a pointer to a caller-supplied function that frees a log I/O block that was previously allocated by pfnAllocBuffer. The function has the following prototype:

VOID
(*PFREE_FUNCTION) (
    IN PVOID Buffer
    );

[in] cbMarshallingBuffer

The size, in bytes, of the individual log I/O blocks that the new marshalling area uses. This must be a multiple of the sector size on the stable storage medium. The sector size is the lpBytesPerSector value returned from GetDiskFreeSpace.

[in] cMaxWriteBuffers

The maximum number of I/O blocks that can be allocated at one time for write operations. This parameter affects the frequency of data flushes. If you do not need to control the frequency of data flushes, set this parameter to INFINITE.

[in] cMaxReadBuffers

The maximum number of log I/O blocks that can be allocated at one time for read operations.

[out] ppvMarshalContext

A pointer to a variable that receives a pointer to an opaque context that represents the new marshalling area.

Return value

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

Remarks

The pfnAllocBuffer and pfnFreeBuffer parameters must both point to caller-allocated functions, or they must both be NULL. If they are both NULL, CLFS provides default functions for allocating and freeing log I/O blocks.

Before calling ClfsCreateMarshallingArea, you must add at least two containers to the underlying log by calling ClfsAddLogContainer or ClfsAddLogContainerSet.

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

Requirements

Requirement Value
Target Platform Desktop
Header wdm.h (include Wdm.h)
Library Clfs.lib
DLL Clfs.sys
IRQL IRQL <= APC_LEVEL

See also

ClfsAddLogContainer

ClfsAddLogContainerSet

ClfsCreateLogFile

ClfsDeleteMarshallingArea

LOG_FILE_OBJECT

POOL_TYPE