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.
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 );
- plfoLog [in]
- 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.
ClfsCreateMarshallingArea returns STATUS_SUCCESS if it succeeds; otherwise, it returns one of the error codes defined in Ntstatus.h.
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.
For an explanation of CLFS concepts and terminology, see Common Log File System.
|Available in Windows Server 2003 R2, Windows Vista, and later versions of Windows.|