PFLT_CONTEXT_CLEANUP_CALLBACK routine

A minifilter driver can register a routine of type PFLT_CONTEXT_CLEANUP_CALLBACK as the minifilter driver's ContextCleanupCallback routine.

Syntax


PFLT_CONTEXT_CLEANUP_CALLBACK ContextCleanupCallback;

VOID ContextCleanupCallback(
  _In_ PFLT_CONTEXT     Context,
  _In_ FLT_CONTEXT_TYPE ContextType
)
{ ... }

Parameters

Context [in]

A pointer to the minifilter driver's portion of the context.

ContextType [in]

The type of context. Must be one of the following values:

FLT_FILE_CONTEXT (starting with Windows Vista)

FLT_INSTANCE_CONTEXT

FLT_STREAM_CONTEXT

FLT_STREAMHANDLE_CONTEXT

FLT_SECTION_CONTEXT (starting with Windows 8)

FLT_TRANSACTION_CONTEXT (starting with Windows Vista)

FLT_VOLUME_CONTEXT

Return value

None.

Remarks

A minifilter driver can optionally specify a routine of type PFLT_CONTEXT_CLEANUP_CALLBACK as the minifilter driver's ContextCleanupCallback routine for each context type that it registers when it calls FltRegisterFilter from its DriverEntry routine. To specify this routine, the minifilter driver stores a pointer to the routine in the ContextCleanupCallback member of the FLT_CONTEXT_REGISTRATION structure for the context type.

If the minifilter driver specifies a ContextCleanupCallback routine for a context type, the filter manager calls this routine before freeing any of the minifilter driver's contexts of that type. In this routine, the minifilter driver performs any needed cleanup, such as freeing additional memory that the minifilter driver allocated inside the context structure. After the ContextCleanupCallback routine returns, the filter manager frees the context.

For more information about context registration, see the reference entry for FLT_CONTEXT_REGISTRATION.

Requirements

Target platform

Desktop

Header

Fltkernel.h (include Fltkernel.h)

IRQL

<=APC_LEVEL

See also

FLT_CONTEXT_REGISTRATION
FLT_REGISTRATION
FltRegisterFilter
PFLT_CONTEXT_ALLOCATE_CALLBACK
PFLT_CONTEXT_FREE_CALLBACK

 

 

Send comments about this topic to Microsoft

Show:
© 2015 Microsoft