FltReleaseContext function

Download EaseFilter Filter Driver SDK Setup File
Download EaseFilter Filter Driver SDK Zip File

FltReleaseContext decrements the reference count on a context.

Syntax

VOID FLTAPI FltReleaseContext(
  PFLT_CONTEXT Context
);

Parameters

Context

Pointer to the context. Must be a valid pointer to a context object for a volume, instance, stream, or stream handle. This parameter is required and cannot be NULL.

Return value

None

Remarks

A minifilter driver calls FltReleaseContext to release a context. FltReleaseContext decrements the reference count on the given context. When the reference count reaches zero, the context is freed immediately if the caller is running at IRQL <= APC_LEVEL. If the caller is running at IRQL DISPATCH_LEVEL, a work item is scheduled to free the context.

Note   After FltReleaseContext returns, the caller must not use the context, because the context might have already been freed.
 
Every successful call to FltAllocateContextFltGetXxxContext, or FltReferenceContext must eventually be matched by a call to FltReleaseContext.

Note that the OldContext pointer returned by FltSetXxxContext and the Context parameter that is used to call FltDeleteContext must also be released by calling FltReleaseContext when they are no longer needed.

To allocate a new context, call FltAllocateContext.

To increment the reference count on a context, call FltReferenceContext.

For more information about context reference counting, see Referencing Contexts.

Callers of FltReleaseContext must be running at IRQL <= DISPATCH_LEVEL if the context was allocated from nonpaged pool. If the context was allocated from paged pool, callers must be running at IRQL <= APC_LEVEL.

Requirements

   
Target Platform Universal
Header fltkernel.h (include Fltkernel.h)
Library FltMgr.lib
DLL Fltmgr.sys
IRQL See Remarks section.