FltReleaseContext function (fltkernel.h)

FltReleaseContext decrements the reference count on a context.

Syntax

VOID FLTAPI FltReleaseContext(
  [in] PFLT_CONTEXT Context
);

Parameters

[in] 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

For more information about contexts, see About minifilter contexts.

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 FltAllocateContext, FltGetXxxContext, 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

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

See also

FltAllocateContext

FltDeleteContext

FltGetContexts

FltGetContextsEx

FltGetFileContext

FltGetInstanceContext

FltGetSectionContext

FltGetStreamContext

FltGetStreamHandleContext

FltGetTransactionContext

FltGetVolumeContext

FltReferenceContext

FltReleaseContexts

FltSetFileContext

FltSetInstanceContext

FltSetStreamContext

FltSetStreamHandleContext

FltSetTransactionContext

FltSetVolumeContext