FltAllocateCallbackDataEx routine

The FltAllocateCallbackDataEx routine allocates a callback data structure and can preallocate memory for additional structures that a minifilter driver can use to initiate an I/O request.

Syntax


NTSTATUS FltAllocateCallbackDataEx(
  _In_     PFLT_INSTANCE                    Instance,
  _In_opt_ PFILE_OBJECT                     FileObject,
  _In_     FLT_ALLOCATE_CALLBACK_DATA_FLAGS Flags,
  _Out_    PFLT_CALLBACK_DATA               *RetNewCallbackData
);

Parameters

Instance [in]

An opaque instance pointer to the minifilter driver instance that is initiating the I/O operation. This parameter is required and cannot be NULL.

FileObject [in, optional]

A pointer to a file object to be used in the I/O operation. This parameter is optional and can be NULL.

Flags [in]

A value of zero or the following flag:

FLT_ALLOCATE_CALLBACK_DATA_PREALLOCATE_ALL_MEMORY

If this flag is set, the routine preallocates all the memory needed by the filter manager for additional structures to be used in an I/O request.

RetNewCallbackData [out]

A pointer to a caller-allocated variable that receives the address of the newly allocated callback data (FLT_CALLBACK_DATA) structure.

Return value

The FltAllocateCallbackDataEx routine returns STATUS_SUCCESS on success or STATUS_INSUFFICIENT_RESOURCES if the routine encountered a pool allocation failure when attempting to allocate the callback data structure or if the FLT_ALLOCATE_CALLBACK_DATA_PREALLOCATE_ALL_MEMORY flag is set and additional memory could not be allocated.

Remarks

If the FLT_ALLOCATE_CALLBACK_DATA_PREALLOCATE_ALL_MEMORY flag is set, the routine allocates all the memory needed for additional filter manager structures to be used in a subsequent I/O request. Using this flag enables a minifilter to preallocate one or more callback data structures to be used for issuing I/O requests under low memory conditions or in situations where recovering from a memory allocation failure might be complicated.

Note   The additional allocated memory is for use by the filter manager. The file system or other filters can still fail the I/O request due to an out-of-memory condition.
 

Set FileObject to NULL if this is a CREATE operation.

Important   The comments for FltAllocateCallbackData apply to FltAllocateCallbackDataEx as well. Review that information in order to select the correct routine for your design.
 

Requirements

Target platform

Universal

Version

Available in Windows 7 and later versions of the Windows operating system.

Header

Fltkernel.h (include FltKernel.h)

Library

FltMgr.lib

IRQL

<= APC_LEVEL

See also

FltAllocateCallbackData
FLT_CALLBACK_DATA

 

 

Send comments about this topic to Microsoft

Show: