FltReleaseContext - NtDoc

Native API online documentation, based on the System Informer (formerly Process Hacker) phnt headers
// fltkernel.h

VOID FLTAPI FltReleaseContext(
  [in] PFLT_CONTEXT Context
);

View the official Windows Driver Kit DDI reference

NtDoc

No description available.

Windows Driver Kit DDI reference (nf-fltkernel-fltreleasecontext)

FltReleaseContext function

Description

FltReleaseContext decrements the reference count on a context.

Parameters

Context [in]

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.

See also

FltAllocateContext

FltDeleteContext

FltGetContexts

FltGetContextsEx

FltGetFileContext

FltGetInstanceContext

FltGetSectionContext

FltGetStreamContext

FltGetStreamHandleContext

FltGetTransactionContext

FltGetVolumeContext

FltReferenceContext

FltReleaseContexts

FltSetFileContext

FltSetInstanceContext

FltSetStreamContext

FltSetStreamHandleContext

FltSetTransactionContext

FltSetVolumeContext