Export (0) Print
Expand All

ClfsCreateMarshallingArea routine

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


NTSTATUS ClfsCreateMarshallingArea(
  _In_     PLOG_FILE_OBJECT   plfoLog,
  _In_     POOL_TYPE          ePoolType,
  _In_opt_ PALLOCATE_FUNCTION pfnAllocBuffer,
  _In_opt_ PFREE_FUNCTION     pfnFreeBuffer,
  _In_     ULONG              cbMarshallingBuffer,
  _In_     ULONG              cMaxWriteBuffers,
  _In_     ULONG              cMaxReadBuffers,
  _Out_    PVOID              *ppvMarshalContext
);

Parameters

plfoLog [in]

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

ePoolType [in]

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.

pfnAllocBuffer [in, optional]

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.

pfnFreeBuffer [in, optional]

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
    );

cbMarshallingBuffer [in]

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.

cMaxWriteBuffers [in]

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.

cMaxReadBuffers [in]

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

ppvMarshalContext [out]

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

Target platform

Desktop

Version

Available in Windows Server 2003 R2, Windows Vista, and later versions of Windows.

Header

Wdm.h (include Wdm.h)

Library

Clfs.lib

DLL

Clfs.sys

IRQL

<= APC_LEVEL

See also

ClfsAddLogContainer
ClfsAddLogContainerSet
ClfsCreateLogFile
ClfsDeleteMarshallingArea
LOG_FILE_OBJECT
POOL_TYPE

 

 

Send comments about this topic to Microsoft

Show:
© 2015 Microsoft